Buck & Boost Converters
The switching-regulator circuits that step voltage down (buck) or up (boost) by rapidly storing and releasing energy in an inductor.
Building on the last lesson: a switching regulator doesn't resist the extra voltage away as heat — it uses an inductor (remember Lesson 8: inductors resist sudden changes in current, and store energy in a magnetic field) as a temporary energy bucket, filled and emptied many thousands of times per second by a transistor acting as a fast switch.
A buck converter steps voltage down. The switch connects the inductor to the input supply in short pulses; between pulses, the inductor's stored energy keeps current flowing to the output through a diode. By controlling how long the switch stays on versus off during each cycle — the duty cycle, which you'll meet properly in Lesson 30 on PWM — the circuit controls exactly what average voltage reaches the output. A longer "on" time each cycle means a higher output voltage.
A boost converter flips the arrangement to step voltage up — useful for, say, running a 5V circuit from a single 1.5V AA battery. It works by letting the inductor build up a large amount of energy while the switch is closed, then forcing all of that energy out through a diode into the output capacitor when the switch opens, which produces a voltage spike higher than the input.
Both circuits need a feedback loop that constantly measures the output voltage and adjusts the switching duty cycle to keep it steady — this is usually handled entirely by a dedicated switching-regulator IC, so in practice you rarely build the switching logic yourself; you just choose the right IC and the right inductor and capacitor values around it.