Interfacing PM2.5 Dust Sensor with Arduino
PM2.5 Dust Sensor (GP2Y1010AU0F)
The PM2.5 GP2Y1010AU0F Dust Sensor detects dust and smoke particles in the air. It is commonly used in air purifiers, environmental monitoring, and HVAC systems where air quality monitoring is essential.
Working Principle of PM2.5 Dust Sensor
The GP2Y1010AU0F Dust Sensor works by using an infrared LED and a phototransistor to detect light scattered by airborne particles. The intensity of scattered light correlates with the dust concentration in the air.
Types of Dust and Smoke Sensors
PM2.5 Optical Dust Sensor
- Emits infrared light into the air chamber.
- Detects scattered light using a photodiode.
- Processes the signal to determine dust concentration.
Laser-Based Dust Sensor
- Emits a focused laser beam.
- Measures angle and intensity of scattered light.
- Provides highly accurate dust measurements.
Requirements
1. Arduino
2. GP2Y1010AU0F Dust Sensor
3. 150 ohm resistor
4. Jumper wires
Pin Configuration of PM2.5 Dust Sensor
GP2Y1010AU0F Module
- V-LED: Connect to 5V via a 150 ohm resistor.
- LED-GND: Connect to GND.
- LED: Connect to a digital output pin to pulse the LED.
- Vo: Analog output connected to Arduino analog input.
- GND: Connect to GND on Arduino.
- Vcc: Connect to +5V on Arduino.
Wiring the PM2.5 Dust Sensor to Arduino
To connect the GP2Y1010AU0F Dust Sensor to Arduino, connect Vcc and GND to +5V and GND. Use a resistor to connect V-LED to 5V, control the LED pin with a digital output, and read the Vo pin from an analog input for particle data.
Algorithm
Initialize Components
- Connect the sensor pins (Vcc, GND, Vo, LED, V-LED) properly to the Arduino using a suitable resistor.
- Ensure the LED pin is controlled via a digital pin for proper pulsing.
Write the Code
- Define sensor pins in the setup() function.
- Pulse the LED and read analog values from the Vo pin.
- Convert the analog values into dust concentration (µg/m3).
Display Values or Control Devices
- Print the dust concentration to the serial monitor.
- Use values to activate air filters, alarms, or log air quality.
Test the Project
- Upload the code to the Arduino.
- Expose the sensor to various dust levels and observe the readings.
1// Arduino code for interfacing GP2Y1010AU0F PM2.5 Dust Sensor
2
3const int dustSensorLED = 9; // LED control pin (connected to 'LED' of sensor)
4const int analogPin = A0; // Sensor's analog output connected to A0
5float dustDensity = 0;
6
7void setup() {
8 Serial.begin(9600); // Initialize serial communication
9 pinMode(dustSensorLED, OUTPUT); // Set LED pin as output
10 Serial.println("GP2Y1010AU0F Dust Sensor Initialized...");
11}
12
13void loop() {
14 digitalWrite(dustSensorLED, LOW); // Turn on LED (active low)
15 delayMicroseconds(280); // Wait for 280μs for LED to stabilize
16
17 int rawValue = analogRead(analogPin); // Read analog voltage output (0–1023)
18 delayMicroseconds(40); // Sampling window
19 digitalWrite(dustSensorLED, HIGH); // Turn off LED
20 delayMicroseconds(9680); // Wait for rest of the 10ms cycle
21
22 // Convert raw ADC value (0–1023) to voltage (0–5V range)
23 float voltage = rawValue * (5.0 / 1024.0);
24
25 // Dust density formula from Sharp datasheet
26 dustDensity = (voltage - 0.9) / 0.5; // Output in mg/m^3
27
28 // Print values to Serial Monitor
29 Serial.print("Raw ADC Value: ");
30 Serial.print(rawValue);
31 Serial.print(" | Voltage: ");
32 Serial.print(voltage);
33 Serial.print(" V | Dust Density: ");
34 Serial.print(dustDensity);
35 Serial.println(" mg/m^3");
36
37 delay(1000); // Delay before next reading
38}
39
Applications of PM2.5 Dust Sensors
- Air quality monitoring systems
- Indoor air purifiers
- HVAC systems
- Smart homes and IoT environments
- Environmental research
- Smoke detection in industrial zones
Conclusion
Interfacing a PM2.5 GP2Y1010AU0F Dust Sensor with Arduino enables precise air quality measurement, useful in smart homes, pollution monitoring, and air purifiers. With simple wiring and code, you can build a powerful dust detection system.