Circuit 3D

How an LED works

An LED, a light-emitting diode, is a diode that gives off light when current flows through it forward, in a color set by its semiconductor. It conducts once its forward voltage is reached, about 2 V for red, so a series resistor sets its current. On 5 V, a red LED at 20 mA needs (5 − 2) ÷ 0.02 = 150 Ω.

R = (Vsupply − VF) ÷ I

where VF is the LED’s forward voltage, about 2 V for red, and I its current, often 20 mA.

Its longer leg, the anode, goes toward the positive supply. Blink it with a 555 timer or a microcontroller and it becomes an LED flasher.

What is an LED?

An LED is a light-emitting diode: a semiconductor diode that gives off light when current flows through it the forward way.

LEDs light indicators, number displays, screens, torches and homes, using far less power than filament bulbs. In Figure 1, the lab’s LED glows brighter as its current rises, while the voltage across it barely changes.

Red, 10 mA: about 1.97 V across it, glowing about 71% as bright as at 20 mA.

Figure 1. The lab’s LED, from 0 to 30 mA. Its voltage barely moves while its light climbs with the current.

How does an LED work?

An LED works by recombination: forward biased, electrons and holes meet at its junction, and each pair gives up its energy as a particle of light, a photon.

The semiconductor’s band gap sets that energy, and so the color: aluminum gallium indium phosphide for red and amber, indium gallium nitride for green and blue. Most white LEDs are blue ones under a yellow phosphor.

What is an LED’s forward voltage?

An LED’s forward voltage is the voltage it drops while lit: about 2 V for red and amber, 2 to 3 V for green depending on its type, and about 3 V for blue and white.

The forward voltage barely changes with current, because the current climbs steeply once the LED conducts. Figure 2 shows the lab’s three colors turning on about 0.1 V apart.

1.82.02.22.4 102030 mA Voltage across the LED (V)

Red at 2 V: about 20 mA.

Figure 2. Current against voltage for the lab’s three LED colors, the dashed line at 20 mA. A tenth of a volt more multiplies the current by about seven.

Why does an LED need a resistor?

An LED needs a resistor because its current climbs steeply with voltage, so a supply even slightly above its forward voltage would drive far too much current; a series resistor sets the current instead.

The resistor takes whatever voltage the LED doesn’t, and Ohm’s law gives its size, as the LED resistor calculator works out. Small LEDs are usually run at about 20 mA, and many take up to about 30 mA; past that they overheat and fail.

Which leg of an LED is positive?

An LED’s longer leg, the anode, is positive and goes toward the supply; the shorter leg, the cathode, sits by a flat edge on the rim and goes toward negative.

The anode and cathode matter because an LED is a diode: put in backwards it simply stays dark, and a small LED can be damaged by more than about 5 V in reverse.

How does an LED flasher work?

An LED flasher works by letting a timer switch the LED: a 555 timer in astable mode charges and discharges a capacitor through two resistors, and lights the LED while its output is high.

The resistors and capacitor set the rhythm. A microcontroller can blink an LED from code instead, and some LEDs have a tiny flasher chip built in.

01234 Time (s) on off

R2 = 68 kΩ: on for 0.693 × 78 kΩ × 10 µF ≈ 0.54 s, off for 0.693 × 68 kΩ × 10 µF ≈ 0.47 s: about one blink a second.

Figure 3. The lab’s Fixed-Rate Beacon: a 555 timer with 10 kΩ, R₂ and 10 µF lights an LED while its output is high.

How do you design an LED circuit?

To design an LED circuit, size the resistor from the supply, the forward voltage and the current, R = (V − VF) ÷ I, and for a flasher, set the timing with the 555’s resistors and capacitor.

Example 1: choose an LED’s resistor

A red LED should run at 20 mA from 5 V. What resistor does it need?

Given
a 5 V supply and a red LED (about 2 V), run at 20 mA
Find
the resistor, R
Solution
The resistor takes the rest: 5 V − 2 V = 3 VR = 3 V ÷ 20 mA = 150 Ω, a standard size, giving 20 mA
Answer
R = 150 Ω

Example 2: time an LED flasher

A 555 flasher has R1 = 10 kΩ, R2 = 68 kΩ and a 10 µF capacitor. How fast does its LED blink?

Given
a 555 astable with R1 = 10 kΩ, R2 = 68 kΩ and C = 10 µF
Find
how long the LED is on and off, and the blink rate
Solution
On: 0.693 × (R1 + R2) × C = 0.693 × 78 kΩ × 10 µF ≈ 0.54 sOff: 0.693 × R2 × C = 0.693 × 68 kΩ × 10 µF ≈ 0.47 sRate: 1 ÷ (on + off) ≈ one blink a second
Answer
About one blink a second

Summary

Key equations

  • R = (V − VF) ÷ I its series resistor
  • ton = 0.693 × (R1 + R2) × C a 555 flasher, on
  • toff = 0.693 × R2 × C and off

Key terms

Forward voltage
The voltage it drops while lit.
Anode, cathode
Its + (long) and − (short, flat side) legs.
Band gap
The energy step that sets its color.
Astable
A 555 that switches on and off by itself.

Practice problems

  1. Which leg of an LED is the anode, the one that goes toward +?

  2. About what forward voltage does a red LED have?

  3. What resistor runs a red LED (2 V) at 20 mA from 5 V?

  4. What sets the color of an LED’s light?

  5. A 555 flasher is on for 0.54 s and off for 0.47 s. About how often does it blink?

FAQ

What does LED stand for?

Light-emitting diode: a diode that gives off light when current flows through it forward.

Can you connect an LED straight to a battery?

Not safely, except to a small coin cell whose own resistance limits the current. Otherwise the current runs away; use a series resistor.

Why won’t my LED light?

It may be in backwards, since the longer leg goes to +; its resistor may be far too large; or the supply may be below its forward voltage.

What is a WS2812B?

An addressable RGB LED with its own tiny controller chip. A chain of them takes color data over one signal wire, so a microcontroller can set every LED separately.

How do white LEDs work?

Most are blue LEDs coated with a yellow phosphor; the mix of blue and yellow light looks white.

What is an RGB LED?

Red, green and blue LEDs in one package. Mixing their brightness makes almost any color; the common-anode and common-cathode kinds have four legs.

Are LEDs more efficient than bulbs?

Yes: an LED bulb gives the light of a 60 W incandescent bulb from about 8 to 10 W.

How does an LED light work?

An LED light bulb has a small driver that turns mains AC into a low, steady DC current for a row of white LEDs, each a blue LED coated in yellow phosphor, so it needs far less power than a filament bulb.