Skip to content
GEEKnodes

Electronics

Voltage Regulators: Linear (7805, AMS1117) vs Buck and Boost

Linear regulators (7805, AMS1117) vs buck and boost switching converters: dropout, power dissipation, efficiency, noise and when to use each one.

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.

RegulatorOutputTypical dropoutQuiescent currentMaximum input
78055 VAbout 2 VAbout 5 mA35 V
AMS1117-3.33.3 VAbout 1.1 V at full loadAbout 5 mA15 V
MCP1700-3.33.3 VAbout 0.18 V at 250 mAAbout 1.6 µA6 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
7805 linear regulator from 12 V to 5 V at 500 mA: the excess 7 V becomes 3.5 W of heat
In a linear regulator, all the excess voltage becomes heat: (12 − 5) × 0.5 = 3.5 W

Example 1: a 7805 from 12 V to 5 V with a 500 mA load.

  1. Excess voltage: 12 − 5 = 7 V.
  2. Power: 7 × 0.5 = 3.5 W of heat.
  3. A TO-220 package without a heatsink has a thermal resistance of about 50 °C/W according to the datasheet of common 7805s.
  4. 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.

Loss comparison from 12 V to 5 V at 500 mA: 3.5 W in a linear regulator vs about 0.28 W in a 90% buck
For the same case, the buck loses about 0.28 W and the linear 3.5 W
  • 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.

  1. Output power: 5 × 0.5 = 2.5 W.
  2. Input power: 2.5 / 0.9 ≈ 2.78 W.
  3. Losses: about 0.28 W, compared with 3.5 W for the linear.
  4. 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.

Buck plus LDO chain: from 12 V to 5 V with ripple, and the LDO delivers clean 3.3 V to the ESP32
A buck steps down efficiently and an LDO cleans up the ripple before the 3.3 V

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

SituationBest optionReason
5 V to 3.3 V, under 300 mALinear (AMS1117 or LDO)Small voltage difference, simple
12 V to 5 V, over 200 mABuckThe linear would dissipate several watts
12 V to 3.3 V for an ESP32Buck (or buck + LDO)A linear overheats
3.7 V battery to 5 VBoostYou need to step up
Lithium battery to 3.3 VLow-dropout LDO or buck-boostUse the whole discharge
ADC, audio or analog sensorsLinearRipple-free output
Battery project with deep sleepLow quiescent current LDOThe 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:

RegulatorInputOutputNote
78050.33 µF0.1 µFAs close to the pins as possible
AMS111710 µF22 µFThe datasheet calls for a tantalum output capacitor for stability
Modern LDO1 µF1 µFUsually fine with ceramics; check the datasheet
Buck or boost moduleIncludedIncludedAdd 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 VIN pin.
  • 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.

Accessibility preferences

Quick profiles

Text and reading

Text size
Default
Line height
Default
Letter spacing
Default
Word spacing
Default

Colour

Motion and orientation

Cursor