TMP36 best practices

I just tried using a TMP36 for the first time, and quickly found out the hard way that basic tutorials (even from high quality sources like Adafruit and SparkFun) that just tell you to slap it on powered with 5V only work if nothing else is connected to your Arduino. A single LED can cause the 5V rail to sag a bit, which then throws off the default 5V analog reference voltage, which messes up your analogRead() value, and a few LEDs later you have a sensor telling you it's 130 deg F while sitting in a 70 deg F room.

So, many thanks to @Wawa and others who have replied in previous forum posts about this that I found very helpful. I wanted to try and create a consolidated list of best practices and clarify some things. Any corrections/suggestions for the following?

  • Powering the sensor - use 3.3V, not 5V
  • Analog reference - some conflicting responses in the forums about whether you should use INTERNAL, or use EXTERNAL and connect the pin to 3.3V. So far I have had more success with internal - in theory this might not work for higher temperature ranges if your analog input exceeds 1.1V, but I am only dealing with room-temperature-ish.
  • Powering the Arduino - use the barrel jack, not USB (although I wonder if this changes if you're using a USB wall adapter/phone charger as opposed to a computer's USB port? Have not tried messing with power supply, have just been on computer USB the whole time)
  • Sensor ground - connect directly to its own GND pin on the Arduino, do not share breadboard ground with the rest of the circuit (I noticed a massive difference with this one)
  • Anything else?

Thanks!

Some of the previous threads I've found for reference:

2 Likes

I had problems with the TMP35 analog sensor and then just switched to the DS18B20 digital sensor. I don't even think about bothering with an analog temperature sensor anymore.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.