Tools / LM317 calculator

LM317 calculator

The LM317 is the go-to adjustable regulator. Enter the output voltage you want for the resistor values, check the heat it must get rid of, and work out the resistor for a constant-current source.

240 Ω is the classic value

R2––
Standard R2––
Regulator power––
Current source resistor––
The diagram updates as you change the values.

The LM317 formula

The LM317 keeps 1.25 V between its output and adjust pins. With R1 from output to adjust and R2 from adjust to ground, the output is Vout = 1.25 × (1 + R2 ÷ R1) + Iadj × R2, where the adjust current is about 50 µA. With R1 = 240 Ω, R2 = 2.4 kΩ gives about 13.8 V. Using a 1% resistor, or a trimmer in series with R2, gets the voltage exact.

Heat and headroom

The input must be at least 3 V above the output for the regulator to work. Everything above the output is turned into heat: (Vin − Vout) × I. A TO-220 LM317 can handle about 1 W in free air. Above that, use the heatsink calculator. The LM317 is rated for 1.5 A, but in practice heat usually sets the limit first.

As a current source

With one resistor from output to adjust, and the load connected to the adjust pin, the LM317 delivers a constant current of 1.25 ÷ R. It's a simple way to drive power LEDs or charge batteries. For LEDs at low current, the LED resistor calculator may be simpler.

Fit a 100 nF capacitor on the input, 1 µF on the output, and optionally 10 µF from the adjust pin to ground for lower ripple, with a protection diode across R1 if you use it.

Questions

What resistors give 12 V from an LM317?

With R1 = 240 Ω, R2 is about 2.04 kΩ. The E24 value 2 kΩ gives 11.8 V, and 2.2 kΩ about 12.8 V.

What resistors give 5 V from an LM317?

With R1 = 240 Ω, R2 is about 715 Ω, which is an E96 value. Or use 680 Ω plus a 100 Ω trimmer.

What is the minimum input voltage?

About 3 V above the output at full current, a little less at low current.

Does an LM317 need a heatsink?

If it dissipates more than about 1 W, yes. Power = (input − output) × current.