Author Topic: TMP37F Weirdness  (Read 7945 times)

0 Members and 1 Guest are viewing this topic.

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
TMP37F Weirdness
« on: November 01, 2013, 05:16:32 pm »
So here's my problem, I'm using a TMP37F 20mv/DegC connected to an MSP430 at 3.545v, but it reads about two degrees high, around 26c and it's jumping around a bit. However, if I connect it up to the 4.995 coming out of my arduino, the output falls to about 24.5, which matches what I've got on another thermometer. Any ideas?

Also checked it on my meter, a definite increase in output voltage.
Death, taxes and diode losses.
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #1 on: November 01, 2013, 06:28:48 pm »
Just a quick edit, it's working fine on my arduino's 3.3v rail, but I still get the output increase if I put it on the rail of the microcontroller I'm measuring it from... Strange...
Death, taxes and diode losses.
 

Offline vtkkorhanjoh

  • Contributor
  • Posts: 32
Re: TMP37F Weirdness
« Reply #2 on: November 01, 2013, 07:38:09 pm »
Maybe a bad cal job or device? These devices are calibrated at the factory, and even though it is highly unlikely, it might have been miscalibrated? Try using a different temperature and see if the error is consistent. If it is = Miscalibration. Also try doing the same thing with 5v. If it is the same the measured temperature coming out, the device is calibrated improperly. If so, either replace it with one from another batch, or use a small step-up for the 5 volts, if you don't have it available. 
Good luck!  :-DMM
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #3 on: November 01, 2013, 08:41:26 pm »
Just a quick edit, it's working fine on my arduino's 3.3v rail, but I still get the output increase if I put it on the rail of the microcontroller I'm measuring it from... Strange...
You almost answered your question. You need power filtering, your sensor is picking noise prom the microcontroller. Make some LC or RC filter.
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #4 on: November 01, 2013, 09:54:46 pm »
Just a quick edit, it's working fine on my arduino's 3.3v rail, but I still get the output increase if I put it on the rail of the microcontroller I'm measuring it from... Strange...
You almost answered your question. You need power filtering, your sensor is picking noise prom the microcontroller. Make some LC or RC filter.

Yeah, I've realized that now  |O
Do you think you could give me some pointers the most effective way of doing this? I've tried just adding some decoupling but that didn't do much...
Or should I just leave it out for the prototyping stage and hope it'll work in the final product that'll be battery powered?
Death, taxes and diode losses.
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #5 on: November 01, 2013, 09:57:44 pm »
Maybe a bad cal job or device? These devices are calibrated at the factory, and even though it is highly unlikely, it might have been miscalibrated? Try using a different temperature and see if the error is consistent. If it is = Miscalibration. Also try doing the same thing with 5v. If it is the same the measured temperature coming out, the device is calibrated improperly. If so, either replace it with one from another batch, or use a small step-up for the 5 volts, if you don't have it available. 
Good luck!  :-DMM

I think I've completely ruled out it being the voltage now, must be noise or something else, thanks anyway though!   ;D
Death, taxes and diode losses.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #6 on: November 01, 2013, 10:19:48 pm »
Try ~47 Ohm resistor in series with + rail and  1Uf ceramic decoupling capacitor, you can also try to connect 10-47uf electrolytic cap in parallel to ceramic. Like on picture, use resistor instead of the inductor (or use inductor, like 10-100 uH).
« Last Edit: November 01, 2013, 10:26:21 pm by wraper »
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #7 on: November 01, 2013, 10:42:02 pm »
Great, thanks. I'll go and try that out now.
Death, taxes and diode losses.
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #8 on: November 02, 2013, 04:00:58 pm »
Nope, no change. I tried powering it from a single Li-ion cell and it still reads high, it's definitely not 28C in this room... It is a +-2DegC accuracy device, but it's about 3 high...  :-//
It's only the arduino's 3.3v rail that will make it read what seems like the correct value.
Death, taxes and diode losses.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #9 on: November 02, 2013, 04:03:11 pm »
Don't you change ground connection somehow when powering from arduino?
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #10 on: November 02, 2013, 05:02:16 pm »
Well when I had it powered off the Arduino I had a jumper from the ground on the sensor to both the ground on the arduino and msp430 launchpad.
Death, taxes and diode losses.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #11 on: November 02, 2013, 05:32:46 pm »
Nope, no change. I tried powering it from a single Li-ion cell and it still reads high, it's definitely not 28C in this room... It is a +-2DegC accuracy device, but it's about 3 high...  :-//
It's only the arduino's 3.3v rail that will make it read what seems like the correct value.
I have reread this and think that it may be actually arduino noisy power (or strange ground loop, etc..) which makes it to read low. It may be that ADC reference is not precise or something like that what causes reading be too high. Try to power it from arduino through RC filter I suggested. If it starts to read too high again then you are looking in the wrong place for sure. Don't forget that max load current for TMP37F is only 50uA so you can't just stick it to the ADC input until it is very high impedance. Have you checked bare sensor output (disconnected/connected to other things) voltage with multimeter to see if voltage is right for temperature according to the datasheet?
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #12 on: November 02, 2013, 05:54:30 pm »
Now it's being REALLY weird, if I take the ADC input out, and just connect a DMM to the output, It's reading too low, around 19.5C, and if I connect the ADC the output shoots up to around 28C  :scared:
Death, taxes and diode losses.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #13 on: November 02, 2013, 06:03:54 pm »
Measure current from the sensor output to the ADC. Connect multimeter between them on uA range.
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #14 on: November 02, 2013, 06:20:38 pm »
I've already tried that, 0.3uA ish, and but when there's a multimeter in series, the output voltage doesn't increase by as much...
I've tried another sensor this time on 5V, same thing. Works fine until I connect the ADC, then it shoots up to 2.6v output instead of 250mV.
Also, I measured the voltage on the ADC input pin and it's up at 3.5ish volts, VCC is 3.6, is that normal?
Death, taxes and diode losses.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #15 on: November 02, 2013, 06:30:28 pm »
I'm not familiar with MSP430, seems like pull up resistor (likely internal). But 0,3uA current shouldn't affect output of the sensor and no way that current can be so low if pull up exists.
but when there's a multimeter in series, the output voltage doesn't increase by as much...
It can't be physically because shunt resistance is low enough so voltage drop on multimeter would be ~0 with 0,3 uA current. So either your multimeter's fuse/shunt is blown or you are doing something really weird.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #16 on: November 02, 2013, 06:32:06 pm »
or there is 0,3 mA, not uA
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #17 on: November 02, 2013, 06:40:58 pm »
Tried again, 57uA current input on the ADC.
And why should there be a pullup? Seems like a strange thing to have on an ADC? Maybe the inputs are configured wrong...
Death, taxes and diode losses.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #18 on: November 02, 2013, 07:13:10 pm »
Datasheet specifies 0 uA < IL < 50 uA load, but it is negative in this case, so not specified. It acts like ~50k pull up resistor. As I said, I'm not familiar with this microcontroller but there may be pull up enabled in it or physical resistor on pcb. So you need either disable pull up (if possible) or use opamp buffer.
« Last Edit: November 02, 2013, 07:15:14 pm by wraper »
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #19 on: November 02, 2013, 07:23:33 pm »
Looked deeper into datasheet. There is schematic of the sensor. According to it, sensor can only supply current but cannot sink as there is basically open emitter output with some internal resistance to GND.
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #20 on: November 02, 2013, 11:51:00 pm »
This pullup ADC thing seems weird to me, I've always thought the pin is just left floating?
I can configure inputs as INPUT_PULLUP and INPUT_PULLDOWN and just INPUT, but neither makes any difference...
I'll try an Opamp buffer tomorrow, I should have a few Analog devices precision ones in a drawer.
Death, taxes and diode losses.
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #21 on: November 03, 2013, 12:04:08 am »
Even with a 3K pulldown to ground, the pin is STILL giving me around 300mV. Weird.
Death, taxes and diode losses.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18211
  • Country: lv
Re: TMP37F Weirdness
« Reply #22 on: November 03, 2013, 12:50:35 am »
Even with a 3K pulldown to ground, the pin is STILL giving me around 300mV. Weird.
It is what should be there considering there is ~50k pullup. As you made voltage divider. 3,6V/(50+3)*3 = 0.2V, far enough as I assumed pull up resistance from current you measured between sensor and ADC input.
 

Offline Sirus

  • Contributor
  • Posts: 22
Re: TMP37F Weirdness
« Reply #23 on: November 03, 2013, 01:27:59 am »
What acuracracy do you need from the sensor? Have you looked at a one package digital alternative? If you have room on your arduino for an extra library you could use a    
DS18b20 that uses one wire bus, and is acurate to .5c. Adafruit has a library. they are made my dallas, cost about £1.50 on ebay and bomb proof. You could use what you have and offset in software, thats probably the easiest thing to do if you have a stable error and a reliable temp probe to calculate out the ofset.
 

Offline Jon86Topic starter

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: TMP37F Weirdness
« Reply #24 on: November 03, 2013, 08:16:06 am »
What acuracracy do you need from the sensor? Have you looked at a one package digital alternative? If you have room on your arduino for an extra library you could use a    
DS18b20 that uses one wire bus, and is acurate to .5c. Adafruit has a library. they are made my dallas, cost about £1.50 on ebay and bomb proof. You could use what you have and offset in software, thats probably the easiest thing to do if you have a stable error and a reliable temp probe to calculate out the ofset.

.5C accuracy is what I want really, a couple of degrees out isn't really good enough. I guess I could cal it in software, but if it's pulling more current than the sensor can supply, I'd rather not do it that way. I think I'm either going to buffer it (fairly easy with one opamp) or I'll use an external 12-bit SPI ADC that should arrive in the post tomorrow, it's only a one off project so I guess I can throw in an extra chip or two if I must.
I don't really have room for an extra library, I'm already using SPI so I can do that, but I've used about 15/16K on my MSP430...
Death, taxes and diode losses.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf