At my serial box i get only 1023.... this is it... If i messure the voltage with voltmeter , it works , it increases volts when it detects gas... from 5.10V it goes to 5.16V
sensorValue = analogRead(A0); //tried 14 with same results...
Serial.print("sensor = " );
Serial.println(sensorValue);
delay(10);
}
At my serial box i get only 1023.... this is it... If i messure the voltage with voltmeter , it works , it increases volts when it detects gas... from 5.10V it goes to 5.16V
How can i make it work ? thanks !
That sounds a little confusing. Any voltage equal to or over 5.000 VDC applied to a analog input pin will return only 1023 counts. Valid DC voltage range for a analog input pin is 0 to 5vdc only. So 5.1V and 5.16V will both return 1023 values. Maybe a link to your sensor will help us help you.
What value load resistor are you using with your sensor? Sounds like it's best to use a 20K pot as a load resistor so you can 'calibrate' the sensor such that it's maximum value will be less the 5vdc output that the arduino analog input pin can handle correctly.
If you can post a drawing on how you specifically wired it up including wiring to the arduino board and any external DC power supply, perhaps we can find a problem.
I was missing the 20k resistor between "Out" pin and GND , now i get value 730-780 when using analogread and >1000 when sensor is detecting a gas ! thanks guys , my bad....