Go Down

### Topic: LM35 at a distance from Arduino (Read 2332 times)previous topic - next topic

#### Diggory

##### Jul 12, 2012, 04:16 pm
Hello,

I'm pretty new to electronics so please excuse my ignorance!

I'm attempting to make a very basic application from an Arduino - I'm attempting to sense the outside and inside temperature of my house.

I've bought some LM35s and they work well when directly attached to a multimeter, or plugged into a breadboard very close to the Arduino.  However when I tried to put one in a box outside the house it didn't work as I expected.  I used some long (approximately 4 meters) multi-strand cabling a bit like this:

The output voltage of the LM35 (measured at the end of the cable) was fluctuating either side of the correct value and off by a significant amount.

Since the output voltage of the LM35 is in the millivolts range (0mV at 0, +10mV per degree above that, so 250mV at 25 deg C) does that mean that the resistance of the cabling is having an effect?

I measured the resistance of each strand of the cable and they all came out at around 1.0  Ohms.

#### Constantin

#1
##### Jul 12, 2012, 05:06 pmLast Edit: Jul 12, 2012, 05:08 pm by Constantin Reason: 1
Any analog signal that you want to measure accurately has to be treated with a lot of respect. My guess is that you're picking up stray EMI, a shielded cable (where the shield end is just grounded at the arduino) may help. Similarly, it would help if the strands in the cable you are using are twisted also, where you'd use two pairs, one signal/GND pair and a second 5V/GND pair. That way, there is a better chance that the interference will cancel itself out. I use CAT5 ethernet wiring for this sort of purpose - inexpensive, twisted, and available in a shielded form, if necessary.

However, a better bet may be to switch to something like the 1-wire series from TI/Dallas/Maxim and use a DS18B20 instead. You get excellent accuracy and a digital bus that is quite EMI-resistant, especially if you use one pair of twisted wire for the DQ and GND signals. For these temp sensors, you can rely on parasitic power from the DQ line to power them also.

There is a big 1-wire library for the Arduino, so much of the hard work getting a DS18B20 is already done. These sensors can be bought for about a buck a piece on e-bay or for 5x on digikey/mouser/etc. Not sure what drives that price difference, some folk have suggested that the sensors sold on e-bay are counterfeits.

#### Diggory

#2
##### Jul 12, 2012, 05:16 pm
Great.  Thanks for the info.  I'll try those instead.

#### MarkT

#3
##### Jul 12, 2012, 05:48 pm
That sensor takes less than 60uA, so its very high impedance.  This means it will pick up a lot of interference without shielded cables.

However don't totally lose hope, try connecting a capacitor across the wires (signal and ground) at the receiving end, something like 10uF to 100uF.  This may substantially improve things.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

#### Diggory

#4
##### Jul 12, 2012, 06:54 pm
Thanks, I'll try shielded cable and a cap as well.

#### tkbyd

#5
##### Jul 12, 2012, 09:17 pm
1-Wire is a bit daunting at first... but well worth the effort. There ARE simple ways to use it. They "throw away" some of the fun you can have... but also make getting going easier!

If you can: Eschew using parasitic power.

More at...

http://sheepdogguides.com/arduino/ar3ne1tt.htm

... where there is a lot of Good Stuff that you can glean and use, even if you are NOT using the Nuelectronics shield the page is supposedly about.

#### Snowman

#6
##### Jul 14, 2012, 04:30 amLast Edit: Jul 15, 2012, 07:31 pm by Snowman Reason: 1
I have done this exact thing approx 5 years ago on my pool solar collector. I solved this issue by using a 0.01uF on the signal tied to ground at the board.
Mark T, where you thinking nano rather than micro?

Also you can use a small cap to ground for AREF

Go Up