Go Down

Topic: Problem using more analog inputs at a time (Read 856 times) previous topic - next topic

claudiu_mirescu

Hello!

I am trying to do this project where I read a temperature from LM35 on analog pin 0 and an electrical resistance (like a photoresistance or potentiometer) on analog pin 1 and display the values on an LCD.
Everything works fine with a tiny bit of a problem: when I change the value of the potentiometer on pin 1, the temperature changes a little. Do analog inputs influence each other? The LM35 is connected to 3V3 pin of the Arduino (do you have any idea why it displays ten Censius degrees more than normal when I connect it to 5V?). I might be using more analog pins in the future and this is annoying.

Thank you!

RIDDICK

1.
the LM35 likes a lot of voltages... 4V to 30V...
but not 3.3V...

2.
can u make a painting of ur cabling?

3.
what if u do 10 analogRead(P)-s from the same pin P with a delay(200) between each?
do the values change then?
-Arne

claudiu_mirescu

1. If I connect the LM35 to 5V, it outputs 37 degrees C instead of 27 and so on, with 10 degrees more than normal;
2. I will draw a schematic and...
3. I will try using delay tomorrow when I'll get to the lab.

Thanks for the answer! Delaying might be the solution for my problem.

RIDDICK

1.
maybe u touched the sensor shortly before u read its output? :)
3.3V is definitely not within its normal parameters...

2.
or ur Vref is lower than u think?
what formula do u use?
what program do u use?

3.
did u try another Vref?
with analogReference(INTERNAL)?
http://arduino.cc/en/Reference/AnalogReference?from=Reference.AREF
-Arne

DuaneB

Hi,

My understanding is that there is one analog to digital convert that is switched between the 6 analog inputs. If you switch between two inputs, the second reading can contain a residual from the first, this is what you are seeing. The simplest solution is to make a dummy reading every time you switch to a new analog input i.e.

analogRead(TEMP_INPUT); // dont use this one, its the dummy
int nTemp = analogRead(TEMP_INPUT);

analogRead(POT_INPUT); // dont use this one, its the dummy
int nPotValue = analogRead(POT_INPUT);

Duane B

rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy