Giter Site home page Giter Site logo

aqloraburk's Introduction

AQLoRaBurk

This Arduino sketch reads BME280 or BME680 environmental sensor and SDS011 particulate matter (PM2.5/PM10) sensor values.

If they are correctly wired they should be automatically detected.

Data is transmitted over LoRaWAN network using ABP activation. Default sending interval is about one minute.

SDS011 values are read once in second, put into an array and when it is time to send the data, QuickStats is used to calculate min, max, avg and mean of PM10 and PM2.5 values.

BME680 is read once in 30 seconds (default).

TTGO ESP32 LoRa V2 and V2.1 have been tested to be functional with this code.

Surprisingly this code has been very stable: dozens of deployments have been running months without issues.

Gettings started

Arduino libraries

Install the libraries below using Arduino IDE's

Sketch->Include Library->Manage Libraries...:

  • Adafruit_Sensor
  • Adafruit_BME280
  • Adafruit_BME680
  • Adafruit_SSD1306
  • MCCI LoRaWAN LMIC library by IBM, Matthis Kooijman, Terry Moore etc.

Define radio type in LMIC lib

Do not forget to define the radio type correctly

#define CFG_eu868 1

in libraries/MCCI_LoRaWAN_LMIC_library/project_config/lmic_project_config.h or from your BOARDS.txt.

The code

  1. Clone this repository
  2. Copy settings-example.h to settings.h
  3. Check that NWKSKEY, APPSKEY, DEVEUI and DEVADDR have correct values in settings.h.
  4. Open AQLoRaBurk.ino, compile and upload the code to the board

LoRaWAN

Check very carefully all LoRaWAN network related values in settings.h.

Data encoding

All data is put into a byte array which may look like this: 2a2c0021002c002800300056003b0000.

An example how to decode it using python can be found in https://github.com/VekotinVerstas/DjangoHttpBroker-Thingpark/thingpark/parsers/aqburk.py

Wiring

Check pin numbers from settings.h:

// I2C settings
#define SDA 21           // Connect to BMEx80 SDA
#define SCL 22           // Connect to BMEx80 SCL

#define SDS011_RXPIN 39  // Connect to SDS011 TX
#define SDS011_TXPIN 36  // Connect to SDS011 RX

In addition:

  • Connect 5V and GND to correct pins in SDS011.
  • Connect 3V3 and GND to correct pins in BMEx80.

Known issues

  • LoRaWAN spreading factor is hard coded (SP7)
  • Only LoRaWAN ABP is supported. If you need OTAA, just implement it and make a pull request

aqloraburk's People

Contributors

aapris avatar bertrik avatar

Stargazers

 avatar  avatar Aimiao avatar Zoller Thierry avatar oelles avatar uf0 avatar PureTek Innovations Limited avatar  avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

aqloraburk's Issues

Input-only pins for SDS serial port

Hi, I was just wondering, you mention that the SDS011 is connected to pins 36 and 39 of the ESP32. Looking at the pin lists at https://randomnerdtutorials.com/esp32-pinout-reference-gpios/ they are mentioned as input-only pins. Are you sure you are getting bidirectional communication with the SDS011?

Myself, I'm experimenting with an ESP32 TTGO LoRa board and I had to test out quite a few combinations before I found a set of pins for the SDS011 that work so I can actually send commands and receive a meaningful response. I'm using pins 35 (receive from SDS011) and 25 (send to SDS011) now.

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.