lm35 sensor reading fluctuates depending on arduino power source

Hi
I've attached an lm35 sensor to my arduino uno board (5v - gnd - analog0); when the board is plugged through usb cable to my pc, everything works fine and the temperature reading is stable

then I've plugged the board to a tp-link router (again through the usb cable) where I've installed openwrt system to use it as a wireless client; in that case the temperature reading becomes erratic, sometimes seems stable and then becomes crazy

my suspect is that the reference for the analog reading is related to power source of arduino, which in the case it draws power from the router is not perfectly reliable, can it be the case? is there a way around?

thanks!

andreo

what reference voltage do u use for analogRead()?

do u use analogReference()?

Hi
I'm not using analogReference

I've tried once with INTERNAL as reference, but nothing changed

I must say that things are more complicate than my original post: the very erratic reading of the sensor occurs when two conditions are true: the arduino board is plugged to the tplink router (drawing power from it) AND the sensor is at the end of a quite long wire (2 meters)

if the wire is much shorter OR the board is plugged to a pc, the sensor reading is much more stable

I do not understand what is the physical origin of the problem, sigh... :~

How is your wiring? Have you tried using the R-C damper from the datasheet?

An unshielded cable will capture a lot of signals and 10mV are easily reached within the reach of WLAN device. The shorter the cable the less noise it's getting on the "antenna". The datasheet uses at least twisted pair cables. What do you use?

thanks for the reply

so you suggest to follow fig. 4 of the datasheet, to shield capacity and impedance of the cable which gets too (radio) noise?

my wiring is in attachment "Untitled0.png"

is it ok in your opinion to add the resistor and capacity close to the sensor, such as in the following sketch: attachment Untitled.png ?

so you suggest to follow fig. 4 of the datasheet, to shield capacity and impedance of the cable which gets too (radio) noise?

I would try it.

is it ok in your opinion to add the resistor and capacity close to the sensor, such as in the following sketch: attachment Untitled.png ?

Yes, that's how I would try it. Although the the datasheet suggests it only for heavy capacitive load, it damps the noise too, so you should get a more stable reading.

In the "Typical Applications" of the datasheet in most cases they use a shielded cable. Is your cable shielded? From your circuitry drawing I would read you're using standard cables without shielding or twisted pair.

I've put the RC damper as suggested in the datasheet, apparently it works, i.e. there are fluctuations but the order of 1-2 degrees instead of 100 degrees of before

I must admit that I can't completely understand the principle of such a damper, since I read the output at the same point as before (the RC are completely in parallel, see fig. 4 of datasheet)

nevertheless, thanks for the useful reply!

A.

that's where the noise comes from:

and that RC thingy works like a second output:

  1. when the noise pulls the LM35 output down, the RC thingy discharges...
  2. when the noise pulls the LM35 output up, the RC thingy charges...
    ...and compensates the noise... :slight_smile:

great video and very nice idea

so, the "rc"-damper I've put on, is not exactly a lowpass filter, is it? or you think is morally the same?

I wonder if it's possible to realize the emf detectoras in the video, but with some rough fourier analyser(to get intensity of each frequency band, etc.), you know of some project like that? ah, but I'm going out of topic, sorry

a.

the "rc damper u put on" is like a "low-pass filter" with a capacitor that has a high ESR... :slight_smile:
because: the LM35 has some output resistance...
the resistor in that recommended rc damper reduces the stress on the LM35 when it is powered up...

i dunno if arduino can do FFT...
lets look in the playground: :wink:
http://arduino.cc/playground/Main/TutorialList
there:
http://www.arduinoos.com/?p=1022