Sub topic 7
Switching regulators: buck, boost, and buck-boost
This chapter assumes you know Ohm's law and power (P = V × I), and that you have read the previous chapter on linear regulators, dropout, and heat. Here you will learn how switching regulators avoid that heat, which of the three common types fits a given battery, and what problems to expect when you use them.
Why a switching regulator exists
A linear regulator burns off the difference between input and output voltage as heat. Feeding 5 V at 100 mA from a 9 V battery wastes (9 − 5) × 0.1 = 0.4 W. The regulator delivers only 0.5 W to the load, so it is about 55% efficient. A linear regulator can also never produce an output above its input.
A switching regulator (also called a switch-mode converter or DC-DC converter) works differently. It turns a transistor on and off hundreds of thousands of times per second and uses an inductor to store energy between pulses. Because the transistor is either fully on or fully off, little power is lost as heat. Typical modules reach 85% to 95% efficiency.
How the switching works
The core parts are:
- A switch, usually a MOSFET (a transistor used as an electronic switch).
- An inductor, a coil that resists changes in current and stores energy in its magnetic field.
- A diode, or a second switch in synchronous designs, that gives the inductor current a path when the main switch is off.
- An output capacitor that smooths the pulses into a steady voltage.
- A control circuit that adjusts the duty cycle, the fraction of each switching period that the switch is on.
The controller watches the output voltage through a feedback divider. If the output drops, it raises the duty cycle. If the output rises, it lowers it. The switching frequency is fixed by the chip, commonly between 100 kHz and 2 MHz.
The three topologies
A topology is the arrangement of switch, inductor, and diode. Each of the three common ones suits a different relationship between battery voltage and the voltage you need.
Buck (step-down)
A buck converter produces an output lower than its input. In an ideal buck converter, the output voltage is the input voltage times the duty cycle: Vout = D × Vin. To get 5 V from 12 V, the duty cycle is about 5 / 12 ≈ 42%.
Use a buck converter when the battery is always above the needed voltage. Examples are a 9 V battery or a 3-cell LiPo (11.1 V nominal) feeding a 5 V board.
Boost (step-up)
A boost converter produces an output higher than its input. In an ideal boost converter, Vout = Vin / (1 − D). To make 5 V from 3.7 V, the duty cycle is 1 − 3.7/5 = 26%.
The input current is higher than the output current. Ignoring losses, power in equals power out, so stepping up from 3.7 V to 5 V at 500 mA output needs about 2.5 W / 3.7 V ≈ 0.68 A at the input, and more once efficiency losses are included. Check that the battery can supply this current (see the chapter on battery ratings and internal resistance).
Use a boost converter when the battery is always below the needed voltage. Examples are one or two AA cells, or a single-cell LiPo powering a 5 V load.
Buck-boost
A buck-boost converter keeps the output steady whether the input is above or below the target. This matters when the battery voltage crosses the target during discharge. A single lithium-ion cell runs from 4.2 V full to about 3.0 V empty. For a 3.3 V board, that range straddles the target. A buck converter would lose regulation near the bottom. A boost converter would be wrong at the top. A buck-boost handles both.
The cost is lower efficiency, a more complex design, and often more noise.
| Type | Output vs. input | Typical use | Notes |
|---|---|---|---|
| Buck | Always lower | 9 V or 12 V pack to 5 V or 3.3 V | Highest efficiency, simplest |
| Boost | Always higher | 1 to 2 AA cells or 1S LiPo to 5 V | Input current is higher than output current |
| Buck-boost | Higher or lower | 1S Li-ion to 3.3 V, 4×AA to 5 V | Handles the battery crossing the target voltage |
A common variant is the SEPIC converter, a buck-boost design whose output has the same polarity as the input. Many small modules labeled "buck-boost" are actually SEPIC.
Efficiency in practice
The datasheet efficiency is measured at a specific input voltage and load current. Real efficiency varies a lot with load. At very light loads, the fixed overhead of the controller dominates, and efficiency can fall below 50%. This is important for sleeping Arduino projects that draw a few milliamps.
You can compare the two regulator types for the same case with the helper below. It extends the heat calculation from the linear regulator chapter.
def ldo_input_power_w(v_in, v_out, current_a):
"""Input power of a linear regulator: load current flows from the input."""
return v_in * current_a
def switcher_input_power_w(v_out, current_a, efficiency):
"""Input power of a switching regulator at a given efficiency."""
return v_out * current_a / efficiency
v_in, v_out, i_load = 9.0, 5.0, 0.100
p_ldo = ldo_input_power_w(v_in, v_out, i_load)
p_buck = switcher_input_power_w(v_out, i_load, 0.90)
print(f"Linear: {p_ldo:.2f} W in, {(v_in - v_out) * i_load:.2f} W heat")
print(f"Buck: {p_buck:.2f} W in, {p_buck - v_out * i_load:.2f} W heat")
print(f"Battery current, linear: {p_ldo / v_in * 1000:.0f} mA")
print(f"Battery current, buck: {p_buck / v_in * 1000:.0f} mA")The output is:
Linear: 0.90 W in, 0.40 W heat
Buck: 0.56 W in, 0.06 W heat
Battery current, linear: 100 mA
Battery current, buck: 62 mAThe buck converter cuts battery current from 100 mA to about 62 mA for the same load. That is a runtime gain of roughly 60%, as long as the converter's own quiescent current stays small.
Trade-offs you must plan for
Switching regulators are not simply better. They cost you in several ways.
Electrical noise
The fast switching edges create ripple, a small repeating voltage variation at the switching frequency on the output, usually tens of millivolts. They also radiate electromagnetic noise. Possible effects in a project:
- Wrong readings from
analogRead, because the ADC (analog-to-digital converter) sees the ripple. - Interference in radio modules and audio circuits.
- Resets on boards with a marginal supply.
Mitigations include extra output capacitance, a small LC filter after the converter, a higher switching frequency, and physical distance from sensors. For very sensitive analog parts, use a switcher followed by an LDO. The LDO removes ripple and wastes little power because its input-to-output drop is small.
Layout and external parts
Pre-built modules hide most of this. If you design your own board, the inductor value, its saturation current rating, and the loop layout all affect stability. An inductor that saturates under peak current causes failures that look random.
Minimum input and start-up behavior
Boost converters often need a higher voltage to start than to keep running. A converter that runs down to 0.8 V may need 1.0 V or more to start. Datasheets list this as the start-up voltage.
Quiescent current
Quiescent current (Iq) is what the regulator draws with no load. Cheap modules can draw 5 to 10 mA, enough to drain a small battery in days even when the project sleeps. Parts designed for low-power use list an Iq in microamps.
Always-on boost modules and cutoff
Many small boost modules keep running until the battery is almost flat. This is a safety problem for lithium cells, which must not be over-discharged. Use a protection circuit or a converter with an undervoltage lockout (UVLO), a feature that turns the converter off below a set input voltage.
Choosing between the three
Work through these questions in order.
- Find the battery's voltage range from full to cut-off.
- Compare it with the voltage the load needs.
- If the whole range is above the target, pick a buck converter.
- If the whole range is below it, pick a boost converter.
- If the range crosses the target, pick a buck-boost converter.
- Confirm that the converter's current rating covers your peak load at the lowest battery voltage, because boost and buck-boost input current rises as the battery drains.
Exercise
Two AA alkaline cells in series give 3.2 V fresh and 2.0 V nearly empty. Your project needs a steady 3.3 V. Which topology do you pick, and why? Which topology would you pick if the project used four AA cells (6.4 V fresh, about 4.0 V empty) and needed 3.3 V?
Show answer
Two cells: the voltage range (2.0 to 3.2 V) is entirely below 3.3 V, so a boost converter is enough. A buck-boost also works but is less efficient. Four cells: the range (4.0 to 6.4 V) is entirely above 3.3 V, so a buck converter is the best choice, since it is the simplest and most efficient option.
Exercise
A 3.3 V board draws 80 mA. It is powered from a 9 V battery through a buck converter that is 88% efficient. How much current does the battery supply, and how does that compare with a linear regulator?
Show answer
Output power is 3.3 V × 0.080 A = 0.264 W. Input power is 0.264 / 0.88 = 0.30 W. Battery current is 0.30 / 9 ≈ 33 mA. A linear regulator would draw the full 80 mA from the battery, so the buck converter uses about 40% of the current and the battery lasts roughly 2.4 times longer.