Blogs
GP2Y1010AUOF Optical Dust Sensor with Cable – Smoke
GP2Y1010AU0F Optical Dust Sensor
Laser-Based Air Quality Detection for PM2.5 and Smoke
Introduction
The GP2Y1010AU0F is an optical air quality sensor that detects fine particles like dust, smoke, and other airborne contaminants. Using infrared LED and phototransistor technology, it provides analog output proportional to particulate concentration, making it ideal for air quality monitors and industrial applications.
Key Features
Particle Detection
Sensitive to PM2.5 and smoke particles
Optical Design
Infrared LED with phototransistor
Analog Output
Voltage proportional to dust density
Built-in Cable
6-pin connector for easy integration
Technical Specifications
Detection Range | 0.5μm to 2.5μm particles |
---|---|
Operating Voltage | 5V DC ±0.5V |
Current Consumption | 20mA (typical) |
Output Type | Analog (0.6V-4.0V) |
Sensitivity | 0.5V per 0.1mg/m³ |
Response Time | <10ms |
Pin Configuration

Pin | Color | Description | Arduino Connection |
---|---|---|---|
1 | Black | Ground | GND |
2 | Red | LED Power (5V) | 5V via 150Ω resistor |
3 | Yellow | LED Control | D2 (Digital Output) |
4 | Green | Not Connected | – |
5 | White | Analog Output | A0 (Analog Input) |
6 | Blue | VCC (5V) | 5V |
Important: LED must be pulsed for proper operation
Wiring Diagram (Arduino)
1 2 3 4 5 6 7 8 9 10 11 |
// GP2Y1010AU0F Connections: // Black → GND // Red → 5V through 150Ω resistor // Yellow → D2 (LED control) // White → A0 (Analog Input) // Blue → 5V // Green → Not connected // Required Components: // - 150Ω resistor for LED // - 220μF capacitor between VCC and GND |
Basic Dust Detection
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
const int ledPin = 2; const int analogPin = A0; void setup() { Serial.begin(9600); pinMode(ledPin, OUTPUT); } void loop() { // Pulse LED for 0.32ms every 10ms digitalWrite(ledPin, LOW); delayMicroseconds(280); int voRaw = analogRead(analogPin); delayMicroseconds(40); digitalWrite(ledPin, HIGH); delayMicroseconds(9680); // Convert to voltage (0-5V scale) float voltage = voRaw * (5.0 / 1023.0); // Calculate dust density (mg/m³) float dustDensity = (voltage - 0.6) / 5.0; Serial.print("Dust Density: "); Serial.print(dustDensity); Serial.println(" mg/m³"); delay(1000); } |
Advanced Applications
Improved Accuracy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// Moving average filter #define READINGS 10 float dustHistory[READINGS]; int index = 0; float getAvgDensity(float newReading) { dustHistory[index] = newReading; index = (index + 1) % READINGS; float sum = 0; for(int i=0; i<READINGS; i++) { sum += dustHistory[i]; } return sum / READINGS; } |
Air Quality Index
1 2 3 4 5 6 7 8 9 10 11 12 |
// Convert to AQI float getAQI(float dustDensity) { if(dustDensity <= 0.054) { return (50/0.054) * dustDensity; } else if(dustDensity <= 0.154) { return 50 + (50/0.1) * (dustDensity-0.054); } else if(dustDensity <= 0.254) { return 100 + (50/0.1) * (dustDensity-0.154); } else { return 150 + (100/0.25) * (dustDensity-0.254); } } |
Data Logging
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// Record to SD card #include <SD.h> #include <SPI.h> File dataFile; void setup() { SD.begin(4); dataFile = SD.open("dust.csv", FILE_WRITE); } void loop() { float density = getDustDensity(); dataFile.print(millis()); dataFile.print(","); dataFile.println(density); delay(60000); // Log every minute } |
Wireless Monitoring
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// Send data via WiFi #include <ESP8266WiFi.h> void sendDustData(float density) { WiFiClient client; if(client.connect("api.thingspeak.com",80)) { String url = "/update?api_key=YOUR_KEY&field1="; url += String(density); client.print("GET "+url+" HTTP/1.1\r\n"); client.print("Host: api.thingspeak.com\r\n\r\n"); } client.stop(); } |
Troubleshooting
No Signal Change
- Verify LED is pulsing (check with oscilloscope)
- Ensure proper 150Ω resistor on LED power
- Check for air flow through sensor
Constant High Readings
- Clean sensor optics with compressed air
- Check for ambient light interference
- Test in known clean environment
Erratic Values
- Add 220μF capacitor between VCC and GND
- Ensure stable 5V power supply
- Implement software averaging