Home

Guide no. 17

There are two ways to bring a voltage down: burn off the difference as heat, or “chop it up” with a fast switch. How they work, how hot they get, how much is lost, with the calculations already done.

By Ada Intelisano · informaticait.it technical team

Download the PDF (A4, 3 pages) Free to print and share, without changes — CC BY-ND 4.0
In short
  • A linear regulator (7805, AMS1117, LDO) lets through the same current that goes out and turns the extra voltage into heat: simple and quiet, but it wastes a lot when the difference is large.
  • A switching regulator (buck, step-down) turns a switch on and off thousands of times per second: it loses little (often 80–90 % efficiency) but leaves a small ripple on the output.
  • Rule of thumb: heat in a linear regulator = (Vin − Vout) × current. If it goes above a few tenths of a watt, consider a switching one.
  • Every regulator needs a minimum margin between input and output (dropout): a 3.3 V AMS1117 wants at least about 4.6 V.

How a linear regulator works

Linear regulator12 VLDO / 78055 V loadacross it: 12 − 5 = 7 Vheat = 7 V × currentThe current in equals the current out: the extra voltage is lost as heat.informaticait.it

Inside there is a transistor that acts as an adjustable resistor: it opens or closes as much as needed to hold the output steady. The current going out is (almost) the same as the current coming in, so the “leftover” voltage stays across the regulator and becomes heat. The advantage is a very clean output: the noise of a 7805 is a few tens of microvolts.

How a switching regulator works

Step-down (buck) switching regulator12 Vswitchdiodeinductor5 V12 V pulsessteady 5 VThe switch is on only part of the time: energy flows in packets and little is lost.informaticait.it

Here the transistor is used as a switch: fully on or fully off, so it gets only slightly warm. The ratio between the on time and the period (duty cycle) sets the voltage: to go from 12 to 5 V it stays on about 42 % of the time. The inductor and the capacitor turn the pulses into a DC voltage; the diode (or a second transistor) closes the circuit while the switch is open.

How much is lost: the calculation

For a linear regulator the heat is P = (Vin − Vout) × I + Vin × Iq, where Iq is the current the regulator uses for itself; efficiency is about Vout ÷ Vin. For a switching regulator you start from the stated efficiency: the losses are Pout × (1 ÷ η − 1).

Linear (7805)load 5 Wheat 7 Wefficiency 42 %Buck, η = 80 %load 5 W1.25 Wefficiency 80 %Power drawn from the 12 V supply (12 → 5 V, 1 A)informaticait.it
Example: 12 V → 5 V, 1 A. The load uses 5 V × 1 A = 5 W. With a 7805, 12 − 5 = 7 V are left across the regulator, that is 7 W of heat (plus about 0.1 W for its internal current): efficiency around 42 %. With a switching regulator at 80 % (the efficiency TI states for the LM2596 from 12 to 5 V at 3 A) the losses are 5 × (1 ÷ 0.8 − 1) = 1.25 W.

How hot it really gets

The chip temperature is TJ = Tambient + P × θJA, where θJA (in °C/W) is the thermal resistance from the package to the air, given in the datasheet. The limit for the AMS1117 is 125 °C.

Two linear regulators, front viewL7805CVTO-2201IN2GND3OUTtab connected to ground (2)AMS1117SOT-2231GND/ADJ2VOUT3VINtab = VOUTheat leaves through the tab and copperof the boardinformaticait.it
Example: AMS1117 from 5 V to 3.3 V at 0.5 A, SOT-223 package (θJA = 90 °C/W according to the AMS datasheet, less if there is plenty of copper on the board). P = 1.7 V × 0.5 A + 5 V × 5 mA ≈ 0.88 W → the chip rises by about 79 °C: at 25 °C ambient it reaches 104 °C, close to the limit. The same regulator from 12 V to 3.3 V at 0.5 A would have to dissipate 4.35 W: impossible without reducing the current.

Where the heat goes. The TI 7805 datasheet gives input, ground and output on pins 1, 2, 3; the AMS1117 in SOT-223 has its tab connected to the output and gets rid of the heat through the copper on the board.

Linear and switching compared

Linear (7805, AMS1117, LDO)Switching (buck)
Efficiencyabout Vout ÷ Vin: good only with a small differenceusually 80–90 % or more
Heat(Vin − Vout) × Ilittle: the losses are a small part of the power
Output noisetens of µV (7805: 40 µV; AP2112: 50 µV)ripple of 0.5–3 % of Vout (LM2596), that is 25–150 mV at 5 V
Output higher than inputimpossiblepossible with step-up converters
Componentsthe regulator and two capacitorsinductor, diode, capacitors, more critical layout
No-load currentfrom 1.6 µA (MCP1700) to 5 mA (AMS1117)from a few tens of µA to a few mA (LM2596: 5–10 mA)

Some common regulators (datasheet figures)

RegulatorTypeInputCurrentTypical dropoutQuiescent current
AMS1117linearup to 15 V1 A1.1 V (1.3 V max) at 0.8 A5 mA
LM7805linearfrom 7.5 to 35 V1.5 A2 V at 1 A8 mA max
MCP1700LDO2.3–6 V250 mA178 mV at 250 mA1.6 µA
AP2112LDO2.5–6 V600 mA250 mV at 600 mA55 µA
LM2596buckup to 40 V3 A≈1.3 V at 3 A5–10 mA
XL4015buck8–36 V5 A—2.1 mA

Which one to choose

  • Linear: small difference (5 → 3.3 V), low current (up to a few hundred mA), or when you need a clean output for analog sensors, ADCs and audio.
  • LDO with low dropout and low quiescent current (MCP1700, AP2112): from a lithium battery (3.0–4.2 V) to 3.3 V, where the AMS1117 can't cope.
  • Switching: from 12 or 24 V down to 5 or 3.3 V, currents of an amp and up, battery projects where every watt counts.
  • Both together: a switching regulator that brings the voltage close to the final value, followed by an LDO that cleans up the ripple (this is the solution TI describes for noise-sensitive circuits).

Common mistakes

What happensWhyFix
The 3.3 V from a lithium battery sags or “wobbles”AMS1117 powered at 3.7–4.2 V: it needs about 1.1–1.3 V of marginlow-dropout LDO (MCP1700, AP2112) or a buck-boost
The 7805 gets very hot and then shuts down12 → 5 V at 1 A = 7 W: the thermal protection kicks ina suitable heat sink, or a switching regulator
Unstable analog readingsswitching ripple on the supply of the ADC or the sensorfilter or LDO after the switching regulator
The battery drains even when idleregulator with high quiescent current (the AMS1117's 5 mA add up to 120 mAh a day)low-power LDO
Unstable output with almost no loadthe AMS1117 needs a minimum load of 10 mA for the stated regulationminimum load resistor or a different regulator
The switching regulator doesn't regulateinput too close to the output (below its dropout) or below the chip's minimum voltagecheck the minimum Vin in the module's datasheet
In practice. The Arduino UNO already has a linear regulator after the barrel jack: powered at 12 V, it gets hotter the more current the modules on its 5 V pin draw. An ESP32 powered from 12 V is the typical case for a step-down. For a precision analog sensor or an ADS1115, a clean linear supply is the better choice.
Sources: Texas Instruments, SNVA558 “Linear and Switching Voltage Regulator Fundamentals”, SNVA559C “Switching regulator fundamentals”, SLVA079 (LDO terms), SNVA871 (DC/DC noise filtering) · Advanced Monolithic Systems, AMS1117 datasheet; Texas Instruments, LM340/LM7805 (SNOSBT0L) and LM2596 (SNVS124G) · Microchip, MCP1700 (DS20001826E); Diodes Inc., AP2112 (DS39724); XLSemi, XL4015 Rev 2.0

Useful products

Other guides

All our guides →
Loading...
Back to top