Every circuit you ever build needs steady DC, but the wall gives you 120 V of writhing AC. This chapter is one pipeline — transformer, rectifier, filter, regulator — and one deep tension: a linear regulator burns the excess voltage as heat, while a switching regulator chops the input on and off to waste almost nothing. That single design choice is why one wall-wart is a brick and the other fits on your fingertip.
You build a small digital project — a microcontroller, a few logic chips, an LED display. They need a clean, steady +5 V. So you do the obvious thing: grab a transformer to step the wall voltage down, a bridge rectifier to flip the negative swings up, and a big fat capacitor to smooth it out. You wire it up, power on… and your chips behave like they are haunted. The display flickers. The microcontroller resets at random. A counter skips numbers. Eventually a chip gets hot and dies.
You put a scope on the "5 V" rail and the truth appears: it is not 5 V at all. It is a sawtooth, sliding from about 5.25 V down to 4.74 V and back, 120 times a second. That up-and-down wobble — ripple — measures about 510 mV peak-to-peak. Your logic family tolerates only ±0.25 V (5%) on its supply. You are riding two-times over the cliff edge, continuously.
The instinct is to fight ripple with a bigger capacitor. But ripple shrinks only linearly with capacitance: to get from 510 mV down to a safe 5 mV you would need a capacitor a hundred times larger — a soda-can-sized 470,000 µF monster that costs more than the rest of the project. The real fix is a 50-cent chip called a voltage regulator, and it knocks ripple down by a factor of a thousand while holding the output rock-steady. That chip is the hero of this chapter.
This is the scope trace of the haunted supply. The orange band is what your logic chips tolerate (±0.25 V). Drag the capacitor up and watch the sawtooth shrink — notice you need an enormous cap to get inside the band. The regulator (next tabs) does it for pennies.
Almost every linear DC supply ever built is the same four-stage assembly line, each stage cleaning up the mess from the last. Once you see the pipeline, every power supply on Earth becomes legible.
Each stage trades one problem for a smaller one. The transformer makes the voltage safe and manageable but leaves it AC. The rectifier makes it unidirectional but leaves it lumpy. The capacitor makes it mostly flat but leaves a small ripple. The regulator makes it clean and constant — the last and most important stage, and the one with the most interesting physics, because it is where the waste-versus-complexity tension lives.
Suppose we want a regulated +5 V at up to 1 A using a common 7805 regulator. Work backward through the pipeline:
This is why a "5 V supply" famously starts with a transformer labelled 9 V or 12 V — the headroom is eaten by the rectifier drop, the ripple valley, and the regulator dropout. Every volt above 5 V at the regulator input is volts the regulator must eventually burn off, which becomes Chapter 7's heat problem.
The same signal at four points along the pipeline. Watch the AC sine become rectified humps, then smoothed DC-with-ripple, then a flat regulated line. This is the whole chapter in one picture.
A diode is a one-way valve for current. That single fact is the whole trick behind turning AC into DC: arrange diodes so that current can only ever flow toward the load in one direction, and the negative swings either vanish or get folded upward. There are three classic arrangements, each better than the last.
One diode in series with the load. It conducts during the positive half-cycle and blocks during the negative one. The result is a train of humps with big gaps between them — you throw away half the input. The output pulses at the line frequency (60 Hz), and because half the time there is nothing at all, the capacitor must work hard and the ripple is large. Simple, but wasteful.
With a center-tapped transformer and two diodes, the negative half-cycle is rerouted so it too comes out positive. Now there are no gaps — a hump for every half-cycle. The output pulses at twice the line frequency: 120 Hz for 60 Hz mains. Twice as many humps means the capacitor refills twice as often, so ripple is roughly halved for the same capacitor.
The bridge rectifier uses four diodes to achieve full-wave rectification from an ordinary (non-center-tapped) secondary. It is the workhorse of nearly every supply. The cost: current always flows through two diodes in series, so the voltage drop is ~1.4 V instead of ~0.7 V. In exchange you get full-wave 120 Hz output and you can use the whole transformer winding.
The wall delivers 60 Hz, so one full AC cycle takes 1/60 s = 16.7 ms, with a positive hump and a negative hump each lasting 8.3 ms. Half-wave keeps only the positive hump, leaving a pulse every 16.7 ms → 60 Hz ripple. Full-wave folds the negative hump up to positive, producing a pulse every 8.3 ms → 120 Hz ripple. The period between refills for full-wave is therefore 8.3 ms, and the capacitor actually discharges for roughly 5 ms of that (the diodes conduct only near each peak). We will use that ~5 ms discharge window in the ripple math.
The transformer's AC sine (dashed) and the rectified output (solid) for each topology. Click to switch. Notice half-wave leaves gaps at 60 Hz, while both full-wave versions fill every half-cycle at 120 Hz.
After the rectifier we have a train of humps — positive, but pulsing all the way down to zero between peaks. The fix is a single component that acts like a tiny reservoir: the filter capacitor, placed in parallel with the load. Think of it as a water tank fed by a pump that only pulses on at the peaks. The tank fills quickly at each peak, then feeds the load steadily during the dry spells, keeping the output high even when the pump is off.
Mechanically, here is the cycle: as each rectified hump rises, the capacitor charges almost up to the peak voltage Vpk. Then the hump falls away faster than the capacitor can follow, so the diode stops conducting (it reverse-biases) and the capacitor is left alone to supply the load by itself. The load drains the capacitor — its voltage sags — until the next hump rises high enough to take over and recharge it. The amount of sag during that lonely stretch is exactly the ripple voltage.
A capacitor obeys I = C·dV/dt. While the capacitor is supplying the load alone, the load draws current IL, and the capacitor voltage falls. Rearranging gives the change in voltage over the discharge interval Δt:
That ΔV is the ripple. Read the equation as a story: more load current drains the tank faster (bigger ripple), a longer gap Δt between refills means more time to droop (bigger ripple), and a bigger capacitor holds more charge so it droops less (smaller ripple). The capacitor's only job is to make ΔV small.
Take IL = 1.0 A, C = 4700 µF, and a full-wave discharge window of about Δt = 5 ms (the ~5 ms the capacitor spends alone between 120 Hz peaks). Then:
So the raw supply sags by roughly a volt between refills. That is the lumpy "DC" from Chapter 0. To halve it to ~0.5 V you would double the capacitor to 9400 µF; to get to 0.1 V you would need ten times the capacitor, ~47,000 µF — physically huge and expensive. The capacitor alone is a losing battle past a point, which is exactly why we add a regulator. (The next tab introduces the practical empirical formula engineers actually use, which folds the messy ~5 ms discharge geometry into one tidy constant.)
The rectified humps (dim) and the capacitor's voltage (bright). Watch the capacitor charge up to each peak, then sag as it feeds the load alone, then get caught and recharged by the next hump. The vertical gap is the ripple ΔV.
This is the payoff lab for the first half of the chapter. We will pin down the ripple voltage with the formula engineers actually reach for, then let you drive a live rectifier-and-filter scope to feel exactly how the capacitor and the load fight each other. By the end you will be able to size a filter capacitor in your head.
The first-principles ΔV = IL·Δt/C from the last tab is correct but awkward, because the real discharge window Δt is not a clean 8.3 ms — the diodes steal back some time near each peak, and we usually want the rms ripple rather than peak-to-peak. Scherz & Monk fold all that geometry into one empirical constant for a full-wave supply on 60 Hz mains:
with IL in amps and C in farads. The 0.0024 already bakes in the 120 Hz period, the ~5 ms discharge window, and the rms conversion. It is the single most useful power-supply formula in the book: give it a load current and a capacitor, and it tells you the ripple.
Now we can produce the haunted-supply number exactly. With IL = 1.0 A and C = 4700 µF:
There it is: 510 mV of ripple, exactly the value the scope showed in Chapter 0, comfortably exceeding the ±0.25 V your logic can tolerate. And here is the kicker that motivates the rest of the chapter: feed this through a 7805 regulator with its ~60 dB of ripple rejection (a factor of 1000) and the output ripple becomes 510 mV / 1000 = 0.51 mV — effortlessly within spec. A 50-cent chip did what a hundred-fold capacitor increase could barely manage.
A live full-wave supply scope. Sweep the capacitor and the load current and watch the sawtooth ripple grow and shrink in real time. The readout gives Vr(rms) from the 0.0024·IL/C formula and flags whether you are inside the ±0.25 V logic band before any regulator. Toggle the regulated trace to see the ÷1000 magic.
We have rippled DC. Now we need to make it clean and constant regardless of ripple or load. The classic answer is the linear regulator, and the simplest mental model is the one Scherz & Monk start from: a reference plus a controlled valve.
The crudest regulator is a zener diode across the load: a zener clamps its voltage to a fixed VZ regardless of current, giving a stable reference. But a bare zener wastes current and sags under heavy load. The fix is to put a transistor as a controlled valve (the series-pass element) between input and output, and use the zener only as a quiet reference telling the transistor how much to open. The transistor passes all the load current; the reference just steers it. An internal op-amp compares the output against the reference and nudges the transistor continuously to hold the output where it belongs — thousands of corrections per second. That feedback is what flattens ripple.
This entire circuit — reference, error amplifier, pass transistor, thermal and current-limit protection — is integrated into a three-terminal chip. The 78xx series gives a fixed positive output where "xx" is the voltage: a 7805 is +5 V, a 7812 is +12 V, a 7809 is +9 V. The 79xx series gives the negative counterparts (a 7905 is −5 V). Three pins: input, ground, output. Add a small input and output capacitor for stability and you have a complete, bulletproof regulator delivering up to ~1.5 A with a heat sink.
A linear regulator can only ever subtract voltage — it cannot boost. And it needs a minimum headroom, the dropout voltage, to keep its internal pass transistor in control. For a 78xx that is typically 2–3 V; if the input ever falls below Vout + Vdropout (even momentarily at the bottom of a ripple valley) the regulator "drops out" and the ripple leaks straight through to the output.
You want +5 V from a 7805 (3 V dropout) at 1 A, with a bridge rectifier (1.4 V drop) and a ripple valley of about 1 Vpp. The regulator input must never dip below 5 + 3 = 8 V. The capacitor's peak must therefore sit at least 8 V + 1 V (ripple valley) = 9 V, plus the 1.4 V bridge drop → transformer peak ≥ 10.4 V. Since Vpk = √2·Vrms, the secondary should be at least 10.4/1.414 ≈ 7.4 Vrms. A standard 9 V or 12 V secondary is chosen for comfortable margin — and that extra margin is precisely the voltage the regulator must burn as heat, the subject of Chapter 7.
The block diagram inside a 78xx: a stable reference, an error amplifier comparing output to reference, and a pass transistor it controls. Rippled DC in (left), clean DC out (right). The mini-scopes show ripple before and after.
The 78xx is locked to one voltage at the factory. The LM317 is the same idea made adjustable: instead of a built-in reference voltage, it maintains a fixed 1.25 V between its output pin and its adjust pin, and lets you set the rest with two resistors. It is one of the most-used ICs ever made, adjustable from 1.25 V all the way to 37 V.
The LM317 forces exactly 1.25 V across a resistor R1 between OUT and ADJ. That fixed voltage across R1 sets a fixed current I = 1.25/R1 flowing through R1. That same current flows on through R2 (the tiny adjust-pin current is negligible), and the voltage across R2 is just I·R2. The output sits above ground by the sum of the two resistor voltages:
R1 is conventionally fixed at 220 Ω or 240 Ω (small enough to keep the regulator loaded for stability). You then pick R2 to dial in the voltage you want. The LM317 is floating: it does not reference ground directly, it references its own output, which is what makes the same chip work at 5 V or 30 V. For negative rails, the LM337 is the mirror-image part.
Use R1 = 220 Ω and solve for R2 to get 5.0 V:
660 Ω is not a standard value, so you use the nearest standard 680 Ω, giving Vout = 1.25×(1+680/220) = 1.25×4.09 = 5.11 V — close enough for most uses, or trim with a small series resistor. For +12 V the same R1: 12 = 1.25(1+R2/220) → R2/220 = 8.6 → R2 ≈ 1.89 kΩ.
Dial R1 and R2 and watch Vout = 1.25(1+R2/R1) on the gauge, clamped to the LM317's 1.25–37 V range. Try to hit 5.00 V (R1=220, R2≈660) and 12 V (R2≈1.89k). The live computation is printed below the needle.
Here is the dark secret of the linear regulator. It holds its output steady by dropping the surplus voltage across its internal pass transistor — but that surplus times the load current is power, and that power becomes heat. A linear regulator is, fundamentally, a controlled resistor that burns the difference. The more you ask it to drop, the more it cooks.
The power dissipated in the regulator is simply the voltage it drops times the current it passes:
And the efficiency — useful power out divided by power in — reduces (at the same current) to a stark voltage ratio:
That second equation is brutal in its honesty: a linear regulator's efficiency is just the ratio of output to input voltage. Drop from 12 V to 5 V and you are 42% efficient at best — the other 58% is heat, no matter how good the chip. There is no engineering cleverness that escapes Vout/Vin; it is thermodynamics.
Run a 7805 at Iload = 1 A from Vin = 12 V:
7 watts in a tiny TO-220 package will reach ~150 °C and trip its thermal shutdown without a serious heat sink — you are delivering 5 W to the load and wasting 7 W as heat, more waste than useful output. Now lower the input to Vin = 8 V (just above the dropout):
Same output, less than half the heat. This is the golden rule of linear supplies: keep Vin as close to Vout as the dropout safely allows. Every extra volt of input is wasted power and unwanted heat.
Fixed Vout = 5 V, fixed load. Sweep Vin from 5 V to 18 V. The thermometer rises with Pdiss=(Vin−Vout)·I, the efficiency bar shows η=Vout/Vin, and below the dropout (Vin<7 V) the regulator falls off the cliff and stops regulating. Watch heat and efficiency trade off.
The linear regulator burns surplus voltage as heat because its pass element is a resistor, and resistors dissipate. The switching regulator's radical idea: replace the resistor with a switch. An ideal switch dissipates nothing — when closed it has no voltage across it, when open it carries no current, and P = V·I is zero in both states. By flicking that switch on and off tens of thousands of times a second and averaging the result with an inductor and capacitor, a switcher delivers exactly the voltage you want while wasting almost nothing.
The most common switcher is the buck converter, which steps voltage down. A transistor chops the input into a square wave; an inductor smooths the chopped current (resisting sudden changes, it averages the pulses); a diode gives the inductor's current a path when the switch opens; and an output capacitor flattens the rest. The key control knob is the duty cycle D — the fraction of each switching period the switch is closed. The output voltage is simply the input scaled by the duty cycle:
Want 5 V from 12 V? Set D = 5/12 = 0.42 — the switch is closed 42% of the time. Because the switch and inductor are near-lossless, the input current automatically drops to match: the converter draws only as much power as the load needs (plus small losses), so input power ≈ output power. That is the whole reason switchers hit 85–95% efficiency where a linear regulator doing the same 12→5 V job manages 42%.
A switcher's transformer (if it has one) and inductor run at ~65 kHz instead of the wall's 60 Hz — over a thousand times higher. Magnetic components shrink dramatically as frequency rises (they move the same energy in far less time), so the bulky 60 Hz iron transformer of a linear supply is replaced by a tiny high-frequency one. Combine "no big transformer" with "barely any heat sink" and you get the modern phone charger: a thumb-sized brick delivering more clean power than a linear supply ten times its size.
You need 3.3 V from a 12 V rail at 2 A. Duty cycle D = Vout/Vin = 3.3/12 = 0.275, so the switch is closed about 28% of each cycle. Output power = 3.3×2 = 6.6 W. At ~90% efficiency the input power is 6.6/0.9 = 7.33 W, drawn from 12 V as 7.33/12 = 0.61 A — far less than the 2 A output current, because the switcher transforms current up as it steps voltage down. A linear regulator doing the same job would draw the full 2 A at 12 V (24 W in, 6.6 W out) and roast 17.4 W as heat. Same job, 2.4 watts of loss versus 17 — an order of magnitude.
An animated buck converter. The switch flicks on and off; the inductor current ramps up while the switch is closed and dribbles down through the diode while it is open. Sweep the duty cycle and watch the output settle at Vout ≈ D·Vin. Note how little heat the (near-ideal) switch makes.
You started this chapter with a "5 V" rail wobbling 510 mV and frying logic chips. Let us assemble the complete cure, then see how every concept connects to the rest of the book.
| Concept | Equation | What it tells you |
|---|---|---|
| Peak from rms | Vpk = √2 · Vrms | Capacitor charges to the peak, not the rms, of the rectified wave |
| Full-wave ripple freq | fripple = 2 · fline = 120 Hz | Both half-cycles make a hump; cap refills twice per cycle |
| Capacitor discharge | ΔV = IL · Δt / C | Ripple = current × time-alone ÷ reservoir size |
| Practical ripple | Vr(rms) ≈ 0.0024 · IL/C | Back-of-envelope full-wave ripple (60 Hz mains) |
| 78xx fixed output | 7805→5 V, 7812→12 V; 79xx negative | Three-pin fixed linear regulator, ~1.5 A with heat sink |
| LM317 adjustable | Vout = 1.25 · (1 + R2/R1) | 1.25 V reference; pick R2 to set 1.25–37 V (LM337 negative) |
| Dropout constraint | Vin ≥ Vout + Vdropout | 78xx ~2–3 V, LDO ~0.5 V; below this, ripple leaks through |
| Linear heat | Pdiss = (Vin − Vout) · Iload | Surplus voltage × current, dumped as heat |
| Linear efficiency | η = Vout / Vin | Brutal ratio; big step-downs are very inefficient |
| Buck duty cycle | Vout ≈ D · Vin | Switcher: 85–95% efficient regardless of step ratio |
| Ripple rejection | −60 dB = ÷1000 | 7805 ~60 dB; LM317 to ~80 dB (÷10,000) with bypass cap |
The central tension of the chapter, side by side. Drive the same 12→5 V job and watch where the energy goes.
Same Vin→Vout job, two technologies. The bars show input power and heat wasted; the linear regulator's heat bar towers over the switcher's. The size icons shrink for the switcher (no big transformer, no big heat sink). Sweep the input voltage to make the gap dramatic.
| Linear (78xx / LM317) | Switching (buck) | |
|---|---|---|
| Efficiency | Vout/Vin, often <50% | 85–95%, step-ratio independent |
| Heat | High (needs heat sink) | Low |
| Output noise | Very quiet | High-frequency switching hash |
| Size / weight | Bulky 60 Hz transformer | Tiny 65 kHz magnetics |
| Can step up? | No (drop only) | Yes (boost topology) |
| Complexity | Three pins, two caps | Inductor, diode, layout care |
| Best for | Low-noise rails, small step-downs | Battery gear, big step-downs, efficiency |
From transformer to regulator, you now own the whole pipeline — and you understand the one decision that defines a supply: burn the surplus as heat (linear, quiet, simple) or chop it away (switching, efficient, noisy). Chapter 12 finally gets to use that clean +5 V.