TMP37F Weirdness - Page 1
Forum section: electronics / projects

author: Jon86
author_rank: Frequent Contributor
timestamp: November 01, 2013, 05:16:32 pm
content: 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.

author: Jon86
author_rank: Frequent Contributor
timestamp: November 01, 2013, 06:28:48 pm
content: 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...

author: vtkkorhanjoh
author_rank: Contributor
timestamp: November 01, 2013, 07:38:09 pm
content: 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!

author: wraper
author_rank: Unknown
timestamp: November 01, 2013, 08:41:26 pm
content: Quote from: Jon86 on November 01, 2013, 06:28:48 pmYou almost answered your question. You need power filtering, your sensor is picking noise prom the microcontroller. Make some LC or RC filter.

author: Jon86
author_rank: Frequent Contributor
timestamp: November 01, 2013, 09:54:46 pm
content: Quote from: wraper on November 01, 2013, 08:41:26 pmYeah, I've realized that nowDo 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?

author: Jon86
author_rank: Frequent Contributor
timestamp: November 01, 2013, 09:57:44 pm
content: Quote from: vtkkorhanjoh on November 01, 2013, 07:38:09 pmI think I've completely ruled out it being the voltage now, must be noise or something else, thanks anyway though!

author: wraper
author_rank: Unknown
timestamp: November 01, 2013, 10:19:48 pm
content: 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).

author: Jon86
author_rank: Frequent Contributor
timestamp: November 01, 2013, 10:42:02 pm
content: Great, thanks. I'll go and try that out now.

author: Jon86
author_rank: Frequent Contributor
timestamp: November 02, 2013, 04:00:58 pm
content: 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.

author: wraper
author_rank: Unknown
timestamp: November 02, 2013, 04:03:11 pm
content: Don't you change ground connection somehow when powering from arduino?

author: Jon86
author_rank: Frequent Contributor
timestamp: November 02, 2013, 05:02:16 pm
content: 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.

author: wraper
author_rank: Unknown
timestamp: November 02, 2013, 05:32:46 pm
content: Quote from: Jon86 on November 02, 2013, 04:00:58 pmI 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?

author: Jon86
author_rank: Frequent Contributor
timestamp: November 02, 2013, 05:54:30 pm
content: 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

author: wraper
author_rank: Unknown
timestamp: November 02, 2013, 06:03:54 pm
content: Measure current from the sensor output to the ADC. Connect multimeter between them on uA range.

author: Jon86
author_rank: Frequent Contributor
timestamp: November 02, 2013, 06:20:38 pm
content: 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?

author: wraper
author_rank: Unknown
timestamp: November 02, 2013, 06:30:28 pm
content: 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.Quote from: Jon86 on November 02, 2013, 06:20:38 pmIt 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.

author: wraper
author_rank: Unknown
timestamp: November 02, 2013, 06:32:06 pm
content: or there is 0,3 mA, not uA

author: Jon86
author_rank: Frequent Contributor
timestamp: November 02, 2013, 06:40:58 pm
content: 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...

author: wraper
author_rank: Unknown
timestamp: November 02, 2013, 07:13:10 pm
content: 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.

author: wraper
author_rank: Unknown
timestamp: November 02, 2013, 07:23:33 pm
content: 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.

author: Jon86
author_rank: Frequent Contributor
timestamp: November 02, 2013, 11:51:00 pm
content: 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.

author: Jon86
author_rank: Frequent Contributor
timestamp: November 03, 2013, 12:04:08 am
content: Even with a 3K pulldown to ground, the pin is STILL giving me around 300mV. Weird.

author: wraper
author_rank: Unknown
timestamp: November 03, 2013, 12:50:35 am
content: Quote from: Jon86 on November 03, 2013, 12:04:08 amIt 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.

author: Sirus
author_rank: Contributor
timestamp: November 03, 2013, 01:27:59 am
content: 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 aDS18b20 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.

author: Jon86
author_rank: Frequent Contributor
timestamp: November 03, 2013, 08:16:06 am
content: Quote from: Sirus on November 03, 2013, 01:27:59 am.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...