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);
if (Value > threshold)
{
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin,LOW);
}
lcd.print("alcohollevel:");
lcd.println(value);
Serial.println(value,DEC);
if (Value > threshold)
{
lcd.print("alert");
Serial.print ("alert");
}
else {
lcd.print("normal");
Serial.print("normal");
}
delay(1000);
lcd.clear();
}