Sharp GP2Y1010AU0F Optical Dust Sensor

View on Amazon
Overview
About Sharp GP2Y1010AU0F Optical Dust Sensor
The Sharp GP2Y1010AU0F is an optical air quality sensor designed to detect fine dust particles in the air. Using an infrared LED and a phototransistor, it measures light reflection from airborne particles, making it ideal for air purifiers and environmental monitoring.
⚡ Key Features
- Infrared-Based Detection – Uses an IR LED and phototransistor to detect fine dust.
- Analog Voltage Output – Provides readings proportional to dust density.
- High Sensitivity – Capable of detecting very fine particles, including cigarette smoke.
- Compact & Low Power – Easily integrates into microcontroller-based air quality systems.
The GP2Y1010AU0F is widely used in air purifiers, HVAC systems, and environmental monitoring for real-time air quality detection. 🚀
The GP2Y1010AU0F operates with a low current consumption of up to 20 mA and a typical operating voltage range of 4.5V to 5.5V. It can detect dust particles by measuring the photometry of a single pulse, enabling it to distinguish between smoke and house dust. The sensor’s compact dimensions (46.0 x 30.0 x 17.6 mm) make it easy to integrate into various applications, including air purifiers, HVAC systems, and other air quality monitoring devices.
Get Your GP2Y1010AU0F
💡 Prices are subject to change. We earn from qualifying purchases as an Amazon Associate.
GP2Y1010AU0F Specifications
Complete technical specification details for Sharp GP2Y1010AU0F Optical Dust Sensor
📊 Technical Parameters
GP2Y1010AU0F Pinout
The GP2Y1010AU0F has 6 pins for power, LED control, and analog output.
Visual Pinout Diagram

Pin Types
Quick Tips
Object],[object Object]
Object],[object Object]
Object],[object Object]
Pin Descriptions
| Pin Name | Type | Description | Notes |
|---|---|---|---|
1 Pin 1 (V-LED) | Power | LED power supply. Connect to 5V through 150Ω resistor. | Resistor limits current to LED. |
2 Pin 2 (LED-GND) | Power | LED ground connection. Connect to system ground. | |
3 Pin 3 (LED) | Control | LED control input. Connect to digital output pin for pulsing. | Control LED timing: 0.32ms pulse, 10ms cycle. |
4 Pin 4 (S-GND) | Power | Signal ground connection. Connect to system ground. | |
5 Pin 5 (Vo) | Analog | Analog voltage output proportional to dust density. | Connect to ADC pin. Output: ~0V (clean) to ~3.5V (very dusty). |
6 Pin 6 (Vcc) | Power | Power supply input (4.5V-5.5V). Typically 5V. | Stable 5V required for accurate measurements. |
Wiring GP2Y1010AU0F to ESP32
To interface the GP2Y1010AU0F with an ESP32, connect Vcc to 5V, LED-GND and S-GND to ground, Vo to an ADC pin (GPIO 34), LED to a GPIO (GPIO 25), and V-LED to 5V through a 150Ω resistor.
Visual Wiring Diagram

Connection Status
Protocol
Pin Connections
| GP2Y1010AU0F Pin | Connection | ESP32 Pin | Description |
|---|---|---|---|
1 Pin 6 (Vcc) Required | 5V | Power supply (5V). Use stable regulated power. | |
2 Pin 2 (LED-GND) Required | GND | LED ground connection. | |
3 Pin 4 (S-GND) Required | GND | Signal ground connection. | |
4 Pin 1 (V-LED) Required | 5V via 150Ω Resistor | LED power through current-limiting resistor. | |
5 Pin 3 (LED) Required | GPIO 25 | LED control. Pulse HIGH for 0.32ms every 10ms. | |
6 Pin 5 (Vo) Required | GPIO 34 (ADC1_CH6) | Analog output. Read 0.28ms after LED turn-on. |
CRITICAL: 150Ω resistor required between 5V and V-LED (Pin 1)
CRITICAL: LED timing: Pulse HIGH for 0.32ms, then LOW for 9.68ms (10ms cycle)
CRITICAL: Read Vo (analog) 0.28ms after LED turns on
ESP32 ADC1 (GPIO 32-39) - avoid ADC2 when WiFi active
220µF capacitor between Vcc and GND for stable power
Dust density (mg/m³) = (Vo - 0.6V) × 0.17
air: Vo ≈ 0.6V, Heavy dust: Vo ≈ 3.5V
sensor away from direct airflow and vibrations
GP2Y1010AU0F Troubleshooting
Common issues and solutions to help you get your sensor working
Common Issues
Issue: The GP2Y1010AU0F sensor outputs constant zero or negative dust density values, indicating potential issues with sensor readings.
Possible causes include incorrect wiring, improper LED control timing, or incorrect voltage reference in calculations.
Solution: Ensure that the sensor's LED control pin is correctly connected to a digital output pin on the microcontroller and that the timing sequence for LED pulsing aligns with the sensor's specifications. Verify that the analog output (Vo) is connected to an appropriate analog input pin. Additionally, confirm that the voltage reference used in calculations matches the actual operating voltage of the sensor (typically 5V).
Issue: The sensor provides inconsistent or fluctuating dust density readings, making it difficult to obtain accurate measurements.
Possible causes include unstable power supply, external light interference, or improper sensor placement.
Solution: Use a regulated power supply to ensure stable voltage levels. Shield the sensor from external light sources, as ambient light can affect the internal photodetector. Position the sensor in a location with consistent airflow and minimal vibration to improve measurement stability.
Issue: The GP2Y1010AU0F sensor does not show any change in readings when exposed to dust, indicating a lack of responsiveness.
Possible causes include a malfunctioning internal LED, blocked optical path, or incorrect sensor orientation.
Solution: Inspect the sensor for any obstructions in the optical path and clean if necessary. Ensure that the sensor is oriented correctly, with the dust entry hole unobstructed. If the internal LED is suspected to be faulty, consider replacing the sensor.
Issue: Miscalculations in converting analog readings to voltage result in incorrect dust density values.
Possible causes include using an incorrect reference voltage in calculations or not accounting for the sensor's sensitivity factor.
Solution: Ensure that the analog-to-digital conversion uses the correct reference voltage, matching the sensor's operating voltage (typically 5V). Apply the appropriate sensitivity factor as specified in the sensor's datasheet to convert voltage readings to dust density accurately.
Debugging Tips
Use the Serial Monitor to check for error messages and verify the sensor's output. Add debug prints in your code to track the sensor's state.
Use a multimeter to verify voltage levels and check for continuity in your connections. Ensure the power supply is stable and within the sensor's requirements.
Additional Resources
GP2Y1010AU0F Programming Examples
Ready-to-use code examples for different platforms and frameworks
#include <GP2YDustSensor.h>
const uint8_t SHARP_LED_PIN = 14; // Sharp Dust/particle sensor Led Pin
const uint8_t SHARP_VO_PIN = A0; // Sharp Dust/particle analog out pin used for reading
GP2YDustSensor dustSensor(GP2YDustSensorType::GP2Y1014AU0F, SHARP_LED_PIN, SHARP_VO_PIN);
void setup() {
Serial.begin(9600);
//dustSensor.setBaseline(0.4); // set no dust voltage according to your own experiments
//dustSensor.setCalibrationFactor(1.1); // calibrate against precision instrument
dustSensor.begin();
}
void loop() {
Serial.print("Dust density: ");
Serial.print(dustSensor.getDustDensity());
Serial.print(" ug/m3; Running average: ");
Serial.print(dustSensor.getRunningAverage());
Serial.println(" ug/m3");
delay(1000);
}#include <stdio.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/adc.h"
#include "esp_adc_cal.h"
#include "driver/gpio.h"
#include "esp_system.h"
#include "esp_log.h"
#include "rom/ets_sys.h" // For microsecond delays
#define LED_PIN 2 // Change to the GPIO pin connected to the LED
#define ADC_CHANNEL ADC1_CHANNEL_6 // GPIO34 (ADC1_CH6)
#define DEFAULT_VREF 1100 // Default ADC reference voltage in mV
#define NO_OF_SAMPLES 64 // Number of ADC samples for averaging
static esp_adc_cal_characteristics_t *adc_chars = NULL;
static const char *TAG = "ESP32_ADC_Task";
// Function to initialize ADC
void init_adc() {
ESP_ERROR_CHECK(adc1_config_width(ADC_WIDTH_BIT_12));
ESP_ERROR_CHECK(adc1_config_channel_atten(ADC_CHANNEL, ADC_ATTEN_DB_0));
adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t));
if (adc_chars == NULL) {
ESP_LOGE(TAG, "Failed to allocate memory for ADC characteristics");
return;
}
// Check and calibrate ADC using eFuse Vref
if (esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_VREF) == ESP_OK) {
esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_0, ADC_WIDTH_BIT_12, DEFAULT_VREF, adc_chars);
} else {
ESP_LOGW(TAG, "eFuse Vref not available, using default Vref");
esp_adc_cal_characterize(ADC_UNIT_1, ADC_ATTEN_DB_0, ADC_WIDTH_BIT_12, DEFAULT_VREF, adc_chars);
}
}
// Function to read ADC value
uint32_t read_adc_value() {
uint32_t adc_reading = 0;
for (int i = 0; i < NO_OF_SAMPLES; i++) {
adc_reading += adc1_get_raw(ADC_CHANNEL);
}
adc_reading /= NO_OF_SAMPLES; // Average
// Convert raw ADC value to voltage (mV)
uint32_t voltage = esp_adc_cal_raw_to_voltage(adc_reading, adc_chars);
ESP_LOGI(TAG, "Raw ADC: %lu, Voltage: %lu mV", (unsigned long)adc_reading, (unsigned long)voltage);
return voltage;
}
// Function to initialize LED
void init_led() {
gpio_reset_pin(LED_PIN);
gpio_set_direction(LED_PIN, GPIO_MODE_OUTPUT);
}
// Task to blink LED with precise timing
void led_task(void *pvParameters) {
while (1) {
gpio_set_level(LED_PIN, 1);
ets_delay_us(280); // 280µs delay (sub-millisecond precision)
gpio_set_level(LED_PIN, 0);
vTaskDelay(pdMS_TO_TICKS(1000)); // Delay for 1 second
}
}
// Task to read ADC values
void adc_task(void *pvParameters) {
while (1) {
read_adc_value();
vTaskDelay(pdMS_TO_TICKS(2000)); // Read ADC every 2 seconds
}
}
// Main function
void app_main() {
init_led();
init_adc();
xTaskCreate(led_task, "LED Task", 2048, NULL, 2, NULL);
xTaskCreate(adc_task, "ADC Task", 2048, NULL, 2, NULL);
}sensor:
- platform: adc
pin: GPIO36
name: "Dust Density"
update_interval: 1s
filters:
- calibrate_linear:
- 0.0 -> 0.0
- 2.5 -> 0.5 # Adjust these values based on sensor calibration
unit_of_measurement: "µg/m³"
gpio:
- platform: output
pin: GPIO4
id: led_control
interval:
- interval: 1s
then:
- output.turn_on: led_control
- delay: 0.28ms
- output.turn_off: led_controlplatformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200main.cpp
#include <Arduino.h>
const int measurePin = 36; // Analog input pin connected to Vo
const int ledPin = 4; // Digital output pin connected to LED control
void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delayMicroseconds(280); // LED on for 280µs
int sensorValue = analogRead(measurePin);
digitalWrite(ledPin, LOW);
// Convert sensor value to voltage (assuming 3.3V ADC reference)
float voltage = sensorValue * (3.3 / 4095.0);
// Convert voltage to dust density (example calibration formula)
float dustDensity = (voltage - 0.4) / 0.05; // µg/m³
Serial.print("Dust Density: ");
Serial.print(dustDensity);
Serial.println(" µg/m³");
delay(1000); // Wait 1 second before the next reading
}from machine import Pin, ADC
import time
# Pin definitions
led_pin = Pin(4, Pin.OUT) # LED control pin
adc = ADC(Pin(36)) # Analog input pin
adc.width(ADC.WIDTH_12BIT) # 12-bit ADC resolution
adc.atten(ADC.ATTN_11DB) # Full-scale voltage (up to 3.3V)
def read_dust_density():
led_pin.value(1)
time.sleep_us(280) # LED pulse width
raw_value = adc.read()
led_pin.value(0)
# Convert raw ADC value to voltage (assuming 3.3V reference)
voltage = raw_value * (3.3 / 4095.0)
# Convert voltage to dust density (calibration formula)
dust_density = (voltage - 0.4) / 0.05 # µg/m³
return dust_density
while True:
dust_density = read_dust_density()
print(f"Dust Density: {dust_density:.2f} µg/m³")
time.sleep(1)read_dust_density() function pulses the LED for 280 microseconds, reads the ADC value, and converts it to voltage. The voltage is then translated into dust density using a calibration formula. The main loop retrieves and prints the dust density every second.Wrapping Up GP2Y1010AU0F
The ESP32 Sharp GP2Y1010AU0F Optical Dust Sensor is a powerful Air Quality sensor that offers excellent performance and reliability. With support for multiple development platforms including Arduino, ESP-IDF, ESPHome, PlatformIO, and MicroPython, it's a versatile choice for your IoT projects.
Best Practices
For optimal performance, ensure proper wiring and follow the recommended configuration for your chosen development platform.
Safety First
Always verify power supply requirements and pin connections before powering up your project to avoid potential damage.
Ready to Start Building?
Now that you have all the information you need, it's time to integrate the GP2Y1010AU0F into your ESP32 project and bring your ideas to life!
Explore Alternative Sensors
Looking for alternatives to the GP2Y1010AU0F? Check out these similar sensors that might fit your project needs.

MiCS-4514 Dual Gas Sensor
The MiCS-4514 is a dual gas sensor capable of detecting oxidizing gases (e.g., NO₂) and reducing gases (e.g., CO, NH₃). It provides analog...

MH-Z19 NDIR CO₂ Sensor
The MH-Z19 is a high-accuracy CO₂ sensor using NDIR technology, suitable for air quality monitoring. It supports UART and PWM communication,...

ENS160 Digital Metal-Oxide Multi-Gas Sensor
The ENS160 is a digital MOX gas sensor optimized for indoor air quality monitoring. It provides accurate measurements of TVOC and eCO₂...





