LM317 Calculator
The LM317 is an adjustable voltage regulator: two resistors set its output anywhere from 1.25 V to about 37 V, at up to 1.5 A. Its output follows:
Vout = 1.25 * (1 + R2 / R1)
where 1.25 V is the reference voltage it holds between its output and adjust pins, R1 is the resistor between those two pins, and R2 goes from the adjust pin to ground. Enter any two of the three, and the calculator finds the third.
Choosing the resistors
R1 is usually 240 Ω, as in the datasheet, which keeps enough current flowing for the regulator to stay stable without a load. Then:
R2 = R1 * (Vout / 1.25 - 1)
For 5 V: R2 = 240 * (5 / 1.25 - 1) = 720 Ω.
Common output voltages with R1 = 240 Ω
| Output | Exact R2 | Nearest standard R2 | Output with it |
|---|---|---|---|
| 3.3 V | 394 Ω | 390 Ω | 3.28 V |
| 5 V | 720 Ω | 750 Ω | 5.16 V |
| 9 V | 1,488 Ω | 1.5 kΩ | 9.06 V |
| 12 V | 2,064 Ω | 2 kΩ | 11.7 V |
The standard values are from the common E24 series. For an exact voltage, use two resistors in series or a trimmer potentiometer for R2.
The adjust pin also passes about 50 µA, which adds a little to the output: Vout = 1.25 * (1 + R2 / R1) + 0.00005 * R2. It is small, about 0.1 V at most for the values in the table, so the calculator leaves it out.
Input voltage and heat
The input must be at least about 2 V above the output, and 3 V is safer at higher currents. The difference turns into heat in the regulator: P = (Vin - Vout) * I. Dropping 12 V to 5 V at 0.5 A makes 3.5 W, which needs a heat sink.
LM350, LM338 and LM337
The LM350 (3 A) and the LM338 (5 A) use the same 1.25 V reference and the same formula, so this calculator works for them too. The LM337 is the negative version: the same formula gives the size of its negative output.
Frequently asked questions
What R2 do I need for 5 V?
With R1 = 240 Ω, 720 Ω. The nearest standard values give 4.79 V (680 Ω) or 5.16 V (750 Ω), and 680 Ω plus 39 Ω in series gives 5.0 V.
Can the LM317 output 0 V?
No. Its lowest output is the 1.25 V reference, with R2 at 0 Ω.