LIBRARYPower rails and a power budget.
Add up every part's current draw, add margin, then pick a supply. How to budget power for an ESP32 or any small board before you choose a regulator or a battery.
A power rail is a net held at one fixed voltage that feeds many parts at once. Before you pick the supply that drives a rail, you add up what everything on it draws and leave room to spare. Budget the load first, choose the source second.
What is a power rail?
A rail is a shared voltage line, like the 3.3 V a regulator puts out or the 5 V that arrives over USB. Every part that needs that voltage taps the same rail. The Fundamentals guide on grounds and rails covers the idea; here you use it to size a supply.
Peak draw and average draw
A part draws two numbers worth knowing. Its average current sets how long a battery lasts. Its peak current, the brief spike when a radio transmits or a motor starts, sets how much the supply must deliver without sagging. An ESP32-S3 sips a few milliamps most of the time but pulls a spike of a few hundred milliamps when its WiFi radio transmits (Espressif). Size the supply for the peak and the battery for the average.
Summing the board's draw
A budget is a table: every part, the rail it sits on, and its worst-case current, added down the column. The microcontroller, each sensor, every LED, the pull-ups. Total the current on each rail and you know what that rail must supply.
Leave margin, then pick the source
Never size a supply to exactly the total. Add margin, commonly 20 to 30 percent, for the parts you forgot, the peaks that overlap, and the aging that lifts current over time. Then pick a source whose voltage matches the rail and whose current rating clears the budget with that margin in hand.
▸Deep dive· Where a budget quietly goes wrong
Two things break a budget that looks fine on paper. First, peaks overlap: if the radio bursts while an LED is full-on, the two spikes add, and a supply sized for the average browns out at the worst moment. Second, a regulator burns a little current just to run itself, its quiescent current, which is negligible under load but dominant on a sleeping battery board where the real load is almost nothing. Budget the worst simultaneous case, not the sum of typical numbers, and on a low-power design read the regulator's quiescent current as carefully as its efficiency.
Checkpoint
Quick check
One Thousand Drones engineering team · verified 2026-07