l35 length accuracy


I'm trying to increase the length of a wire on my lm35 sensors. Unfortunately, I see significant noise when I do this. I've tried using some regular communications cable and experienced noise. Then I read cat5 would be ideal due to the twisted pairs. I tried this out and both with the 10k on the Vout but I still see the values floating around inaccurately. Without the long cable it runs fine. I should note the lm35 is on the board end of the cable by the arduino not soldered to the lm35. Can anyone provide any direction or tips?

Cheers, cyboman :D

If length becomes substantial you might step over to digital temp sensors like the DS18B20. These do the ADC conversion internally and can be read with a 1-wire handshake.

Check - http://www.milesburton.com/Dallas_Temperature_Control_Library -

The LM35 data sheet at http://www.national.com/ds/LM/LM35.pdf tells you how to connect it over a long cable run on page 7.

thx for the replies rob and dc42. i apologize for my noobness before my long post here.

thx for the link to the DS18B20, i think i was looking at an IC like that. obviously there would be a bit of a cost increase. but makes the most sense. is that basically an IC that sends a digital pulse representing the temp? For now Im wondering if I can calibrate this “noise” on the software end? Like read and delay a bunch and throw out most of it. I wish I could find some sort of pattern in the ‘wavering’ I’m seeing in the reading. But there is already sampling and averaging going on so that might be the wrong direction.

I remember looking at that datasheet and reading about the resistor and potentially a capacitor to filter? My knowledge of Micro elec is intermediate at best so I’ll need to polish up my circuit reading skills and logic before understanding what’s there. I did read a post saying to put a 10k filter on the Vout to the arduino, also twisted pairs were recommended. I tried that to no avail. In figure 3 on the datasheet it shows the resistor right next to the sensor, i know it’s a diagram etc, so it shouldn’t matter if it’s at the arduino or sensor end of the wire correct? I’ll prolly try both. And it looks like Vout it tied to ground with negative leg. same in figure 4 is that correct or am i just reading this wrong.

I know this is a reach but I always like personal responses. I could wiki around and I will, but just in case someone would like some typing practice. Can someone explain how the sensor and the capacitance of the wire and resistance relate? Maybe even a simple recommended arduino diagram with capacitors and resistors?

I’m going to plug it in and mess around some more!

i used a 100kR resistor in series with the Vout pin and no capacitor…

how big is the noise?
just +/-2 can be used for over sampling…

how long is the cable?
mine r <5m…

what ADC reference do u use?
i use INTERNAL (1V1)…

It does make a difference which end of the cable the resistor is on, because of the capacitance of the cable. The sensor may not output a stable value when loaded with capacitance. I suggest a 10K resistor at the sensor end and and a 10nF or 100nF capacitor to ground at the Arduino end.

Thx for the reply Arne. 1: I will try the 100kR value R 2: The noise was more significant than +/-2 I would see 5 to 8 degree erratic changes (convert'd to F) 3: The cable is over 6 feet. 4. I'm using the internal 3v3. Which is giving good accuracy on the short cables. (short cables are solid and not stranded wire, dunno if that has an effect)

dc42, thx for the tip re: capacitance and location of the resistor and the cap on ground.

Thx for saving me a bunch of hours of head scractching. I'm going to try this out soon and will post my results.

Cheers, cyboman :grin:

dc42, I tried moving the resistor and like magic the reading is way way more stable - that really was the big bug. I was thinking the wire itself acts as a weak resistor so the placement of the actual resistor seemed arbitrary. Assumptions are the mother of all ...ahem. In any case thanks dc42. Also question. The capacitor to ground, would you recommend that only on the long cables? or will it help smooth out the short sensors too? maybe that's overkill? Same goes for the resistors, should i put that on my other sensors even if I'm experiencing fairly good readings? Right now I'm getting 79,78,79 and a tiny bit of +/- 1 on all three, so really it seems only neccessary to do it for the long cables. I haven't added the cap to the ground leg at the arduino end yet, the readings look good without it but maybe I'll give it a go. The long cable does seem about 1 degree higher than the shorter one's pretty consistently but that's pretty acceptable. Sorry for the long winded response.

Cheers and thx for the help all.

-cyboman XD

You can expect the reading to change by about +/- 1 anyway, so if the reading is fluctuating by no more than that without the capacitor, adding the capacitor probably won't help. You may want to display the temperature averaged over 10 or more readings in order to smooth the fluctuations.

When you say you are using "internal 3.3", do you really mean that you have set the ADC to external reference and connected the Aref pin to 3.3v?

One more tip: to reduce fluctuations in your readings from analog pins, keep the analog and digital grounds separate. Dedicate one of the ground pins on the Arduino as analog ground and connect the ground side of all your analog sensors (along with any capacitors from analog pins to ground) to that. Use the other ground pins for power and for the ground side of any output devices.