How to eliminate noise of the LM35 connected to Analog pin of Arduino..?

I have connected LM35 to the arduino’s analog pin…
The problem is the sensor cable is little longer so the reading is a bit noisy…

How do I eliminate this noise…??
Add a capacitor to the analog pin and Ground…??

Yes, it's an analogue device to placing a capacitor on the analogue input point will dampen the noise.

If you can analyse the noise you might be able to narrow it down to an item of equipment - and cure the problem at source.

You do not state whether or not you are using screened cable. Ideally you should be and this must be isolated from all terminals at the sensor end and connected to the analogue ground at the Arduino end. The ground wire which is connected to the LM35 should be fed as one of the cores within the screened cable.

As to capacitor size, something like a 0.1microfarad should do the job.

I tried using the LM35 with 1 mtr cable to an Arduino Duemilanove board, There was no noise...

But when I connect the same LM35 with the same length cable to a project board made on a vero board there is a noise of 10°C in the reading..

I tried with another analog pin but the problem is same...

So I connected a 0.1uf non polarized cap between the GND and the analog pim the noise came down to 1°C. Then I tried with a 47uf polarized cap. that gave me good results, no noise..

But now my question is that as I am using the cap am I getting a true reading all the time... In case the temperature rises and then cools down very quickly will the reading take time to decrease due to the capacitor's stored charge...??

Something on your veroboard is creating serious noise. may I suggest you provide both a circuit diagram and photos of both sides of your board. Also, do you have any active circuits on the board (such as amplifiers or oscillators etc)

As to the large capacitor, yes it will grossly dampen any transient temperature changes.

The LM35 claims to have a low output impedance of 0.1 ohm - just placing a capacitor across that is likely to cause problems of overloading the output when it changes.

Instead use an RC low pass filter, say 1k in series to a 100uF capacitor to GND - that gives a time-constant of 0.1 second and doesn't overload the output. Its unlikely you'll be seeing temperature changes at more than a few Hz.

jackrae: Something on your veroboard is creating serious noise. may I suggest you provide both a circuit diagram and photos of both sides of your board. Also, do you have any active circuits on the board (such as amplifiers or oscillators etc)

I am attaching the pics here..

The circuit is pretty simple.. I have a 16x2 LCD attached to PINS 12, 11, 5, 4, 10, 9 a voltage divider with R1 = 2.2k & R2 = 820R is connected to A0 to measure voltage. A LM7805 as a voltage regulator for the circuit. 2 nos. tactile buttons attached to A5 & A4.

Thats all what I have...

I tried with opening the 1mtr wire from the A1 ( pin for LM35) and connected the LM35 to the A2 with a Short wire, the noise persists. So I tried connecting the LM35 to A3 still the problem persist.

I even detached all the other connections from the Analog pins.. Still the problem persists... :(

So I pulled up an Arduino Duemilanove board and connected the LM35 to It and checked.. There was no noise... So the LM35 is good..

What may be causing the noise...

That circuit doesn't connect to the AREF pin so can't have the required decoupling capacitor on AREF that's needed for low-noise ADC performance... All Arduino boars do this to my knowledge.

MarkT: That circuit doesn't connect to the AREF pin so can't have the required decoupling capacitor on AREF that's needed for low-noise ADC performance... All Arduino boars do this to my knowledge.

Ok...I missed that... :P

Now I have connected a 104K pf between GND and the AREF pin...

But still the problem persists... :(

Ciao,

have You decoupled the power input of the LM35 too?

Here You can find a project using 2 LM35.

UberFridge hardware and schematics http://www.elcojacobs.com/uberfridge-hardware-and-schematics/

As You can see from the schematics there is a RC filter + LM35 power in decoupling to avoid power (there are 2 probes in this project: probe1 and probe2 in the schematics).

Also take a look at another article that Elco Jacobs posted about hardware noise reduction + code to reduce noise and improve measurements. Eleminating noise from sensor readings on Arduino with digital filtering http://www.elcojacobs.com/eleminating-noise-from-sensor-readings-on-arduino-with-digital-filtering/

Have a nice day, Marco.

By trial and errors I found that connecting a 10K resistor Between the LM35 sensor pin and the GROUND the noise goes away…
Should I use that…??

And what's the crystal for that appears on the left of the circuit. Your LCD display will use multiplexing to encode the characters which itself will generate lots of noise. You therefore need to ensure its supply is decoupled as close as possible to the display power connects.

I know it's difficult to keep wires separated but all those wires crossing over each other will also cross-couple any noise signals to where they aren't wanted - particularly the one from the crystal (if it's an active part of your circuit)

jackrae: And what's the crystal for that appears on the left of the circuit. Your LCD display will use multiplexing to encode the characters which itself will generate lots of noise. You therefore need to ensure its supply is decoupled as close as possible to the display power connects.

I know it's difficult to keep wires separated but all those wires crossing over each other will also cross-couple any noise signals to where they aren't wanted - particularly the one from the crystal (if it's an active part of your circuit)

Reading your post I removed both the Xtal wires and freshly connected a xtal below the board( soldered the xtal directly on the pins 9 and 10 )..

Still the problem persists..

So I removed the LCD and still found the problem persists... :(

I found that the power supply is causing the problem... As I am using a LM7805 to power the circuirt I tried a 12 volt battery but still the noise existed.. Then I powered the circuit with the LM7805 and with a %v power supply from another arduino board(original) There was no noise at all... :)

So what may the problem be...??? I tried 3000uf filter caps before the LM7805 and a 0.1uf non polar capon the 5volt... still the problem was there...

Time for an accurate circuit diagram of the components you actually have wired into the system. Sounds like you’ve missed out the required capacitors on the voltage regulators. See vendor data sheets for subject regulators, where the manufacturers specify what capacitance is required at regulator input and output to prevent oscillation.

jackrae: Time for an [u]accurate[/u] circuit diagram of the components you [u]actually[/u] have wired into the system. Sounds like you've missed out the required capacitors on the voltage regulators. See vendor data sheets for subject regulators, where the manufacturers specify what capacitance is required at regulator input and output to prevent oscillation.

:P how funny when I am using the small 7805 (TO- 92) there is no noise, this small 7805 does not even require a cap on its output..

But whenever I am trying to use big one there is a lot of noise.. :(. and on its output without a filter cap it will not even boot the atmega...:P

This is the circuit of ripple rejection as on the datasheet... :( huh its too big... :(

Sorry, but the drawing you provided is totally irrelevant to the problem. You were requested for actual as-built circuit, not a drawing from the vendor data sheet - which, by the way calls for a 0.1microfarad on the output as well as a 0.33 on the input, both of which should be as close as possible to the regulator pins. Have you considered the possibility that your regulator may be defective.

Yes I have tried other 7805s ther behaved the same... Only when I use the small 7805 (TO- 92) there is no problem...