# Voltage divider and Arduino power supply voltage measurement

3804 5
This content has been translated » The original version can be found here
• Level 9
Hello,
I am asking for a hint regarding the voltage divider.
I want to measure the voltage of a 12V car battery with the help of Arduino.
I will use the analog arduino pin and voltage divider as in the diagram.

When calculating the R1 and R2 resistor, I assumed that the maximum Uwe is 15V, and Uwy is to be 5V.
Thanks to the program "Electronics assistant 2.2.5" I calculated that if R1 = 2 then R2 = 1 but they are not the resistor values but the ratio R1 to R2.
Question:
What should be the resistors R1 and R2? What order of magnitude Ohm, kOhm, MOhm?
For the tests I took R1 = 20kOhm and R2 = 10kOhm and it works, but what should be the most optimal sizes of R1 and R2 resistors.
• Level 40
20kOm and 10 kOm resistors are correctly calculated.
• Level 20
Aim somewhere in the kiloom range. The values you propose will be approx.
• Level 10
Hello,
guzik121 wrote:
Hello,
I am asking for a hint regarding the voltage divider.
I want to measure the voltage of a 12V car battery with the help of Arduino.
I will use the analog arduino pin and voltage divider as in the diagram.

When calculating the R1 and R2 resistor, I assumed that the maximum Uwe is 15V, and Uwy is to be 5V.
Thanks to the program "Electronics assistant 2.2.5" I calculated that if R1 = 2 then R2 = 1 but they are not the resistor values but the ratio R1 to R2.
Question:
What should be the resistors R1 and R2? What order of magnitude Ohm, kOhm, MOhm?
For the tests I took R1 = 20kOhm and R2 = 10kOhm and it works, but what should be the most optimal sizes of R1 and R2 resistors.
it all depends on how it is value of input resistance R IN the above analog input pin to which this input will be supplied voltage from this divider.
It is practically accepted that value of equivalent resistance R WITH resistance divider, and seen from that pin towards the divider resistors should be at least one hundred times smaller from R IN .
And the value R WITH - using your designation of the divider resistors - is:
R WITH = 1 / (1 / R 1 + 1 / R 2 ) , this is their parallel connection.
And then, since; R 1 = 2 o R 2 , we have:
R WITH = 1 / (1 / (2 o R 2 ) + 1 / R 2 ) = R 2 / (1/2 + 1/1) = R 2 / ((1 + 2) / 2) = R 2 o (2/3) , i.e.
R 2 = (3/2) o R WITH .
But if it is to be:
R WITH = (1/100) o R IN then we have:
R 2 = (3/2) o (1/100) o R IN .
You still have to count for yourself because I don't know the value of the input resistance R IN .
Of course,
R 1 = 2 o R 2 .

greetings
• Level 9
Hello,
I have one more question.
The system from the first post works perfectly provided that the voltage from the battery from which the arduino is powered is measured.
How to measure the voltage from several batteries with arduino, e.g. 2, if the arduino itself will be powered separately from a 9V battery.
Thank you in advance for the hint.