# Voltage Dividers

As we are now familiar with resistor combinations, let's take a deeper look into voltage dividers.

## Voltage Dividers

A voltage divider can be as simple as two resistors in series. As we saw in the last tutorial on resistor combinations the voltage in between both resistors will be a fraction of the input voltage. The exact value can be adjusted by changing the resistor values.

There are quite a few use cases for such a circuit and I'll cover some of them in future tutorials. The most obvious one is adjusting the level of an analog signal, like an audio signal. A common example are volume knobs, which commonly use a potentiometer as voltage divider.
Other use cases include the use for measuring higher voltages, measurements with resistance based sensors or level shifters. I'm sure there is more to add to this list, but in this tutorial we will focus on the basics of voltage dividers.

In the picture above, you see a simple voltage divider circuit with two resistors $$R_1$$ and $$R_2$$ and the measured output voltage $$U_{out}$$ . We can calculate the output voltage using ohms law as following:
$$R_{12} = R_1 + R_2$$
$$I = {U_{in} \over R_{12}}$$
$$U_{out} = R_2 \cdot I$$

We can also put all of this into a single formula:
$$U_{out} = U_{in} \cdot {{R_2} \over {R_1 + R_2}}$$

This formula for voltage dividers is, however, more commonly written like this:
$${U_{out} \over U_{in}} = {R_2 \over {R_1 + R_2}}$$

$${U_{out} \over U_{in}}$$ is called the divider's voltage ratio. There are multiple possible resistor combinations, which all produce the same voltage ratio. Let's look at a simple example: converting 5 V to 3.3 V.

In this example our voltage ratio is: $${U_{out} \over U_{in}} = {{3.3 V} \over {5 V}} = 0.66$$

In theory, we can just use a fixed value for $$R_1$$ and then calculate the matching value for $$R_2$$ to get our desired output voltage. Here is the derivation for the required formula:
$${U_{out} \over U_{in}} = {R_2 \over {R_1 + R_2}}$$
$${U_{out} \over U_{in}} \cdot ({R_1 + R_2}) = R_2$$
$${U_{out} \over U_{in}} \cdot R_1 = R_2 - {U_{out} \over U_{in}}) \cdot R_2$$
$${U_{out} \over U_{in}} \cdot R_1 = (1 - {U_{out} \over U_{in}}) R_2$$
$$R_2 = R_1 \cdot {{U_{out} \over U_{in}} \over {1 - {U_{out} \over U_{in}}} }$$
$$R_2 = R_1 \cdot {{U_{out}} \over {U_{in} - U_{out}} }$$

Let's calculate $$R_2$$ for $$R_1 = 1 kΩ$$:
$$R_2 = 1 kΩ \cdot {{3.3 V} \over {5 V - 3.3 V}} \approx 1.94 kΩ$$

The result is fine, but there is a problem: there is no 1.94 kΩ resistor. If we want to build this circuit with standard 5% tolerance resistors, we can either use 1.8 kΩ or 2 kΩ. Of course, we won't get exactly 3.3 V if we do so. To need a more accurate result, we can try out different values for R1 until we get a resistance value for R2 that matches one of the available values.

## Resistor Calculator

It can be a quite tedious task to try out different combinations, until one finds one that matches your output voltage close enough. For this reason, I wrote a simple tool that delegates this task to your computer. Just choose the desired output voltage and the resistor range and pick one of the proposed combinations from the table below.

Input Voltage (V)
Output Voltage (V)
Range (Ω)
E-Series

When playing around with the resistor calculator you will notice that you can achieve your desired voltage ratio with very small resistors as well as with very big resistors in the range of mega ohms. Does it matter which resistance range one chooses? Yes, it does. Let's see why.

You might have noticed the column 'idle current' in the resistance calculator. This is the current that will directly flow through both resistors, even if you don't use the output voltage. The higher this current, the more energy is wasted and the more likely the power rating of the resistors is exceeded. Choosing extremely high resistor values, however, is not good either. To understand why, we need look at how voltage dividers behave under load.

When connecting a load to our voltage divider, some current flows through this load. For simplicity, let's assume that the load has a fixed resistance and can thus be represented by the resistor $$R_L$$:

$$R_2$$ and $$R_L$$ are connected in parallel and their combined resistance is less than the one of $$R_2$$. This affects the voltage ratio, we will get a lower output voltage than expected. If we know the exact resistance of $$R_L$$, we can use ohms law and recalculate the resistor values for $$R_1$$ and $$R_2$$ to get the correct output voltage again. In case you don't know the exact value for $$R_L$$ or the load is not constant we are faced with a problem. If we do the math, we will come to the conclusion that this problem gets worse for high resistance values. With small values for $$R_1$$ and $$R_2$$ we get a higher voltage stability.

To visualize this I created another tool. To use it, enter input and output voltage and the expected load. If the load is not constant or you don't know the exact value, you should to estimate and enter the worst case load. If you only know the maximum current and the voltage just use ohms law ($$R = {U \over I}$$) to calculate the load resistance.

The graph will show you, which voltage you get for different resistance values for $$R_1$$ and the given worst-case load. You can freely choose the maximum $$R_1$$ value shown in the graph and check whether the change in the output voltage under full load is acceptable for you. $$R_2$$ is internally calculated to exactly produce the specified output voltage at no load.
A small hint: it does not make sense to try resistor values above your worst case load resistance.

Maximum R1 Value (Ω)