Pages: [1]   Go Down
Author Topic: lm35 sensor reading fluctuates depending on arduino power source  (Read 1305 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Brunsbüttel, SH, F.Rep.GERM
Offline Offline
God Member
*****
Karma: 4
Posts: 596
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

what reference voltage do u use for analogRead()?

do u use analogReference()?
http://arduino.cc/en/Reference/AnalogReference?from=Reference.AREF
Logged

-Arne

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...  smiley-confuse
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4687
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?


* Untitled0.png (11.09 KB, 819x460 - viewed 54 times.)

* Untitled.png (11.27 KB, 819x460 - viewed 55 times.)
« Last Edit: August 14, 2012, 08:44:03 am by andreo73 » Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 96
Posts: 4687
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Brunsbüttel, SH, F.Rep.GERM
Offline Offline
God Member
*****
Karma: 4
Posts: 596
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...  smiley
Logged

-Arne

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Brunsbüttel, SH, F.Rep.GERM
Offline Offline
God Member
*****
Karma: 4
Posts: 596
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

the "rc damper u put on" is like a "low-pass filter" with a capacitor that has a high ESR...  smiley
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:  smiley-wink
http://arduino.cc/playground/Main/TutorialList
there:
http://www.arduinoos.com/?p=1022
Logged

-Arne

Pages: [1]   Go Up
Jump to: