I am connecting a LilyPad temperature sensor to the LilyPad Arduino 328 Home page to read reasonably accurate ambient temperature readings. The sensor receives power and gives answers that I can read by the serial number.
The problem I am facing is that reading from the sensor gives me a very unusual - albeit a constant number. I read the input of an analog sensor and convert it to volts, like this ...
loop(){
float therm;
therm = analogRead(2); // Read from sensor through Analog 2
therm *= (5.0/1024.0); // 5 volts / 1024 units of analog resolution
delay(100);
}
This gives a consistent reading of about 1.1 volts, which the sensor documentation indicates is the ambient temperature of about 60 degrees Celsius, when the true ambient temperature is about 23 degrees. The sensor is not close to any other electronics, so I can not predict that this is a problem.
Is my sensor reading code incorrect? Can the sensor be faulty?
source
share