Asked — Edited
Resolved Resolved by Dunning-Kruger!

Tmp36gt9 Temperature Sensor


So I have a few TMP36GT9 analog temperature sensors that I want to use.

I have hooked them up directly to a analog port (3.3voltage) and get readings from it. When I read the values it fluctuates between 44 and 57. I have read that a pull up/down resistor will stabilize the readings, but I am not sure what value resistor I should try?

This sensor accepts input voltage between 2,7 and 5,5v and should output 750mV @ 25c and is linear between -40 to +125c

So my second question is how do I find the correct unit multiplier to show the temperature in Celsius?

All help is much appreciated!


Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.


Does the sensor state what the mV or V value would be at 0C or 100C or any other temperature other than 25C? If it gives you another temp stat then you can use the two analog values to extrapolate the temperature between those two measurements... For instance... if the mV reading was 0mV at 0C (highly unlikely but just as an example) and 750mV at 25C then 12.5C would be 325mV.... You can try a 10K and see what it gets you....


From the graph in the datasheet it looks to be 1.7v @ 125c

User-inserted image


Will try with a 10k resistor as soon as I find my resistor box :P


OK the data sheet says 10mV per 1 degree of C and 25C is 250mV so the math is dead easy.... 10mV = 1C , 20 mV = 2C, 30mV = 3C.... etc...


Hmmm... Looks like I was looking at the wrong sensor... So indeed 750mV =25C and 125C at 1750mV.... It states 10mV per deg of C.... -40 looks like around 100mV... so the range is 165C and 1650mV...


Have to get ready for work.... Maybe someone else can help you with the math to convert the analog reading to a Celsius reading.... Should be straight forward to do but I don't have the time right now....


Thank you so much for the help Richard R! This seems pretty straight forward yes. I am at work myself so I wont get to do any progress until tomorrow anyways.


Okey. I got it working. I used a 10K as a pull down and that stabelised it quite a bit. The readings is still jumpy but I suspect it will improve further when I actually solder the wires.

The strange thing is that it reports an ambient temp of 5-8c while the actual ambient at the moment is 22c. But if I hold the sensor in my hand and check the voltage output, temperature rise it fits the graph in the datasheet perfectly. Could it be the sensor? bad connections maybe?

The code I used might be a bit bulky for what it does, but it works. If this can be simplified I would love to learn how:)

$adc1 = GetADC(adc0)
$tv1 = ($adc1*0.0128125)*1000
$temp1 = ($tv1-500)/10
Goto (t1)

Marked as solved. Thank you Richard R!


The voltage you are seeing at ambient temperature does probably not correspond to 22C as far as temperature vs voltage (according to the chart) is concerned. The only thing you can count on is the change in voltage as the temperature changes. Not the specific value at ambient. That reading is just a number. But it is a number you can start with. I would venture to guess you would get a different voltage at ambient if you tried a different resistor. To get a voltage reading where it should be at 22C, you would have to use a voltage divider.

The point is that it doesn't matter what voltage it says at 22C ambient, just consider that voltage to be 22C and go from there. A better reference would be 0C using an ice cube wrapped in plastic to get close to it. It depends on how accurate you need it to be. Also, place 0.1 microfarad capacitor across the power input to further stabilize it.