The problem a dimmer switch already solved
In rung 2 you met the ideal switch: when it's closed it drops zero volts, when it's open it carries zero current, and either way it burns zero power (power is voltage times current, and one of them is always zero). That's a beautiful device — but it seems useless for *adjusting* a voltage. A switch has only two positions. How do you get something in between?
The answer is older than electronics. Think of an old ceiling-fan pull cord, or a person flicking a wall light on and off very fast. If the bulb is on for half of every second, it glows at roughly half brightness — your eye averages the flicker. Run the flicker fast enough and you stop seeing flashes at all; you just see a steady, dimmer light. Pulse-width modulation (PWM) is exactly this idea, applied to a power switch: keep the switching fast, and vary the *fraction* of each cycle the switch is on.
Duty cycle: the one number that rules the average
A PWM signal repeats with a fixed period T (one full on-then-off cycle). Within each period the switch is on for a time we call t_on. The duty cycle D is simply the on-fraction:
D = t_on / T (a fraction from 0 to 1, often written as a percent)
|<----------- T ----------->|
|<--- t_on --->| |
______________ ______________
| | | |
| SWITCH ON | SWITCH | SWITCH ON | ...
| (Vin) | OFF (0V) | (Vin) |
_| |____________| |____
D = 25% : on a quarter of the time
D = 50% : on half the time
D = 75% : on three-quarters of the timeNow the punchline. When the switch is on, the output sees the full rail voltage Vin; when it's off, it sees 0 V. The time-average of that chopped square wave is the height of the high part (Vin) weighted by how long it's high (D), plus the low part (0 V) weighted by the rest. The second term vanishes, leaving the single most important equation in switching power:
Vavg = D · Vin + (1 - D) · 0 = D · Vin
┌─────────────────────────────────────────────┐
│ Vavg = D · Vin │
│ (average output = duty cycle × input rail) │
└─────────────────────────────────────────────┘A worked example: powering a CPU from 12 V
Let's put real numbers on it. Your desktop's power supply hands the motherboard a 12 V rail, but a modern CPU core wants something near 1.2 V, and an LED strip you're driving wants about 9 V. One switch, three duty cycles — let's compute the average for each.
Given Vin = 12 V. Vavg = D · Vin
Duty cycle D Vavg = D × 12 V Use case
----------- ---------------- ----------------------------
10% 0.10 → 0.10 × 12 = 1.2 V CPU core rail
25% 0.25 → 0.25 × 12 = 3.0 V logic / 3.3 V-ish rail
50% 0.50 → 0.50 × 12 = 6.0 V half-rail
75% 0.75 → 0.75 × 12 = 9.0 V LED strip
100% 1.00 → 1.00 × 12 = 12 V switch stuck closed = pass-through
0% 0.00 → 0.00 × 12 = 0 V switch stuck open = offNotice how *easy* the control knob is. To go from 1.2 V to 9 V you don't swap any parts — a digital controller just counts a few more clock ticks before opening the switch. That is why nearly every chip on a board today gets its own tiny switching regulator: the same silicon design serves any output by reprogramming D.
Why it isn't a jagged mess: the LC filter
Hold on — a CPU can't run on a square wave that slams between 12 V and 0 V tens of thousands of times a second. It needs *smooth* 1.2 V. The average is the right number, but how do we physically extract it from the chop? With two humble components that act as a low-pass filter: an inductor and a capacitor.
Think of the inductor as a heavy flywheel for current. Current through an inductor can't jump — it can only ramp. So when the switch slams the input from 12 V to 0 V, the inductor refuses to let current change abruptly; it coasts, smoothing the violent voltage edges into a gentle, triangular ripple of current. The capacitor then plays the role of a small reservoir tank across the output: it soaks up charge on the up-swings and releases it on the down-swings, ironing the remaining ripple flat. What the CPU finally sees is the *average* — a clean DC level with only a few millivolts of wiggle.
chopped node after L+C
(switch output) (CPU rail)
12V _ _ _ _ 1.2V ~~~~~~~~~~~~~~~ <- smooth DC = the average
| | | | | | | | (tiny ripple)
0V_| |_| |_| |_| |
^ square, brutal ^ inductor smooths current,
capacitor smooths voltage
L resists current change → triangle ripple of current
C resists voltage change → flat output voltageSwitching frequency: the engineer's central trade-off
So why not just switch at a billion hertz and use a postage-stamp inductor? Because every flick of the switch costs energy. Here's the tension that defines power-electronics design.
- Higher frequency shrinks the magnetics. A faster chop means less time for current to drift between cycles, so a *smaller* inductor and capacitor suffice. This is why phone chargers went from brick-sized to thumb-sized: pushing into the hundreds of kHz (and MHz with GaN transistors) let the bulky transformer shrink.
- But every transition burns switching loss. A real transistor isn't a perfect switch — for a few nanoseconds during each turn-on and turn-off it conducts current *while* dropping voltage, so it dissipates a pulse of heat. That loss is paid *once per cycle*, so it grows directly with frequency. Double the frequency, double the switching loss.
- The sweet spot is a balance. Designers pick a frequency where the silicon stays cool enough yet the inductor stays small enough. For mainstream supplies that lands around 100 kHz to 2 MHz; wide-bandgap parts (SiC, GaN) switch cleanly faster, pushing the whole curve to higher frequency and smaller, lighter converters.
Where this goes next
You now hold the master key to switching power. A fast switch turns a fixed rail into a chopped square wave; the duty cycle sets its average via Vavg = D·Vin; and an L-C filter irons that average into clean DC, with the switching frequency trading converter size against switching loss. Every regulator on your motherboard, every USB-C charger, every electric-vehicle inverter is a variation on these four sentences.
In rung 4 we wire the switch, the inductor, the capacitor, and a feedback controller into actual topologies — the buck that steps down (the worked example above, made real), the boost that steps up, and the buck-boost that does both. The duty-cycle intuition you just built is the thing that makes those circuits feel obvious instead of magic.