Home Code Arduino Dust sensor example

Arduino Dust sensor example

by shedboy71
[lebox id="1"]

Sharp's GP2Y1010AU0F is an optical air quality sensor it is designed to sense dust particles. An infrared emitting diode and a phototransistor are diagonally arranged into this device, to allow it to detect the reflected light of dust in air. It is especially effective in detecting very fine particles like cigarette smoke, and is commonly used in air purifier systems.

gp2y1010au0f

To interface with this sensor, you need to connect to its 6-pin, 1.5mm pitch connector by using mating connector.

Specifications:

  • Low Current Consumption (MAX: 20mA)
  • Typical Operating Voltage: 4.5V to 5.5V (MAX: 7V)
  • The presence of dust can be detected by the photometry of only one pulse
  • Enable to distinguish smoke from house dust
  • Dimensions: 1.81 x 1.18 x 0.69” (46.0 x 30.0 x 17.6mm)

 

gp2y1010au0f diagram

 

dustdensitycharateristics

 

Connection

The following connections are used

Sharp pin 1 (V-LED)          =  5V this is connected via a 150 ohm resistor
Sharp pin 2 (LED-GND)     =  Arduino GND pin
Sharp pin 3 (LED)             = Arduino pin D2
Sharp pin 4 (S-GND)         = Arduino GND pin
Sharp pin 5 (Vo)               =  Arduino A0 pin
Sharp pin 6 (Vcc)              =  5V

Refer to this layout diagram

Layout

Resister, R1=150Ω and capacitor, C1=220uF mentioned above is required for pulse drive of the LED of GP2Y1010AU0F. Please use the ones with the above mentioned constants. Without these components, the device does not work.

arduino-and-dust-sensor_schem

Code

[codesyntax lang=”cpp”]

int dustPin = 0; // dust sensor - Arduino A0 pin
int ledPin = 2;    

float voltsMeasured = 0;
float calcVoltage = 0;
float dustDensity = 0;
  
void setup()
{
  Serial.begin(57600);
  pinMode(ledPin,OUTPUT);
}

  
void loop()
{
  digitalWrite(ledPin,LOW); // power on the LED
  delayMicroseconds(280);
  
  voltsMeasured = analogRead(dustPin); // read the dust value
  
  delayMicroseconds(40);
  digitalWrite(ledPin,HIGH); // turn the LED off
  delayMicroseconds(9680);
  
  //measure your 5v and change below
  calcVoltage = voltsMeasured * (5.0 / 1024.0);
  dustDensity = 0.17 * calcVoltage - 0.1;
  Serial.println("GP2Y1010AU0F readings"); 
  Serial.print("Raw Signal Value = ");
  Serial.println(voltsMeasured); 
  Serial.print("Voltage = ");
  Serial.println(calcVoltage);
  Serial.print("Dust Density = ");
  Serial.println(dustDensity); // mg/m3
  Serial.println("");
  delay(1000);
}

[/codesyntax]

 

Testing

This is the output that I saw via the serial monitor

GP2Y1010AU0F readings
Raw Signal Value = 6.00
Voltage = 0.03
Dust Density = -0.10

GP2Y1010AU0F readings
Raw Signal Value = 176.00
Voltage = 0.86
Dust Density = 0.05

GP2Y1010AU0F readings
Raw Signal Value = 97.00
Voltage = 0.47
Dust Density = -0.02

GP2Y1010AU0F readings
Raw Signal Value = 7.00
Voltage = 0.03
Dust Density = -0.09

 

Link

DAtasheet – http://www.sharp-world.com/products/device/lineup/data/pdf/datasheet/gp2y1010au_appl_e.pdf

 

GP2Y1010AU0F Compact Optical Dust Sensor Smoke Particle Sensor With Cable

Share
[lebox id="2"]

You may also like

Leave a Comment