I know this has been discussed here a couple times and I don't really want the conversation to get sidetracked and start talking about the Arduino UNO and the internal reference (I have tried all of that, believe me).
This is my case, I have a room thermometer at home that I am using as a reference to confirm how accurate the readings of the LM35 are. The readings were about 1.5 degrees off and were increasing when the temperature increased so I decided to buy a second LM35 just to give it a try. The second one had a similar behavior but on the low side. So the difference between both LM35 readings are about 2.5 degrees.
These offsets can be fixed (mostly) by adding an offset to the temperature calculation in the arduino, but it doesn't explain why a "calibrated sensor" is not calibrated.
I then decided to start measuring the voltage with my multimeter and that confirmed that the Arduino is fine, the ADC is fine, the reference is fine, but the output on the sensors is off by more than what the manufacturer says on their datasheet.
Am I missing something? Is this offset something normal that will need to be calibrated every time I purchase a new LM35?
What is the tolerance of the part, and how do you calibrate your circuit and what are you using to measure and determine your error. You are probably getting hit by a stack up of tolerances. What does your circuit look like, and what are the tolerances of the parts. Remember none of the parts are exact, that is why calibration is needed. it is specified at 0.5°C Ensured Accuracy (at 25°C). On the TI data sheet look at Figure 8. Accuracy vs Temperature (Ensured) chart. From what I see you are in tolerance. Also most of the specifications are + and -.
Yes, your understanding of thermal radiation is missing.
Black epoxy packaged temperature sensors will pick up radiated heat from your body and read warmer than
the surrounding air if you or lights or fires are near. Metal encapsulated sensors reflect radiated heat and are not affected this way.
To calibrate a black plastic temperature sensor you need either to:
use water or oil bath, heat radiation is stopped by water, liquids are much more efficient at conduction.
use a small fan to blast air across the sensor, increasing the efficiency of thermal conduction between air and sensor
take measurements in a room with no lights, fires, humans or animals, at night
wrap sensor in metal foil (careful not to short the leads), reflecting heat radiation.
The human body can radiate heat at about 500 watts/sq metre.
MarkT:
Yes, your understanding of thermal radiation is missing.
Black epoxy packaged temperature sensors will pick up radiated heat from your body and read warmer than
the surrounding air if you or lights or fires are near. Metal encapsulated sensors reflect radiated heat and are not affected this way.
To calibrate a black plastic temperature sensor you need either to:
use water or oil bath, heat radiation is stopped by water, liquids are much more efficient at conduction.
use a small fan to blast air across the sensor, increasing the efficiency of thermal conduction between air and sensor
take measurements in a room with no lights, fires, humans or animals, at night
wrap sensor in metal foil (careful not to short the leads), reflecting heat radiation.
The human body can radiate heat at about 500 watts/sq metre.
I actually don't agree with this. I am testing both sensors next to each other (less than 1cm apart) so the reading should be about the same. If one is affected for all the random causes above, then the other one should be affected too.
gilshultz:
What is the tolerance of the part, and how do you calibrate your circuit and what are you using to measure and determine your error. You are probably getting hit by a stack up of tolerances. What does your circuit look like, and what are the tolerances of the parts. Remember none of the parts are exact, that is why calibration is needed. it is specified at 0.5°C Ensured Accuracy (at 25°C). On the TI data sheet look at Figure 8. Accuracy vs Temperature (Ensured) chart. From what I see you are in tolerance. Also most of the specifications are + and -.
This kind of makes sense. I am just wondering why no one mentions the need of calibration or adding an offset. I am an electronics engineer so I kind of understand how semiconductors work, and I know no parts are identical. BUT, it's weird that TI claims that the part is pre-calibrated if it needs to be calibrated later. That makes me confused.
My circuit is pretty basic, I using a regulated power supply at 5V and I'm measuring the output on pin 2 of both LM35. The typical error that I should get is about 0.5C meaning that the difference in readings should be within 5mV MAX, but I am getting differences of 20mV and it's constant. So my conclusion is that it's a calibration issue.
But, as I am a crazy person, I decided to order 5 LM35 from TI directly just to see how consistent their sensors are (I am not sure of where the ones I got came from).
MarkT:
Well you definitely get errors due to heat radiation, there may be other errors too. You have genuine LM35's ? (ie you didn't buy them on eBay).
I know there is heat radiation, but if the sensors are close enough to each other, then both sensors should be affected in a very similar amount. The datasheet claims they are "calibrated". I just can't believe that I am the only one noticing this problem as most people just tend to believe the results that the sensors are giving them.
And, I have no idea where those two LM35's came from. And, as I am crazy and this has become a personal challenge then I decided to buy 5 more directly from TI. I am guessing those should be very very very consistent (or I will just complain to them directly).
I will post my results probably tomorrow once I have received them (it will be 12 dollars well spent if it helps me solve the mystery )
2mV is 0.2C, you mean 20mV? The "typical" values in a datasheet is arguably marketing, "minimum" or "maximum" are the only thing you can actually rely on unless there's a histogram to back up the "typical" values.
I am not sure of where the ones I got came from
Then just assume they are counterfeit, factory reject, remarked or pulls from old equipment.
A few things you may want to consider. This is the data sheet for the LM35 and you may want to read page 14 Capacitive Drive Capability. The data sheet offers up a work around you may want to apply. You can find additional reading on the subject here where he specifically mentions the LM35.
But if you try to measure a high impedance circuit (like an LM35 temperature sensor), you must take into account the time it requires to allow the capacitor to charge/discharge. A common workaround for this is to perform two or more readings in rapid succession: each reading will give the capacitor a chance to equalize to the pin voltage, eventually bringing it to the desired voltage.
There is also a matter of which device(s) to believe? Like having two watches and never knowing the correct time because they don't agree.
What about the linked portion of the LM35 Data Sheet? Yeah, the second link was not on target but then why the error unless as mentioned it's not a genuine TI LM35?
While radiation is a real phenomena I doubt at the temperature you are discussing it will be a measurable effect.
My guess is the environment you are testing I is not stable and the difference in response time(s) make it more difficult.
When I test temperature devices I put them in a small cardboard box. Maybe 6 x 6 x 6. The size is not that important.
Put all the sensors you wish to measure in the box, perhaps sitting on some thermal insulator (foam) so they are not touching any surface of the box. Now most important put the box in an area free from direct thermal inputs (i.e. A/C or heating vents etc)
Watch them and when the change in a 30 minute period is < 0.5 degrees, record all the temperatures.
If you want to gain a better "standard" get a liquid capable device (maybe a BBQ thermometer).
Test in in boiling water: should be very close to 100°C
Test in 2 cups of crushed ice and water, will probably be about 0.5 °C (unless it is in a well insulated vacuum bottle with a cover).
OK, I got my "Genuine" LM35's and some results. I tested with my multimeter also and the Millivolt values are very accurate so I just decided to use the Arduino UNO to take some data. Another thing I did was to rotate the Analog inputs to make sure that the readings were consistent (all Analog inputs are fine and give me repetitive values).
Notes:
I used the internal reference 1.1V for the DAC and 1023 to represent the max value of 1100mV (0 is 0V and 1023 is 1100mV):
Results 0 and 4 are my old LM35's and 1, 2 and 3 are the new "Genuine" ones directly from TI:
Analogvalue0= 216
Millivolts0= 232.26
in DegreeC0= 23.23
Analogvalue1= 205
Millivolts1= 220.43
in DegreeC1= 22.04
Analogvalue2= 202
Millivolts2= 217.20
in DegreeC2= 21.72
Analogvalue3= 204
Millivolts3= 219.35
in DegreeC3= 21.94
Analogvalue4= 204
Millivolts4= 219.35
in DegreeC4= 21.94
I would say what with the exception of the first LM35, all the others are very consistent, so I will just throw that one away. BUT!!! Here are a couple other very annoying findings:
I have an ambient Thermopro thermometer in my room (just next to these LM35) that reads 20.7C. That is almost 1 degree off (not a huge deal but it still confuses me).
I was reading the datasheet again and it seems to imply that there is an offset of 2 degrees when you use the sensor like this (Figure 14 on the Datasheet). Am I misunderstanding?. It says the output for the range of 2C to 150C is 0mV+10mV/C.
Anyways, at least now I know that one of my sensors is malfunctioning so I can sleep again :).
By The way, I really appreciate all your responses and your willingness to help.
Honestly, sometimes the solutions proposed here are too theoretical and cannot really be applied to real life. In summary, a DIY electronics design should just work without "lab grade" testing equipment or super complex techniques to make it work under ideal conditions. In the end, conditions are never ideal, there will always be electrical noise (mostly if we use a power adapter to convert from AC to DC) and the circuits (and sensors) should still work in our imperfect electronic world. I myself have an oscilloscope and a couple of fancy diagnostic tools that help me understand the issues, but trying to make it ideal is just a dream.
That being said, I think my main issue with the LM35's is that one of the sensors was giving me readings out of the manufacturer's specification (I am concluding it's just broken) and the readings (now of all the remaining LM35's) are off by about 1 degree with reference to my Thermopro thermometer (this is not a definitive conclusion as my thermometer could be just wrong).
I guess what I'm trying to say with this post is: Don't go crazy about looking for ideal conditions, that's probably not the reason why your circuit doesn't work. Noise and environmental conditions will always be there, and you can try to minimize them, but your circuit should still work under real life conditions. Check your components and make sure you have an understanding of how things work, check your connections and program. That's very likely where the problem is.
Calibration is the comparison between a product and a national traceable standard such as temperature, voltage, current and so on.
Calibration is NOT changing the reading of a product to indicate exactly the same as a national traceable standard. Changing a measured value to meet the standard is called justification and is an entirely different process.
Any "calibrated" product should be accompanied with a calibration certificate stating which national standard equipment was used in the calibration, who did the calibration and what the results were. If the LM35 are calibrated" but didn't came with documentation, the whole statement is moot.
Calibration is performed on a product by using a national traceable standard that has at least a 3 to 5 times higher accuracy as the product being calibrated.
In case of temperature, sensors are used in hot water baths, oil baths or specific developed furnaces to calibrate products. What that means is that the environment under which the calibration is performed, is specifically controlled and of little influence to the total measurement uncertainty.
Comparing your LM35s to your room thermostat is comparing apples to oranges, yes, they are both round but of a completely different nature, unless ofcourse, your room thermostat is a calibrated one.
In order to validate the LM35s, make sure to eliminate as much influencing parameters as possible. Measure them in a closed box of ample size so that the still air is constant in temperature throughout the validation. Measure the LM35s for longer periods of time to analyze the trends, hours or so.
Make sure to provide a very stable supply Voltage to the sensors, an Arduino regulator would not do.
All in all, you can do only so much in your home. A comparison is possible but I wouldn't rely on your home thermostat as the main source for "calibration".