How to use the lm317 voltage regulator calculator
- Choose R2 for a wanted output, Output from R1 and R2, or Current limit resistor.
- For voltage, enter the top resistor R1 and either the output you want or the value of R2. Add the input voltage and load current to see the heat in the regulator.
- For a current limit, enter the single resistor.
- In Advanced options adjust the reference voltage, adjust pin current and dropout to match your data sheet.
Formula
Vout = Vref x (1 + R2 / R1) + Iadj x R2
R2 = (Vout - Vref) / (Vref / R1 + Iadj)
Constant current: I = Vref / R
Regulator power = (Vin - Vout) x load current; least Vin = Vout + dropout
The regulator holds a steady reference voltage between its output and adjust pins, so the current in R1 is Vref / R1. The small adjust pin current adds a little to the output.
Five volts from a 240 ohm resistor
With R1 = 240 ohms, a 1.25 V reference and a 50 uA adjust current, a 5 V output needs R2 = 3.75 / (0.0052083 + 0.00005) = 713.15 ohms. The nearest E24 value is 680 ohms, which gives 4.8257 V, and the least input is 7 V with a 2 V dropout.
Using R1 = 240 and R2 = 720 gives 5.036 V. From a 12 V input at 0.5 A the regulator turns (12 - 5.036) x 0.5 = 3.482 W into heat. A 2.5 ohm resistor in the current limiter connection sets 0.5 A and dissipates 0.625 W.
Choosing resistors
Resistors come in standard series. The E24 series has 24 values per decade, about 10 percent apart, and the page shows the nearest one with the output it would give. If the result is slightly off, choose the next value up or down, or combine two resistors in series or parallel. A 1 percent resistor from a finer series gives a tighter result.
To work out the current in a resistor see the Ohm's law calculator, to split a voltage with two resistors the voltage divider calculator, and to size a resistor for an LED the LED resistor calculator.
Heat and headroom
A linear regulator turns the whole voltage drop times the current into heat. A large drop with a high current needs a heat sink, and the input must stay above the output plus the dropout. When the heat is large, a switching regulator may be a better fit.
Assumptions and limits
- The reference voltage, adjust current and dropout are nominal values that you can edit. Check the data sheet of the exact part.
- Resistor tolerances, temperature drift and load regulation are not modeled.
- The wanted output must be above the reference voltage.
- The limiter connection uses a single resistor and ignores the small adjust pin current.
Frequently asked questions
How do I calculate the LM317 output voltage?
Use Vout = 1.25 x (1 + R2 / R1) plus a small term for the adjust current. With R1 = 240 ohms and R2 = 720 ohms the output is about 5.04 V.
What value should R1 be?
Data sheet circuits often show 240 ohms, and some use 120 ohms, so that enough current flows through the divider to keep the regulator in control. Check the minimum load current in the data sheet of your part.
How do I make a constant current source with an LM317?
Place one resistor between the output and adjust pins and take the load from the adjust side. The current is the reference voltage divided by the resistor, so 2.5 ohms sets about 0.5 A.
Why does my regulator get hot?
It dissipates the voltage across it times the current. Dropping 7 V at 0.5 A is 3.5 W, which needs a heat sink. Lower the input voltage or the current to reduce the heat.