I am connecting a LilyPad Temperature sensor to a LilyPad Arduino 328 Main Board with the goal of reading fairly accurate ambient temperature readings. The sensor is receiving power and giving a responses I'm able to read over serial.
The problem I am confronted with is that reading from the sensor is giving me very unusual - although consistent numbers. I'm reading the analog sensor input and converting 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 yields a consistent reading of about 1.1 Volts which the sensor documentation indicates would be a ambient temp of about 60 degrees Celsius when the true ambient temp is about 23 degrees. The sensor is not close in proximity to any other electronics so I can't foresee that being the problem.
Is my code for reading the sensor incorrect? Could my sensor be faulty?