A voltage divider is an electrical circuit which divides the input voltage. The output voltage is a portion of the input voltage and the value of the output is dependent on the resistor ratio in the circuit. The schematics on the right includes two resistors.
The output of the circuit is calculated by the following equation:
U2 = U1 ⋅ (R2 / (R1 + R2))
where:
The equation is derived from Ohm's law
where:
I = U1 / (R1 + R2)
and:
U2 = I ⋅ R2
A voltage divider is very often used together with resistive sensors (photo resistor, thermistor etc.) where one of the resistors is replaced by the resistive sensor. In this way, the change of the resistance of the sensor is easily transformed to the voltage change, which is compatible with the microcontroller's analogous input.