Go Down

### Topic: Best Resistors for a voltage divider (Read 1 time)previous topic - next topic

#### DaveO

##### May 13, 2012, 08:12 am
I need to monitor my supply voltage ( usually around 13,8vDC ), so assume I need a voltage divider into an analog pin on my Mega 2560.

From what I read, I need 2 resistors ( R1 & R2 ) connected as  Vin --- R1 --- pin A1 --- R2 --- Gnd.

Question : is it better to use higher valued resistors, or lower ( and why ) ?

For example :

R1 = 10,000 (10k)
R2 = 1,000 (1k)
10000 + 1000 = 11000 / 1000 = 11 : 1 ratio.
In software, I should multiply the analog read voltage by 11 to get the real value.

R1 = 10,000 (10k)
R2 = 4,700 (4k7)
10000 + 47000 = 14700 / 4700 = 3.127 : 1 ratio.
In software, I should multiply the analog read voltage by 3.127 to get the real value.

R1 = 1,000 (10k)
R2 = 220
1000 + 220 = 1220 / 220 = 5.55 : 1 ratio.
In software, I should multiply the analog read voltage by 5.55 to get the real value.

#### runaway_pancake

#1
##### May 13, 2012, 08:21 am
Lower values present more load on your circuit.
Metal-film resistors, 1%, temp. stable, not "expensive".
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

#### DaveO

#2
##### May 13, 2012, 08:54 am
OK. So best option ( using components I have ) would be :

R1 = 10,000 (10k)
R2 = 3,300 (3k3)
10000 + 3300 = 13300 / 3300 = 4.03 : 1 ratio.
In software, I should multiply the analog read voltage by 4.03 to get the real value.

Am I correct then to assume that the MAX Vin would then be :  4.03 x 5v = 20.15vDC ?

#3
##### May 13, 2012, 10:13 am
Vout = (Vin * R2)/(R1+ R2)
Vout (R1  + R2) = Vin R2
Vout (R1 + R2) / R2 = Vin
5V (10000 + 33000) / 3300 = 20.1V, analog reading of 1023

Analog Reading * 0.00488 = voltage at input pin, assuming default settings and Vcc = 5V.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### MarkT

#4
##### May 13, 2012, 03:18 pm
Make the resistors as high as possible without taking the input impedance presented to the analog pin above 10k.  So something like 27k and 15k would work and present the least load.  They combine to produce an impedance of about 10k (compute the parallel equivalent).

In a noisy environment (high currents being switched, high voltages etc), reduce the values by a factor of ten or so might be a wise precaution, as would adding a 10nF capacitor from analog pin to ground.

If you make the resistors really low in value they will heat up significantly, worth avoiding.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up