Calculators
LM317 calculator
By Bulan Sarkar
Put in R1 and R2 and get the output voltage, including the small ADJ-pin current term. Or give a voltage and get the best standard resistor pair. The same page checks the input headroom, works out how hot the regulator runs and what heatsink it needs, and sizes the single resistor for the LM317 used as a current limiter.
Use the lowest point of the input, at the bottom of the ripple.
What the circuit draws. 500m or 0.5 both work.
TI's recommended maximum is 125 °C. 110 °C leaves some margin.
0.8 with thermal compound. An insulating pad adds more; check its data.
- Output voltage
- 5.036 V
- 5 V if you ignore the ADJ current
- Part to part
- 4.84 V to 5.27 V
- reference 1.2 to 1.3 V, ADJ current 50 to 100 µA
- Headroom
- 6.96 V
- at least 3 V: fine
- Regulator dissipation
- 3.52 W
- 505 mA through it, 41.5 % efficient
- Junction, no heatsink
- 269 °C
- TO-220 in free air, 65 °C/W: 1.08 W is the most it can shed
- Heatsink needed
- 14 °C/W or lower
- sink to air, after 5 °C/W junction to case and 0.8 °C/W interface
Figures from the TI LM317 datasheet (SLVS044Z): reference 1.2 to 1.3 V, ADJ current 50 µA typical and 100 µA maximum, 3 V headroom, 1.5 A. Thermal figures for a TO-220 in free air from the onsemi LM317 datasheet.
The formula
Vout = 1.25 V × (1 + R2 / R1) + IADJ × R2
The LM317 holds 1.25 V between its OUT and ADJ pins. R1 sits across exactly that gap, so the current through it is fixed at 1.25 V / R1: 5.2 mA with the usual 240 Ω. The same current flows on down through R2, and the output is the 1.25 V plus whatever that current drops across R2. The ADJ pin itself leaks about 50 µA (100 µA at most) into R2 as well, which adds IADJ × R2 on top. With a 1.5 kΩ R2 that is 75 mV, enough to matter when the target is 5.00 V.
The 1.25 V is itself a spread: TI specifies 1.2 V to 1.3 V across parts, temperature and load. That is ±4 %, which is why the calculator prints a part-to-part range beside the typical figure, and why precise supplies put a trimmer in R2.
Worked examples
5 V from E24 resistors
Ignore the ADJ current and 5 V needs R2 / R1 = 3 exactly, so 240 Ω with 720 Ω would do it. But 720 Ω is not an E24 value. The calculator tries every E24 R1 from 100 Ω to 1 kΩ, solves for R2 with the 50 µA term included, and rounds each way. The best pair is 510 Ω with 1.5 kΩ: 1.25 V × (1 + 1500 / 510) = 4.926 V, plus 50 µA × 1.5 kΩ = 75 mV, gives 5.0015 V,+0.029 % off. Here the ADJ current is what makes the pair land on 5 V.
That pair passes only 2.45 mA through R1, and the LM317 needs up to 10 mA flowing to hold regulation (3.5 mA typical). Fine with a load connected; with nothing on the output, the voltage can creep up. If the board is ever unloaded, take 120 Ω with 360 Ω instead: 5.018 V (+0.36 %), and R1 alone draws 10.4 mA. The runner-up in the table, 100 Ω with 300 Ω, gives 5.015 V.
1 A at 5 V from a 12 V adapter, on a 40 °C day
Same resistors, 12 V in, 1 A out. The regulator carries the load plus the divider current, 1.002 A, and drops 7 V doing it, so it dissipates 7.02 W. Only 42 % of the input power reaches the load; the rest is heat.
A TO-220 standing in free air runs at about 65 °C/W. In a 40 °C room it can shed 1.08 W before the junction reaches 110 °C, so 7.02 W needs a heatsink. Working back from 110 °C: (110 − 40) / 7.02 W = 9.98 °C/W for the whole path. Take off 5 °C/W for junction to case and 0.8 °C/W for the thermal compound, and the sink must be 4.18 °C/W or better, which calls for a large finned heatsink.
The cheaper fix is a lower input. From 9 V the drop is 4 V, still over the 3 V the LM317 needs, and the dissipation falls to 4.01 W; the sink can be as poor as 11.7 °C/W. Each volt of input above what the regulator needs adds 1 W of heat for every amp of load.
The LM317 as a current limiter
Leave out R2, put one resistor between OUT and ADJ, and take the load from the ADJ side. The chip still holds 1.25 V across the resistor, so the current is 1.25 V / R whatever the load does, and R = 1.25 / I. For a 350 mA LED string, R = 3.57 Ω; the next E24 value up, 3.6 Ω, gives 347 mA including the ADJ current. The resistor dissipates 1.25 V × I = 434 mW, so it wants a 1 W part.
From 12 V the load can drop up to 7.75 V and still get the full current: the resistor takes 1.25 V and the regulator wants its 3 V. If the load is ever shorted, the LM317 takes the lot, 3.73 W, so size the heatsink for that case. The current source lesson covers why a fixed voltage across a fixed resistor is a fixed current.
Headroom and dropout
The LM317 regulates only while the input stays about 3 V above the output. TI's recommended operating range starts at 3 V between input and output, and its datasheet says the part needs up to 3 V of headroom to regulate at full current and low temperature. Below that the output follows the input down, one dropout voltage under it. The check that matters is the lowest point of the input: after a rectifier and capacitor, that is the bottom of the ripple, not the DC average a meter shows.
The upper limit is 40 V between input and output, and it bites at switch-on and when the output is shorted, because then the whole input sits across the chip. A 37 V output from a 40 V input is fine; a 5 V output from a 48 V input is not.
Where the thermal numbers come from
Datasheets disagree about the TO-220, and the difference matters. The current TI datasheet (SLVS044Z) lists the KCS TO-220 at 23.5 °C/W junction to ambient, but that figure is measured on a JEDEC test board with copper planes, not for a part standing up in free air. The same table gives 0.1 °C/W junction to the tab. The onsemi datasheet gives 65 °C/W to free air and 5 °C/W junction to case. This calculator uses the onsemi pair: it is the more cautious of the two, so any error goes toward a bigger heatsink.
| Figure | Value | Source |
|---|---|---|
| Reference voltage | 1.2 / 1.25 / 1.3 V | TI, min / typ / max |
| ADJ pin current | 50 µA typ, 100 µA max | TI |
| Minimum load current | 3.5 mA typ, 10 mA max | TI |
| Input to output | 3 V to 40 V | TI, recommended |
| Output current | 1.5 A | TI, onsemi |
| Junction temperature | 0 to 125 °C | TI, recommended |
| TO-220, junction to air | 65 °C/W | onsemi (TI: 23.5 on a test board) |
| TO-220, junction to case | 5 °C/W | onsemi |
The regulator thermal design lesson walks the same chain of thermal resistances, and heatsinks explains how to read a sink's °C/W rating. If the dissipation is more than a few watts, a linear regulator is probably the wrong part, and a switching one will waste far less of it.