LM34 Temperature Sensor
sjenny
Posts: 25
I purchased several LM34 temperature sensors to use with my high school engineering classes. The LM34 has a great reputation for accurate temperature measurement (+/- 0.5 degree F) and provides a voltage signal that is a linear function of the Fahrenheit temperature (10mV per degree F, 0 v = 0 degrees F). My LM34 sensors seem to read about 5 degrees F (50 mV) higher than a thermometer placed next to the breadboard. I have tested the reference voltage to the LM34 and found it to be 4.96-4.97 v. Can anyone suggest what the problem might be? Many thanks as always for your incredible support!
Comments
2. Do you know the thermometer is correct?
3 Is it just me or is it drafty in here?
And: Are you sure the LM34 and the thermometer are at the same temperature? Everything has had plenty of time to settle?
Your second question is one that I also have. While all the parts had time to settle, I wondered if the local temperature on the board (or in the wires??) might be elevated vs ambient temp.
If the 5 degree difference is constant over the entire temperature range you can always subtract it in the software.
If we can't get to the root cause, we'll make an offsetting correction in the code.
Thanks for your help!
To increase resolution, use a lower Vref. What is the max temp. you need to read?
When I need precision, I calibrate with ice/boiling water. LM34's fit perfectly into 1/4" brass tube. You can crimp and then solder the end for a quick submersible sensor housing.
Good luck!
Jonathan
A voltage offset can be caused by many things such as poor connections, leaky capacitors, circuit noise, and defective components. Because you are getting the same error with multiple LM34's it may be from the ADC, although having the multimeter verify the problem seems to rule that out. Another possible source of error is noise or voltage fluctuations on the power supply.
What voltage are you applying to the LM34?
(If you can, measure both at the sensor and the ADC pin to make sure you don't have a voltage drop. Do you have a cap across the output? Is the reading steady or bouncing around?)
I seem to get the same voltage reading with the multimeter and the ADC and the reading seems to be steady. What do you mean by a "cap across the output?"
(To increase resolution, use a lower Vref. What is the max temp. you need to read?)
The maximum temperature we need is about 150 degrees F.
(When I need precision, I calibrate with ice/boiling water. LM34's fit perfectly into 1/4" brass tube. You can crimp and then solder the end for a quick submersible sensor housing.)
Thank you for this suggestion!!! I have a couple of students working on a project for which they'll need to immerse the LM34. They will be very grateful for your advice!
(Good luck!
Jonathan)
Thank you, Jonathan!
LM34CAZ +/- 1°F $10ea
LM34CZ +/- 2°F $6ea
LM34DZ +/-3°F $2ea
My guess is that you have the D grade, and that could explain some of the spread. It sounds like they were all around the same value, 5° above your reference.
I wouldn't trust the reference. There can be remarkable differences between locations (and thermometers!
One thing with the LM34 happens when it is mounted on a cable or has a certain amount of capacitance in parallel with its output. It can become unstable and go into an oscillation that makes the output seem high. I doubt that is happening with yours, but it is something to be aware of.
By "a cap across the output" I mean a small (.1 to .01) cap connected between the LM34 output and the ground pin. If the signal you are reading changes slowly and the distance to the sensor is long, a small cap can help stabilize bouncy readings. An example of this was on my old hot hot tub setup. It was 30' from the tub to the controller and tub temperatures change slowly. I had a 2 degree difference between on and off for the heater and bouncy reading could cause the heater pump to cycle. The cap smoothed it out and solved the problem.
Since you only need to read a max of 150 degrees, you could use a Vref as low as 1.5V. However, what I would do is use a 2.5 Vref as you can buy them easily. This will double your resolution. Be forewarned though that you will have to play with integer math to get it to add up correctly.
The brass tube is good but will not stand up to water forever. The electrolysis will eventually corrode the tube and cause it to leak. Use silver solder for longest life. I actually use stainless steel tube and weld the end shut but it is kinda tricky to weld with the tube being so thin walled. In the hot tub I would get a couple of years out of the brass sensor housing before they failed. Now I use the stainless.
Jonathan
It's best if you show a photo of your setup and the code you are using.
TomCrawford mentioned the TI datasheet.
http://www.ti.com/lit/ds/symlink/lm34.pdf
Kwinn mentioned power issues.
Figure 13 (page 12) of the TI datasheet shows an optional 0.1 uF Bypass Capacitor connected between the + and - leads.
Section 9 on page 16 also says that a bypass capacitor may be needed in a noisy environment.
Five degree difference is too much -- There is something wrong somewhere in the setup or the assessment.
Back then I had a similar question, my readings were not up to snuff and were coming in outside the ±1°F tolerance that National claimed for the LM34CAH. I called National and asked to speak to someone in technical support. To my surprise, Bob Pease took the call himself. To those not familiar with the pantheon of analog designers at National, Bob Pease along with Widlar and Dobkin were the gods, thus, wow!, my estimation of National went through the roof. Bob took a half hour to explain to me the care they had taken in their own lab to set up the packaged sensors inside a double insulated cardboard box with circulating air flow and lack of other heat sources conductive or radiative, matching thermal masses of test devices and their ASTM (American Society of Testing Materials traceable) reference. The effects of self-heating (minimal). Then on to difficulties of testing at the wafer level, before the chips were packaged. I thanked him for the education and sure enough, similar preparations on my part brought my readings into agreement with an ASTM thermometer, one that set me back a bundle of cash.
Jonathan