The job of a regulator
Most circuits need a steady voltage, but the supply rarely matches. A battery’s voltage falls as it discharges, a plug-in adapter may deliver more than a chip wants, and different parts of one project may need different voltages. A voltage regulator takes an input and produces a stable output. The two common families go about it in very different ways.
Safety note: the ideas here apply to low-voltage electronics. Anything connected to household mains involves shock and fire hazards and belongs with certified products and qualified people. For other builds, follow the manufacturer’s ratings for any regulator you use.
How a linear regulator works
A linear regulator behaves like a smart, adjustable resistor placed in series with the load. It continuously adjusts how much resistance it presents so that the output stays at the target voltage. The surplus voltage, the difference between input and output, is simply dropped across the regulator, and the energy associated with it becomes heat.
The heat is easy to estimate. Power lost in the regulator is approximately:
(input voltage - output voltage) x load current
For example, converting 9 V down to 5 V with a load that draws 0.5 A means a 4 V difference, so the regulator dissipates about 4 x 0.5 = 2 W as heat. That is enough to make a small package very hot without a heat sink. By contrast, the same regulator taking 6 V down to 5 V at 0.5 A dissipates 1 x 0.5 = 0.5 W. The smaller the gap between input and output, the less heat.
Linear regulators also have a dropout voltage, which is the minimum difference needed between input and output for regulation to work. Standard types need a volt or two of headroom, while low-dropout (LDO) types need less. As a battery discharges, the input may fall close to the output and a regulator with too high a dropout stops regulating. Check the datasheet for the figure; reading datasheets is the reliable way to learn these details.
Strengths. They are simple, small, cheap and quiet. The output is clean, with little electrical noise, which suits sensitive analogue circuits, sensors and radio front ends.
Weaknesses. They waste energy in proportion to the voltage drop. Efficiency roughly equals output voltage divided by input voltage (ignoring the small current the regulator itself uses), so a large step-down wastes most of the input power. That hurts battery life and creates heat that has to go somewhere.
How a switching regulator works
A switching regulator takes a different route. It rapidly switches the input on and off, thousands or millions of times a second, using a transistor, and uses an inductor and capacitor to smooth the result. The ratio of on-time to off-time sets the average output. The principle relies on storing energy briefly in the inductor and releasing it to the load, instead of burning the excess as heat.
Because it does not dissipate the difference as heat in the same way, a switching regulator can be considerably more efficient, especially where the input is much higher than the output. Different topologies exist: a buck type steps voltage down, a boost type steps it up, and others can do both. A linear regulator can only step down. That ability to boost is why switching converters appear in battery projects that need a higher voltage than a single cell provides.
Strengths. Higher efficiency over a wide range of inputs, less heat for the same load, and the ability to step up as well as down.
Weaknesses. More complexity, more components and more things to get wrong. The rapid switching creates electrical noise and ripple on the output and can radiate interference. Layout and component selection affect performance, and a poorly laid out board can misbehave. Noise can upset analogue measurements, audio circuits and radios.
Heat versus noise
The core trade-off is simple: linear regulators are quiet but waste energy as heat, and switching regulators are efficient but noisy. Which matters more depends on the project.
- A small sensor board that is powered from a supply a little above its needed voltage may be best served by a linear regulator. Its heat is small, and its quiet output helps readings.
- A battery-powered device that needs a long runtime, or any build that drops a large voltage at significant current, usually benefits from a switching converter. Its efficiency affects how long the pack lasts, as you can see in the way a battery runtime estimate depends on actual current drawn.
- A mix is common. Some designs use a switching regulator for the bulk step-down, followed by a linear regulator for a clean final rail feeding a sensitive part.
Reducing noise in practice
Whichever type you use, smoothing capacitors help. Input and output capacitors recommended in the datasheet should be fitted close to the regulator, and decoupling capacitors near each chip help absorb fast changes in current. Keeping wiring short, separating noisy switching sections from sensitive analogue sections and using a ground plane or sensible grounding are typical practices. Ready-made regulator modules take care of much of this, though quality varies, so check what protections and ratings they claim and treat unverified claims cautiously.
Ratings and safety
Check the input voltage limit, the output current capability and the thermal limits of any regulator, and leave margin. A regulator that runs hot at the edge of its ratings can fail, and failure of a regulator can sometimes pass the higher input voltage on to the circuit it was meant to protect. Protective measures such as a fuse upstream, correct wire gauge and sensible enclosures reduce the consequences of a fault, and good project enclosures also give heat a way out.
Remember that regulators do not remove the need for protection on batteries. Lithium packs still need their own protection against over-discharge and short circuits, and the regulator is only one part of the power chain.
Choosing: a short checklist
- Compare input and output voltage. A small gap favours a linear regulator; a large gap favours a switching one.
- Estimate the load current and calculate heat for the linear option.
- Consider how sensitive the downstream circuit is to noise.
- Check whether you need to step voltage up as well as down.
- Check dropout, ratings and thermal limits in the datasheet.
When uncertain, a well-reviewed, ready-made module from a reputable source can be a sensible choice, and for anything near mains voltage, use certified supplies rather than building your own.