By Grace Whitlock Fact-checked by Hugo Lindgren Published
A Li-ion 18650 cell starts at about 4.2 V when fully charged and ends near 3.0 V, so it spends part of its life above an ESP32’s 3.3 V rail and part below it. A buck regulator can only step voltage down and a boost regulator can only step it up. A buck-boost converter does both, and it keeps the output steady while the input crosses it. This guide covers the three circuits sold under that name, the formulas behind them and the modules that hold up in maker projects.
Key takeaways
- You need a buck-boost when your input voltage range crosses your output voltage. Otherwise a plain buck or boost is simpler and more efficient.
- Sellers use “buck-boost” for three different circuits: classic inverting (negative output), SEPIC modules (XL6009, LM2577) and 4-switch synchronous ICs (TPS63xxx).
- For one Li-ion cell feeding a 3.3 V ESP32, a 4-switch part such as the TPS63802 or TPS63031 is the right choice, not an LM2596 buck or an LDO.
- Size the inductor and diode for Iload/(1−D), not Iload. Treat a cheap module’s current rating as a peak switch limit, not as continuous output.
- A buck-boost will happily drain an unprotected cell until it is damaged, so you still need low-voltage cutoff.
Fact-checked
We checked these key facts against the sources named, on November 14, 2026:
- Add a dummy load: a 100 Ω resistor draws 33 mA at 3.3 V; use 220 Ω at 5 V (source: allaboutcircuits.com)
- Per TI’s datasheet, the TPS63031 delivers 800 mA in buck mode and 500 mA in boost mode (VIN above 2.4 V) (source: ti.com)
- Usually, but by less than you might expect for a single Li-ion cell, where an LDO reaches 79 to 89% while the cell sits above its dropout (source: ti.com)
- Use X5R or X7R ceramics close to the IC pins, and remember that a 10 µF ceramic rated 6.3 V can lose most of its capacitance at 5 V of DC bias (source: murata.com)
- The XL6009’s 400 kHz and the TPS63031’s 2.4 MHz allow small inductors and capacitors, while the older LM2577 runs much slower and needs larger magnetics (source: ti.com)
What is a buck-boost converter (and do you actually need one)?
A buck-boost converter is a switching DC-DC regulator that can make an output voltage higher or lower than its input. It does this by storing energy in an inductor while a switch is on and releasing it into the output while the switch is off. The decision rule is simple. If your input’s whole range stays above your output, use a buck. If it stays below, use a boost. If it crosses the output at any point (battery full vs battery empty, USB vs battery, a 3S LiPo pack feeding a 12 V rail), you need buck-boost.
The 18650-to-ESP32 case is the textbook example. A fresh cell at 4.2 V is 0.9 V above the 3.3 V target, so the converter has to step down. Near the end of discharge, at 3.0 V, it is 0.3 V below and has to step up. The ESP32 is specified for a 3.0 to 3.6 V supply, so it tolerates some droop, but Wi-Fi transmit bursts pull the rail down hardest exactly when the cell is weakest. That is when brownout resets begin.
So, for a 3.7 V LiPo powering a project: should you go up or down? It depends on the rail. For a 5 V Arduino Uno, the cell is always below 5 V, so a boost converter works and buck-boost is optional. For a 3.3 V ESP32, the cell crosses 3.3 V, so you should use buck-boost or accept losing the bottom part of the cell’s capacity.
Buck vs boost vs buck-boost in one table
All three topologies use the same parts: a switch, an inductor, a diode or second switch, and capacitors. What changes is where the inductor sits. The table compares them, including the two non-inverting variants that most hobby modules use.
| Topology | Output vs input | Output polarity | Typical maker use | Example part |
|---|---|---|---|---|
| Buck (step-down) | Always lower | Positive | 12 V robot pack to 5 V logic | LM2596 |
| Boost (step-up) | Always higher | Positive | One Li-ion cell to 5 V USB | MT3608 |
| Inverting buck-boost | Higher or lower magnitude | Negative | −5 V or −12 V rail for op-amps, LCD bias | Inverting-configured buck IC |
| SEPIC | Higher or lower | Positive | 9 to 16 V input to a fixed 12 V rail | XL6009, LM2577 modules |
| 4-switch synchronous buck-boost | Higher or lower | Positive | Li-ion cell to 3.3 V ESP32 | TPS63802, TPS63031 |
| Cuk converter | Higher or lower magnitude | Negative | Low-noise negative rails | Rare in hobby modules |
Why not just use an LDO or a plain buck module?
The trouble with both is dropout, not efficiency. A linear regulator from 4.2 V to 3.3 V is 79% efficient (efficiency equals Vout/Vin), and at the cell’s 3.7 V plateau it is about 89%. That is close to what a cheap switcher manages. The problem is that every linear regulator needs some headroom. Common AMS1117-class parts need roughly a volt, and even a good low-dropout part stops regulating once the cell sags to a few hundred millivolts above 3.3 V, which leaves the rest of the cell’s charge unused.
A plain buck module fails the same way. In an Arduino Forum thread from 2025 (a community source, but the measurements are typical), an ESP32-CAM powered through an LM2596 buck sagged to about 2.9 to 3 V under load and kept failing. The advice in the thread was a converter with very low dropout or a buck-boost. A buck cannot output more than its input minus its losses, so once the source falls near the target, the output follows it down.
The counter-argument deserves a fair hearing. If your project can live with a narrower range, a single LiFePO4 cell (3.2 V nominal, about 3.6 V full) sits inside the ESP32’s supply window and needs no regulator at all. If you need maximum runtime from Li-ion, though, buck-boost wins.
The three things sold as “buck-boost”
Three different circuits are sold under the same label: the classic inverting buck-boost, which outputs a negative voltage; the SEPIC, which outputs a positive voltage through two inductors and a coupling capacitor; and the 4-switch synchronous buck-boost, which outputs a positive voltage through a single inductor and four transistors. Listings rarely say which one you are getting, so learn to recognise each on the board.
Inverting buck-boost
The classic buck-boost uses one switch, one inductor, one diode and one output capacitor, and its output is negative with respect to ground. As TI’s Analog Applications Journal note SLYT286 describes, the circuit is a buck converter with the inductor and catch diode swapped and the output capacitor reversed.
In words: Vin goes to the switch, the switch node goes to an inductor whose other end is grounded, and a diode with its anode at the output and its cathode at the switch node carries energy to a capacitor whose positive side is grounded.
- Pros: fewest parts, any buck IC with a floating ground can be repurposed, and output magnitude can be above or below the input.
- Cons: negative output only, pulsed input and output current (noisy), and the IC is stressed by Vin plus |Vout|.
SEPIC modules (XL6009, LM2577)
A SEPIC (single-ended primary-inductor converter) gives a positive output that can be above or below the input, using a boost-style switch to ground, two inductors (or one coupled inductor) and a series coupling capacitor. Its ideal transfer function is Vout = Vin·D/(1−D), the same magnitude as the inverting buck-boost but with positive polarity.
The XLSEMI XL6009 is a boost controller with an internal switch. The chip accepts 5 to 32 V, switches at 400 kHz and has a 4 A internal switch rated to 60 V. Module listings quote up to 94% efficiency and outputs from 1.25 to 35 V, with efficiency falling as the gap between input and output grows. Many “XL6009” boards are boost-only, though. The automatic buck-boost version uses a different PCB, which you can spot by the coupling capacitor and the second (or coupled) inductor.
- Pros: positive output, wide input range up to about 32 V, cheap (US retailers commonly list single modules for about $4 to $11) and an adjustable trimpot.
- Cons: Schottky diode losses, mediocre efficiency at low voltages, current ratings that describe the switch rather than the output, and frequent relabeling.
4-switch synchronous buck-boost
A 4-switch buck-boost uses a single inductor between two half-bridges: two transistors on the input side and two on the output side. The controller picks a mode based on the input. With the input above the output it runs as a buck, below the output as a boost, and in the narrow band where they are nearly equal it runs a blended buck-boost or pass-through mode.
| Mode | When | Input-side switches | Output-side switches |
|---|---|---|---|
| Buck | Vin well above Vout | Switching | High-side held on |
| Buck-boost / pass-through | Vin close to Vout | Both bridges active in sequence | Both bridges active in sequence |
| Boost | Vin well below Vout | High-side held on | Switching |
Texas Instruments’ TPS63802 is a good example. Its datasheet (SLVSEU9D, January 2021 revision) lists 1.3 to 5.5 V input, 1.8 to 5.2 V adjustable output, 2 A output (at VIN ≥ 2.3 V and 3.3 V out), 11 µA quiescent current and a 3.0 × 2.0 mm VSON package, with automatic switching between buck, boost and buck-boost modes.
- Pros: positive output, no diode drop, the highest efficiency of the three at 3.3 to 5 V, and seamless switching across the cell’s range.
- Cons: input usually limited to 5.5 V on the TPS63 family, the parts come in leadless packages that are hard to hand-solder, and good breakouts cost more than SEPIC modules.
How it works: switch ON, switch OFF
Every buck-boost moves energy in two phases. With the switch on, the input charges the inductor’s magnetic field while the output capacitor alone feeds the load. With the switch off, the inductor dumps that energy into the output. The inverting version is the clearest case, so the phases below follow it.
Phase 1: storing energy in the inductor
When the switch closes, the full input voltage appears across the inductor, so its current ramps up at a slope of Vin/L. The diode is reverse-biased and blocks, which means no energy reaches the output during this phase. The output capacitor carries the entire load current by itself. This is why buck-boost output ripple is worse than a buck’s at the same capacitance.
Phase 2: dumping energy into the output
When the switch opens, the inductor fights any change in its current. Its voltage flips polarity, the switch-node end swings below ground, and the diode conducts. Current keeps flowing in the same direction through the inductor, from ground through the inductor and diode, which pulls the output capacitor’s ungrounded plate negative. That reversal is the whole reason the classic output is negative. The inductor current ramps down at a slope of |Vout|/L until the switch closes again.
SEPIC and 4-switch designs rearrange the parts so that the released energy charges the output positive, but the same store-then-release cycle drives them.
Continuous vs discontinuous conduction
In continuous conduction mode (CCM), the inductor current never reaches zero during the off phase, and the formulas below apply cleanly. At light load the current falls to zero before the next cycle. That is discontinuous conduction mode (DCM), where the output voltage starts to depend on load as well as duty cycle. Good ICs handle DCM with power-save or pulse-skipping modes. Cheap modules with minimal compensation often handle it badly, which is one cause of the light-load misbehavior covered in the troubleshooting section.
Buck-boost converter waveforms
On a scope, a buck-boost in CCM shows a square switch-node voltage, a triangle-shaped inductor current and a small sawtooth on the output. The table describes each signal in both phases for an inverting converter, so you can tell what you are looking at.
| Signal | Switch ON (D·T) | Switch OFF ((1−D)·T) | What a cheap scope shows |
|---|---|---|---|
| Switch-node voltage | About +Vin | About Vout − Vf (negative) | Square wave swinging Vin + |Vout|, with ringing on edges |
| Inductor current | Rising at Vin/L | Falling at |Vout|/L | Triangle riding on a DC level of Iload/(1−D) |
| Diode current | Zero | Jumps to inductor peak, then ramps down | Pulsed, high peak |
| Output voltage | Sagging (cap feeds load) | Recovering (diode recharges cap) | Sawtooth plus spikes at switch edges |
Inductor current ripple
Peak-to-peak inductor ripple is ΔI = Vin·D/(f·L). For 12 V in, D = 0.5, 400 kHz and a 22 µH inductor, that gives ΔI = 6 / 8.8 ≈ 0.68 A. With a 1 A load, the average inductor current is 2 A (see the formulas below), so the peak is about 2.34 A. Pick an inductor whose saturation current clears that with margin, around 2.8 A or more.
Output voltage ripple
Because the capacitor feeds the load alone for the whole on time, the capacitive ripple is approximately ΔV ≈ Iload·D/(f·C). At 1 A, D = 0.5, 400 kHz and 22 µF, that is 57 mV. On top of that comes ESR ripple, which is the capacitor’s ESR multiplied by the peak diode current. At a 2.34 A peak and 20 mΩ of ESR, that adds about 47 mV. Low-ESR ceramics, and one more capacitor in parallel, fix most ripple complaints. If you probe with a long ground clip, the spikes you see are mostly probe pickup, so use the short ground spring.
Buck-boost formulas with a worked example
The core inverting buck-boost relationship in CCM is Vout = −Vin·D/(1−D), where D is the fraction of each switching period that the switch is on. As the Plexim reference material notes, the output goes toward 0 as D approaches 0 and toward negative infinity as D approaches 1. In practice, losses cap the usable gain long before that.
Inverting formula and duty cycle
The formula comes from volt-second balance: over a full cycle in steady state, the inductor’s average voltage must be zero. During the on time it sees Vin for D·T. During the off time it sees Vout (negative) for (1−D)·T. Setting Vin·D + Vout·(1−D) = 0 and solving gives the transfer function. Rearranged for duty cycle, as Microchip’s buck-boost application note gives it:
D = |Vout| / (|Vout| + Vin)
For 12 V in and −12 V out, D = 12/24 = 0.5. That is the classic symmetric case: at 50% duty cycle, the output magnitude equals the input.
Inductor current and why it’s higher than you think
The average inductor current in an inverting buck-boost is IL = Iload/(1−D), according to the same Microchip note. That is higher than in a buck, where the inductor current equals the load current. At D = 0.5, the inductor carries twice the load current. At D = 0.7, it carries 3.3 times as much. TI’s SLVA721 design note identifies the worst case as maximum duty cycle at minimum input voltage, so run your inductor, switch and diode numbers at the lowest Vin you expect.
Size for the real current
Size your inductor and diode for Iload/(1−D), not Iload. At D = 0.5 that is double the load current, before you add half the ripple on top.
4-switch duty cycle at both ends of a battery’s range
For a non-inverting 4-switch converter, TI’s application report SLVA535B says to calculate the minimum duty cycle for buck mode at maximum input and the maximum duty cycle for boost mode at minimum input, with efficiency (η) included:
- Buck mode: D = Vout / (Vin_max × η)
- Boost mode: D = 1 − (Vin_min × η) / Vout
Worked example: one 18650 cell to a 3.3 V ESP32, with an assumed 90% efficiency.
- Full cell, 4.2 V, buck mode: D = 3.3 / (4.2 × 0.9) = 0.87. Inductor current is about equal to the load current.
- Near empty, 3.0 V, boost mode: D = 1 − (3.0 × 0.9) / 3.3 = 0.18. Inductor current rises to Iload/(1−D) ≈ 1.22 A per amp of load. That matches the input current you get from power balance: 3.3 W / (0.9 × 3.0 V) = 1.22 A.
- Around 3.3 to 3.5 V, the converter is in its buck-boost or pass-through band, and you only see a smooth handover if the IC handles the transition well, which TI’s TPS63 parts are designed to do.
The table collects the worked cases. Inverting and SEPIC values are ideal (lossless). The 4-switch rows use η = 0.9.
| Vin | Target Vout | Mode | Duty cycle D | Avg inductor current (per 1 A load) |
|---|---|---|---|---|
| 12 V | −12 V | Inverting | 0.50 | 2.0 A |
| 12 V | −5 V | Inverting | 0.29 | 1.42 A |
| 5 V | −12 V | Inverting | 0.71 | 3.4 A |
| 4.2 V | 3.3 V | 4-switch, buck | 0.87 | 1.0 A |
| 3.0 V | 3.3 V | 4-switch, boost | 0.18 | 1.22 A |
| 5 V | 12 V | SEPIC (XL6009 module) | 0.71 | 2.4 A input inductor, 1.0 A output inductor |
The Vin + |Vout| voltage trap
In an inverting buck-boost, the IC’s ground pin connects to the negative output, so the chip sees the voltage from VIN to VOUT rather than to ground. Microchip’s application note spells out the consequence: the maximum allowed input is the IC’s rating minus |Vout|. Take a buck IC rated for 40 V that you want to make −15 V with. Its input is now limited to 25 V, minus a safety margin. The switch node also swings the full Vin + |Vout|, so the diode’s reverse voltage rating has to cover that too.
Did you know?
At 50% duty cycle, a classic inverting buck-boost turns 12 V into −12 V, so the output magnitude equals the input. Every other duty cycle makes it either smaller (below 0.5) or larger (above 0.5).
Choosing parts for a DIY buck-boost circuit
If you build a converter from a bare controller, three choices matter most: an inductor that will not saturate at peak current, a rectifier that will not overheat, and output capacitors with low enough ESR. Get those right and most other details are forgiving.
Inductor
Pick an inductance that keeps ripple around 20 to 40% of the average inductor current, then check two ratings. The saturation current must exceed the peak (average plus half the ripple) at minimum Vin. The RMS current rating, which is thermal, must exceed the average. When a saturated inductor’s inductance collapses, current spikes, the switch hits its limit and the output sags, which looks like “the module can’t deliver its rating”. A low DC resistance (DCR) cuts conduction loss, which counts most in boost mode at low input.
Diode or synchronous switch
In a non-synchronous design the Schottky diode carries the full output current on average and the inductor’s peak current in pulses. At 3.3 V out, a 0.4 V Schottky drop alone costs about 12% of output power. That is the main reason 4-switch synchronous ICs beat SEPIC modules at low voltage. At 12 to 24 V out, the same drop is 2 to 3%, and a diode is perfectly reasonable. Choose a Schottky rated for at least 1.5 times the peak current and comfortably above Vin + |Vout| (inverting) or Vout plus Vin (SEPIC) in reverse voltage.
Switching frequency trades size for losses. The XL6009’s 400 kHz and the TPS63031’s 2.4 MHz allow small inductors and capacitors, while the older LM2577 runs much slower and needs larger magnetics. Higher frequency means more switching loss per watt and more radiated noise, so fast parts reward a tight layout.
Input and output capacitors
Buck-boost converters draw pulsed current on the input (inverting) and deliver pulsed current to the output (all types), so both capacitors see real ripple current. Use X5R or X7R ceramics close to the IC pins, and remember that a 10 µF ceramic rated 6.3 V can lose most of its capacitance at 5 V of DC bias. Check the manufacturer’s DC-bias curve. Add an electrolytic or polymer bulk capacitor for load transients, and on SEPIC designs the coupling capacitor must handle the full RMS ripple current.
Best buck-boost modules and ICs for makers
For one-cell Li-ion projects, a 4-switch TI part (TPS63802, TPS63031, TPS63020) gives the best results. For 5 V or 3.3 V from a wider battery range, Pololu’s S9V11 series is the easiest drop-in. For 12 to 24 V rails, XL6009 SEPIC modules are cheap and adequate if you derate them. The picks below are based on datasheet input range, rated current at realistic input voltages, quiescent current and topology, ranked in that order for battery use. Listing claims were not counted.
| Part / module | Topology | Input range | Output | Rated current | Best for |
|---|---|---|---|---|---|
| TI TPS63802 (IC) | 4-switch synchronous | 1.3–5.5 V | 1.8–5.2 V adjustable | 2 A at VIN ≥ 2.3 V, 3.3 V out | ESP32 from one Li-ion cell |
| TI TPS63900 (IC) | 4-switch synchronous | 1.8–5.5 V | 1.8–5 V in 100 mV steps | >400 mA at VIN ≥ 2.0 V, 3.3 V out | Deep-sleep sensors |
| TI TPS63020 (IC) | 4-switch synchronous | 1.8–5.5 V (EVM) | Adjustable (EVM set to 3.3 V) | 4 A switches | Higher-current 3.3 V rails |
| ThingPulse breakout (TPS63031) | 4-switch synchronous | 1.8–5.5 V | 3.3 V fixed | 800 mA buck, 500 mA boost (chip) | Drop-in ESP32/ESP8266 supply |
| Pololu S9V11F5 | Synchronous buck-boost module | 2–16 V (3 V to start) | 5 V fixed | About 1.5 A typ near 5 V in | 5 V Arduino from batteries |
| Pololu S9V11F3S5 | Synchronous buck-boost module | 2–16 V (3 V to start) | 3.3 V, or 5 V via SEL | About 1.5 A typ | 3.3 V boards from 1 to 4 cells |
| XL6009 buck-boost module | SEPIC | 5–32 V (chip) | 1.25–35 V (listing) | 4 A switch, about 3 A diode | 12–24 V rails, LED strips |
| LM2577 SEPIC module | SEPIC | 3.5–40 V (chip) | Adjustable | 3 A switch | Same jobs, often sold as XL6009 |
Pricing varies a lot. Pololu lists the S9V11F5 at $8.95 for one unit. XL6009 modules commonly sell for about $4 to $11 at US retailers. The bare TPS63031 chip costs under a dollar in volume (about $0.76 each per 1,000 in distributor listings), but it comes in a tiny leadless package, which is why breakout boards exist.
For ESP32 / 3.3 V from one Li-ion cell
Choose a TPS63802- or TPS63031-class 4-switch converter. The ThingPulse board puts the TPS63031 on a breakout for ESP32 and ESP8266 projects, with 1.8 to 5.5 V in, a fixed 3.3 V out and up to 96% claimed efficiency. Per TI’s datasheet, the TPS63031 delivers 800 mA in buck mode and 500 mA in boost mode (VIN above 2.4 V). That covers a bare ESP32 module. If you add a camera, LEDs or a power-hungry display, the TPS63802’s 2 A is the safer headroom.
For an ESP32-CAM, the board already has its own 3.3 V linear regulator fed from its 5 V pin. Driving that pin from a 5 V buck-boost such as the Pololu S9V11F5 gives the onboard regulator its headroom back, which avoids the sag reported in the LM2596 thread.
Pick the right family
For one Li-ion cell to a 3.3 V ESP32, pick a 4-switch buck-boost (TPS63802 or TPS63031 class) over an LM2596 buck. The buck drops out as the cell drains, right when Wi-Fi peaks hit hardest.
For 5 V Arduino / Raspberry Pi Pico from batteries
The Pololu S9V11F5 is the simplest route to a steady 5 V for an Arduino Uno’s 5V pin from three or four AA cells or one Li-ion cell. Pololu’s page notes two catches. It needs 3 V to start, though it keeps running down to 2 V once started. And its 1.5 A typical maximum applies when the input is near 5 V, so available current falls as the input moves away from the output. From a nearly empty Li-ion cell, plan on well under 1.5 A.
The original Raspberry Pi Pico and Pico W need no external converter at all. They already carry an RT6150 buck-boost behind the VSYS pin, which accepts 1.8 to 5.5 V, so a single Li-ion cell can feed VSYS directly. Full-size Raspberry Pi boards are a different matter. A Pi 5 wants a 5 V, 5 A supply, which is beyond these hobby modules.
For wide-range 12–24 V robot rails
A 3S LiPo runs from about 12.6 V down to about 9.9 V, so a 12 V rail from it needs buck-boost, and an XL6009 SEPIC module is the usual budget choice. Keep the motors and servos on their own supply and use the buck-boost only for the logic and sensors that need a steady voltage. Motor inrush is exactly the kind of load that trips a cheap module’s switch limit.
Derate hard. From 5 V to 12 V at 1 A out, an ideal SEPIC draws 2.4 A from the input, and the switch carries input plus output current while it is on. That puts a 4 A switch limit at roughly 1 A of continuous 12 V output once you add losses and ripple, far from the 4 A on the listing. From a 12 V source to 24 V, the ratio is better but the same logic applies.
For deep-sleep sensors (quiescent current)
When a board sleeps most of the time, the regulator’s own standby draw (quiescent current, Iq) can matter more than its peak efficiency. Compare these datasheet figures first:
| IC | Typical quiescent current | Source |
|---|---|---|
| TPS63900 | 75 nA (60 nA shutdown) | TI product page |
| TPS631000 | 8 µA | TI comparison listing |
| TPS63802 | 11 µA | Datasheet SLVSEU9D |
| TPS63031 | 25 µA typ, 35 µA max at 3.6 V in | Datasheet SLVS696D |
Does quiescent current kill the battery if your ESP sleeps 99% of the time? With an 18650, not from a good IC. A 2,500 mAh cell would take over 25 years to drain at the TPS63802’s 11 µA alone, so the ESP32’s own deep-sleep current, your board’s extra parts and the cell’s self-discharge dominate. Iq becomes decisive with small batteries: a 220 mAh coin cell loses its whole charge to 11 µA in about 2.3 years, while 75 nA barely registers. What does kill batteries is a cheap module with a power LED. If a module’s LED and circuitry draw 3 mA, the same 2,500 mAh cell is gone in about 35 days.
The TPS63900 also offers a programmable input current limit from 1 to 100 mA, or unlimited, which suits weak primary cells. Its output of just over 400 mA is marginal for ESP32 Wi-Fi bursts, so it fits best with BLE and low-power microcontrollers.
Did you know?
According to Texas Instruments, the TPS63900 draws 75 nA of quiescent current, about 147 times less than the TPS63802’s 11 µA. On a coin-cell sensor, that difference can decide whether the regulator or the application drains the battery.
Sleep math first
If your board spends most of its time in deep sleep, compare quiescent current first and peak efficiency second, and desolder or cut the power LED on any module you keep.
Wiring a buck-boost module to an ESP32 or Arduino
Wire the converter in this order: battery, then protection, then buck-boost, then microcontroller. Feed the regulated output into the board’s 3V3 pin (ESP32) or 5V pin (Arduino Uno), which bypasses the onboard regulator, and never connect the microcontroller until you have measured the output under a dummy load.
| From | To | Wire purpose |
|---|---|---|
| 18650 cell + | Protection/charger board B+ | Cell into protection circuit |
| 18650 cell − | Protection/charger board B− | Cell return |
| Protection board OUT+ | Buck-boost VIN | Protected battery feed |
| Protection board OUT− | Buck-boost GND | Ground |
| Buck-boost VOUT (3.3 V) | ESP32 3V3 pin | Regulated supply, bypasses onboard LDO |
| Buck-boost GND | ESP32 GND | Common ground |
| Protection board OUT+ via 100 kΩ | ESP32 GPIO34 | Battery-sense divider top |
| ESP32 GPIO34 via 100 kΩ | ESP32 GND | Battery-sense divider bottom |
| 470 µF electrolytic (+) | ESP32 3V3, with (−) to GND | Reservoir for Wi-Fi bursts |
For an Arduino Uno, swap in a 5 V module such as the S9V11F5 and land VOUT on the Uno’s 5V header pin, not VIN, because VIN expects 7 V or more for the onboard regulator.
Power check
Never feed 3V3 from the buck-boost while USB is also plugged in, because two 3.3 V sources would be tied together. Li-ion cells can deliver very high short-circuit currents, so insulate every joint before power-up.
Setting the trimpot safely
Adjustable modules (XL6009, LM2577) often ship set to a high voltage, and fixed modules can read high at no load. The S9V11F5, for example, can rise to 5.2 V at no load. Use this sequence:
Build steps
- Connect only the battery or a bench supply to VIN, with nothing on VOUT.
- Measure VOUT with a multimeter and turn the trimpot slowly toward the target.
- Add a dummy load: a 100 Ω resistor draws 33 mA at 3.3 V; use 220 Ω at 5 V.
- Re-check VOUT under load and trim again if it moved.
- Power down, connect the microcontroller, then power up and measure once more.
Maker tip
Multi-turn trimpots on cheap modules do not all turn the same way. Make one quarter-turn, measure, and only then keep going, so you never overshoot past 3.6 V into an ESP32.
Battery protection and low-voltage cutoff
Do you still need over-discharge protection with a buck-boost module? Yes. A buck-boost is designed to keep the output steady as the input falls, so it will drain an unprotected 18650 far below a safe voltage without any visible sign. Use a protected cell, a charger board with a protection IC (the common TP4056 modules come in protected and unprotected versions), or a regulator with built-in cutoff. Pololu sells an S9V11F3S5C3 variant with a fixed 3 V low-voltage cutoff.
A firmware cutoff adds a second layer. This ESP32 Arduino sketch reads the cell through the divider in the wiring table and puts the chip into deep sleep below a threshold. GPIO34 is one of the ESP32’s input-only general purpose input output pins on ADC1, so it keeps working while Wi-Fi is active.
\#include "esp_sleep.h"
const int BATT_PIN = 34; // ADC1 input-only pin
const float DIVIDER_RATIO = 2.0; // 100k over 100k
const int CUTOFF_MV = 3300; // cell voltage cutoff in millivolts
void setup() {
Serial.begin(115200);
}
void loop() {
uint32_t sum = 0;
for (int i = 0; i < 16; i++) {
sum += analogReadMilliVolts(BATT_PIN);
delay(2);
}
int cellMv = (int)((sum / 16) * DIVIDER_RATIO);
Serial.printf("Cell: %d mV\n", cellMv);
if (cellMv < CUTOFF_MV) {
Serial.println("Low battery, sleeping until reset");
Serial.flush();
esp_deep_sleep_start(); // no wake source configured
}
delay(5000);
}
The 200 kΩ divider draws about 21 µA from a full cell, which is more than the TPS63802’s quiescent current. For long sleep projects, use 1 MΩ resistors with a 100 nF capacitor across the bottom resistor, or switch the divider with a MOSFET.
Troubleshooting: overheating, sagging and fake modules
Most buck-boost failures in maker projects have three causes: a rectifier diode running past its rating, a cheap module losing regulation at light load or low input, and a chip that is not what the listing claims. The table maps symptoms to fixes.
| Symptom | Likely cause | Fix |
|---|---|---|
| Module hot near the output side | Schottky diode overloaded | Cut the load, add airflow, or swap to a higher-rated diode |
| Output drops on Wi-Fi bursts | Converter at current limit or too little bulk capacitance | Add 470 µF at the load, choose a 2 A part |
| Output collapses to about 2 V at light load | Poor DCM handling on cheap SEPIC boards | Add a small preload resistor or change module |
| Will not start from a weak battery | Startup threshold (S9V11 needs 3 V) | Start above 3 V or choose a lower-start IC |
| ESP32-CAM resets as battery drains | Buck module in dropout | Replace with a buck-boost |
| Charging a LiPo through the module overheats it | No current limiting, battery draws everything | Use a proper charger |
Module gets hot
On many XL6009 boards the 4 A IC is not the bottleneck. In a teardown thread on Budgetlightforum (a community source with photos and part numbers), the output Schottky diode, rated around 3 A absolute maximum, was identified as the real current limit. In a SEPIC the diode carries the full output current on average and the inductor peak in pulses, so it heats first. If the diode or inductor is too hot to touch after a minute, you are past what the board can sustain.
One heating case comes up often: an XL6009 boost board used to charge a 2S LiPo. A voltage regulator has no constant-current stage and no charge termination, so a discharged pack pulls as much current as the converter can push and the diode cooks. Use a dedicated balance charger for multi-cell packs.
Output drops under load or at light load
Sagging under load usually means the converter is at its switch current limit. Recall the Iload/(1−D) multiplier and the fact that available current falls as input moves away from output. Sagging at light load is a separate symptom. Owners on maker forums report regulation collapsing to around 2 V on some cheap XL6009 boards at very light loads. That points to poor discontinuous-mode behavior rather than a dead part. If the module regulates properly with a small resistor load, it is not broken, but it is a poor fit for a sleepy microcontroller. Inrush is the other trap: a large capacitor or a motor on the output at power-up can trip the limit before the output ever comes up.
Spotting a fake or relabeled chip
The same Budgetlightforum thread found boards sold as XL6009 that were really LM2577S-ADJ CC/CV SEPIC modules. To check what you have:
- Read the marking under a loupe and compare the package and pinout against the datasheet you expect.
- Measure switching frequency with a scope on the switch node. An XL6009 runs at 400 kHz, while an LM2577 runs far slower, so the frequency is a reliable tell.
- Count trimpots. A CC/CV module with two pots is not a plain XL6009 board.
- Load-test with power resistors at your real input voltage and watch the diode temperature. Ignore the headline amp rating.
Treat the 4 A on XL6009 listings as the internal switch limit. Your real continuous output current is a fraction of it, set by the voltage ratio.
Which should you choose: the verdict
For a single Li-ion cell feeding a 3.3 V ESP32 or ESP8266, buy a 4-switch TI-based board: TPS63031 for bare modules up to about 500 mA, TPS63802 when you need 2 A. For a 5 V Arduino or a mixed battery range, the Pololu S9V11F5 at $8.95 is the least fiddly option, provided you start above 3 V. For 12 to 24 V robot rails, an XL6009 SEPIC module is fine if you treat it as a roughly 1 A part and watch the diode. For coin-cell or energy-harvesting sensors, the TPS63900’s 75 nA is in a different league.
Skip buck-boost altogether when your input never crosses your output. A buck from a 3S pack to 5 V, or a boost from one cell to 5 V, is simpler, cheaper and usually more efficient. Your next step: write down your input’s minimum and maximum, then your output voltage and peak current, and run the duty-cycle numbers above at the minimum input before you order anything.
FAQ
What is a buck-boost converter used for?
It holds a steady output voltage while the input moves above and below that voltage. Common uses are battery-powered projects (one Li-ion cell to 3.3 V, a LiPo pack to 12 V), automotive and solar inputs that swing widely, and negative supply rails using the inverting version.
What is the difference between a buck, boost and buck-boost converter?
A buck only steps voltage down, a boost only steps it up, and a buck-boost does either. All three store energy in an inductor while a switch is on and release it while the switch is off. The difference lies in where the inductor and diode sit, which sets whether the output ends up below, above or either side of the input.
Why is the output of a buck-boost converter negative?
In the classic topology, the inductor connects to ground and the diode faces the output. When the switch opens, the inductor keeps its current flowing in the same direction, pulling current out of the output capacitor’s ungrounded plate and leaving it negative. SEPIC and 4-switch designs rearrange the parts to give a positive output.
What is the formula for a buck-boost converter?
For the inverting buck-boost in continuous conduction, Vout = −Vin·D/(1−D). A SEPIC has the same magnitude with positive polarity. Average inductor current in the inverting type is Iload/(1−D).
How do you calculate duty cycle for a buck-boost converter?
For the inverting type, D = |Vout|/(|Vout| + Vin). For example, 12 V to −12 V gives D = 0.5. For a 4-switch type, TI’s SLVA535B method uses D = Vout/(Vin_max × η) in buck mode and D = 1 − (Vin_min × η)/Vout in boost mode, so you calculate at both ends of the input range.
Is a SEPIC the same as a buck-boost converter?
Functionally yes, structurally no. A SEPIC steps up or down like a buck-boost and has the same voltage-gain magnitude, but it uses two inductors and a coupling capacitor to give a positive output. Most cheap “automatic buck-boost” modules built on the XL6009 or LM2577 are SEPICs.
What is the best buck-boost converter module for an ESP32?
Pick a board built on a TI 4-switch IC such as the TPS63031 (for example the ThingPulse breakout) or the TPS63802 for more current. Both cover a Li-ion cell’s full 3.0 to 4.2 V range with a fixed 3.3 V output and no diode drop. Pololu’s S9V11F3S5 suits wider input ranges.
Is a buck-boost converter more efficient than a linear regulator?
Usually, but by less than you might expect for a single Li-ion cell, where an LDO reaches 79 to 89% while the cell sits above its dropout. The real advantage of buck-boost is that it keeps regulating below 3.3 V, so it uses the whole cell. From higher input voltages, such as 12 V to 3.3 V, switching wins by a wide margin.
Can a buck-boost converter charge a battery?
Not safely by itself. A voltage regulator lacks the constant-current stage, charge termination and, for multi-cell packs, the balancing that a battery needs. Use a dedicated charger such as a TP4056 board for one Li-ion cell, or a balance charger for 2S and larger LiPo packs.
Which buck-boost converter IC should I use?
For 1.8 to 5.5 V inputs, the Texas Instruments TPS63 family covers most needs: TPS63802 for 2 A general use, TPS63020 for higher current, TPS63031 for a simple fixed 3.3 V output and TPS63900 for ultra-low quiescent current. If you are new to reading an integrated circuit datasheet, start from the TI evaluation module schematic and copy its layout.
Notes on this article
- Fact-checked by Hugo Lindgren against the sources listed below before publication.
- Published
Fact-checking
- Researched from 8 sources, listed below.
- Every claim is checked by Hugo Lindgren; anything we cannot confirm is corrected, labelled or removed.
Sources (8)
- Plexim: Buck-boost converter reference (plexim.com)
- Microchip application note: inverting buck-boost (file.aichiplink.com)
- TI Analog Applications Journal SLYT286 (ti.com)
- TI SLVA721 inverting buck-boost design (ti.com)
- TI SLVA535B basic calculations of a 4-switch buck-boost power stage (tij.co.jp)
- TI TPS63802 datasheet SLVSEU9D (ti.com)
- TI TPS63802 product page (ti.com)
- TI TPS63900 product page (ti.com)









