Air Quality Monitoring System

1. Introduction

Nowadays, air pollution is a big problem all over the world and this project aims to measure the quality of air that surrounds a user in such that he can take the best measures in order to keep his lungs healthy. The system checks the particulate matter, relative humidity, temperature, altitude, and the atmospheric pressure for this reason. The particles that are related to air pollution are also known as particulate matter. PM stands for particulate matter (also called particle pollution): the term for a mixture of solid particles and liquid droplets found in the air. Some particles, such as dust, dirt, soot, or smoke, are large or dark enough to be seen with the naked eye. Others are so small they can only be detected using an electron microscope. Particles come in a wide range of sizes. Particles less than or equal to 10 micrometers in diameter are so small that they can get into the lungs, potentially causing serious health problems. Ten micrometers is less than the width of a single human hair.

Particle pollution includes:

  • Coarse dust particles (PM10): inhalable particles, with diameters that are generally 10 micrometers and smaller. Sources include crushing or grinding operations and dust stirred up by vehicles on roads.
  • Fine particles (PM2.5) : fine inhalable particles, with diameters that are generally 2.5 micrometers and smaller. Fine particles are produced from all types of combustion, including motor vehicles, power plants, residential wood burning, forest fires, agricultural burning, and some industrial processes

2. Hardware description

ESP32 (Wemos Lolin32)

It is a low-power microcontroller (MCU) with integrated Wi-Fi and dual-mode Bluetooth—it is a successor of ESP8266 MCU.


This module is used for reading the temperature, pressure and relative humidity of the environment.

Nova Fitness SDS011 PM Air Quality Sensor

This sensor uses the principle of laser scattering to detect particles between 0.3 and 10 µm in the air. This sensor consists of a small fan, air inlet valve, laser diode, and photodiode. The air enters through the air inlet where a light source (Laser) illuminates the particles and the scattered light is transformed into a signal by a photodetector. These signals are then amplified and processed to get the particle concentration of PM2.5 and PM10.

3. Hardware implementation

Schematic diagram:

The real life system:

4. Software implementation

Software tools needed:
  • Arduino IDE
  • Adafruit_BME280 library
  • Serial library
  • ThingSpeak API
  • ArduinoHttpClient

The BME280 sensor communicates with the microcontroller using the I2C protocol. The communication is done through an existing library and all the necessary data is fetched through some specialized functions. The SDS011 sensor has a serial interface which is connected to the microcontroller in order to send and receive data. In this case no library was used, and instead some functions were developed in order to establish the communication. For this reason the turnoff() and turnon() functions were developed by taking into consideration the protocols used by the SDS011 sensor. As for the input data, another function was developed in order to process the data received by the air quality sensor. Thus, by taking into account the table from below that was extracted from the datasheet, all the elements were put in a matrix after the checksum is verified.

Moreover, the PM data goes through a correction algorithm by taking into account the relative humidity. After that, the data collected is uploaded on the ThingSpeak platform using their API by making a get request. The end result can be seen in the picture below:

5. Conclusions

This project gives a good understanding of the importance of Internet of Things for the human beings. Also with the ongoing problems with climate change and the overall pollution, these kind of devices can help everybody to monitor these effects and to also take actions. As for this project, I tried to upload the data to the website but I ran into problems using the POST request that I was not able to resolve in time.

6. Resources

iothings/proiecte/2022/airqualitymonitoringsystem.txt · Last modified: 2023/01/21 20:58 by serhan.refigean
CC Attribution-Share Alike 3.0 Unported Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0