Illustration of PM2.5 Air Quality Measurement using SDS011 sensor

PM2.5 Air Quality Measurement with SDS011

Introduction

With growing urbanization and industrial activities, air pollution poses a significant threat to health and the environment. Measuring particulate matter such as PM2.5 and PM10 helps in assessing air quality and understanding pollution levels. In this guide, we’ll demonstrate how to build a simple yet effective air quality monitor using the SDS011 sensor and Arduino, enabling real-time PM2.5 measurement and data visualization.

Components Needed

Circuit Setup

  1. Connect the SDS011 sensor's RX and TX pins to the Arduino's TX and RX pins, respectively, using a SoftwareSerial library connection. (For Arduino Uno, use pins 10 and 11.)
  2. Provide power to the SDS011 sensor through the Arduino's 5V and GND pins.
  3. If using a breadboard, neatly arrange the components for easier debugging.

Below is a diagram of the circuit setup:

How the SDS011 Sensor Works

The SDS011 sensor uses laser scattering to detect fine particles in the air. A laser beam is passed through the air inside the sensor, and a photodetector measures the intensity of scattered light. This data is processed to calculate the concentration of PM2.5 and PM10 particles in micrograms per cubic meter (µg/m³).

Code for PM2.5 Measurement

Use the following code to measure PM2.5 levels. Upload this sketch to your Arduino using the Arduino IDE:


#include 
#include 

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

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
  sensor.begin();
  Serial.println("PM2.5 Air Quality Monitor");
}

void loop() {
  float pm25, pm10;
  if (sensor.read(&pm25, &pm10) == 0) { // If data is successfully read
    Serial.print("PM2.5: ");
    Serial.print(pm25);
    Serial.print(" µg/m³ | PM10: ");
    Serial.println(pm10);
  } else {
    Serial.println("Error reading data from SDS011 sensor");
  }
  delay(1000); // Read data every second
}
            

Make sure to install the SDS011 library in the Arduino IDE before running the code.

Understanding PM2.5 Levels

Particulate matter is categorized by size:

The sensor outputs readings in µg/m³. Below is a general guide for PM2.5 levels:

PM2.5 Level (µg/m³) Air Quality
0-12Good
13-35Moderate
36-55Unhealthy for Sensitive Groups
56-150Unhealthy
151-250Very Unhealthy
251+Hazardous

Practical Applications

Troubleshooting