When you start electronics hobby projects with sensors and different microcontroller platforms, you may find that components do not always use the same operating voltages. Perhaps a Raspberry Pi uses 3.3V while the sensor uses 5V. This is where the voltage divider comes in. It can bridge the gap between components and microcontrollers.
A voltage divider is often a subcircuit within a larger circuit, using two or more resistors to divide a voltage into a corresponding number of smaller voltages. The image below shows two resistors in series. By varying the values of the resistors R1 and R2, we can determine the voltages measured at V1 and V2. Depending on the R1 and R2 values, these two voltages may be equal or very different.


DERIVING THE FORMULA
Below is a derivation of the formula used to calculate the component values for R1 and R2 to obtain the desired output voltage.


First, write down KVL, assuming that no current flows to Vout:

Now solve for i:

Applying KVL to Vout, we look only at the output:



Voltage Divider Formula
We can now write the voltage divider formula and use it to calculate the unknown value. Further down, you will also find links to online calculators.

Applications
Sensor measurements
Sensor analogue or digital outputs may have a higher voltage than the receiving input can tolerate. If you use your microcontroller with an external ADC with an allowed measurement range of 0–5V, and the sensor provides 0–10V, you must adapt the signal before connecting it. Overvoltage can damage the input; it is not simply displayed as 5V. A standard Raspberry Pi has no built-in ADC and requires an external ADC for analogue measurements.
The example below shows a reduction from 5V to 3.3V. On a standard Raspberry Pi, a suitably adapted digital signal can be read through GPIO; analogue sensor signals require an external ADC. Always check the allowed input voltage and the load on the voltage divider.

High-Voltage Measurement
A voltage divider can also scale down a very high voltage so it can be measured with a voltmeter. Measurement probes often have a built-in voltage divider.Logic Level Shifting
Under suitable conditions, a voltage divider can be used for one-way reduction of a logic level, for example from 5V to 3.3V. It is not a general bidirectional level shifter. The load, input impedance, and signal bandwidth or edge rates must be assessed. This is similar to the sensor measurement example above. A classic example is allowing a 5V system to communicate with a 3.3V system, for example over UART or SPI When connecting Arduino and Raspberry Pi, a logic level shifter is often needed. A simple voltage divider can only be used in the higher-to-lower-voltage direction when the load and signal speed allow it. If we have a 1000 ohm resistor in a drawer, we can easily calculate the other one. We assume that the 1000 ohm resistor is R2.


Useful Calculators
The link below is a simple calculator where you can enter known values and calculate the ones you need to find.
Voltage Divider Calculator | DigiKey
There is also a calculator for several resistors in series in your voltage divider. It calculates the voltage between each successive resistor.
Voltage Divider Calculator - Electrical Engineering & Electronics Tools (allaboutcircuits.com)
Comments (1 comment)
Hej Rasmine,
Spændende side. Jeg er ved at lære en masse om dette univers. Jeg vil dog lige gøre opmærksom på at der er fejl i de links der er her på siden:
1. Udledning af formel
1.1 Eksempler
1.2 Videoer
2 Anvendelser
3 Nyttige udregnerer
De linker alle til jeres egen forside.
Hilsen Anders