Hi everyone. I am using Arduino Nano and GP2Y1010AU0F Dust Sensor. Actually everything is fine.
Vled--------------Arduino 5v
Led-Gnd--------Arduino GND
led----------------D2 pin
S-GND-----------Arduino GND
Vo-----------------Analog pin 0
VCC---------------Arduino 5v
And I use 150 ohm resistor and 220 uF capacitor like datasheet.
This is my test code:
int measurePin = A0;
int ledPower = 2;
unsigned int samplingTime = 280;
unsigned int deltaTime = 40;
unsigned int sleepTime = 9680;
float voMeasured = 0;
float calcVoltage = 0;
float dustDensity = 0;
void setup(){
Serial.begin(9600);
pinMode(ledPower,OUTPUT);
}
void loop(){
digitalWrite(ledPower,LOW);
delayMicroseconds(samplingTime);
voMeasured = analogRead(measurePin);
delayMicroseconds(deltaTime);
digitalWrite(ledPower,HIGH);
delayMicroseconds(sleepTime);
calcVoltage = voMeasured*(5.0/1024);
dustDensity = 0.17*calcVoltage-0.1;
if ( dustDensity < 0)
{
dustDensity = 0.00;
}
Serial.println("Raw Signal Value (0-1023):");
Serial.println(voMeasured);
Serial.println("Voltage:");
Serial.println(calcVoltage);
Serial.println("Dust Density:");
Serial.println(dustDensity);
delay(1000);
}
Everything is ok but when i try to measure Analog voltage with my multimeter, i could not see 3.46 v or 0.42 volt. Just i can see 7 mV or 18 mV. How can it possible??
I want to put an op-amp (for comparator with lm358 or lm393) to sensor Vout pin but for now a little bit confused.
if anybody help me , really aprreciated.
Best regards..
1 post - 1 participant