Almost every Arduino, ESP32 or Raspberry Pi project needs to step a voltage down or up: from 12 V to 5 V, from 5 V to 3.3 V, from a 3.7 V battery to 5 V. There are two families of regulators, and picking the wrong one ends in a chip that burns up or an ESP32 that keeps rebooting. Here you’ll learn how to calculate how much heat a linear regulator produces and when a switching one is worth it.
In short
- A linear regulator turns all the excess voltage into heat: P = (Vin − Vout) · I.
- A switching regulator (buck to step down, boost to step up) reaches 80–95% efficiency, but produces more noise.
- Dropping 12 V to 3.3 V with an AMS1117 is the classic mistake: the chip goes into thermal shutdown.
How a linear regulator works
A linear regulator behaves like a variable resistor that adjusts itself to keep the output fixed. All of the load current flows through it, and the voltage difference between input and output stays in it as heat.
The best-known ones:
- 7805 (78xx series): fixed 5 V output, up to about 1.5 A with a good heatsink, input up to 35 V.
- AMS1117: the one many ESP32 and Arduino boards use to generate 3.3 V. Up to about 800 mA–1 A and a maximum input of 15 V.
- Low-power LDOs (for example, the MCP1700): low current and a very small dropout, designed for batteries.
Minimum headroom (dropout)
Every linear regulator needs the input to exceed the output by a minimum amount, the dropout voltage. Below that margin, the output is no longer regulated.
| Regulator | Output | Typical dropout | Quiescent current | Maximum input |
|---|---|---|---|---|
| 7805 | 5 V | About 2 V | About 5 mA | 35 V |
| AMS1117-3.3 | 3.3 V | About 1.1 V at full load | About 5 mA | 15 V |
| MCP1700-3.3 | 3.3 V | About 0.18 V at 250 mA | About 1.6 µA | 6 V |
Practical consequence: a 7805 needs at least about 7 V at the input. Powering it from USB’s 5 V or from four nearly dead AA batteries gives an output below 5 V.
Calculating power dissipation
The formula is straightforward:
P = (Vin − Vout) × I

Example 1: a 7805 from 12 V to 5 V with a 500 mA load.
- Excess voltage: 12 − 5 = 7 V.
- Power: 7 × 0.5 = 3.5 W of heat.
- A TO-220 package without a heatsink has a thermal resistance of about 50 °C/W according to the datasheet of common 7805s.
- Temperature rise: 3.5 × 50 = 175 °C above ambient. Impossible: the regulator goes into thermal shutdown.
Without a heatsink, a TO-220 comfortably handles around 1 W. Above that you need a heatsink or a different technology.
Efficiency
In a linear regulator, the input current is practically the same as the output current, so efficiency is roughly Vout / Vin:
- 12 V to 5 V: 5 / 12 ≈ 42%.
- 5 V to 3.3 V: 3.3 / 5 ≈ 66%.
The closer the input and output are, the better a linear regulator works.
How a switching regulator works
A switching regulator turns a transistor on and off hundreds of thousands of times per second and uses an inductor and capacitors to store and deliver energy. Since the transistor is almost always either fully on or fully off, it dissipates very little.

- Buck (step-down): the output is lower than the input. Example chips: LM2596, MP1584.
- Boost (step-up): the output is higher than the input. Example: MT3608.
- Buck-boost: holds the output whether the input is above or below it. Useful with lithium batteries at 3.3 V, because the cell goes from 4.2 V to about 3 V as it discharges.
With a switching regulator, what is conserved is power, not current:
Pin = Pout / efficiency
Iin = (Vout × Iout) / (Vin × efficiency)
Example 2: the same 12 V to 5 V, 500 mA case with a 90% buck.
- Output power: 5 × 0.5 = 2.5 W.
- Input power: 2.5 / 0.9 ≈ 2.78 W.
- Losses: about 0.28 W, compared with 3.5 W for the linear.
- Input current: 2.78 / 12 ≈ 0.23 A, less than half that of the linear.
Example 3: boosting a 3.7 V battery to 5 V at 1 A, with 85% efficiency. The battery supplies 5 / (3.7 × 0.85) ≈ 1.6 A. When stepping voltage up, the input current is always higher than the output current; keep that in mind when choosing the battery and the wires.
Noise: the downside of switching
Switching leaves ripple on the output (usually tens of mV) and generates high-frequency interference. For an Arduino, an ESP32 or an LED strip it usually doesn’t matter.

It does matter for:
- Precise analog readings with the ADC.
- Audio (you hear hum or whine).
- Sensitive sensors and radio circuits.
The usual solution is to combine both: a buck steps 12 V down to about 5 V efficiently and an LDO cleans the output down to 3.3 V. That way the linear regulator only dissipates (5 − 3.3) × I.
When to use each one
| Situation | Best option | Reason |
|---|---|---|
| 5 V to 3.3 V, under 300 mA | Linear (AMS1117 or LDO) | Small voltage difference, simple |
| 12 V to 5 V, over 200 mA | Buck | The linear would dissipate several watts |
| 12 V to 3.3 V for an ESP32 | Buck (or buck + LDO) | A linear overheats |
| 3.7 V battery to 5 V | Boost | You need to step up |
| Lithium battery to 3.3 V | Low-dropout LDO or buck-boost | Use the whole discharge |
| ADC, audio or analog sensors | Linear | Ripple-free output |
| Battery project with deep sleep | Low quiescent current LDO | The AMS1117’s 5 mA drains the battery |
To see how quiescent current affects battery life, try the ESP32 battery life calculator.
Required capacitors
No regulator works well without capacitors, and the datasheet gives the minimum values. The usual ones:
| Regulator | Input | Output | Note |
|---|---|---|---|
| 7805 | 0.33 µF | 0.1 µF | As close to the pins as possible |
| AMS1117 | 10 µF | 22 µF | The datasheet calls for a tantalum output capacitor for stability |
| Modern LDO | 1 µF | 1 µF | Usually fine with ceramics; check the datasheet |
| Buck or boost module | Included | Included | Add 100 µF if the input wires are long |
On the AMS1117, the output capacitor is not optional: without it, or with too low a value, it can oscillate and the output voltage becomes unstable. If you need a refresher on the types, see the guide to types of capacitors.
Common mistakes
- Making 3.3 V from 12 V with a linear regulator: with an ESP32 drawing 250 mA, the AMS1117 dissipates (12 − 3.3) × 0.25 ≈ 2.2 W in a SOT-223 package. It heats up until it shuts down, and the ESP32 reboots as soon as it turns on Wi-Fi. Put a buck in front of it.
- Feeding 12 V into the 5 V or 3.3 V pin: those pins sit after the regulator. The input voltage goes through the jack or the
VINpin. - Not adjusting the module before connecting it: buck and boost modules with a potentiometer can ship set to any output. Adjust them with the multimeter and no load.
- Thinking a disabled boost gives no voltage: on many boost modules, the input passes through to the output via the inductor and the diode, minus about 0.3–0.5 V.
- Forgetting dropout: at full load, an AMS1117-3.3 needs about 4.4 V at the input, more than a fully charged lithium cell provides (4.2 V). On battery, use a low-dropout LDO.
- Trusting the current in the module’s listing title: “3 A” is usually the chip’s limit with good cooling, not a continuous rating.
- No common GND: the ground of the regulator, the microcontroller and the load must be connected together.



