GithubHelp home page GithubHelp logo

civiclabsbelgium / lora_particle_sensor Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 762 KB

A fine dust sensor based on ESP8266, RFM95W, DHT22, HPM sensor

Home Page: http://www.influencair.be

License: MIT License

C++ 82.76% C 16.31% JavaScript 0.92%
esp8266 hpma115s0 luftdaten influencair dht22

lora_particle_sensor's Introduction

LoRaWAN pm sensor

This sensor measures the fine dust concentration in the air and sends data over TTN LoRaWAN network. Via a data forwarder the data is pushed to the luftdaten servers

Project description

This is the firmware for a Influencair LoRaWan sensor based on a Honeywell HPM series pm sensor, ESP8266 and RFM95W. For the LoRaWAN network we use The Things Network.

This repo contains the firmware and the helper tools necessary for flashing these sensors.

This sensor assembly is based on a NodeMcu ESP8266-e12, RFM95W lora transeiver, HPM pm sensor, DHT22 humidity/temperature sensor.

Requirements

Hardware

HPM sensor

- pin 1: Not connected
- pin 2: NodeMCU UV (USB Voltage = 5V)
- pin 3: Not connected
- pin 4: Not connected
- pin 5: Not connected
- pin 6: NodeMCU D3
- pin 7: NodeMCU D4
- pin 8: NodeMCU GND

DHT22 sensor

- pin 1: NodeMCU UV (USB Voltage = 5V)
- pin 2: NodeMCU D1
- pin 3: Not connected
- pin 4: GND

RFM95W

- GND : GND
- MISO: NodeMCU D6
- MOSI: NodeMCU D7
- SCK : NodeMCU D5
- NSS : NodeMCU D8
- RST : Not connected
- GND : GND
- DIO2: Not connected
- DIO1: NodeMCU D2
- DIO0: NodeMCU D0
- 3.3V: NodeMCU 3.3V
- DIO4: Not connected
- DIO3: Not connected
- GND : GND
- ANT : ANTENNA

LoraWan Setup

You will need an account at https://console.thethingsnetwork.org and create an application. In the application go to payload formats and add this decode function:

function Decoder(bytes, port) {
  var decoded = {};

  // Decode bytes to int
  var p10int = (bytes[0] << 8) | bytes[1];
  var p25int = (bytes[2] << 8) | bytes[3];
  var hum = (bytes[4] << 8) | bytes[5];
  var temp = (bytes[6] << 8) | bytes[7];

  // Decode int to float
  decoded.pm10 = p10int / 100;
  decoded.pm25 = p25int / 100;
  decoded.humidity = hum / 100;
  decoded.temperature = temp / 100;

  return decoded;
}

Next create a new 'ABP' device in TTN console https://console.thethingsnetwork.org/applications/your_appID and copy the 'deviceId'

Use

  1. open this project within Platformio.
  2. Run yarn in the project root
  3. Go to TTN console and open your TTN application
  4. Copy your appID
  5. Set your TTN appID in your environment variables export appID=your_appID
  6. Copy your application accessKey, make sure this key has access to 'devices' & 'settings'
  7. set your TTN accessKey in your environment variables export accessKey=your_accessKey

Flash a sensor

  1. Create a new 'ABP' device in the TTN console and copy the 'deviceId'
  2. Run deviceId='deviceId' node getDevice.js

lora_particle_sensor's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.