dear experts
i have purchased alcohol sensor from the sparfun.com and according to data sheet i have connected 10k ohm resistor accross it and switche on for one whole day and night after that i try to write code and when alchol is not detected 200 value shows in the lcd i it should have shown value o how to solve this problem any idea ?
here is the code #include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int ledPin = 13;
int sensorPin = A0;
int value = 0;
const int threshold = 350;
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
}
void loop()
{
int Value = analogRead(sensorPin);
value = analogRead(0);
Have you wired it up correctly? You say i have connected 10k ohm resistor accross it but 10K resistor should not be connected across device but is to ground.
Your reading the pin twice
int Value = analogRead(sensorPin);
value = analogRead(0);
You don't need the second one. The device really needs calibrating using known alcohol concentrations.
yes 10k is connected to the ground and when the alcohol is present value varies from 200 to 1024 but when alcohol is not present shows value 200 my wiring is correct