How the heat is calculated
A linear regulator carries the whole load current and drops the difference between input and output across itself. All of that power becomes heat, plus the small current the regulator uses to run (its quiescent current).
P = (Vin − Vout) × Iload + Vin × Iq
Tj = Ta + P × θJA
η = (Vout × Iload) ÷ (Vin × (Iload + Iq))
Example: an AMS1117-3.3 from 12 V feeding an ESP32 with Wi-Fi on (120 mA). P = 8.7 V × 0.12 A + 12 V × 5 mA = 1.1 W. In SOT-223, at 90 °C/W, the junction reaches 25 + 99 = 124 °C, right at the 125 °C limit. The efficiency is 26 %: three quarters of the power turns into heat.
Dropout: the lowest input voltage
A regulator needs some voltage across it to work. Below the output voltage plus the dropout, the output follows the input down. Bipolar parts such as the AMS1117 and the 7805 need about 1.1 V and 2 V; CMOS LDOs such as the MCP1700 need tens to a few hundred millivolts, rising with the current. The check uses the peak current and the lowest input voltage, because that is where the regulator fails first.
Vin,min = Vout + Vdropout(Ipeak)
Example: an AMS1117-3.3 needs 3.3 + 1.1 = 4.4 V. From USB (4.75 V or more) it works; from a Li-ion cell, which goes from 4.2 V down to 3.0 V, it never regulates properly.
TO-220 regulators and heatsinks
Tj = Ta + P × (θJC + θCS + θSA)
θSA ≤ (Tjmax − 25 °C − Ta) ÷ P − θJC − θCS
In free air a 7805 in TO-220 has θJA = 50 °C/W: at 25 °C ambient it reaches 125 °C with 2 W. On a heatsink the heat flows through the case (θJC, 5 °C/W), the contact (θCS, about 1 °C/W with thermal paste, assumed here) and the heatsink (θSA, from its datasheet). The calculator sizes the heatsink to keep 25 °C of margin below the limit.
The regulators in the list
| Part | Package | Dropout | Quiescent | Max current | Max input | θJA |
| AMS1117 | SOT-223 | 1.1 V / 800 mA | 5 mA | 900 mA | 15 V | 90 °C/W |
| LM1117 | SOT-223 | 1.2 V / 800 mA | 5 mA | 800 mA | 15 V | 61.6 °C/W |
| 78xx (L7805…) | TO-220 | 2 V / 1 A | 8 mA | 1.5 A | 35 V | 50 °C/W |
| 78Lxx (78L05…) | TO-92 | 1.7 V / 40 mA | 3.8 mA | 100 mA | 30 V | 156 °C/W |
| LM317 | TO-220 | 2 V / 1 A | 5 mA | 1.5 A | 40 V (input − output) | 50 °C/W |
| MCP1700 | SOT-23 | 178 mV / 250 mA | 1.6 µA | 250 mA | 6 V | 336 °C/W |
| MCP1700 | TO-92 | 178 mV / 250 mA | 1.6 µA | 250 mA | 6 V | 160 °C/W |
| HT73xx (HT7333…) | SOT-89 | 90 mV / 40 mA | 4 µA | 250 mA | 12 V | 200 °C/W |
| XC6206 | SOT-23 | 250 mV / 100 mA | 1 µA | 200 mA | 6 V | 200 °C/W |
| AP2112K | SOT-23-5 | 250 mV / 600 mA | 55 µA | 600 mA | 6 V | 184 °C/W |
| TLV755P | SOT-23-5 | 150 mV / 500 mA | 25 µA | 500 mA | 5.5 V | 231 °C/W |
Typical values at 25 °C from the makers’ datasheets (AMS, Texas Instruments, STMicroelectronics, Microchip, Holtek, Torex, Diodes). The guaranteed maximum dropout is higher: 1.3 V for the AMS1117. Each maker measures θJA on its own test board, so the figures are only roughly comparable.
Why θJA is only a starting point
Small packages shed their heat through the copper they are soldered to. TI measured the LM1117 in SOT-223 at 136 °C/W with a pad of about 8 mm² and at 66 °C/W with 6.5 cm² (one square inch) of copper; AMS gives 55 to 80 °C/W for the AMS1117 depending on the copper area. The datasheet figure gives the order of magnitude, and the copper on your board decides the rest.
Linear or switching?
A linear regulator is cheap, small and quiet: its output carries no switching ripple, which is why it is still used for ADCs, audio and radio, often after a switching converter. It makes sense when the voltage difference is small or the current is low. With a large drop (12 V to 3.3 V) or hundreds of milliamps, a buck converter wastes far less. On a battery that sleeps most of the time, what counts is the current drawn at rest: 1.6 µA for an MCP1700, about 5 mA for an AMS1117.
Frequently asked questions
How do I calculate the power a linear regulator dissipates?
P = (Vin − Vout) × Iload + Vin × Iq. From 12 V to 3.3 V at 120 mA that is 8.7 V × 0.12 A = 1.04 W, plus 12 V × 5 mA = 0.06 W for an AMS1117: 1.1 W in total. Multiply by θJA and add the ambient temperature to get the junction temperature.
Why does my AMS1117 get so hot?
Because it burns the whole voltage difference. From 12 V at 120 mA it dissipates 1.1 W, and in SOT-223 at 90 °C/W that means about 100 °C above ambient. From 5 V the same load gives 0.23 W and about 21 °C above ambient. Lower the input voltage or use a buck converter.
Can an AMS1117 make 3.3 V from a Li-ion battery?
No. It needs about 1.1 V of headroom, so at least 4.4 V at the input, while a Li-ion cell goes from 4.2 V down to 3.0 V. Use a low-dropout CMOS LDO (the TLV755P has 150 mV at 500 mA, so it regulates down to about 3.45 V) or, to use the whole battery, a buck-boost converter such as the TPS63802.
How big a heatsink does a 7805 need?
From 12 V to 5 V at 500 mA it dissipates 7 V × 0.5 A + 12 V × 8 mA = 3.6 W. To stay 25 °C below the 125 °C limit at 25 °C ambient, θSA must be at most 75 ÷ 3.6 − 5 − 1 = 15 °C/W. Without a heatsink it would reach 25 + 3.6 × 50 = 205 °C, and the thermal protection would cut in.
Can I replace a 7805 with a switching module?
Yes. The Recom R-78E and Traco TSR 1 modules have the same pin order (input, ground, output), fit the TO-220 footprint and need no heatsink. Check the input range (R-78E5.0-0.5: 7–28 V, 500 mA) and fit the capacitors that the module’s datasheet asks for.
Can I power an ESP32 straight from a battery?
From a LiFePO4 cell, yes, with care: ESP32 modules accept 3.0 to 3.6 V (3.6 V is also their absolute maximum) and the cell sits around 3.2–3.3 V for most of its discharge. A standard charge ends at 3.65 V, so use a charger that stops below 3.6 V, and cut the module off at 3.0 V. From a Li-ion cell, no: at 4.2 V it is far above the maximum.
Is a linear regulator ever better than a buck converter?
Yes: when the voltage drop is small (5 V to 3.3 V at a low current), when the circuit is sensitive to noise (ADC, audio, radio), or when size and cost matter more than efficiency. A common combination is a buck converter close to the target voltage followed by a low-noise LDO.