From a wobbly rail to a rock-steady one
The last guide left us with a respectable but unreliable rail. A bridge rectifier and a reservoir capacitor gave us a DC level sitting near the peak — but it is still an unregulated supply. Draw more current and the average droops while the ripple grows; let the mains sag or surge by ten percent and the whole rail moves with it; and the ripple never truly vanishes, it only gets small. For a heater or a motor that is fine. For a logic chip that resets on every dip, a sensor whose reading rides on the supply, or an op-amp that passes ripple straight to its output, that wobble is unacceptable.
What these circuits demand is a regulated supply: an output held at a chosen value almost regardless of how much current the load draws or how the input wobbles. Engineers grade a supply by two numbers. Line regulation asks how little the output moves when the input changes; load regulation asks how little it moves when the load current changes. A good regulator scores tiny on both — millivolts of output shift for volts of input swing or amps of load step. This guide builds the simplest device that delivers that: the linear regulator.
Inside the linear regulator: a feedback thermostat
A linear regulator is three pieces wired into a loop. First, a stable voltage reference — a fixed yardstick the output is compared against (a Zener or, better, a bandgap; that is the whole subject of the next guide). Second, an error amplifier, usually an op-amp. Third, a series-pass transistor sitting right in the main current path between input and output. Hold the analogy in your head: the pass transistor is a tap on the pipe, the error amplifier is the hand on the tap, and the reference is the target level the hand is aiming for.
Now watch the loop settle. The output is sampled by a divider (R1 and R2) and the sensed fraction is fed to the amplifier's inverting input, while the reference holds its non-inverting input. By negative feedback — the same thermostat that nudged every amplifier in the op-amp rung — the amp drives the pass transistor exactly hard enough to make the sensed fraction equal the reference. If the output dips because the load grabbed more current, the sensed voltage drops below the reference, the amp opens the tap wider, and the output climbs back. If the output rises, the amp throttles the tap. It comes to rest where sense equals Vref, which means Vout = Vref times (1 + R2/R1) — exactly the non-inverting-amplifier algebra you already know.
LINEAR REGULATOR = a tap held by a feedback thermostat
Vin o---[ series-pass transistor Q ]---+-------o Vout
(lumpy, ^ drive | (steady)
ripples) | [ R2 ]
+----+-----+ |
| error |----------------+ <- sense node
| amplifier| (-) |
+----+-----+ [ R1 ]
| (+) |
Vref (stable GND
reference)
Loop: Vout rises -> sense rises -> amp eases Q off -> Vout falls.
Settles where sense = Vref, so Vout = Vref x (1 + R2/R1).
Example: Vref = 1.25 V, R2 = 720, R1 = 240 -> Vout = 1.25 x 4 = 5 V.The crudest version of this idea needs no op-amp at all: a Zener sets a fixed voltage on the base of an NPN emitter follower, and the output simply follows that voltage minus one base-emitter drop, with the transistor's current gain turning the Zener's trickle into a big load current. It is the same negative feedback in miniature — the base-emitter junction is the error sensor. The honest catch is that the output then tracks the Zener's drift and the base-emitter drop's temperature wobble, so it is only semi-regulated. Wrapping a real op-amp around the loop cures this: the amplifier's huge gain means even a microscopic error at the sense node is enough to fully correct the tap, so the output clings to the reference far more tightly than any single junction could manage.
78xx and LM317: regulation in three pins
You almost never build this from loose parts, because it comes in a single chip. The three-terminal regulator packs the reference, the error amplifier, the pass transistor, and a set of protection circuits into one little package with just three legs: input, output, and ground. The 78xx family is fixed-output — a 7805 makes 5 V, a 7812 makes 12 V, a 7833 makes 3.3 V — with the sense divider already built in. Bolt one across your unregulated rail, add a small capacitor on each side, and you have a clean regulated supply. The 79xx family does the identical job for negative rails.
When you need an output the catalogue does not stock, reach for the adjustable LM317. Instead of a fixed internal divider, it works to hold a constant 1.25 V (its internal reference) between its output and adjust pins. You supply the divider yourself: a resistor R1 from output to adjust, and R2 from adjust to ground, giving Vout = 1.25 times (1 + R2/R1) + Iadj times R2. The Iadj term is a tiny adjust-pin current (around 50 microamps) and is usually ignored. A worked example: pick R1 = 240 ohm and R2 = 720 ohm, then Vout = 1.25 times (1 + 720/240) = 1.25 times 4 = 5 V. Want 9 V instead? Solve R2 = R1 times (Vout/1.25 - 1) = 240 times 6.2 ≈ 1.5 k.
Dropout and the LDO
Every linear regulator shares one catch: the input must stay a certain amount above the output, or it falls out of regulation and the output just sags along with the input. That minimum headroom is the dropout voltage. A classic 7805 needs roughly 2 to 2.5 V — you must feed it at least about 7 V to get a clean 5 V out. Why so much? Its pass element is an NPN (often a Darlington pair), and the internal circuitry that drives it spends a couple of base-emitter drops plus some saturation headroom getting from input to output. That spent voltage is the price of the topology.
This bites hardest at the bottom of the ripple and on batteries. Recall from guide 1 that the unregulated rail sags into its ripple trough twice a cycle; the input must stay above Vout plus dropout even at that lowest dip, or the output ripples through. Worse, run from a cell: a lithium-ion battery falls from 4.2 V down to about 3.4 V as it empties. A 7805-style part demanding 2 V of headroom cannot even make 3.3 V from a 3.7 V cell — it drops out and the output collapses with the battery, throwing away hours of usable runtime that were still in the cell.
The cure is the low-dropout regulator, the LDO. It keeps the same feedback loop and the same heat arithmetic, but swaps the pass element for a PNP transistor or, in modern parts, a P-channel MOSFET whose full input-to-output path can saturate down to a very small drop — tens of millivolts to a few hundred. So an LDO can regulate with as little as 0.1 to 0.3 V of headroom: a clean 3.3 V out from a 3.5 V input, squeezing the battery nearly dry. Whenever the input sits only a little above the output you want — fed from another regulator, or from a battery near its target — the LDO is the right tool.
The honest heat tradeoff
Here is the bill, and there is no dodging it. The pass transistor drops the entire difference (Vin minus Vout) across itself while carrying the full load current I, so it burns P = (Vin minus Vout) times I as heat — power dissipation turned straight into warmth. A linear regulator is, in essence, a smart self-adjusting resistor that throws away the excess voltage. The useful output power is only Vout times I, so the best possible efficiency is just Vout/Vin (and a hair less once you count the chip's own quiescent current). This is the deep, honest limit of the whole linear approach.
Put numbers on it. Make 5 V at 1 A from a 12 V rail: the chip dissipates P = (12 minus 5) times 1 = 7 W while delivering just 5 W to the load — an efficiency of 5/12, about 42 percent. That 7 W is real heat in a thumbnail-sized package, and without help the silicon will cook. Contrast the battery LDO from before: 3.3 V at 0.2 A from a 3.5 V input wastes only (3.5 minus 3.3) times 0.2 = 0.04 W, an efficiency of 94 percent. The moral is sharp: a linear regulator is wonderful when Vin sits close to Vout, and wasteful when the gap is wide.
Every watt has to leave the chip, or its junction overheats and dies, so power parts get a heat sink — a finned slab of aluminium that gives the heat a wide road to the surrounding air (guide 5 sizes it properly). And good regulators guard themselves: a current limit caps the output current so a shorted output cannot draw infinite current, and a thermal shutdown switches the chip off if the die climbs past about 150 degrees C, then restarts once it has cooled. The two together mean an overload makes a three-terminal regulator hiccup and survive, where a bare discrete pass transistor would simply burn out.