voltage divider output wrong adc reading

I connected two 100k resistors in series between GND pin and +5V pin.I connected the ADC A4 pin at the the middle. AREF = DEFAULT(+5V). But the ADC did not read 512 units. Instead it kept fluctuating between 506 to 508 units. What must be the reason for this weird behavior ?
Note - Arduino Uno was powered by 12V AC-DC power adapter

Probably, the two Rs are not equal, swap them & see if you get 516 to 518.

That's actually not that bad... 5 counts out of 500 is a 1% error.

Electronic components are not perfect. Resistors have a tolerance, and 5% resistors are common (5% resistors could be anyehwere between 95K and 105K). If one resistor is 5% high and the other 10% low, that's a 10% difference, or a 50 count error on the ADC.

The ADC isn't perfect either, but I believe it's accurate to within +/- 1 count.

The noise (randomly changing count) is probably electromagnetic interference from the AC power lines around you. Changing to 10K resistors would lower the tendency to pick-up noise. Shorter wires/leads might also help, or putting the Arduino in a metal box. Or you can put a small capacitor (maybe 0.1uF) across the "bottom" resistor to filter-out noise.

You are always at risk of randomly changing by one-count because the analog-to-digital can be on the "hairy edge" between two numbers.

Hi,
Try lower value resistors, the input impedance of the analog input is affecting the pot divider action.

Try 10K for each resistor.

Tom... :slight_smile:

edgemoron:
Probably, the two Rs are not equal, swap them & see if you get 516 to 518.

DVDdoug:
Resistors have a tolerance, and 5% resistors are common (5% resistors could be anyehwere between 95K and 105K). If one resistor is 5% high and the other 10% low, that's a 10% difference, or a 50 count error on the ADC.

TomGeorge:
Try lower value resistors, the input impedance of the analog input is affecting the pot divider action.

Yeah thanks for helping :slight_smile:
Next I tried this with capacitors..
I connected two 100uF capacitors in series(in series with 220ohm resistor) between GND pin and +5V pin.I connected the ADC A4 pin at the the middle of the 2 capacitors. AREF = DEFAULT(+5V). But the ADC did not read 512 units. Instead it read ~600 units.
What must be the reason for this weird behavior ?
Note - Arduino Uno was powered by 12V AC-DC power adapter.

SumitAich:
Next I tried this with capacitors..
I connected two 100uF capacitors in series(in series with 220ohm resistor) between GND pin and +5V pin.I connected the ADC A4 pin at the the middle of the 2 capacitors. AREF = DEFAULT(+5V). But the ADC did not read 512 units. Instead it read ~600 units.
What must be the reason for this weird behavior ?
Note - Arduino Uno was powered by 12V AC-DC power adapter.

But even if the 100uF capacitors are not exactly 100uF, would there be such large error of ~100 units ?

Hi,
Capacitors will not help the potential divider you are trying to use.
Did you try 10K resistors like I suggested in post #3?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom.... :slight_smile:

SumitAich:
Yeah thanks for helping :slight_smile:
Next I tried this with capacitors..
I connected two 100uF capacitors in series(in series with 220ohm resistor) between GND pin and +5V pin.I connected the ADC A4 pin at the the middle of the 2 capacitors. AREF = DEFAULT(+5V). But the ADC did not read 512 units. Instead it read ~600 units.
What must be the reason for this weird behavior ?
Note - Arduino Uno was powered by 12V AC-DC power adapter.

The voltage on the capacitors depends on the history of charge in the caps and their leakage currents.
There will be a long time constant associated with the combination of capacitance/leakage resistance,
so the voltage you measure may slowly change with time too, tending towards a limit defined by the
ratio of leakage resistances.

Electrolytic capacitors have very low accuracy anyway (-20%/+50% is a typical specification).

Looks like another abandoned thread continuation, started here:

http://forum.arduino.cc/index.php?topic=494257.0

Note the OP's same behavior of never answering questions, the only response is to ignore suggestions and respond with nosensical questions.