TMP36 - Temperature Sensor drops over time

I made a simple temperature readout using this:Temperature Sensor - TMP36 - SEN-10988 - SparkFun Electronics

I set it up so I could see a readout on my LCD of the current temp, highest recorded and lowest recorded. It starts off just fine, reading room temp right around 71 degrees, but over time the temperature readout trends lower and lower, eventually going down as low as 64/65 (Fahrenheit). If I restart the temperature starts out again and a more expected range. What are some reasons why this dropoff might occur?

You have at least one bug in your code.

Pete

You have at least one bug in your code.

Or, the ambient temp was dropping.

Seriously, though, do you have another thermometer to check it against? How do you know it's misbehaving?

JimboZA:

You have at least one bug in your code.

Or, the ambient temp was dropping.

Seriously, though, do you have another thermometer to check it against? How do you know it's misbehaving?

If he restarts the temperature returns to a correct range. Therefore, it's not that it's just getting colder. An increase in temp could mean that the circuit is heating up. But, it's getting colder so that's not it either. It really does sound like a bug in the sketch.

Tim

What are some reasons why this dropoff might occur?

If you do averaging with integer values you can get drifting values due to integer rounding.

Think it is time to post the code

If the sensor is wired for too much impedance coming into the analog pin and too little resistance going to ground then that will happen too, especially if you do a lot of reads per second. Been there trying to sense very low currents.

How long are the wires between sensor and Arduino? A few degrees drift is a VERY small difference in voltage. Maybe (exceeding my knowledge of physics here) some induced voltage is building up/ draining off?

Part of the reason I prefer to deal with the "little problems" that the 1-Wire sensors throw up... at least the signal, when you finally master getting it, is immune to such issues. Please, maybe, revise the subject of this thread to include "TMP36" in it?

The wires are 3 inches or so.

Might a voltage regulator on the power source help?

You might watch the Arduino 5V with a meter first, assuming that's your power source.

What's powering the LCD? Do you have another Arduino with nothing attached you could try the sensor with and print to serial monitor instead of the LCD?