Understanding the LM317 calculator — concept and principle
This calculator works out the output voltage of an LM317 adjustable regulator from its two resistors, or the R2 needed for a target voltage. It also shows the current through R1, the input–output headroom and the power the regulator turns into heat. Electronics hobbyists and engineers use it to design simple adjustable power supplies.
How it is calculated
V_out = 1.25 V × (1 + R2 ÷ R1) + I_ADJ × R2
R2 for a target = (V_out − 1.25) ÷ (1.25 ÷ R1 + I_ADJ)
Current through R1 = 1.25 ÷ R1
Dissipation P = (V_in − V_out) × I_load
- Resistances in Ω, I_ADJ in µA (typically 50), currents in mA.
The principle
The LM317 holds about 1.25 V between its output and adjustment pins. That fixed voltage across R1 sets a fixed current, which then flows down through R2 to ground. The voltage across R2 adds to the 1.25 V, so the ratio R2/R1 sets the output. A small current, I_ADJ, also leaves the adjustment pin and flows through R2, adding a few tens of millivolts. The regulator drops the difference between input and output across itself, so all that voltage times the load current becomes heat.
Worked example
Default inputs: R1 = 240 Ω, R2 = 720 Ω, I_ADJ = 50 µA, V_in = 12 V, load 500 mA, target 5 V.
- Without I_ADJ: 1.25 × (1 + 720/240) = 5 V.
- I_ADJ term: 50 × 10⁻⁶ × 720 = 0.036 V, so V_out = 5.036 V.
- Current through R1 = 1.25 ÷ 240 = 5.21 mA.
- Headroom = 12 − 5.036 = 6.96 V; dissipation = 6.96 × 0.5 = 3.48 W.
- R2 for exactly 5 V = 3.75 ÷ (0.0052083 + 0.00005) = 713 Ω; check: at least 3 V headroom.
| R1 – resistor from OUT to ADJ (Ω) | Output voltage (V) |
|---|---|
| 60 | 16.286 |
| 120 | 8.786 |
| 180 | 6.286 |
| 240 | 5.036 |
| 300 | 4.286 |
| 360 | 3.786 |
| 480 | 3.161 |
How to read the result
3.48 W is too much for a bare TO-220 package; a heatsink is needed. The TI datasheet specifies regulation with at least 3 V between input and output, so keep that headroom. The reference varies between parts, so measure the output and trim if precision matters.
Common mistakes
- Making R1 too large, so the minimum load current is not met at light load.
- Ignoring dissipation, which makes the regulator overheat and shut down.
- Expecting an exact output from standard resistor values.
- Running with too little input–output difference.
Frequently asked questions
Why is R1 often 240 Ω?
It draws about 5 mA through R1, which helps meet the regulator's minimum load requirement.
Can I ignore I_ADJ?
Often yes for rough work; it adds only a few tens of millivolts with typical R2.
How hot will it get?
It dissipates (V_in − V_out) × I_load; use the package's thermal resistance to estimate the temperature rise.
What is the lowest output?
About 1.25 V, with R2 = 0.
Sources: Texas Instruments, LM317 3-Terminal Adjustable Regulator datasheet, SLVS044H