We offer you here to build your own sensor to measure air quality.
This educational kit invites you to discover the basics of electronics and fine particle measurement using
an Arduino UNO microcontroller board and an SDS011 probe. The kit is equipped with a battery to power the different components as well as
a screen to visualize the data. Connections are made using small Dupont cables.
This kit is an excellent educational tool that has proven itself during interventions with students in schools, with the general public
during events such as Science Fair and even with air quality professionals.
Check that you have all the necessary components:
The first step is to connect the + and - of the battery to the breadboard which will serve as an "electrical power strip" to power all the components. For this we use the connections available on the side of the battery always respecting the polarity: + (5V) and - (GND). The "-" pin is located above the "+" pin on the side of the battery. We use the red line for + and the black line for - (GND). Make the connections as shown in the images above using "Male-Female" cables.
The second step is to power the Arduino UNO with electricity. For this, connect the + and - on the breadboard using the 2 "Male-Male" cables. Be careful to respect the polarity on the Arduino by connecting the - to a GND pin and the + to the 5V pin. The Arduino starts up and the small red LED lights up.
Power the screen with electricity using the 5V and GND pins (as for the Arduino). Connect the screen to the Arduino UNO using pins A4 and A5 as shown in the images above. Note that once the connections are made the screen lights up. Restart the Arduino UNO using the small red button located on it, you should see the inscriptions "AirCarto.fr - Sensor Workshop" appear.
The last step is to connect the fine particle probe. Power the screen with electricity using the 5V and GND pins (as for the Arduino and screen). Connect the probe to the Arduino using pin 10 as shown in the images above. Once the cables are connected the screen may display inconsistent information. Restart the Arduino UNO using the small red button located on it, you should see the inscriptions "AirCarto.fr - Sensor Workshop" appear then a second screen with real-time fine particle measurements
The screen displays fine particle measurements updated every second. To test your sensor you can wave a scarf or rub your clothes above the air inlet of the sensor to see the dust concentrations increase.
In case of doubt, here is the electrical diagram of the connections to be made.
In case of purchasing the kit from AirCarto, the code is already present on the Arduino and this step is not necessary. If you have your own material here is the code to upload to the microcontroller. You can also modify the code to your liking if you wish.
/*
Code for Arduino UNO - Educational air quality kit proposed by AirCarto and AtmoSud (2024 version)
More info on the aircarto website: aircarto.fr
Assembly tutorial: https://aircarto.fr/kit_pedagogique/tuto/
Hardware:
1.Arduino UNO
2.Fine particle sensor SDS011 connected to pin 10 (TX)
3.LCD screen 1602 with I2C module connected to pins A4 and A5
You need to install two libraries to make the script work
*/
#include
#include //library for LCD screen (LiquidCrystal I2C by Frank de Brandander https://github.com/johnrickman/LiquidCrystal_I2C)
#include //library for SDS011 sensor (SDS011 sensor Library by R. Zshiegner https://github.com/ricki-z/SDS011)
LiquidCrystal_I2C lcd(0x27,16,2);
float p10,p25;
int error;
bool led_on = true;
SDS011 my_sds;
void setup()
{
Serial.begin(9600);
my_sds.begin(10,11);
pinMode(LED_BUILTIN, OUTPUT);
lcd.init();
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Sensor Workshop"); //intro message line 2
for (int i = 0; i <= 16; i++) {
lcd.setCursor(i,1);
lcd.print("-");
// we blink the LED
if(led_on){
digitalWrite(LED_BUILTIN, LOW);
led_on = false;
}else{
digitalWrite(LED_BUILTIN, HIGH);
led_on = true;
}
delay(200);
}
lcd.clear();
delay(1000);
}
void loop()
{
error = my_sds.read(&p25,&p10);
if (! error) {
//Uncomment next two line for serial debugging output
//Serial.println("P2.5: "+String(p25));
//Serial.println("P10: "+String(p10));
lcd.clear();
lcd.setCursor(0,0);
lcd.print("PM10: "+ String(p10,1));
lcd.setCursor(11,0);
lcd.print("ug/m3");
// We display here the thresholds according to the atmo index: https://www.atmosud.org/article/comprendre-les-indices-pour-qualifier-lair
if(p10<=20){
lcd.setCursor(6,1);
lcd.print("GOOD");
}
if(p10>20 && p10<=40){
lcd.setCursor(5,1);
lcd.print("FAIR");
}
if(p10>40 && p10<=50){
lcd.setCursor(4,1);
lcd.print("POOR");
}
if(p10>50 && p10<=100){
lcd.setCursor(4,1);
lcd.print("BAD");
}
if(p10>100 && p10<=150){
lcd.setCursor(4,1);
lcd.print("VERY BAD");
}
if(p10>150 ){
lcd.setCursor(4,1);
lcd.print("EXTRM. BAD");
}
if(led_on){
digitalWrite(LED_BUILTIN, LOW);
led_on = false;
}else{
digitalWrite(LED_BUILTIN, HIGH);
led_on = true;
}
}
delay(200);
}
Charging the battery is very simple. On the left side of the battery, you will find a micro-USB or USB-C port for charging.
Charge indicators on the battery
The initial code has been optimized to display only the essential. We chose to display only PM10 because these are the particles most commonly measured in official air quality indices.
It is quite possible to display both measurements (PM2.5 and PM10) by modifying the code. Here is the modified code to use:
void loop()
{
error = my_sds.read(&p25,&p10);
if (! error) {
lcd.clear();
// PM10 display line 1
lcd.setCursor(0,0);
lcd.print("PM10:" + String(p10,1));
lcd.setCursor(11,0);
lcd.print("ug/m3");
// PM2.5 display line 2
lcd.setCursor(0,1);
lcd.print("PM2.5:" + String(p25,1));
lcd.setCursor(12,1);
lcd.print("ug/m3");
if(led_on){
digitalWrite(LED_BUILTIN, LOW);
led_on = false;
}else{
digitalWrite(LED_BUILTIN, HIGH);
led_on = true;
}
}
delay(200);
}
If your screen appears blank or has a very low brightness, it can be due to two main reasons:
Adjust the small blue screw under the LCD to modify the contrast.
The displayed thresholds follow the French ATMO index:
The SDS011 sensor uses laser light scattering to detect and count particles suspended in the air. A fan draws air through the measurement chamber where a laser beam illuminates the particles. A photodetector then measures the scattered light to calculate the concentration of PM2.5 and PM10 particles.
To modify the Arduino code, simply connect the Arduino to your PC and modify the code via the Arduino IDE. Here's how to proceed:
If your sensor displays abnormally high fine particle readings, this can be due to two main causes:
Example of normal readings displayed on screen