| Linear (7805, AMS1117) | Switching (buck / boost) | |
|---|---|---|
| Method | Burns the excess voltage as heat | Chops at high frequency, stores energy in an inductor |
| Efficiency | Vout/Vin — poor with a large drop | 80–95% regardless of drop |
| Noise | Very clean | Switching ripple at tens of kHz |
| Can step up? | No, only down | Yes (boost), and invert |
| Cost / complexity | One part, two capacitors | A module, or a more careful layout |
| Use for | Small clean loads, analogue, references | Anything drawing real current |
// why a 7805 from 12V at 500mA gets hot P_wasted = (12 − 5) × 0.5 = 3.5 watts in a small package // a buck converter doing the same job wastes about 0.3W
Dropout voltage is the linear regulator's other constraint: it needs the input to stay some margin above the output — often 1.5–2V for older parts, a few hundred millivolts for a low-dropout (LDO) type. Trying to get 5V out of a fading battery pack at 5.4V will fail on an ordinary 7805 and work on an LDO.
| Type | Nominal | Notes |
|---|---|---|
| Alkaline AA | 1.5V | Sags steadily as it discharges; four gives ~6V fresh, ~4V tired |
| NiMH AA | 1.2V | Flatter curve, rechargeable; four gives ~4.8V |
| Li-ion / LiPo | 3.7V | 4.2V full to 3.0V empty. Needs protection and a proper charger |
| 9V PP3 | 9V | Convenient, low capacity, poor value — fine for a blinking LED, not a motor |
| USB power bank | 5V | Excellent for projects; may switch off below a minimum draw |
Capacity is quoted in mAh: 2000mAh nominally supplies 200mA for ten hours. Treat it as optimistic — high currents reduce effective capacity, and a regulator's own consumption counts too.
A microcontroller idling at 20mA that transmits over Wi-Fi in 300mA bursts needs a supply and capacitance that can cover the burst. An ESP32 browning out during transmission is one of the most common beginner problems, and it looks exactly like a firmware crash. The fix is a supply with headroom plus a few hundred µF nearby.
Your board runs fine on USB but resets whenever a servo moves, even though the 5V supply is rated for 2A. What is the most likely cause?