Every component so far (resistors, capacitors, inductors) treats current the same way in both directions. A diode does not: it lets current through one way and blocks it the other, like a non-return valve in a water pipe. That one trick lets you light an LED, protect a circuit from a battery put in backwards, absorb the spike from a relay coil (the problem raised at the end of Basic Electronics 4), hold a voltage steady, and turn the alternating current from a transformer into the direct current a robot's electronics need. This chapter builds on Ohm's law (Basic Electronics 1), series and parallel rules (Basic Electronics 2), the voltage divider (Basic Electronics 3) and the capacitor and inductor laws (Basic Electronics 4).
1. The diode
One-way current
A diode has two legs: the anode (A) and the cathode (K). Conventional current flows easily from anode to cathode, which is the way the triangle in the symbol points. The bar is the cathode, and on a real diode a painted band marks that end.
Symbol and the real part:
anode cathode
A o-----|>|-----o K current flows A to K (arrow direction)
( A )==[=====|]==( K ) 1N4001: the band is on the CATHODE endForward biased (anode more positive than cathode by about 0.6 to 0.7 V or more):
it conducts, and drops about 0.7 V whatever the current.
Reverse biased (anode more negative): it blocks, apart from a leakage current
of nanoamps. Beyond its reverse-voltage rating it breaks down and is destroyed
(a Zener diode is built to survive this, section 3).
Water analogy: a spring-loaded check valve. It needs a small push (about 0.7 V) to open,
then lets everything through; pushed backwards it stays shut.
What is inside: the PN junction (briefly)
A silicon diode is two layers of silicon joined together. One layer (P) is doped to have mobile positive "holes"; the other (N) has mobile electrons. Where they meet, electrons and holes cancel and leave a thin depletion region with no free carriers, and an electric field across it that acts as a built-in barrier of about 0.6 to 0.7 V for silicon. A forward voltage larger than the barrier pushes carriers across; a reverse voltage widens the barrier and nothing flows. You do not need more detail than this to use diodes; the exact current is described by one equation.
The Shockley equation
I = Is x ( e^( V / (n x Vt) ) - 1 )
I diode current (positive = forward) V voltage across it, anode minus cathode
Is saturation (leakage) current: depends on the part; about 1e-14 A for a small
silicon signal diode (used below as an illustration; real parts vary from 1e-15 to 1e-8 A)
n ideality factor, 1 to 2 (use 1 here)
Vt thermal voltage = k T / q = 1.381e-23 x 300 / 1.602e-19 = 25.85 mV at 300 K (about 27 C)
Forward, V much greater than Vt: the -1 can be ignored, so I = Is x e^(V / Vt)
Reverse, V much less than -Vt: e^(...) goes to 0, so I = -Is (just the tiny leakage)Solve it for the voltage needed to carry a chosen current (take logs):
V = n x Vt x ln( I / Is )
I = 1 uA: V = 0.02585 x ln(1e-6 / 1e-14) = 0.02585 x 18.42 = 0.476 V
I = 10 uA: V = 0.536 V
I = 100 uA: V = 0.595 V
I = 1 mA: V = 0.02585 x ln(1e11) = 0.02585 x 25.33 = 0.655 V
I = 10 mA: V = 0.714 V
I = 100 mA: V = 0.774 V
Every TEN-fold increase in current adds only Vt x ln(10) = 59.5 mV. So over a range
of 100,000 to 1 in current the voltage only moves from 0.48 V to 0.77 V. That is why
"a silicon diode drops about 0.7 V" is a good rule: the current can change enormously
while the voltage barely moves.Small-signal (dynamic) resistance at a given current: rd = n x Vt / I
at 1 mA: rd = 0.02585 / 0.001 = 25.9 ohm at 10 mA: 2.6 ohm at 100 uA: 259 ohm
Temperature: the barrier falls about 2 mV for each degree C of warming.
From 25 C to 75 C (+50 C), the drop falls by about 100 mV.
A diode in a circuit: the load-line idea
The diode and its resistor share the supply, and the same current flows through both. You can solve it two ways. The quick way assumes the drop is a fixed Vf (0.7 V). The exact way is repeated guessing against the equation.
5 V o----[ 1 k ]----|>|---- 0 V 1N4148-type diode, forward biasedQuick method (constant drop 0.7 V):
I = (5 - 0.7) / 1000 = 4.30 mA
Exact method: the resistor says I = (5 - V)/1000, the diode says V = 0.02585 x ln(I / 1e-14).
Guess V, find I from the resistor, find the V that I needs, repeat:
guess V = 0.70: I = 4.300 mA -> V = 0.02585 x ln(4.3e-3 / 1e-14) = 0.6925 V
guess V = 0.6925: I = 4.3075 mA -> V = 0.6925 V (settled)
Answer: V = 0.692 V, I = 4.31 mA. The 0.7 V rule is within 1 % of the current.
Reverse the diode: no current flows, so there is no voltage across the resistor,
and the whole 5 V appears across the diode (the meter shows 5.00 V across it).
Common diodes
Part
Kind
Forward drop (typical)
Max current
Max reverse voltage
Use
1N4148
Small-signal silicon
0.62 V at 5 mA
200 mA
100 V
Logic, signals, protecting a signal pin; fast
1N4001 to 1N4007
Rectifier silicon
0.9 V at 1 A
1 A
50 V (1N4001) to 1000 V (1N4007)
Power rectifiers, flyback across a relay or small motor
1N5819
Schottky
0.45 V at 1 A
1 A
40 V
Low-loss rectifier, polarity protection, flyback across a motor
BZX55C5V1 (and similar)
Zener
0.7 V forward; 5.1 V in reverse
500 mW
(breakdown is the point)
Voltage reference or clamp (section 3)
LED
Light-emitting
1.8 to 3.3 V by colour
20 mA
about 5 V only
Indicator (section 2)
Three ratings to read on every datasheet
Maximum forward current (average, and a higher surge value), maximum reverse voltage (written VR or PIV, the peak inverse voltage), and the forward drop at your working current. Power lost in the diode is P = Vf × I, so a 1 A silicon diode at 0.9 V wastes 0.9 W and gets warm.
2. LEDs and their resistors
A light-emitting diode is a diode whose junction gives out light when current flows. It follows the same exponential curve, but its forward drop is higher (the barrier depends on the semiconductor material, which also sets the colour). The brightness follows the current, not the voltage, and the current rises steeply with a tiny voltage change, so an LED must never be connected straight to a supply. A series resistor sets the current.
Forward voltage by colour
Colour
Typical Vf at 10 to 20 mA
Typical working current
Notes
Infrared (remote control)
1.2 V
20 to 100 mA
Not visible; a phone camera shows it
Red
1.8 to 2.0 V
5 to 20 mA
The classic indicator
Yellow / amber
2.0 to 2.1 V
5 to 20 mA
Green
2.0 to 2.2 V (3.0+ V for the bright "pure" type)
5 to 20 mA
Check the datasheet
Blue, white
3.0 to 3.3 V
5 to 20 mA
Need more than 3.3 V of supply to run properly
The resistor calculation
The resistor is in series with the LED, so it carries the same current I. Kirchhoff's voltage law (Basic Electronics 2) says the supply Vs is shared between the LED drop and the resistor drop; the resistor gets what the LED does not use:
Vs o---[ R ]---|>|---o 0 V (the LED's triangle points towards 0 V; anode on the R side)
Vs = V(R) + Vf = I x R + Vf so R = (Vs - Vf) / I
Then round R UP to the next standard value (E12: 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82 x powers of ten).
A slightly higher R gives a slightly lower current, which never exceeds the LED rating.Example 1: red LED (Vf = 2.0 V), 5 V supply, 10 mA wanted
R = (5 - 2.0) / 0.010 = 300 ohm -> next E12 value: 330 ohm
Actual current: I = (5 - 2.0) / 330 = 9.09 mA
Resistor power: P = I^2 R = 0.00909^2 x 330 = 27.3 mW (a 1/4 W resistor is plenty)
LED power: 2.0 x 0.00909 = 18.2 mW
Example 2: the same red LED from a 3.3 V logic pin, 8 mA wanted
R = (3.3 - 2.0) / 0.008 = 162.5 ohm -> next E12 value: 180 ohm
Actual current: 1.3 / 180 = 7.22 mA (if you choose 150 ohm, I = 8.67 mA: also fine for most LEDs)Example 3: blue LED (Vf = 3.2 V), 5 V supply, 15 mA wanted
R = (5 - 3.2) / 0.015 = 120 ohm (exactly an E12 value) Actual current 15.0 mA
On a 3.3 V supply the same LED has only 0.1 V across the resistor. It will be dim or
off and its brightness will depend on the exact Vf. Use 5 V, or a boost converter.
Why the voltage drop spread matters: the LED's Vf varies +/-0.2 V between samples.
A SMALL resistor (little headroom) gives a large current error; a bigger headroom
gives a steady current. At 5 V and 330 ohm: Vf 1.8 V gives 9.7 mA, Vf 2.2 V gives 8.5 mA.
At 3.3 V and 180 ohm: the same two LEDs give 8.3 mA and 6.1 mA: a larger spread.
Same 330 ohm resistor on 5 V, different colours (typical Vf):
Colour Vf Current = (5 - Vf)/330 Brightness
Red 2.0 V 9.09 mA good
Yellow 2.1 V 8.79 mA good
Green 2.1 V 8.79 mA good
Blue 3.2 V 5.45 mA fine (blue LEDs are very bright)
Typical "5 mm" indicators are bright at 2 to 5 mA; 20 mA is the maximum and is rarely needed.
Never power an LED without a resistor
Without a series resistor the LED's tiny dynamic resistance lets the current rise until the LED, or the pin driving it, burns out. A microcontroller pin typically supplies only 8 to 40 mA in total depending on the board. An LED also blocks only about 5 V in reverse: connect it backwards to more than that and it can fail. The long leg is the anode (+); the flat edge on the case is the cathode (−).
Several LEDs: series or parallel?
SERIES: the same current flows through all, the drops add. One resistor serves the chain.
9 V o---[ R ]---|>|---|>|---|>|---o 0 V 3 red LEDs in a chain
R = (9 - 3 x 2.0) / 0.015 = 3.0 / 0.015 = 200 ohm -> next E12: 220 ohm
Actual current: 3.0 / 220 = 13.6 mA. Resistor power 13.6 mA^2 x 220 = 41 mW. Battery draws 13.6 mA.
The supply must exceed the total drops: three blue LEDs need 3 x 3.2 = 9.6 V, so 9 V is not enough.
If any LED fails open, the whole chain goes out.
PARALLEL: the same voltage across each. GIVE EACH LED ITS OWN RESISTOR.
5 V o----+-------+-------+
| | |
[330] [330] [330]
| | |
|>| |>| |>|
| | |
0 V o----+-------+-------+
Each branch: (5 - 2.0) / 330 = 9.09 mA. Total supply current = 3 x 9.09 = 27.3 mA.
Power from the supply: 5 x 27.3 mA = 136 mW. The LEDs take 3 x 2.0 x 9.09 mA = 54.5 mW (40 %);
the rest is lost as heat in the resistors. In the series chain above, the LEDs take 3 x 2.0 = 6 V of the
9 V (67 %), which is why series is the more efficient layout when the supply is high enough.
Why not share ONE resistor across parallel LEDs? Their Vf differ slightly. The LED with
the lowest Vf takes more than its share, heats up, its Vf falls further (the temperature effect above)
and it hogs still more current, a runaway. Separate resistors force each branch to its own current.
Layout
Supply voltage needed
Supply current
Resistors
Best for
Series
Sum of the Vf values plus headroom
One LED's current
One
High supply voltage (9 V, 12 V), saving battery current
Parallel (own resistors)
One Vf plus headroom
N times one LED's current
One per LED
Low supply voltage (3.3 V, 5 V), independent switching
Multiplexing: lighting many LEDs with few pins
Your eye averages light over about 10 ms. If you switch LEDs on and off faster than about 100 times a second, they look steadily lit, with a brightness proportional to the average current. Multiplexing uses this to share the driver pins among several LEDs by turning on just one group at a time and cycling through them quickly. A 4-digit seven-segment display, for example, joins the same segment (a to g) of all four digits together, with one common line per digit.
Four digits take turns, each on for one quarter of the frame:
time: 0--2.5 ms 2.5--5 ms 5--7.5 ms 7.5--10 ms (then repeat; 100 frames/s)
digit 1: ON off off off
digit 2: off ON off off
digit 3: off off ON off
digit 4: off off off ON
duty cycle = 1/4 = 25 % average current = peak current x duty cycle
To get the same brightness as a steady 5 mA, each pulse must carry 4 times as much:
peak = 5 mA / 0.25 = 20 mA (exactly the LED maximum: do not push higher)
resistor for a 5 V supply and red LEDs: R = (5 - 2.0) / 0.020 = 150 ohm (E12 value)
Perceived brightness is close to the average current, so equal to a steady 5 mA LED.
Pins saved: 4 digits x 8 segments = 32 LEDs. Driven directly that needs 32 pins; multiplexed
it needs 8 segment lines + 4 digit lines = 12.
One digit's pulse carries up to 8 segments x 20 mA = 160 mA, which is more than a microcontroller pin
can supply, so each digit line needs a transistor switch (Basic Electronics 6).
Basic Electronics 10 drives displays from a microcontroller using this method.
3. Zener diodes
If you apply a large enough reverse voltage to an ordinary diode it suddenly conducts, and usually dies. A Zener diode is designed so that this reverse breakdown happens at a precise voltage (3.3 V, 5.1 V, 9.1 V and so on, written Vz) and is survivable. Forward, it behaves like an ordinary diode; reversed, it holds its terminals at about Vz while current flows, as long as you limit that current with a series resistor so that the power stays below the rating.
Zener symbol: the diode symbol with a bent bar, wired REVERSED in use:
cathode (K, bar) on the more positive side, anode (A) towards 0 V
Behaviour at a glance (for a 5.1 V part):
forward (A positive): like any diode, drops about 0.7 V
reverse, below 5.1 V: almost no current (a little leakage)
reverse, at about 5.1 V: conducts, and the voltage stays near 5.1 V while the
current rises from a few mA to tens of mA
So it holds its terminals near Vz, provided a series resistor keeps the current
inside its power rating: Iz(max) = P(rated) / Vz = 0.5 / 5.1 = 98 mA.
The shunt regulator
Vin o-----[ R ]-----+-----------+-----o Vout (about Vz)
| |
K | |
--- [ RL ] the load
/_\ A |
| |
0 V o----------------+-----------+-----o 0 V
Wire the Zener with its cathode (bar) on the +Vout node and its anode on 0 V.
Currents: I(R) = (Vin - Vz) / R = Iz + IL (the Zener takes whatever the load does not)
Design: Vin = 8 to 10 V (a run-down 9 V battery), Vz = 5.1 V, load 0 to 20 mA.
The Zener only regulates while it carries at least about 5 mA (keep Iz_min = 5 mA).1. The WORST case for keeping the Zener in regulation is the lowest Vin and the biggest load:
R_max = (Vin_min - Vz) / (IL_max + Iz_min) = (8 - 5.1) / (0.020 + 0.005) = 2.9 / 0.025 = 116 ohm
Round DOWN (a smaller R gives more current, which keeps Iz above its minimum): E24 value 110 ohm.
2. Check both ends with R = 110 ohm:
Vin = 8 V, full load: I(R) = 2.9 / 110 = 26.4 mA -> Iz = 26.4 - 20 = 6.4 mA (above 5 mA, good)
Vin = 10 V, NO load: I(R) = 4.9 / 110 = 44.5 mA -> Iz = 44.5 mA (the worst case for heat)
3. Power ratings:
Zener, worst case: Pz = Vz x Iz = 5.1 x 0.0445 = 227 mW -> use a 500 mW Zener
Resistor, worst case: PR = I^2 x R = 0.0445^2 x 110 = 218 mW -> use a 1/2 W resistor (1/4 W would run too hot)
4. Reality check:
At 9 V and full load: I(R) = 3.9 / 110 = 35.5 mA, so the input power is 9 x 0.0355 = 319 mW,
and the output power is 5.1 x 0.020 = 102 mW: efficiency 102 / 319 = 32 %.
The rest is heat, and with no load the Zener still burns its full current.
Load regulation: the Zener has a small dynamic resistance (about 10 to 30 ohm for a 5.1 V part),
so Vout moves by a few tens of mV when the load changes. Fine for a reference, poor for a supply.
When to use a regulator IC instead
Use a Zener for a reference voltage or a small current. For a robot's main 5 V or 3.3 V supply use a linear regulator (such as the 7805 or an LDO) or a switching converter, introduced in Basic Electronics 9. They hold the voltage far better, handle hundreds of milliamps, and waste far less current than a Zener with its resistor.
Zener as a clamp
A signal that may go up to 5 V is going into a 3.3 V input pin. Clamp it with a 3.3 V Zener:
signal o----[ 1 k ]----+-----o to the 3.3 V input pin
|
K |
--- 3.3 V Zener, cathode (bar) to the input node, anode to 0 V
/_\ A
|
0 V o---------------+-----o 0 V
Signal at 5 V: current = (5 - 3.3) / 1000 = 1.7 mA; the pin sees 3.3 V. Zener power = 3.3 x 1.7 mA = 5.6 mW.
Signal at 3 V: the Zener does not conduct (Vz is 3.3 V); the pin sees the signal.
A real 3.3 V Zener already leaks a little below 3.3 V and the voltage is only +/-5 % accurate, so for
critical work use a divider or a level-shifter (logic levels are covered in Basic Electronics 8).
4. Schottky diodes
A Schottky diode joins metal to silicon instead of two types of silicon. That gives a lower barrier (a forward drop of about 0.2 to 0.45 V instead of 0.6 to 0.9 V) and a very fast switch-off, because no stored charge has to be cleared. The price is a larger reverse leakage current and a lower reverse-voltage rating, typically 20 to 60 V for common parts.
Silicon (1N4001)
Schottky (1N5819)
Forward drop at 1 A
about 0.9 V
about 0.45 V
Power lost at 1 A
0.9 W
0.45 W
Switching speed
Slow (microseconds)
Very fast (nanoseconds)
Reverse leakage
about 5 µA or less
up to a few mA when hot
Max reverse voltage
50 to 1000 V
20 to 60 V (common types)
Best for
Mains rectifiers, high voltage
Low-voltage supplies, battery circuits, flyback in switching converters, protection when every tenth of a volt counts
5. Flyback and protection diodes
Flyback (freewheel) diode: the fix promised in Basic Electronics 4
Basic Electronics 4 showed that switching off the current through a coil makes a huge voltage, v = L di/dt, that can destroy the switching transistor. The flyback diode gives the coil's current somewhere to go. Take the same 12 V relay coil as before: R = 240 Ω, L = 240 mH, running current 50 mA.
+12 V o--------+----------------+
| |
( L ) coil --- K flyback diode: cathode (bar) to the +12 V side,
[ R ] /_\ A anode to the switched node
| |
+----------------+------o switched node (to the transistor, then 0 V)
Switch ON: the coil current flows from +12 V down through the coil to the switch.
The diode has +12 V on its cathode and 0 V on its anode: reverse biased, it does nothing.
Switch OFF: the coil keeps pushing the same current the same way, downward through the coil.
It leaves the coil's bottom end, which swings positive, and returns to the top end
through the diode: coil bottom -> diode anode -> diode cathode -> coil top.
The switched node can only rise to about 12 V + 0.7 V = 12.7 V.
In that loop the diode's drop and the coil's own resistance use up the energy. With a clamp voltage Vc across the loop and the coil's resistance R, the current decays according to L di/dt = −(iR + Vc):
Solving (same method as the RL circuit in Basic Electronics 4, starting at I0 = 50 mA):
i(t) = (I0 + Vc/R) x e^(-t R / L) - Vc/R tau = L / R = 0.24 / 240 = 1 ms
Case 1: ideal diode (Vc = 0): i(t) = 50 mA x e^(-t / 1 ms) 10 % (5 mA) after 2.30 ms
Case 2: real diode (Vc = 0.7 V):
Vc / R = 0.7 / 240 = 2.92 mA
i(t) = 52.92 mA x e^(-t / 1 ms) - 2.92 mA
10 % of 50 mA = 5 mA when e^(-t/tau) = (5 + 2.92) / 52.92 = 0.1496, so t = 1.90 ms
current reaches zero at t = 1 ms x ln(1 + 50 / 2.92) = 1 ms x ln(18.1) = 2.90 ms
The trade-off: the diode keeps the current flowing for about 3 ms, so a relay is slower to drop out
(and a motor slower to stop braking). To release faster, let the voltage across the coil rise a
little: put a Zener in series with the flyback diode (the Zener is reverse-biased in the loop:
its cathode faces the diode's cathode)
Clamp = Zener 24 V + diode 0.7 V: Vc = 24.7 V
Vc / R = 24.7 / 240 = 102.9 mA
current reaches zero at t = (L/R) ln(1 + I0 R / Vc) = 1 ms x ln(1 + 12 / 24.7) = 1 ms x ln(1.486) = 0.396 ms
10 % (5 mA) at t = 0.349 ms
The switching transistor now sees 12 + 24.7 = 36.7 V when it turns off, so choose one rated
comfortably above that (60 V or more), not a general-purpose 40 V part.
Fit the diode the right way round
A flyback diode fitted backwards short-circuits the supply through the diode the moment the switch turns on, because the diode is then forward biased across the coil's supply. It will overheat, blow, or damage the supply. Cathode (band) to the positive side of the coil, anode to the switched side. For a coil switched by a transistor, almost any 1N4001 or 1N4148 suffices for a small relay (the diode must carry the coil current, 50 mA here, at the moment of switching). For motors use a 1N4001 to 1N4007 or a Schottky such as the 1N5819. Wiring this to a transistor is in Basic Electronics 6, and relays and motors are in Basic Electronics 9.
Protecting an input pin
Two small diodes (1N4148 or a Schottky such as the BAT85) can clamp a signal pin to the supply rails. One goes from the pin up to +V (anode on the pin) so the pin cannot go more than about 0.7 V above the supply; the other from 0 V up to the pin (cathode on the pin, anode on 0 V) so it cannot fall below −0.7 V. Put a 1 kΩ resistor in the signal line to limit the current through whichever diode conducts. Most microcontroller pins already have these diodes built in, but only for a few milliamps.
Reverse-polarity protection
Method 1: a diode in series with the supply (anode on the battery side)
battery + o----|>|----o +V to the circuit
battery - o-------------o 0 V
Connected correctly the diode conducts; the circuit sees the supply minus the diode drop.
Connected backwards the diode blocks and nothing happens.
9 V battery, circuit draws 100 mA:
silicon 1N4001: drop 0.7 V circuit sees 8.3 V power lost 0.7 x 0.1 = 70 mW
Schottky 1N5819: drop 0.3 V circuit sees 8.7 V power lost 0.3 x 0.1 = 30 mW
12 V and a 500 mA load:
silicon (0.75 V at 0.5 A): 11.25 V delivered; lost 0.375 W (3.1 % of the 12 V x 0.5 A = 6 W)
Schottky (0.40 V at 0.5 A): 11.6 V delivered; lost 0.20 W
Method 2: a diode ACROSS the supply, after a fuse (the shunt, or crowbar, type)
battery + o----[ fuse ]----+-----o +V to the circuit
|
K --- diode across the supply: cathode (bar) to +, anode to 0 V
/_\ A
|
battery - o----------------+-----o 0 V
Correct polarity: the diode is reverse biased and does nothing, and there is no voltage loss.
Reversed battery: the diode conducts, takes the current and blows the fuse in a few milliseconds,
and the circuit sees only about -0.7 V. Needs a diode that can pass the fuse's blowing current briefly.
Method 3 (an advanced one) uses a P-channel MOSFET with almost no drop: Basic Electronics 6.
6. Rectifiers: AC to DC
A transformer or an AC adapter delivers alternating voltage, which rises and falls through zero (Basic Electronics 1). Electronics needs a one-way voltage. A diode passes only the positive half-cycles, which is rectification. Remember the AC maths: a sine wave of RMS voltage Vrms has peak Vpk = Vrms × √2 = 1.414 Vrms. A 9 Vrms source peaks at 12.73 V.
Half-wave rectifier
AC o----|>|----+----+-----o +out
A K | |
===== [ RL ] smoothing capacitor C and load RL, both to 0 V
| |
AC o----------------+----+-----o 0 V (the other AC lead)
Only positive half-cycles pass. The output is a series of humps, one per cycle (50 per second on UK mains).
Peak output = Vpk - Vf = 12.73 - 0.7 = 12.03 V for 9 Vrms
Average (no capacitor, resistive load) = Vpeak / pi = 12.03 / 3.14159 = 3.83 V (wasteful: half the time nothing flows)
Full-wave bridge rectifier
Four diodes in a diamond use both half-cycles, with the output current always going the same way through the load. Name the four corners AC1, AC2, P (positive output) and N (negative output, 0 V).
P (+out)
/ \
D1 / \ D2 D1: anode AC1, cathode P
(AC1 to P) / \ (AC2 to P) D2: anode AC2, cathode P
/ \ D3: anode N, cathode AC1
AC1 o---------+ +---------o AC2 D4: anode N, cathode AC2
\ /
D3 \ / D4
(N to AC1) \ / (N to AC2)
\ /
N (-out, 0 V)
The diodes D1 and D2 point UP towards P; D3 and D4 point UP from N towards the AC corners.
The load (and the smoothing capacitor) go between P and N.
Trace the current to check there is no short circuit:
AC1 positive (AC2 negative): AC1 -> D1 -> P -> load -> N -> D4 -> AC2 (D1 and D4 conduct)
AC2 positive (AC1 negative): AC2 -> D2 -> P -> load -> N -> D3 -> AC1 (D2 and D3 conduct)
In both cases the current goes P to N through the load, so the output is always positive at P.
D3 and D1 are in series and point the same way (N to AC1 to P), as are D4 and D2, so no path from P
back to N runs along the diodes: the AC source can never short P to N.
Two diodes conduct at a time, so: Vout peak = Vpk - 2 x Vf = Vpk - 1.4 V
The output humps come at TWICE the AC frequency (100 per second on 50 Hz mains).
Smoothing capacitor and ripple
Between the humps the output falls to zero. A capacitor across the load (Basic Electronics 4, "Smoothing a rectified supply") fills at each peak and feeds the load in the gaps. The load current I discharges it for roughly one hump period, T = 1/fr, so from Q = C V the voltage falls by Vr = I × T / C:
ripple (peak to peak) Vr = I / (f_r x C) f_r = ripple frequency (hump rate)
mean output voltage Vdc = Vpeak - Vr / 2
Bridge from the 9 Vrms source with C = 470 uF and a 1 kohm load:
Vpeak = 9 x 1.4142 - 1.4 = 12.73 - 1.4 = 11.33 V
Load current I = 11.2 / 1000 = 11.2 mA (use the mean voltage, near 11.2 V)
f_r = 100 Hz
Vr = 0.0112 / (100 x 470e-6) = 0.0112 / 0.047 = 0.238 V
Vdc = 11.33 - 0.119 = 11.21 V (the output swings between 11.09 V and 11.33 V)Half-wave from the same source, same C and load: f_r = 50 Hz, Vpeak = 12.73 - 0.7 = 12.03 V
I = 11.8 / 1000 = 11.8 mA (mean output near 12.03 - 0.25 = 11.8 V)
Vr = 0.0118 / (50 x 470e-6) = 0.0118 / 0.0235 = 0.50 V -> the ripple is more than DOUBLE the bridge's.
Rule of thumb: for a bridge on 50 Hz mains, allow about 1000 uF per 100 mA for a ripple near 1 V.
Check: 0.1 / (100 x 1e-3) = 1.0 V.Choose C for a target ripple: C = I / (f_r x Vr)
200 mA load, bridge, 0.5 V ripple: C = 0.2 / (100 x 0.5) = 4 mF = 4000 uF -> use 4700 uF (next E6 value up)
Voltage rating: the capacitor sees Vpeak. 12.73 V peak needs a 25 V part (at least 1.5 to 2 times, Basic Electronics 4).
Half-wave
Full-wave bridge
Diodes
1
4
Peak output
Vpk − 0.7 V
Vpk − 1.4 V
Ripple frequency
f (50 Hz)
2f (100 Hz)
Ripple for the same C and I
Twice as large
Half
Diode peak reverse voltage
Up to 2 Vpk with a capacitor
Vpk
Used for
Tiny supplies, signal detectors
Power supplies of all sizes
Safety: never build this from the mains
Do not connect a breadboard to mains voltage, ever. The rectifier here is built from a sealed low-voltage AC source: a 9 to 12 V AC plug-in adapter (check the label says "AC" output), a small bell transformer, or a signal generator in a simulator. Measure the adapter's real AC output first with the meter on the AC range: an unregulated AC adapter reads well above its label (for example 12 V instead of 9 V) when lightly loaded.
Diode ratings for a rectifier
Each diode needs a reverse rating above the peak voltage (12.7 V: any 1N4001 at 50 V is fine), an average current rating at least equal to the load current (in a bridge each diode carries half the load current on average), and a surge rating for the moment the empty capacitor is first charged, when the current is large for a few cycles. The surge is higher the larger the capacitor and the lower the resistance of the transformer.
7. Build it: LEDs, diodes, Zener and rectifier
Four stages. Stages A to C use a breadboard, a 5 V or 9 V supply and a multimeter. Stage D, the rectifier, shows its ripple only on an oscilloscope, so it is a simulator job, with an optional real version if you own an AC adapter and a scope. (A multimeter on the AC range shows the input; on the DC range it shows the mean output.)
Parts list
Part
Value
Used in
LEDs
Red, green, and blue or white (5 mm)
A
R1
330 Ω, 1/4 W (orange-orange-brown)
A
R2
1 kΩ, 1/4 W (brown-black-red)
B, and the 1 kΩ load in C and D
Diodes
1N4148, 1N4001 and 1N5819 (a Schottky); four more 1N4001 for D
B, D
Zener
5.1 V, 500 mW (BZX55C5V1 or similar)
C
R3
220 Ω, 1/2 W (red-red-brown)
C
Loads for C
1 kΩ (R2) and 330 Ω (R1)
C
C
470 µF electrolytic, 25 V
D
Supply
5 V for A and B; a 9 V battery (PP3) for C; 9 Vrms AC (adapter) for D
A to D
Breadboard, jumper wires, multimeter
A to D
Stage A: LEDs and the resistor calculation, measured
Hole list (one column per connection):
R1: column 5 row a -> column 10 row a (330 ohm)
LED: anode (long leg) column 10 row b, cathode (flat side, short leg) column 12 row b
J2: column 12 row c -> - rail
J1: column 5 row b -> + rail
Supply + to + rail, supply - to - rail (connect LAST)
Measure LED voltage: red probe column 10 row e, black probe on the - rail
Measure resistor voltage: red probe column 5 row e, black probe column 10 row d
(current = resistor voltage / 330; or put the meter in series on the 10 mA range between columns 5 and 10)
Check the supply reads 5 V. Power up with the red LED.
Record V(LED) and V(R1). Calculate I = V(R1) / 330 and compare with the table.
Swap in the green, then the blue or white LED, and repeat.
Try backwards: turn the LED round for a moment: it stays dark and the meter across it reads nearly the supply (about 5 V), because nothing flows.
Stage B: diode drops and reverse blocking
Hole list:
R2: column 5 row a -> column 10 row a (1 k)
Diode: anode (plain end) column 10 row b, cathode (band) column 12 row b
J2: column 12 row c -> - rail
J1: column 5 row b -> + rail
Supply 5 V (connect LAST)
Measure: red probe column 10 row e (diode anode), black probe on the - rail -> the diode drop Vf
Current = (5 - Vf) / 1000. Repeat for 1N4148, 1N4001, 1N5819.
Then reverse the diode and measure again.
Stage C: Zener regulator
Hole list (9 V battery; R3 = 220 ohm):
R3: column 5 row a -> column 10 row a
Zener: cathode (band) column 10 row b, anode (plain end) column 12 row b (REVERSED: band to +)
J2: column 12 row c -> - rail
J1: column 5 row b -> + rail
Load: one resistor from column 10 row c to column 12 row d (try: none, 1 k, then 330 ohm)
Battery + to + rail, battery - to - rail (connect LAST)
Measure: red probe column 10 row e (the output node), black on the - rail
No load: record Vout. The Zener current is (9 − 5.1) / 220 = 17.7 mA, power 5.1 × 0.0177 = 90 mW.
Add the 1 kΩ load (5.1 mA): the Zener current falls to 12.6 mA; Vout should barely change.
Swap to the 330 Ω load (15.5 mA): the Zener is left with only 17.7 − 15.5 = 2.3 mA, which is below the knee; Vout will sag a little. Watch it happen.
Stage D: bridge rectifier
Hole list (four 1N4001; the band is the CATHODE). Nodes: AC1 = column 5, P = column 8, AC2 = column 11,
N = column 14, AC1-extension = column 17 (joined to column 5 by a jumper).
D1: anode column 5 row a, cathode (band) column 8 row a (AC1 to P)
D2: anode column 11 row a, cathode (band) column 8 row b (AC2 to P)
D4: anode column 14 row a, cathode (band) column 11 row b (N to AC2)
D3: anode column 14 row b, cathode (band) column 17 row a (N to AC1, via the extension)
Jumper: column 5 row c -> column 17 row b
AC input: one lead to column 5 row d, the other lead to column 11 row d
C: + leg column 8 row c, - leg (stripe) column 14 row c (stripe on N, the 0 V side)
Load: 1 k column 8 row d -> column 14 row d
Measure: DC volts, red probe column 8 row e (P), black probe column 14 row e (N)
Measure the AC input with the meter on AC volts across column 5 row e and column 11 row e
Simulators
Falstad Circuit Simulator (falstad.com/circuit): in the Circuits menu pick Diodes and the bridge-rectifier example, or draw it: an AC voltage source (amplitude 12.73 V for 9 Vrms, frequency 50 Hz), four diodes, a 470 µF capacitor and a 1 kΩ load. Right-click P and choose scope to see the humps and the ripple. Note that Falstad's default diode model has a slightly larger forward drop (about 0.8 V rather than 0.7 V), so expect the output about 0.2 V lower than the calculated value, and its LED has a drop of about 2 V by default. The same program has the Zener (add a Zener diode and edit its breakdown voltage) and the half-wave version (delete three diodes).
Tinkercad Circuits (tinkercad.com): the breadboard, resistor, red LED (the LED edit box shows its current), diode, Zener, electrolytic capacitor, battery and multimeter cover stages A to C with the same hole lists. For D use the function generator and oscilloscope: set a sine at 12.7 V peak (check whether its amplitude is a peak or peak-to-peak value; if its range is too small, scale every voltage down by the same factor) and 50 Hz.
Flyback (simulator): take the 12 V, 240 Ω, 240 mH circuit from Basic Electronics 4 stage C. Without a diode the switched node spikes; with the 1N4001 flyback diode, anode on the switched node and cathode on +12 V, it stays near 12.7 V and the current reaches 5 mA about 1.9 ms after opening. Add a 24 V Zener in series with the diode (Zener cathode facing the diode's cathode) and the current dies in about 0.35 ms, with the node reaching about 36.7 V.
Reverse polarity: put a 1N4001 in series with a 9 V source and a 100 Ω load, then swap the supply polarity. Forward: about 8.3 V at the load; reversed: 0 V.
Expected readings
Measurement
Calculated
Real (typical)
Simulator
A: red LED voltage / current (5 V, 330 Ω)
2.0 V / 9.1 mA
1.8 to 2.1 V / 8.8 to 9.7 mA
about 2.0 V / 9 mA
A: green LED voltage / current
2.1 V / 8.8 mA
1.9 to 2.3 V / 8.2 to 9.4 mA
about 2.0 V / 9 mA
A: blue or white LED voltage / current
3.2 V / 5.5 mA
2.9 to 3.3 V / 5.2 to 6.4 mA
about 3.0 to 3.2 V
A: LED reversed
0 mA, 5 V across it
about 5.0 V across it
5 V across it
B: 1N4148 drop (1 k, 5 V)
0.69 V (4.3 mA)
0.6 to 0.72 V
0.65 to 0.8 V
B: 1N4001 drop (1 k, 5 V)
0.69 V (4.3 mA)
0.62 to 0.72 V
0.65 to 0.8 V
B: 1N5819 Schottky drop (1 k, 5 V)
about 0.25 to 0.3 V (4.7 mA)
0.2 to 0.35 V
0.2 to 0.4 V
B: any diode reversed
5.00 V across the diode
4.99 to 5.00 V
5 V
C: Zener, no load (9 V, 220 Ω)
5.1 V (17.7 mA)
4.9 to 5.3 V
5.1 V
C: Zener, 1 kΩ load
5.1 V (Iz 12.6 mA)
4.9 to 5.3 V
5.1 V
C: Zener, 330 Ω load
5.1 V ideal (Iz only 2.3 mA)
4.6 to 5.0 V (below the knee)
5.0 to 5.1 V
D: bridge peak output (9 Vrms, 470 µF, 1 kΩ)
11.33 V
depends on the adapter
11.1 to 11.3 V (see the note)
D: ripple (peak to peak)
0.24 V
0.2 to 0.3 V (scope)
0.24 V
D: mean DC output
11.2 V
meter on DC
11.0 to 11.2 V
D: half-wave, same parts: ripple / peak
0.50 V / 12.03 V
(needs a scope)
0.50 V / 11.8 to 12.0 V
Flyback: time to 5 mA, 24.7 V clamp vs 0.7 V diode
0.35 ms vs 1.9 ms
(needs a scope)
0.35 ms vs 1.9 ms
The real readings spread because diodes and LEDs vary from sample to sample (Vf changes by ±0.1 to 0.2 V) and with temperature. The things that do not vary are the relationships: the LED current is (Vs − Vf)/R, a silicon diode drops about 0.7 V, a Schottky drops less than half of that, and the bridge ripple is half the half-wave ripple.
8. Challenges
Challenge 1: LED resistors
(a) A green LED (Vf = 2.1 V) is run from 5 V at about 12 mA: find the resistor, round it up to E12, then find the actual current, the resistor power and the LED power. (b) A red LED (1.9 V) on a 3.3 V logic pin at about 8 mA: find the resistor and the current with the E12 value above it; then find the current for the LED with Vf = 1.7 V and for Vf = 2.1 V. (c) Four red LEDs (2.0 V each) in series on 12 V at 15 mA: find R (E12 up), the real current and the resistor power; could you also run four blue LEDs (3.2 V) on the same supply? (d) A 4-digit display is multiplexed so each digit is lit one quarter of the time: find the peak current needed for a 5 mA average, the resistor for a 5 V supply with red LEDs, and the time each digit is on at a 100 Hz frame rate.
Challenge 2: Zener regulator and polarity protection
(a) Design a Zener shunt regulator giving 5.1 V from a 12 V supply that varies from 11 V to 13 V, for a load of 0 to 30 mA, keeping at least 5 mA through the Zener. Find the resistor (round down to E24: 150, 160, 180, 200 Ω), check the Zener current at both extremes, find the worst-case power in the Zener and in the resistor, and the efficiency at 12 V and full load. (b) A 12 V supply feeds a 500 mA load through a reverse-polarity series diode. Compare a 1N4001 (0.75 V at 0.5 A) with a 1N5819 (0.40 V at 0.5 A): load voltage, power lost in the diode and the diode's share of the total power, and say which is better and why.
(a) A transformer gives 12 Vrms. A bridge rectifier (0.7 V per diode) with a 2200 µF capacitor feeds a 200 mA load: find the peak voltage, ripple, mean output, minimum output, and the voltage rating you would choose for the capacitor. Give the average current and peak reverse voltage per diode. (b) Repeat with a single-diode half-wave rectifier and the same capacitor and load, and say how the ripple compares. (c) For the capacitor size that gives 0.5 V ripple with the bridge at 200 mA, find C and the next E6 value up. (d) A relay coil (12 V, 240 Ω, 240 mH, 50 mA) is switched off. With a 0.7 V flyback diode find the time for the current to fall to 5 mA; then with a 12 V Zener in series with the diode (clamp 12.7 V) find the time to reach zero current and the voltage the transistor sees.
Diode: conducts anode to cathode (band = cathode); silicon drops about 0.7 V, Schottky 0.2 to 0.45 V, LED 1.8 to 3.3 V; reverse blocks until breakdown
Shockley: I = Is (eV/(nVt) − 1), Vt = 25.85 mV at 300 K; V = nVt ln(I/Is); +59.5 mV per tenfold current; rd = nVt/I
LED resistor: R = (Vs − Vf)/I, rounded up to E12; typical 5 to 20 mA; always one resistor per parallel branch
Series LEDs: supply > sum of Vf; multiplexing: average current = peak × duty cycle, refresh at 100 Hz or more
Zener regulator: R = (Vin_min − Vz)/(IL_max + Iz_min), rounded down; check Pz = Vz × Iz at no load and PR = I²R
Flyback diode: across every coil, cathode to the supply side; i(t) = (I0 + Vc/R) e−tR/L − Vc/R; a Zener in series speeds the release
Reverse-polarity protection: a series diode (loses Vf, Schottky is better) or a shunt diode after a fuse
Rectifiers: Vpk = 1.414 Vrms; half-wave peak Vpk − 0.7, bridge Vpk − 1.4; ripple Vr = I/(f_r C) with f_r = f (half-wave) or 2f (bridge); Vdc = Vpeak − Vr/2
Next, Basic Electronics 6 introduces transistors as switches: using a weak signal to switch a lamp or motor, base and gate resistors, and fitting the flyback diode from this chapter across the load.