User manual
5 V / 1,024 = 0.00488 V = 4.88 mV
If we were to raise the input voltage range to 30 V, the
resolution would deteriorate five-fold ((30 V – 5 V) / 5 V = 5).
We would »only« be working with a resolution of 0.0244 V = 24.4 mV
anymore.
Now we can determine the voltage divider for a measuring range
up to 30 V. We already know that we want to expand the input range
from 5 V to 30 V, which corresponds to factor 5. The measuring
input for voltage measurements must not be too low-Ohmic and
should be at least 100 kΩ. Modern voltage meters in contrast,
have an input resistance of 10 MΩ to put as little stress as
possible on the voltage source and to avoid falsifying the
measuring result as far as possible.
Let us assume an input resistance of approx. 100 kΩ and define
the resistor R1 at 100 kΩ. In a serial circuit, the ratio of the
voltages is identical to the ratio of the resistors to each other.
The resistor R2 only needs to be 1/5 as large as the resistance
of R1. We take 100 kΩ / 5 and will receive the value 20 kΩ for R2.
Let us now determine the current that flows in the circuit. In
a serial circuit, the current through the resistors is the same
and the voltages will be divided. The current through the
resistors is calculated as follows:
I = U / R
Total
30 V / 120 kΩ = 0.25 mA
The following voltage drop would result at R2 then:
U = R2 x I
20 kΩ x 0.25 mA = 5 V
At an applied voltage of 15 V, the value at the ADC would be:
15 V / 120 kΩ = 0.125 mA
20 kΩ x 0.125 mA = 2.5 V
Let us calculate the power loss across the resistors at maximum
input voltage now:
P = U x I
30 V x 0.25 mA = 7.5 mW
You can now calculate your own matching voltage divider and
adjust the measured value in the program by multiplying it by
your voltage divider factor. The measuring error can be de-
termined by experimenting with a precise voltage meter and is
included in calculation of the multiplication factor. Observe
the resistance values of the E-series and do not try to include
the mathematically determined values in a circuit by using
unusual E-series or even trying to switch resistors in series
or in parallel to get precisely the calculated resistance.
This calculation also does not consider the input resistance of
the ADC. In the Arduino™-UNO ATmega328, it is at approx. 100 kΩ.