Measure Air Quality

by danielgass in Circuits > Microcontrollers

1814 Views, 5 Favorites, 0 Comments

Measure Air Quality

fin01(0).jpg

Air quality and fine particles:
The suspended particles (denoted "PM" for "Particulate matter") are generally the fine solid particles carried by the air (Wikipedia). Fine particles penetrate deep into the lungs. They can cause inflammation and worsen the health of people with heart and lung disease.

The device measures the presence rate of PM10 and PM2.5 particles

The term "PM10" refers to particles whose diameter is less than 10 micrometers. The term "PM2.5" refers to particles whose diameter is less than 2.5 micrometers.

The sensor:

This sensor is based on a SDS011 PM2.5 / PM10 laser to accurately and reliably measure the quality of the air. This reliable, fast and precise laser measures the particle content in the air between 0.3 and 10 μm.

Project constraints:

Wifi connected device

Wifi performance because far from the Wifi base

Must only be activated twice an hour (power consumption limitation and Wifi limitation)

Waterproof environment

Monitor the charge level of the battery

Supplies

Components Needed

component.jpg
  • Wemos D1 mini pro
  • Sensor SDS011
  • Reed relay Celduc D31A3110 (or equivalent PRME 15005, Edr0201 a0500, SIP1A05)
  • Two resistors: 470K, 100K
  • Battery holder Wemos ESP32
  • Battery 18650 2500 mAh
  • Electric box ~6.2x3.5x2.3in (158x90x60mm)
  • Two angled tubes plus fitting tube (diameter ~0.63in (16mm))
  • Flexible PVC tube (diameter ~0.47in (12mm))
  • PVC glue
  • Solar panel 5V 5W
  • Miscellaneous hardware: junction terminal, printed circuit board, switch, 2 screws, ~0.47in (12mm) aluminum flat shank, relay support

Software:

  • Espeasy Mega embedded software (version 20190619)
  • Centralization of measures on Domoticz server

Electronics and Principle of Operation:

schemasonde.png

The particle sensor is programmed (from the factory) to supply on an I2C bus, after about fifteen seconds of operation, the measured values corresponding to PM10 and PM2.5.
This sensor is controlled by an ESP8266 type controller equipped with ESPEasy mega software (Version 20190626). The software must be flashed beforehand in the controller.

ESPEasy includes a plugin capable of interfacing the SDS011 sensor and collecting the measured values. There will therefore be no programming (or very little) to do but only the setting.

It starts from the principle of a measurement every 30 minutes. In the meantime the system will have to go into sleep mode in order to limit the power consumption. The ESP8266 natively has a sleep setting. For the sensor, which also includes a device for sleeping, we will opt instead for a pilot relay Reed. This relay will be powered by the ESP8266 when it wakes up (port D1 of the ESP8266). Thus the power consumption of the system will be minimal in sleep mode (of the order of 20μA). The use of a Reed relay has the advantage of being controlled directly by the ESP8266 (consumes 10mA on the maximum 12mA recommended per port).

In order to monitor the system supply voltage a voltage divider (resistors 100kO-470kO) will supply a voltage between 0 to 1V (0 for 0V and 1 for 5V) at port A0 of the ESP8266. This port accepts a maximum voltage of 1V. The ESP8266 features an analog / digital converter that provides the read value (from 1 to 1024). This value will be retransformed by the ESP8266 in voltage from 0 to 5V before being transmitted to Domoticz.

Espeasy Settings: Main

conf.png

Espeasy Setings: Controler (domoticz)

contr.png

Espeasy Settings: Task (voltage Monitoring)

ianalog.png

Espeasy Settings: Task (SDS011)

inter.png

Espeasy Settings: Rule

On SDS011#PM10 do

SendToHTTP 192.168.1.231,8082,/json.htm?type=command¶m=udevice&idx=63&nvalue=0&svalue=[SDS011#PM10]

SendToHTTP 192.168.1.231,8082,/json.htm?type=command¶m=udevice&idx=62&nvalue=0&svalue=[SDS011#PM25]

gpio,5,1

timerSet,1,5

endon

On System#Wake do

gpio,5,0

endon

On Rules#Timer=1 do

deepsleep,1800

endon

Domoticz Settings: Controller (dummy)

dommat.png

Domoticz Settings: Attached Devices

domdispo.png

Mounting the Sensor in the Box

iboit.jpg
iboitcapt.jpg

Circuit Board

platine.jpg
platinemont.png

Final Assembly

finalmont.jpg

The Operational Sensor

captoper.jpg

The metal rod is fixed to the housing and curved so that it can be easily hooked (balcony). The solar panel is fixed using a mounting allowing a rotation on two axes.

Result of the Measurements in Domoticz (three Devices)

domvue4.jpg

Result of the Measurements in Domoticz (PM2.5)

domvue2.png

Result of the Measurements in Domoticz (PM10)

domvue3.png

Conclusion:

This assembly does not represent any particular difficulty for people with knowledge in Domoticz and ESPEasy software.
It can effectively measure the presence of fine particles near your home. Thanks to the solar panel it will be possible to increase the frequency of the measurements if necessary. This assembly can be completed with probes for measuring temperature, humidity, pressure, CO2 etc.

This project is also visible on my site (multilingual): https://dangasdiy.top/