⌁ Hardware & electronics

Ohm's law in practice: resistors, LEDs and power dissipation

Ohm's law applied to real cases: calculating an LED resistor, reading colour codes, series and parallel, the voltage divider and power dissipation.

Almost every basic electronics calculation comes down to a three-letter formula. Ohm's law links voltage, current and resistance: V = R × I. Memorising it is easy; knowing how to use it to choose a real component without burning it out is what separates a circuit that works from one that smokes.

The three quantities

  • Voltage (V, volts): the "push" that moves charges, the potential difference between two points.
  • Current (I, amperes): the amount of charge that passes in one second. In electronics we often think in milliamperes (mA).
  • Resistance (R, ohms, Ω): how much a component opposes the flow of current.

From the formula you get the other two forms: I = V / R and R = V / I. A useful picture is the plumbing one: voltage is pressure, current is flow rate, resistance is a narrower or wider pipe. It is not a perfect model, but it helps you reason.

The most common case: the resistor for an LED

An LED does not behave like a resistor: once a certain voltage is exceeded, its forward voltage, it conducts and the current rises rapidly. Without something to limit it, it burns out. That's why a resistor is placed in series.

The formula becomes:

R = (Vsupply − Vled) / I

Forward voltage values depend on the colour and the model and are found in the datasheet; as a rough guide, a common red LED is around 2 volts, a blue or white one around 3 volts.

Example with a 5 V supply, a 2 V red LED and a desired current of 15 mA:

R = (5 − 2) / 0.015 = 200 Ω

Resistors come in standard values: pick the nearest higher value, 220 Ω. The current will be slightly lower and the LED just a little dimmer: that's perfectly fine.

Same LED, 3.3 V supply: R = (3.3 − 2) / 0.015 ≈ 87 Ω, so you choose 100 Ω. With a 3 V white LED on a 3.3 V supply, however, the margin is minimal: the current becomes very sensitive to small variations and brightness hard to predict.

Don't forget power

Every resistor turns part of the energy into heat. The power dissipated is calculated with P = V × I, or P = R × I².

In the first example, 3 V drop across the resistor with 15 mA: P = 3 × 0.015 = 0.045 W. An ordinary quarter-watt resistor is more than enough.

But if you power an LED strip at 12 V with 200 mA and drop 6 V across a resistor, the power rises to 1.2 W: a quarter-watt resistor would heat up until it burned. Rule of thumb: choose a resistor with a power rating at least twice the calculated value.

Series and parallel

  • In series, resistances add up: 100 Ω + 220 Ω = 320 Ω.
  • In parallel, the total is always less than the smallest one. For two resistors: R = (R1 × R2) / (R1 + R2). Two 1000 Ω resistors in parallel give 500 Ω.

Parallel is useful when you don't have the exact value in the drawer, or to share the power across several components.

The voltage divider

Two resistors in series between supply and ground form a divider: at the midpoint you get an intermediate voltage.

Vout = Vin × R2 / (R1 + R2)

With Vin = 5 V, R1 = 10 kΩ and R2 = 20 kΩ you get about 3.3 V. It's the classic way to read a 5 V signal with an input that accepts at most 3.3 V, or to measure a battery's voltage with an analog input.

The limit to remember: a divider is not a power supply. As soon as you connect a load that draws current, the output voltage changes. It's fine for signals, not for powering circuits.

Reading colour codes

Through-hole resistors show their value with coloured bands. On four-band versions, the first two are digits, the third is the multiplier, the fourth the tolerance.

Colour Digit
Black 0
Brown 1
Red 2
Orange 3
Yellow 4
Green 5
Blue 6
Violet 7
Grey 8
White 9

Red, red, brown means 2, 2 and a multiplier of 10: 220 Ω. A gold band indicates a 5% tolerance. When in doubt, and with faded colours, a multimeter settles it in a moment.

A frequent mistake

Using a single resistor for several LEDs in parallel looks like a saving, but LEDs are never identical: the one with the lowest forward voltage takes more current than the others, heats up, shifts its characteristics further and may fail first. Each LED, or each branch of LEDs in series, needs its own resistor.

In short

  • V = R × I: current and resistance follow from it.
  • The resistor for an LED is (Vsupply − Vled) / I, rounded up to the next standard value.
  • Always calculate the power dissipated and choose a twofold margin.
  • The voltage divider is for signals, not for supplying power.
  • One LED, one resistor: no LEDs in parallel on a single resistor.
MM
Marco Marzaduri

Marco Marzaduri works in cybersecurity, digital forensics and web development. With degrees in computer science and psychology, he combines technical analysis with an understanding of the human factor.

Read also