Giter VIP home page Giter VIP logo

cubecell-air-quality's Introduction

cubecell-air-quality

Uses the following sensors

  • BME680 to measure humidity, temperature, pressure and gas (resistance)
  • SCD30 to measure co2, humidity and temperature

Based on the measurements, it calculates a AQI.

LoraWan Data Paket

function parse(payloadHex, port) {
    function hexToBytes(hex) {
        for (var bytes = [], c = 0; c < hex.length; c += 2)
            bytes.push(parseInt(hex.substr(c, 2), 16));
        return bytes;
    }
    var bytes = hexToBytes(payloadHex);
    let msg = {};

    msg.counter = (bytes[0] << 8) | bytes[1];
    msg.battery = (bytes[2] << 8) | bytes[3];

    msg.temperature = (bytes[4] << 24 >> 16 | bytes[5]) / 100;  // signed
    msg.temperature2 = (bytes[6] << 24 >> 16 | bytes[7]) / 100;  // signed

    msg.humidity = ((bytes[8] << 8) | bytes[9]) / 100;
    msg.humidity2 = ((bytes[10] << 8) | bytes[11]) / 100;

    msg.pressure = ((bytes[12] << 24) | (bytes[13] << 16) | (bytes[14] << 8) | bytes[15]) / 100;

    msg.gas = ((bytes[16] << 8) | bytes[17]) / 10;

    msg.aqi = (bytes[18] << 8) | bytes[19];

    msg.co2 = ((bytes[20] << 8) | bytes[21]);
    return msg;
}

cubecell-air-quality's People

Contributors

pavax avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.