Sharp’s GP2Y1010U0F is an optical air quality sensor it was designed to sense dust particles. An infrared emitting diode and a photo-transistor are diagonally arrange into this device, to allow it to detect the reflected light of dust in the air. It is especially effective to detect very tiny particles especially detecting a smoke this device commonly used in air purifier systems, the sensor has a very low current consumption around 20mA MAX, can be powered up to 7v DC. The ouput of the sensor is an analog voltage proportional to the measured dust density, with a sensitivity of 0.5v / 0.1ma/m3 according to the SHARP GP2Y1010UOF data sheet, all 6 pins on sensor need to be connected to the Arduino input/ouput.
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 |
int dustPin=0; int dustVal=0; // Define dust val 0 int LEDPower=2; // Define LED to Pin Digital Pin 2 int delay1=280; int delay2=40; float offTime=9680; void setup(){ Serial.begin(9600); // Serial Communication Read baud-rate 9600 pinMode(LEDPower,OUTPUT); pinMode(4, OUTPUT); } void loop(){ digitalWrite(ledPower,LOW); // Power the LED Off delayMicroseconds(delay1); // Delay 280 Milliseconds dustVal=analogRead(dustPin); // Read the Dust/Smoke Value delayMicroseconds(delay1); // Delay 40 Milliseconds digitalWrite(ledPower,HIGH); // Power the LED On delayMicroseconds(offTime); // Floating Point delay(3000); Serial.print(dustVal); } |
Working on Dust Particle Optical Sensor with Arduino