Disappointing response and consistency with TMP36 temp sensors

As part f a larger project which I think will benefit from a temperature sensor, I ordered a couple of TMP36 temp sensor ICs from an ebay supplier, since so much info about them exists online. I'm using a NANO and for my initial experiments, I powered it from the 3.3V NANO output, and fed the input to analog input A1. I also called analogReference(EXTERNAL) in my setup() call, and tied the AREF pin to the 3.3v pin as well (yes, I remembered to make the connection AFTER initialization completed). For a quick and dirty test, I'm basically doing the below in my loop. I'm printing output via a serial.println() statement, about every 2 second.

#define SECOND (1000 * 60)
#define aref_voltage 3.3

loop()
{
                  {
   uint16_t tempReading = analogRead(A1); 
   float voltage = tempReading * aref_voltage;
   float tempF, tempC; 
   voltage /= 1024.0; 

   static uint32_t display_timer = millis();

   tempC = (voltage - 0.5) * 100;  // .5V offset
   tempF = (tempC * 9.0 / 5.0) + 32;

   if ((millis() - display_timer) > (SECOND * 2)) // every 2 seconds
    {
    
     display_timer = millis();;
   
     Serial.println(String("") + "A = " + tempReading + " V= " 
      + voltage + " Temp = " + tempF + 'F'');
   
    }
}

So the result was a display of a fairly constant 65 degrees F. But knowing the room was more like 72 was a little discouraging.

A = 217 V= 0.70 Temp = 67.88F
A = 217 V= 0.70 Temp = 67.88F
A = 215 V= 0.69 Temp = 66.72F
A = 217 V= 0.70 Temp = 67.88F

So I thought about the fact that this reading is only using about the first 1/4 of the usable A/D range. So I thought I might increase its accuracy by using one of the other analogReference() options available. The sensor output was only about .7 Volts, at the current output, so I set my analogreference(INTERNAL), which is supposed to to generate a 1.1 V analog reference. I changed my aref_voltage define to 1.1 as well. Finally I disconnected the AREF from the 3.3 v pin, though I continued to power the TMP36 from the 3.3V.

So the result, with the same calculations (except with the aref_voltage updated and the analogreference(INTERNAL) set) , was that I now had more realistic 71 degree output...

A = 666 V= 0.72 Temp = 70.78F
A = 666 V= 0.72 Temp = 70.78F
A = 664 V= 0.71 Temp = 70.39F
A = 662 V= 0.71 Temp = 70.00F

The good thing here is that more of the A/D counts are being used in the measurement, and I'm never going to need to measure beyond the 90s (F) anyway. Even 100 F would still be well below the max 1023 count of the A/D.

But the more disturbing thing was when I tried to test changing the temperature, and the TMP36 didn't seem to respond so well. OK, I realize this isn't a very scientific experiment, but I have a cheap "dime-store" digital thermometer, and if I hold its probe between my fingers it will quickly get to at least 90 in less than 1/2 a minute. Not so with this TMP36 setup. Holding the whole IC between my fingers (no, I'm not touching its wires), it rarely went beyond 75 degrees, even after a more than a minute.

A = 693 V= 0.74 Temp = 76.00F
A = 688 V= 0.74 Temp = 75.03F
A = 689 V= 0.74 Temp = 75.22F
A = 690 V= 0.74 Temp = 75.42F
A = 688 V= 0.74 Temp = 75.03F

I'm not too concerned about the different readings with the different voltage references, because I suspect it could be corrected by more accurately setting my aref_voltage define. After all, neither the 1.1V nor the 3.3V output on my NANO are that close (the 3.3 measures 3.379, and the 1.1 measures 1.153). So this could be corrected by a calibration "fudge" factor.

But my bigger concern is whether I'll have any accuracy once I get a few degrees past the nice 70 degree "room temp" range. Why couldn't I move the temp by more than 5 degrees with my fingers, when another thermometer move over 15 degrees doing the same thing? I thought maybe the problem was that I'm testing an a breadboard, and it might be acting like a big heatsync through its own pins. But after taking another TMP36 and soldering one two feet of very thin flexible wires, with a 3 pin header on the other side for easy plug in, the result was the same. I could tightly hold this IC all day, and it rarely exceeded 75 F.

Is this the best I can expect from TMP 36 ICs?

One thing I have discovered already, which is that with either analogreference() method, both the accuracy and response of device became much more acceptable once I tried powering it from the 5.0V supply from the NANO. So either the datasheet specification for the TMP 36 is completely wrong (it says something like 2.7 to 5.5V is all OK), or I got some cheap and poorly made clone. Powered from 5V, using the 1.1V define and analogReference, I get a consistant 79F in the room, same as my dime-store digital thermometer. And when I touch or hold the sensor, it works just as I'd expected.

So problem solved, but has anyone else found these things won't work right on anything less than 5V?

For accuracy ratings, check its data sheet. If you're within 1 deg C you're normally OK.

The internal reference will give you a better result as it's much more stable, and you make better use of the range of your ADC. With a 5V reference you use only the bottom 20% of your range, with the 1.1V reference you use like 90% of the range.

Also mind that this reference voltage has an error of +/- 10% or so. This is between devices - your device will have a very specific voltage of about 1.1V, but could be a bit more or a bit less. You'll have to calibrate. I usually just stick the sensor in my mouth (I mostly use waterproof thermistors), keep it for a while under my tongue, and expect to see a reading of about 36.5 deg.

wvmarle:
For accuracy ratings, check its data sheet. If you're within 1 deg C you're normally OK.

The internal reference will give you a better result as it's much more stable, and you make better use of the range of your ADC. With a 5V reference you use only the bottom 20% of your range, with the 1.1V reference you use like 90% of the range.

Also mind that this reference voltage has an error of +/- 10% or so. This is between devices - your device will have a very specific voltage of about 1.1V, but could be a bit more or a bit less. You'll have to calibrate. I usually just stick the sensor in my mouth (I mostly use waterproof thermistors), keep it for a while under my tongue, and expect to see a reading of about 36.5 deg.

Yes and thanks. I had already surmised the same thing about using the internal reference, and mentioned that in my post. I'll admit the post was long though, so I can see how that was missed. But the bigger issue for me was that the huge difference in accuracy and response to temp changes, powering the TMP36 with 5V vs. 3.3. In a 76° (F) room, it displayed about 62 with a 3.3V supply, and would not change more than a few degrees with finger heat. The same device with 5V applied read a much better 75°, and easily moved up past 90 with a short squeeze between fingers. with This difference is so huge, I'm suspicious they are phony and poorly copied chips, and they are all over ebay!

I'm going to call the original company (analog devices I believe) today, and ask them if that's the way they should work ( I suspect not ) and request a sample or two. If it turns out they work better, I'll have to make a post warning folks about it.

I ordered a couple of TMP36 temp sensor ICs from an ebay supplier

ebay is likely to be your problem.

The TMP36, when purchased from a reputable supplier, is specified to operate between 2.7 and 5.5 V, with an accuracy of +/- 2 degrees C over the entire temperature range.

The accuracy of any sensor that behaves predictably over the range (out of spec or not) can be substantially improved by calibration against an accurate standard. See this calibration tutorial.

There have been reports of better TMP36 results by adding a load resistor (between the output and ground). Try one between 10k and 47k and see if it helps.

DaveEvans:
There have been reports of better TMP36 results by adding a load resistor (between the output and ground). Try one between 10k and 47k and see if it helps.

Thanks. I had tried loading it with 10K. Still lousy response below 5V. I’ve ordered a few authentic parts from a real distributor (Mouser.com). I’ll definitely report what I find. For now, I’m highly suspicious of the “Made in China” TMP36 parts I got from the ebay sale, and have requested a refund.

Badly cloned parts for China are starting to happen a lot. :frowning:

PeterPan321:
I'm highly suspicious of the "Made in China" TMP36

You can get them made somewhere else, maybe.

For anyone else using TMP 36 ICs for temp measurement, I've gone a bit further since I first posted, and I think I have some useful information. First, there are indeed some poorly made copies of these ICs being sold on E-bay. Despite having authentic markings, Their performance over their specified range of operating voltage (3V - 5.5V) is terrible. Having purchased some more of these ICs from Mouser.com, which definitely does not supply phony clones of ANY IC, I paid slightly more but had much better results, with a variation of less than 40mV output difference, in the same ambient temperature (about 80F), when the supply was switched between 5V and 3.3. Further, with the recommended ceramic capacitor of at least 0.1uF across the VCC and GND terminals, that 40mV difference disappeared completely. I had no such luck with any bypass capacitors with the imitation chips.

So bottom line, while there are plenty of usable clones of all kinds of electronic parts on ebay and aliExpress, this part is not one of them! If accurate temperature measurement is important to you, this is probably one of the cases where getting the real deal is the better choice.