Diodes and LEDs
A diode lets current through one way only, and that one trick does a surprising amount of work. This volume shows why a silicon diode takes about 0.7 V, how to choose the resistor every LED needs, how one diode guards a circuit against a reversed battery, how four diodes and a capacitor turn alternating current into steady direct current, and how a Zener diode holds a voltage.
- How a diode conducts one way and blocks the other, and why this course calls its drop 0.7 V
- How to choose the series resistor for one LED or several
- How a series diode protects a circuit from a reversed battery, and what it costs
- How half-wave and bridge rectifiers work, and how a smoothing capacitor reduces the ripple
- How a Zener diode holds a steady voltage, and where its limits are
- Volume 03: capacitors and the RC time constant.
4.1 The diode: a one-way valve
A diode lets current flow one way only. Forwards, it conducts and takes about 0.7 V; backwards, it blocks. It is a one-way valve for current.
The one-way valve
A diode has two leads. Current flows in at the anode and out at the cathode. The symbol is an arrow pointing the way current can flow, with a bar across its tip. The bar matches the stripe painted round one end of a real diode: that end is the cathode.
circuit one-way: L1 carries 100 mA and lights; L2 carries 0 A
(9 V - 0.7 V) / 83 Ω = 100 mA
L1's diode is forwards, so it conducts. It takes 0.7 V, and the other 8.3 V drives the current through L1. L2's diode is backwards, so no current flows through it at all.
Why 0.7 V?
A real silicon diode does not switch on sharply. Below about 0.6 V, hardly any current flows. Above it, the current climbs very steeply:
1 mA flows at 0.655 V
10 mA flows at 0.714 V
40 mA flows at 0.750 V
Over the currents that circuits use, the voltage hardly moves. So this course treats a conducting silicon diode as a fixed forward voltage of 0.7 V, and a diode that is not conducting as an open gap.
The stripe on a diode marks the cathode. Current flows into the anode and out of the cathode - the way the symbol's arrow points.
A diode's anode is at 5 V and its cathode at 9 V. Does it conduct?
Show the answer
Answer: A. Current can only flow from anode to cathode, which needs the anode about 0.7 V higher than the cathode. Here the cathode is 4 V higher, so the diode is backwards and no current flows.
4.2 LEDs and their series resistor
An LED is a diode that gives out light. Once it conducts, its voltage barely changes, so it cannot limit its own current. A resistor in series sets the current.
A diode that shines
LED stands for light-emitting diode. It works one way only, like any diode, but its forward voltage is higher, and depends on its colour:
| Colour | Forward voltage, roughly |
|---|---|
| Red | 2 V |
| Yellow | 2.1 V |
| Green | 2.2 V, or 3 V for bright green |
| Blue | 3 V |
| White | 3 V |
The longer lead is the anode, and the flat edge on the rim marks the cathode. Most small LEDs want about 10 mA to 20 mA.
The series resistor
circuit led: 20 mA flows; the LED drops 2 V and R1 has 3 V across it
the LED uses 40 mW and R1 turns 60 mW into heat
The LED takes its 2 V, and R1 takes the rest. Ohm's law on R1 then sets the current. Turned round, it gives the resistor for any LED:
R = (supply voltage - LED voltage) / current
5 V, a blue LED (3 V) at 10 mA: R = 200 Ω; the E12 value above is 220 Ω, giving 9.09 mA
3.3 V, a red LED (2 V) at 10 mA: R = 130 Ω; the E12 value above is 150 Ω, giving 8.67 mA
12 V, three red LEDs (2 V each) in series at 20 mA: R = 300 Ω; the E12 value above is 330 Ω, giving 18.2 mA
Round up to the next E12 value, so the current comes out slightly below the target, never above. LEDs in series share one current and one resistor, and their voltages add.
Why the resistor is not optional
Without a resistor, nothing but the battery's own internal resistance limits the current:
an LED straight across a 5 V battery with 1 Ω inside: 3 A - the LED burns out at once
Connecting an LED straight to a supply, or to a microcontroller pin, with no resistor. Its voltage stays near its forward voltage whatever the current, so the current rises until something burns out. Always put a resistor in series.
A green LED of 2.2 V runs from 5 V at 14 mA. Which resistor sets that current?
Show the answer
Answer: C. R = (5 V - 2.2 V) / 14 mA = 2.8 V / 14 mA = 200 Ω.
4.3 Protecting against a reversed battery
A battery fitted backwards can destroy a circuit in a moment. One diode in series stops that: it conducts when the battery is the right way round, and blocks when it is reversed.
One diode in series
circuit protect: battery the right way: the circuit gets 8.3 V and 83 mA; reversed: 0 V and 0 A
Reversed, the diode blocks, and nothing flows. Nothing is damaged, and the circuit works again as soon as the battery is turned round.
The price
The protection costs the diode's 0.7 V, all the time, and the power that goes with it:
the diode wastes 0.7 V x 83 mA = 58.1 mW
A Schottky diode drops only about 0.3 V, so it wastes less:
with a Schottky diode dropping 0.3 V: the circuit gets 8.7 V
For bigger currents, designers use a transistor wired to act like a diode with almost no drop. Volume 05 introduces the transistors that make that possible.
A 5 V supply feeds a circuit through a protection diode that drops 0.7 V. What does the circuit get?
Show the answer
Answer: B. The diode takes its 0.7 V, leaving 5 V - 0.7 V = 4.3 V for the circuit.
4.4 Rectifiers: AC to DC
A rectifier turns alternating current into direct current by letting it through one way only. A bridge rectifier uses both halves of the wave, and a smoothing capacitor fills in the gaps.
Half-wave: one diode
Every plug-in power adapter starts with alternating current, which swings positive and negative. Here the input is a 10 V peak at 50 Hz:
circuit half-wave: solved at every 0.5 ms for 40 ms; the output peaks at 9.3 V
The output is always positive, but it spends half its time at zero. That is direct current of a sort, but a very lumpy one.
The bridge: four diodes
A bridge rectifier uses four diodes to catch both halves. When the input's left side is positive, D1 and D4 conduct. When its right side is positive, D2 and D3 do. Either way, the current flows down through the load, from its top to its bottom:
circuit bridge: solved at every 0.5 ms for 40 ms, without C1; the output peaks at 8.6 V
Smoothing
A capacitor across the output charges up at each peak, then feeds the load while the input falls away. It only tops up near the peaks. What is left is a small ripple:
with C1 the output ripples between 7.88 V and 8.60 V: a ripple of 0.72 V
rule of thumb: ripple = load current / (2 x frequency x C) = 8.6 mA / (2 x 50 Hz x 100 µF) = 0.86 V
the same C1 on the half-wave rectifier ripples by 1.54 V
The rule of thumb gives a little more ripple than the real circuit, which is the safe side to be wrong on. A bigger capacitor, or a smaller load current, means less ripple. The half-wave rectifier ripples twice as much, because it tops up only once a cycle.
How the rectifier numbers were worked out
Without C1, the solver worked out the whole circuit afresh every 0.5 ms, with the input at that moment's voltage, choosing for itself which diodes conduct. With C1, the rule is simple: while the rectified input is above the capacitor's voltage, the diodes conduct and the capacitor follows the input. Otherwise they block, and the capacitor empties into RL along its RC curve. That was stepped every 0.01 ms.
Why is a bridge rectifier's output 1.4 V below the input's peak, not 0.7 V?
Show the answer
Answer: D. In a bridge, the current always goes through one diode on the way to the load and another on the way back. Two diodes take 0.7 V each: 1.4 V in all.
4.5 Zener diodes
A Zener diode is made to conduct backwards at a chosen voltage. Fitted backwards with a resistor, it holds its voltage steady, even when the supply changes.
Conducting backwards on purpose
An ordinary diode blocks backwards until the voltage is so high that it breaks down. A Zener diode is made to break down at a low, exact voltage, such as 3.3 V or 5.1 V, and it takes no harm from it. Forwards, it behaves like any diode.
circuit zener: Vout = 5.1 V; R1 carries 14.7 mA, RL takes 5.1 mA and the Zener takes 9.58 mA
R1 carries a current from the supply, and the load takes what it needs. The Zener soaks up the rest, and while it conducts, its voltage stays at 5.1 V.
A steady output from a changing supply
| Supply | Vout | Zener current |
|---|---|---|
| 10 V | 5.1 V | 5.33 mA |
| 12 V | 5.1 V | 9.58 mA |
| 14 V | 5.1 V | 13.8 mA |
The supply changes by 4 V, but the output does not move. Only the Zener's share of the current changes.
The limit
The Zener can only hold its voltage while there is current left over for it. A load that wants more than R1 can supply takes it all, and then the Zener switches off:
with a 200 Ω load instead: the Zener turns off and Vout falls to 3.58 V
A Zener also wastes power, most of all with no load at all:
the Zener turns 74.9 mW into heat with no load
So Zeners suit small, light jobs, such as a reference voltage. To power a real circuit, Volume 07's voltage regulators do the job far better.
In the Zener circuit, the supply rises from 12 V to 14 V. What happens?
Show the answer
Answer: C. While the Zener conducts, it holds 5.1 V. The extra current from R1 goes through the Zener, which rises from 9.58 mA to 13.8 mA, and the load does not notice.
What you learned
- A diode conducts from anode to cathode, taking about 0.7 V, and blocks the other way.
- An LED needs a series resistor: R = (supply voltage - LED voltage) / current, rounded up to an E12 value.
- A series diode protects a circuit from a reversed battery, at the cost of its 0.7 V; a Schottky diode costs less.
- A half-wave rectifier uses one diode; a bridge uses four and loses 1.4 V; a smoothing capacitor leaves only a ripple.
- A Zener diode, fitted backwards with a resistor, holds its voltage while there is current to spare.
Key words from this volume
Every word below has a plain-English entry in the glossary.
- Diode
- Anode
- Cathode
- Forward voltage
- LED (light-emitting diode)
- Schottky diode
- Rectifier
- Bridge rectifier
- Smoothing capacitor
- Ripple
- Zener diode
Practice
A red LED on 9 V
A red LED (2 V) should run at 15 mA from a 9 V battery. Which resistor, and what current does it give?
Show the solution
9 V, a red LED (2 V) at 15 mA: R = 467 Ω; the E12 value above is 470 Ω, giving 14.9 mA
Two white LEDs
Two white LEDs (3 V each) run in series from 9 V at 20 mA. Which resistor do they need?
Show the solution
9 V, two white LEDs (3 V each) at 20 mA: R = 150 Ω; the E12 value is 150 Ω, giving 20 mA
150 Ω is itself an E12 value, so the current comes out exactly on target.
A 3.3 V Zener
A 3.3 V Zener and a 330 Ω resistor run from 9 V, with a 1 kΩ load. Find the output and the currents.
Show the solution
9 V, 330 Ω and a 3.3 V Zener with a 1 kΩ load: Vout = 3.3 V; R1 17.3 mA, load 3.3 mA, Zener 14 mA
A bigger bridge
A bridge rectifier is fed with an alternating input of 12 V peak. What is the output's peak?
Show the solution
a bridge fed with a 12 V peak gives a 10.6 V peak
Two diodes are always in the path, so the output peak is 12 V - 1.4 V.
Interview corner
Why an LED needs a resistor
"Why does an LED need a series resistor, when a lamp doesn't?"
Show the solution
"A lamp's filament is a resistor, so it limits its own current. An LED is a diode: once it conducts, its voltage stays almost fixed at its forward voltage, however much current flows. So nothing in the LED limits the current, and a supply only slightly above the forward voltage drives far too much. A series resistor takes up the difference between the supply and the forward voltage, and Ohm's law on that resistor sets the current."
Volume 05 meets the transistor, which lets a small current switch a large one on and off.