Skip to content

Instructions

Charlie Jaewoong Mun edited this page Jan 4, 2020 · 8 revisions

Step 1: Choosing and setting up the hardware for our IoT device

You may choose from a variety of sensors. The website AQICN has some good reviews for these sensors. The cheaper ones all work the same way: They have an infrared light source (LED or laser) and a light detector diametrically positioned across an air chamber. The detector measures light scattered by the fine dust or smog particulates in the air chamber, although, accuracy may varies, depends on the sensor models and price.

For this project, I chose to use the Nova PM Sensor SDS011 air quality sensor.

The sensor module has 4 wires: two for power supply and two for data. The power wires (GND and VCC) connect to the GND and Vin PINs on the NodeMCU board, as they draw 5V power from the NodeMCU. The data wire connects to two digital PINs on the NodeMCU. I choose to connect to [D0] and [D1]. The wiring is shown in The assembled prototype device with power source. above (the wire colors refer to the wires coming out of the air quality sensor the photo which located at the top). The NodeMCU board can be powered by using a regular Micro-USB connection. So, I attached a rechargeable USB portable battery to the prototype as power source.

Step 2: Reading sensor data

The data output from the sensor is a waveform with random peaks and troughs. Every peak indicates that the sensor has detected Particulate Matter (PM) greater than 1um in size. To read PM level from the sensor, the NodeMCU application needs to compute Lo Pulse Occupancy time (LPO time) in a given time unit. It needs to determine how much time (percentage) the data wire is in the low voltage state. The LPO value can then be converted to particulates per liter of air (or particulate mass per m³) using a response curve given in the product specification.

Step 3: Connecting our IoT device to ThingSpeak or Plaive

Step 4: Sending the data to ThingSpeak or Plaive and analyzing the data

Conclusion

Clone this wiki locally