PM2.5 Air Quality Measurement with SDS011

Introduction

This experiment shows how to measure air quality by detecting PM2.5 particulate matter using an SDS011 sensor with Arduino.

SDS011 Sensor

Components Needed

Circuit Setup

  1. Connect the SDS011 sensor to the Arduino's RX and TX pins using a SoftwareSerial connection.
  2. Power the sensor with 5V and GND pins of the Arduino.

The SDS011 sensor measures particulate matter in the air and sends the data to the Arduino.

PM2.5 Circuit Setup

Code for PM2.5 Measurement

Upload the following code to your Arduino to measure PM2.5 levels:


#include 
#include 

SoftwareSerial mySerial(10, 11); // RX, TX pins
SDS011 sensor(mySerial);

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
  sensor.begin();
}

void loop() {
  float pm25, pm10;
  sensor.read(&pm25, &pm10);
  Serial.print("PM2.5: ");
  Serial.print(pm25);
  Serial.print(" µg/m³ | PM10: ");
  Serial.println(pm10);
  delay(1000);
}
            

Explanation

The SDS011 sensor detects the concentration of particulate matter in the air. The Arduino reads this data and displays the PM2.5 and PM10 levels on the Serial Monitor.

Troubleshooting