Measuring Air Quality and Light Level and More

by danielgass in Circuits > Arduino

13075 Views, 151 Favorites, 0 Comments

Measuring Air Quality and Light Level and More

The aim of this project is to assess air quality by measuring the concentration of fine particulate matter, CO₂ levels and the UV index.

Thanks to its portability, measurements can be taken at home or on the move.


Air quality and fine particles

Particulate matter (abbreviated to ‘PM’) generally refers to fine solid particles suspended in the air (source: Wikipedia). Fine particles penetrate deep into the lungs. They can cause inflammation and exacerbate the health condition of people with heart and lung diseases.

The device measures the concentration of PM10 and PM2.5 particles.

The term “PM10” refers to particles with a diameter of less than 10 micrometres.

The term “PM2.5” refers to particles with a diameter of less than 2.5 micrometres.

The sensor is based on an SDS011 PM2.5/PM10 laser, enabling accurate and reliable air quality testing. This reliable, fast and accurate laser measures the concentration of airborne particles between 0.3 and 10 µm.


Air quality: the gas sensor:

The MQ135 is sensitive to the main pollutants present in the atmosphere. This sensor detects CO₂, alcohol, benzene, nitrogen oxides (NOx) and ammonia (NH₃). In this project, we are limiting ourselves to measuring CO₂ levels.


The sensor consists of a heating element whose electrical resistance varies depending on the presence of CO2 in the atmosphere. The voltage supplied (pin A0 of the sensor) allows the concentration to be determined.


The value provided is not linear with respect to the CO2 concentration. The resulting value must be adjusted (by the programme). I won’t go into further detail; numerous articles published online provide more information.


Light intensity: the GUVA-S12SD sensor


The GUVA-S12SD UV sensor measures ultraviolet radiation intensity in real time. The GUVA-S12SD module operates primarily with ultraviolet radiation emitted by sunlight and does not respond correctly to conventional artificial lighting.

How It Works

The controller used is the Arduino Nano Every (programmed via the IDE), which features a large number of analogue pins as well as a power port capable of handling voltages well above 5V. A built-in 5V regulator supplies power to the other components.


The particle sensor is factory-programmed to provide the values for PM10 and PM2.5 via an I2C bus every 2 minutes.


The ST7735 display allows the trend of the measurements to be monitored.


A measurement is taken every two minutes. Two tables allow the trend of the measurements to be tracked over 44 minutes (22 measurements). Each new measurement is added to the right of the table after the previous measurements have been shifted to the left.


The display also shows the time remaining until the next measurement, as well as the battery voltage.


To monitor the system’s supply voltage, a voltage divider (10kΩ-10kΩ resistors) is connected to the battery and port A6 of the controller. This voltage divider prevents a voltage higher than 4.5V from being applied to port A6. Using a 9V 1000mAh battery, the device can operate for 6 hours.


The MQ-135 sensor is connected to analogue port A0.


The UV sensor is connected to analogue port A1.


A switch connected to port A6 allows the display to be toggled between two modes.


SDS011 mode for PM10 and PM2.5 values

MQ-135 and UV mode

Programming

Programming is carried out using the Arduino IDE. The libraries used are listed at the start of the programme. They can be downloaded from the Arduino website.


The programme is divided into functions to make it easier to read. The image shows the functions used for each half-window depending on the position of the switch.


The PM10 and PM2.5 display shows the latest measurements. A measurement is taken and stored every two minutes. This provides a record of pollution levels over time. Lines indicate the tolerance thresholds above which the permitted standards are exceeded.


The CO2 and UV display is updated in real time as the sensors are read.


The full programme can be downloaded here.

Conclusion

This setup does not present any particular difficulties.


It allows for the effective measurement of fine particulate matter.


This setup can be expanded to include sensors for measuring temperature, humidity, pressure, CO₂, etc.


Other sensors are available. These sensors operate on the same principle as the MQ135 sensor.


The circuit diagram can be adapted to use several sensors simultaneously. The Arduino Nano, with its 8 analogue inputs, makes it easy to handle the sensors.


However, the power consumption of the unit must be monitored. Current power consumption is 230mA. With an 800mAh battery, the system can run for up to 3 hours. 18650-type batteries with a capacity of 2000mAh can last much longer.


List of sensors:

MQ-3 Alcohol, ethanol and smoke

MQ-4 Methane (CH4). From 300 to 10,000 ppm

MQ-5 Natural gas, LPG. From 300 to 50,000 ppm

MQ-6 LPG, butane. From 200 to 10,000 ppm 48

MQ-7 Carbon monoxide (CO). From 20 to 2,000 ppm

MQ-8 Hydrogen. From 100 to 10,000 ppm

MQ-9 Carbon monoxide, methane (CH4)

MQ131 Ozone

MQ136 Hydrogen sulphide gas (H2S

MQ137 Ammonia. From 5 to 500 ppm

MQ138 Benzene, Toluene, Alcohol, Acetone, Propane, Formaldehyde, Hydrogen.

MQ214 Methane (3,000ppm to 20,000ppm), LPG and propane (500ppm to 10,000ppm), butane (500ppm to 10,000ppm)

MQ216 Natural gas, coal gas, propane, CH4

MQ303A Alcohol, ethanol, fumes

MQ306A LPG, butane

MQ307A Carbon monoxide (CO)

MQ309A Carbon monoxide, flammable gases