How to Set the LM317 Output Voltage
The LM317's output voltage is set by two resistors: Vout = 1.25 V × (1 + R2/R1). The LM317 holds a fixed 1.25 V reference between its ADJ and OUT pins. For example, with R1 = 240 Ω and R2 = 720 Ω: 1.25 × (1 + 720/240) = 5 V. Increasing R2 raises the output.
The LM317 is a popular adjustable linear voltage regulator whose output is set by two resistors. Unlike a fixed-output regulator, a single LM317 can produce any voltage from 1.25 V up to about 37 V. This article covers the formula that sets the output, how to choose the resistors, and the practical caveats (dropout, minimum load, heat).
How the LM317 works (the 1.25 V reference)
The LM317 always maintains a fixed 1.25 V reference voltage (VREF) between its ADJ (adjust) and OUT (output) pins. If you place a resistor (R1) between these pins, a constant current flows through it: I = 1.25 / R1. That current also flows through a second resistor (R2), dropping an additional voltage across R2 and raising the total output. So the output voltage is set by the ratio of R1 and R2.
LM317 output voltage formula
The output voltage is given by:
Vout = 1.25 V × (1 + R2 / R1) + IADJ × R2
| Symbol | Meaning | Typical value |
|---|---|---|
| VREF | Internal reference (ADJ–OUT) | 1.25 V (fixed) |
| R1 | Resistor between OUT and ADJ | 240 Ω (or 220 Ω) |
| R2 | Resistor between ADJ and GND (adjust) | Set by target output |
| IADJ | ADJ pin leakage current | ≈ 50 µA (usually ignored) |
Because IADJ is tiny, in practice the formula simplifies to Vout ≈ 1.25 × (1 + R2/R1). This is Ohm's law applied to the regulator.
Choosing the resistors, step by step
- Pick R1 — the datasheet recommends 240 Ω (220 Ω is also common).
- Decide your target output voltage (Vout).
- Solve for R2: R2 = R1 × (Vout/1.25 − 1).
- Pick the nearest standard value; for a precise output use a trimpot for R2.
- Check the input: Vin ≥ Vout + 3 V (dropout).
- Calculate the power dissipation and add a heatsink if needed.
Worked examples
| R1 | R2 | Vout = 1.25 × (1 + R2/R1) |
|---|---|---|
| 240 Ω | 240 Ω | 1.25 × (1 + 1) = 2.5 V |
| 240 Ω | 720 Ω | 1.25 × (1 + 3) = 5 V |
| 240 Ω | 2.4 kΩ | 1.25 × (1 + 10) = 13.75 V |
For example, if you want 5 V and R1 = 240 Ω: R2 = 240 × (5/1.25 − 1) = 240 × 3 = 720 Ω.
Dropout and minimum load
The LM317 is a linear regulator; the input must be at least ~3 V above the output to work (dropout). It also needs a minimum load current of about 5–10 mA for its reference to behave; running with no load can let the output drift high. A small "bleeder" resistor across the output, or a real load, fixes this.
Power dissipation and heat
In a linear regulator the input–output difference is dissipated as heat: P = (Vin − Vout) × Iout. For example, going from 12 V to 5 V at 0.5 A: P = (12 − 5) × 0.5 = 3.5 W — a serious amount of heat that definitely needs a heatsink. With a large input–output gap and high current, consider a switching (buck) regulator instead for efficiency.
Common mistakes
- Making R1 too large: the minimum load current is not met and the output drifts. Keep R1 at 240 Ω.
- Ignoring dropout: Vin = Vout + 1 V will not regulate; leave at least +3 V.
- Skipping the heatsink: at high dissipation the LM317 hits thermal shutdown and cuts the output.
- Omitting input/output capacitors: for stability, ~0.1 µF at the input and ~1 µF at the output (or the datasheet's values) are recommended.
Use the calculator
To instantly find R1/R2 for your target output voltage, use our LM317 Voltage Calculator.