Air Quality Sensor with information dashboard and mobile notification functionality.
Made with an Arduino ESP32, IFTTT, io.adafruit and multiple sensors wires, and resistors.
Air pollution is responsible for 7 million premature deaths around the world each year. When breathed in, pollutants can be absorbed in the blood and travel throughout the body and can damage the heart and other vital organs.
So on that dark note... how do we get better air?!
Air pollution sensors can help individuals control their environments through increased awareness of what's in the air around them. With this awareness, individuals can change their day-to-day life in order to increase the quality of life and overall health of individuals.
-
Low-power system on a chip (SoC) series with Wi-Fi & dual-mode Bluetooth capabilities. Enginereered for IoT devices.
This analog sensor can detect a variation of gasses, dependant on the resistance set, which configurable from the dial on the rear of the sensor.
Designed to sense dust particles. An infrared emitting diode and a phototransistor are diagonally arranged into this device, to allow it to detect the reflected light of dust in air. Effective in detecting very fine particles found in smoke.
This module provides a stable 5 V from a single Lithium Ion Polymer Battery. (2.5V - 5V) 600 mA TO USB 5 V.
Thin, light and powerful. The output of the battery ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 1200mAh for a total of about 4.5 watt-hours.
A simple terminal array board. Solderless breadboard does not require soldering, it is reusable.
-
Data from the gas sensor is read from A4 analog pin.
-
Data from the dust sensor is read from A3 analog pin.
-
When the Lithium Ion Polymer Battery battery is connected to the ESP32 and no USB power is available, the USB pin does not provide power.
-
The battery voltage is available at the BAT pin which is 4.2V and reduces to 3.3V when battery exhausts.
-
As the sensors connected need 5V, a DC-DC booster is required to needed to boost the battery voltage to 5V.
-
DC-DC Boost Module does this for us.
-
Simple pseudocode description of code process:
...
WAKE
Setup analog pin allocation
setup()
Search for WiFi network
Connect to WiFi
Connect to io.adafruit via MQTT
Connect to io.adafruit dust and gas feeds
Obtain analog reading from dust sensor from pin A3
Publish reading to io.adafruit dust sensor feed
Obtain analog reading from gas sensor from pin A4
Publish reading to io.adafruit gas sensor feed
Start sleep activation
loop() //empty as all functioning happens in setup() then goes back to sleep
SLEEP for x minutes
...
When the gas and dust sensor data is sent to io.adafruit, the data is stored in individual gas and dust 'feeds'. The data in the feeds can be visualised in a variation of ways on the io.adafruit dashboard.
Additonally, the data from the feeds can be read by IFTTT (IF This Then That). I created two 'applets' which moniter both gas and dust feeds in io.adafruit.
The first applet sends me a notification to my phone if the dust sensor reads a value larger than 100.
The second applet sends me a notification to my phone if the gas sensor reads a value larger than 1200.
![]() |
|
![]() |
![]() |
![]() |
![]() |
Notification from IFTTT when a high reading of dust is detected. | Notification from IFTTT when a high reading of gas is detected. |