Why is my TMP35 giving me weird values? A TMP35/36/37 is giving very high voltage readings, which results in high temperature readings. The serial monitor looks like this: 

As you can see, the sensor value is in the 900s, voltage is almost 5, and temp is in the 400s. The circuit is very simple, just a TMP connected to 5V and ground and pin A0. Here is my code:

const int sensorPin = A0;
const float baselineTemp = 20.0;

void setup() {
  Serial.begin(9600);


}

void loop() {
  int sensorVal = analogRead(sensorPin);
  Serial.print("Sensor value: ");
  Serial.print(sensorVal);

  float voltage = (sensorVal / 1024.0) * 5.0;
  Serial.print(", volts: ");
  Serial.print(voltage);

  Serial.print(", degrees C: ");
  float temperature = (voltage - .5) * 100;
  Serial.println(temperature);
  delay(1000);
}


This is a very simple program and a very simple circuit, so I'm not sure what is going on. Maybe the problem is the sensor itself. I have also tried this sensor with multiple other circuits and programs and the same thing happens.

If anyone knows anything about this, help would be great.
I use voltage dividers a lot and have seen this before.  

In each and every case where ALL my readings are high, yet they vary predictably (like on my solar panels - they go up during day and down at night), there has always been proven to be a very simple, single cause.

Resistance in the ground lead.  

Such as if it is plugged into a breadboard hole that is not holding it well, or if I have extended it and have connections along the way.  

So that would be the first thing I would look for.  



Having said that, if the readings are very high and do NOT vary predictably, then I would look for a disconnected ground lead.



If all the connections are good but it still misbehaves then I would swap it out with another one to make sure the part itself isn't the problem.