I've been interested in environmental sensing for a long time - mainly for monitoring renewable energy sources. I've been collecting interesting sensors for a while and one of those was a "Nova PM Sensor SDS011 High Precision Laser PM2.5 Air Quality Detection Sensor" (mine came from Bang Good, but available in lots of places). This is quite a large sensor with a fan to control air flow over a laser detection sensor. The datasheet is available here.
The data is obtainable via a digital output (pulses when particles are detected) or via a serial connection (at a default of 9600 baud). It comes with a USB-Serial interface which I plugged in and saw I was getting data, but not in a human-readable form.
Luckily clever folk have already created an Arduino library to talk to the unit, read the data and output it as a human readable data values. You can install the library via Arduino IDE library manager, searching for "sds sensor".
Using the example code (but changing the Tx/Rx pins) I got data being streamed via a serial connection. This returns PM2.5 and PM10 values. These relate to the size of the particles being measured (PM2.5 is for particles < 2.5 microns, PM 10 is for particles < 10 microns).
I used the basis of my fermentation monitor code to create an environmental monitoring unit for my workshop.
There were a few changes I needed to do:
- I added softwareSerial to read the sensor (via a patch cable and socket).
- I could not use the DS18D20 1-wire temperature sensor, as it needed the same DIO pin. I found DO on the NodeMCU does not work with a 1-wire sensor, either. So I have removed the temperature sensing for now and will add a different sensor (I'll do anothe blog post).
- I added a new feed to Adafuit IO showing the PM2.5 value. I am limited with feeds for the free version (maximum of 10), so I'm not recording the PM10 value to Adafruit IO, but I could easily.
- I added an extra timed function which wakes up the SDS011. It then waits for an adjustable time. Then it takes the sensor readings of PM2.5 and PM10. It then goes to sleep until it needs to wake up for the next reading. It is recommended to power the unit for > 30 seconds before taking a reading (to remove any dust build up in the unit).
- I added extra display modes and graphing pages to show the PM2.5 and PM10 values on the OLED screen.
This went really pretty smoothly and I now have an Adafruit IO dashboard showing me PM2.5 values.
I'm hoping to add more sensors. Now I have a pretty good base code for this (that I understand, but definitely not great code!).
I need to work more on the basic code to make it much easier to add sensors and graphs. This will include making a library for repeated functions I use. Hopefully my understanding of C and C++ will improve as well!
Other projects like this:
|DIY ESP32Air quality sensor
|Video showing how to make above. DIY ESP32Air quality sensor
|Citizen Science project to record air quality data.
|Gaia Earth Sensing Labs
|Air Quality Monitoring units
|Air Quality Egg
|Story of the Air Quality Egg project
|Air Quality Egg
|Buy the Air Quality Egg with NO2 and CO monitoring
|Sparkfun Weather Shield
|Not air quality - weather monitoring. DIY kit from SparkFun (US).
|Using Streetlight sensors for air quality sensing.
|Seeed Studio kit for monitoring data.
|Fab Lab Barcelona Citizen Science unit (2012!)
|Elektor Air Quality Kit
|This Air Quality Sensor Kit from Elektor contains all essential parts for analyzing the environment around you
|Community data from envrionmental montioring sensors
|Air Quality Aberdeen
|Did a DIY air quality monitoring kit for Aberdeen
|Sensor.Community (new name for LuftDaten)
|Basically exactly what I build above... But sends data to sensor.community.
Share this post