TMP36 reading 411.43 Degrees C

Hi. Im new to Arduino and need some help.
I have connected up a TMP36, left pin to 5v ,centre pin to A0, right pin to gnd, to an uno board. I have fitted a LCD shield that has worked perfectly with other sketches.
Here is my sketch.

//simple tmp36 thermometer with lcd. readout.

float voltage = 0;
float celsius = 0;
float sensor = 0;

// include the library code:
#include <LiquidCrystal.h>

const int numRows = 2;
const int numCols = 16;

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

void setup()
  lcd.begin(numCols, numRows);

void loop()
  //read the temp in celsius.
 sensor = analogRead(A0);
voltage = (sensor*5000)/1024;
voltage = voltage-500;
 celsius = voltage/10;



The lcd reads 411.43 DegreesC and it drops if I warm it with my hand. What am I doing wrong?
I replaced the TMP36 with another and got the same result.

What is the actual temperature?

Also, try printing the sensor and temperature values to the serial port - leave the LCD until you've got your temperature looking good.

Thanks for the reply,
The room temp is about 16°C at the moment.
I used the serial monitor and got the same result, 411.34 and the sensor is 945

The TMP36 data sheet says that it will give 750mV @ 25 degrees C. Using 5V for analog reference, that should give an analog reading of about 150. So 945 is way out of range - do you have a wiring issue?

Problem solved,although Im still not sure why. :slight_smile:
I changed the tmp36 over to my spare uno board without the lcd shield and it worked perfectly.
Why would the shield cause this problem?