Go Down

Topic: Analog Inputs distortion problem (Read 2340 times) previous topic - next topic

robertgrech91

Hi,

I've been working on a school project, which includes reading analog values from two LM35 temperature sensors, displaying the results on LCD, and also monitoring background noise.

I've tried this setup on both an Arduino Duemilanove and an Arduino Nano (ATmega168). Both presented the same problem, which is,
that the temperature inputs get affected by the noise inputs!

If the noise input is grounded, the temperature readings are steady and true.

With the noise pin connected and receiving an analog signal, I notice that the temperature readings by approximately +/- 5*C, which totaly distorts the accuracy and makes the whole project malfunction.

I don't know what else to try, there is a good ground throughout the circuit and breadboard, they share the same supply.

Regarding coding, temperature sensors use analog inputs 0 and 1, whilst the noise signal (coming from an op-amp circuit is on analog pin 5)(I didnt make it analog pin 2 to sort of isolate them)


What can I do please? This is getting so frustrating  :~

Thanks  :smiley-surprise:

Magician

There is an excellent book, that include your project and idea how to manage analog noise.
"C programming for microcontrollers" by Joe Perdue.
What is idea?
Read analog input 8 times and calculate an average.

pluggy

Stick a capacitor (100 nF as  a starting value) between gnd and the pin reading the analog input.
http://pluggy.is-a-geek.com/index.html

retrolefty

Well I would try and 'half-split' the symptom to try and determine if the noise generator input is effecting the analog input A/D conversion, or if the noise generator is effecting your temp sensor. Why don't you disconnect the temp sensor and instead jumper a wire from the 3.3v pin to the analog input pin that was reading the temp sensor. Then run your program without the noise signal input to verify a steady 3.3v reading and then input the noise source and see if the 3.3v signal is effected or not. That might give one a direction to go from there.

Lefty


robertgrech91


Well I would try and 'half-split' the symptom to try and determine if the noise generator input is effecting the analog input A/D conversion, or if the noise generator is effecting your temp sensor. Why don't you disconnect the temp sensor and instead jumper a wire from the 3.3v pin to the analog input pin that was reading the temp sensor. Then run your program without the noise signal input to verify a steady 3.3v reading and then input the noise source and see if the 3.3v signal is effected or not. That might give one a direction to go from there.


Just tried that, connected the sound input to ground, and one of the temperature inputs to 3.3v supply. Interestingly, the readings on the LCD still fluctuated as before..

Therefore, it seems that the noise problem is within the ADC =/ 

retrolefty

One thing that helped me with a small 'jumping' value from a analogRead() value (+/- 2counts) was to wire a .1ufd cap from the Aref pin to ground. This pin is connected to A/D reference source and the extra filtering may help.

Lefty


robertgrech91

Tried that too, even did what pluggy suggested earlier.

For a precaution, I did   analogReference(DEFAULT); before the A/D Conversion in the sketch, this means   
Quote
DEFAULT: the default analog reference of 5 volts (on 5V Arduino boards) or 3.3 volts (on 3.3V Arduino boards)


Stuck 0.0

TerryKing

What is the amplitude of the "Noise" signal? If it is too strong it will bounce the Arduino chip internal nodes enough to cause problems.

It should not go above Vcc or Below Gnd..   Do you have an oscilloscope to check it?

Or for now attenuate it down like 5:1 with a voltage divider of two resistors... Make sure it's not too strong...


robertgrech91

@ Terry King:

A few millivolts, since it's a temperature reading, I can only notice about +/- 3 to 5*C difference, for example ranging from 12.50*C to 16.55* in an instant.
It does not get below GND or above Vcc

MarkT

Suspect your power supply - is the op-amp circuit overloading and pulling the supply rails down?  Have you looked for noise on the power rail?
What is the impedance of the LM35 driving the ADC?  Do you have suitable low-pass filtering (bandwidth of 1Hz would do) on the analog pin connected to the temp sensor?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

robertgrech91

Good thinking MarkT, thanks!
I notice that when the microphone picks up a signal, the supply voltage goes from 4.99V to 4.98V, this problem happens when the opamp gives an output, it effects the supply.
Just removed the opamp, and the problem's gone!

What should I do? =/

TerryKing


Good thinking MarkT, thanks!
I notice that when the microphone picks up a signal, the supply voltage goes from 4.99V to 4.98V, this problem happens when the opamp gives an output, it effects the supply.
Just removed the opamp, and the problem's gone!What should I do? =/


That's the "Noise" I meant  :)  What is the output voltage swing of the Opamp into the Arduino analog input??  That needs to be controlled so it does not hit the limits of GND-Vcc.

If you significantly overdrive an analog input it can affect the other analog inputs...

Go Up