I use an LM335 to control the temperature of a peltier element. I used thermally conductive paste to pin the LM335 onto the peltier element. I calibrate the sensor with a potentiometer via the adj Pin. So far so good.
I thought I could take quite exact measurements but the sensor seems to deliver quite random values - sometimes ranging from +/- 3 degrees from the actual temperature. (??)
How can I get an exact measurement of the temperature? Or should I use another TempSensor?
... the wires to connect the sensor are about 10 cm long.
Thanks for your help!
can you post your code?
you might need to average multiple readings to get rid of noise,
what do you use to power the system?
When the peltier heats up you might get a small power drop which influences the analog read.
Could be a swing problem of the LM35. I had the same once and wrote a post in my blog about this. If interested, look at:
Thanks very much guys for your recommendations! I wrote a small smoothing algorithm that takes the average of 15 values and now it seems to be quite stable.
Good to hear,
from performance point of view you might better take 8 or 16 samples to average as dividing by a power of 2 is much faster (bitshift) than dividing by 15.
I would give 8 samples a try.
The fact that you had +/-3 variations in count originally indicates that there are noise, grounding or power supply issues affecting the readings. These effects won't necessarily always average out over a number of multiple readings.