My TMP36 Temperature Sensor Stopped Working

Hello,

I was using my TMP36 temperature sensor for a project and it was working fine, displaying correct temperatures. About 20 to 30 minutes after I was using it, it just stopped working. My house was at room temperature but the sensor kept reading 32 degrees F (0 degrees C). I took the sensor out the circuit and the serial monitor was reading back the same values as it was when the sensor was plugged in (32 degrees F). I took this as evidence that the sensor was not working. The sensor came in a brand new arduino kit that I was gifted only last week and the temperature sensor is already not working. The sensor is hooked up correctly and I didn't change anything in the code from when it was working. I just wanted to know what you guys think I should do or if you have any suggestions on how to fix my problem. Thank you

The first thing to do is supply the code and circuit you used,

Weedpharma

Its just a simple code to take the Temperature in fahrenheit and celsius

const int tempPin = A0;
int sensorVal = analogRead(tempPin);
float voltage = (sensorVal/1024.0) * 5000;
float celsius = (voltage/10);
float fahrenheit = (celsius * 1.80) + 32.0;

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

void loop()
{
      Serial.print(celsius);
      Serial.print(" C, ");
      Serial.print(fahrenheit);
      Serial.println(" F");  
}

Where in the loop() do you update the temperature?

Weedpharma

What do you mean by update temperature? It is a loop so it checks the temperature over and over very rapidly. In the serial monitor I can see it updating at a very fast rate. I put a delay at the end of the loop but it did not seem to fix the problem.

This is the only part that loops.

void loop()
{
Serial.print(celsius);
Serial.print(" C, ");
Serial.print(fahrenheit);
Serial.println(" F");
}

There is no updating of the sensor here, just printing output.

Try putting this in the loop so it is read each time around.

int sensorVal = analogRead(tempPin);
float voltage = (sensorVal/1024.0) * 5000;
float celsius = (voltage/10);
float fahrenheit = (celsius * 1.80) + 32.0;

Weedpharma

Oh thank you so much! It worked