TTN Ulm particulate matter sensor
A Arduino sketch to measure particulates in the air via the SDS011 sensor and sending them to TheThingsNetwork.
- Connect the SDS011 to the PINs configured in the sketch (PIN 8 and 9 are preconfigured)
- Connect the 5V and GND pins
- Connect the DHT sensor to PIN 10, 3.3v and GND.
- Fill in your TTN credentials
- Make sure you have the TheThingsNetwork, DHT library installed, you can get them from the Arduino Library Manager(see below).
- Write the sketch to the arduino
Quick explanation what this does
- sleeps for a given amount of time.
- spins up the fan for some time to clean the fan and the housing (1 minute recommened).
- takes 10 samples of sensor data (pm2.5 and pm10)
- calculates the median of each to avoid outlier
- takes the current humidity and temperature values
- encodes the values into bytes
- send them to the given TTN app
Install the following libraries through the Arduino Library Manager:
- Adafruit Unified Sensor (scroll wayyy down)
- DHT sensor library
GNU Affero General Public License v3 (AGPL-3.0) See LICENSE file
Other code used
TheThingsNetwork library by Johan Stokking (email@example.com) https://github.com/TheThingsNetwork/arduino-node-lib