Go Down

Topic: Analog input channels are incorrectly reading input voltages (Read 519 times) previous topic - next topic

ccb2134

I am using an Arduin Mega and I am trying to read the voltages across a variable resistors, but the the analog input pins are not accurately reading the voltages.  The voltaged being read by the Arduino are also changing depending on which pins are being used.  Is there a way to set the Arduino such the pins being used won't matter?  Is it possible there is interference between the channels?

JCross

I had success with a photocell by inserting a 10k resistor between the analog input and GND (the analog input pin connects both to the photocell and the resistor lead).
I also had found some information at http://www.ladyada.net/learn/sensors/cds.html which shows this process in a good tutorial.  Hope this may help.

CrossRoads

Are you leaving some settling time between reads? The analog inputs have to charge up an internal sample & hold cap that theA/D converts. If your analog source has very low current drive capability it could take a while to settle. Like 10's of microseconds.  Read the A/D section of the atmega data sheet for more details.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

MarkT

Need to see the circuit to know what the problem is.  Note that the ADC only works accurately with 'low' impedance sources (which I think means 10k or lower, something like that).
[ I won't respond to messages, use the forum please ]

Go Up