A buck-boost converter
A lithium cell starts at 4.2 V and finishes at 3.0 V, and an ESP32 wants 3.3 V the whole way. A buck-boost converter steps the voltage down while the cell is above the rail and up once it is below. The TPS631000 does both with one coil, and while the board sleeps it costs about 20 µA, as long as its MODE pin is low.
A lithium cell spends its life on both sides of 3.3 V. Full, it is at 4.2 V; most of its charge comes out between 4.0 V and 3.6 V; and it is empty at 3.0 V. A regulator that can only step down, like every LDO and every buck converter, gets stuck where the cell crosses the rail. A buck-boost converter keeps going. It steps down above the rail, steps up below it, and does a bit of both in between.
The cell is at 3.90 volts, 70 per cent. The regulator is the TPS631000 in buck mode, MODE low. The rail is 3.30 volts and the cell supplies 36 mA.
Why an LDO is not enough
An LDO can only give out less than it takes in, and it needs a margin to do even that. The ME6211 on the logic level converter needs 260 mV at 200 mA, which is about what an ESP32 draws while Wi-Fi transmits (the bursts can go higher). So it needs 3.56 V in to hold 3.3 V out. Below that, every radio burst pulls the rail down.
Drag the cell down and watch the rail:
At 3.56 V about an eighth of the cell is still unused. When the cell gets near empty, the bursts pull the rail below 3.0 V, the lowest supply the ESP32 is rated for. A brownout reset in the middle of a transmission is the usual way you find out.
The buck-boost costs less above the rail as well. An LDO passes the board's whole current straight through and turns the extra voltage into heat. From a full cell, the board's 40 mA is 40 mA from the cell. A converter trades voltage for current, so at 4.2 V the same board takes about 34 mA.
What is inside it
The part here is TI's TPS631000, eight pins in a SOT-583 package about 2 mm by 1.6 mm. Inside are four switches, arranged as two legs:
- The input leg connects one end of the coil (LX1) either to the cell or to ground.
- The output leg connects the other end (LX2) either to ground or to the rail.
The only part outside the chip that stores energy is a 1 µH inductor between LX1 and LX2. For how a coil hands energy from one switch to the next, see the buck converter.
| TPS631000 (data sheet, typical) | |
|---|---|
| Input | 1.6 to 5.5 V (1.65 V to start) |
| Output | 1.2 to 5.3 V, set by two resistors |
| Current at 3.3 V out | 1.5 A from 2.7 V in, 2 A from 3 V in |
| Switching | 2 MHz, 1 µH coil |
| Drawn while idle | 8 µA |
| Drawn with EN low | 0.5 µA, output disconnected |
When it bucks, and when it boosts
The chip picks the mode from the two voltages, with no input from you:
- Cell above the rail: buck. The input leg switches back and forth to chop the cell's voltage down. The output leg holds LX2 on the rail.
- Cell below the rail: boost. The input leg holds LX1 on the cell. The output leg switches, storing energy in the coil and then releasing it at the higher voltage.
- Roughly equal: buck-boost. Both legs switch, and the chip alternates buck cycles with boost cycles.
The data sheet says the change from one mode to the next moves the output by less than 20 mV. The ESP32 does not notice it happen.
When it switches: the MODE pin
The MODE pin decides what happens when the load is small.
- MODE low: PFM (pulse-frequency modulation, which TI calls power save mode). When the load is light, the chip switches in short bursts to top the output up. Between bursts all four switches are open and the chip draws about 8 µA. It changes over to PFM by itself once the current in the coil falls below about 145 mA at its peak.
- MODE high: forced PWM. Every cycle runs at 2 MHz, whatever the load. The ripple on the output is smaller and always at the same frequency, which makes it easier to filter. With no load, half of each cycle pushes current backwards through the coil, and every cycle costs switching losses whether the board needs power or not.
With the board awake, the two modes are within a few per cent of each other. With the board asleep, they are not. The data sheet has no idle-current figure for forced PWM. Its efficiency curve puts the loss at about 20 mW with next to no load, or roughly 5 mA from the cell, and that empties a 2000 mAh cell in about two weeks. In PFM the same sleeping board takes about 20 µA. The curve stops at 100 µA of load, so treat that figure as an estimate. For comparison, the ME6211's own 60 µA would drain the cell in about three years.
Tie MODE to ground. Use forced PWM only when something on the rail needs a quiet supply at a fixed frequency, such as a radio module that is sensitive to supply noise or an audio stage. If you need that only occasionally, wire MODE to a GPIO and drive it high only for as long as it matters.
Where the parts go
The pins are 1 VOUT, 2 LX2, 3 LX1, 4 VIN, 5 EN, 6 MODE, 7 GND, 8 FB. The data sheet's 3.3 V design needs six parts besides the chip:
- A 22 µF capacitor from VIN to GND and a 47 µF capacitor from VOUT to GND.
- The 1 µH coil from LX1 to LX2. Choose one rated for the current, since the chip's switch limit is 3 A.
- 511 kΩ from VOUT to FB and 91 kΩ from FB to GND. FB regulates to 0.5 V, so the output is 0.5 × (1 + 511/91) = 3.31 V.
Three rules:
Never leave EN or MODE floating. The data sheet says so for both pins. Both count as high above 1.2 V, so a 3.3 V GPIO can drive either one. Tie EN to VIN if the rail should always be on. Pulling EN low is a real shutdown: the output is disconnected from the cell, and the chip draws 0.5 µA. A plain boost converter cannot do this, because its diode lets the cell through to the output even when it is off.
Keep the capacitors at the pins. The data sheet's layout guidance comes first for a reason. These loops carry 2 MHz edges, and a long trace is an inductor in the wrong place. Keep the FB trace away from LX1 and LX2.
Check the capacitors' real value. A ceramic capacitor loses much of its capacitance at its working voltage, most of all in small packages. The data sheet tells you to account for this when choosing them. Check the capacitance at 3.3 V on the capacitor's own data sheet, not the value printed on the reel.
Who needs one, and who does not
- A single lithium cell powering a 3.3 V board is the case this part is for. So is anything else whose voltage crosses the rail during discharge, such as three alkaline AA cells (about 4.8 V new, 2.7 V spent).
- A board powered from USB only. 5 V is always above 3.3 V, so an LDO or a buck is simpler.
- More than 5.5 V in, for example two lithium cells in series. That is outside the part's range, so choose a bigger converter.
- More than about 1.5 A at 3.3 V, or more than 2 A with the cell above 3 V. Choose a bigger part.
- A module that needs switching off completely while the board sleeps. Use a load switch after the converter. Or, if the module is the only load, use the converter's own EN pin.
Edit this page — content/fundamentals/power/a-buck-boost-converter.mdx
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.