Electricity

Ohm’s law and voltage divider

Change the voltage and the resistors and watch how current flows and how the voltage is shared. The wire color shows its potential.

High potential 0 V Current direction
Current-voltage curve (I = V / R)
—Current I
—Total power P
—Total resistance
—Voltage across R1
—Output voltage (across R2)

Ohm’s law

Ohm’s law links the three basic quantities of a circuit: voltage V (in volts), which pushes the charges; current I (in amperes), the amount of charge flowing per second; and resistance R (in ohms), which opposes the flow.

V = I · R I = V / R R = V / I

A useful analogy is water in a pipe: voltage is the pressure, current is the flow rate and resistance is a narrowing. More pressure pushes more water through; a narrower pipe lets less through. On the current-voltage plot, a resistor is a straight line with slope 1/R.

Power

The energy the resistor turns into heat each second is the power P = V · I = I² · R, in watts. That is why resistors have a power rating: a typical 1/4-watt resistor burns out if it has to dissipate more.

The voltage divider

With two resistors in series, the same current flows through both and the battery voltage is shared in proportion to their values. The voltage across R2 is:

Vout = Vin · R2 / (R1 + R2)

Voltage dividers are everywhere: reading resistive sensors (light, temperature), shifting 5 V logic levels down to 3.3 V or setting a transistor’s bias. Careful: if you connect a load to the output, it ends up in parallel with R2 and the voltage drops, which is why a divider is no substitute for a power supply.

Frequently asked questions

What resistor does an LED need?

Apply Ohm’s law to the leftover voltage: R = (Vsupply − VLED) / I. For a red LED (about 2 V) at 20 mA on a 5 V supply, R = (5 − 2) / 0.02 = 150 Ω. Blue and white LEDs drop about 3 V, so around 100 Ω is enough at 5 V. If the result is not a standard value, pick the next higher one.

What power rating should the resistor have?

Work out the power it dissipates with P = I² · R or P = V² / R and choose a resistor rated for at least twice that. In the LED example, P = 0.02² × 150 = 0.06 W, so an ordinary 1/4 W resistor is more than enough. An undersized resistor heats up and may burn out or drift in value.

How do I drop 5 V to 3.3 V with a voltage divider?

With Vout = Vin · R2 / (R1 + R2) you need R2 to be twice R1: for example, R1 = 10 kΩ and R2 = 20 kΩ give 3.33 V. It works for level-shifting a 5 V logic signal into a 3.3 V microcontroller input, but not for powering anything: as soon as the load draws current, the output voltage sags.

Does Ohm’s law always hold?

Only for so-called ohmic materials, such as resistors and metal wires at constant temperature. An LED or a diode does not follow it: current grows exponentially with voltage. Nor does a filament bulb, whose resistance rises sharply as it heats up. Even so, at any single operating point you can still use R = V / I.