Advertisement
Advertisement
PHYSICS

LM317 Resistor Calculator — R1, R2, output voltage and heat

Pick the resistor pair that programmes an LM317 to the voltage you want, or read the voltage a pair already gives, with the dissipation the regulator has to survive.

Constant-current mode uses a single resistor between the output and the adjust pin, and the load hangs off the adjust pin instead of ground.
R1 sets the current that keeps the regulator loaded. The classic value is 240 Ω, which draws about 5.2 mA and satisfies the minimum-load requirement on its own.
The target voltage is read only in R2 mode and the target current only in constant-current mode. The other one is ignored rather than used.
Both come from the datasheet for the exact part you are using. The reference is nominally 1.25 V but is specified over a range, and the adjust pin current is typically 50 µA.
Output voltage
 
 
0
Output voltage
0
R2 value
0
Set current through R1
0
Heat in the regulator
Power to the load
0%
Power burned as heat
0%
Tip: the LM317 is a linear regulator, so every volt it drops at the output current is turned into heat inside the package. The resistor pair is the easy half of the design; the thermal calculation is the half that decides whether it survives.
Advertisement

The LM317 resistor calculator above works the programming network of the most widely used adjustable linear regulator in existence. Two resistors set the output voltage. This page gives you the voltage a pair produces, the R2 needed to hit a target, and the single resistor that turns the same chip into a constant-current source — plus the number most calculators leave out, which is how much heat the regulator sheds while doing it.

Arb Digital builds free calculators that each own one job. This page owns the LM317 specifically, including its 1.25 V internal reference and the small adjust-pin current that shifts the answer. The site's voltage divider calculator handles an ordinary resistive divider, which the LM317 network resembles but is not — the divider here sits inside a feedback loop and carries a regulated current rather than a fraction of a source voltage. For a plain series resistor on an LED, the LED resistor calculator is the right page.

What This LM317 Calculator Does

The LM317 does one thing internally: it drives its output pin until the voltage between output and adjust equals its reference, nominally 1.25 V. Everything else follows from that. Put a resistor R1 between output and adjust and the chip forces a fixed current through it. Put R2 from adjust to ground and that same current, plus the small current leaving the adjust pin, develops an additional voltage across it. The output voltage is the sum of the two.

That structure explains a property that surprises people meeting the part: the LM317 has no ground pin. It is a floating regulator that only sees the difference between its output and adjust terminals, which is why the same chip works at 5 V and at 30 V with nothing changed but two resistors.

The tool also reports the set current through R1 and the power dissipated in the package. Both are design constraints rather than decoration. The set current must exceed the regulator's minimum load current or the output will drift upward with no load attached, and the dissipation decides whether the part needs a heatsink, a bigger heatsink, or a different topology altogether.

How to Use It

  1. Choose your mode. Working out the voltage from a pair you already have is the analysis case; solving for R2 is the design case.
  2. Leave R1 at 240 Ω unless you have a reason not to. It is the canonical value because it draws just over 5 mA, comfortably above the minimum load the part requires.
  3. Enter the real input voltage and load current. These do not affect the output voltage, but they entirely determine the heat figure and the dropout check.
  4. Set the reference and adjust current from your datasheet. The defaults are the typical values, but the specified range matters when you need accuracy better than a few per cent.
  5. Read the heat figure before ordering anything. If it is more than about a watt, the package needs a heatsink; well above that and a switching regulator is the better answer.

The Formula: How the LM317 Sets Its Output

The output voltage is Vout = Vref × (1 + R2/R1) + Iadj × R2. The first term is the reference voltage amplified by the resistor ratio; the second is the extra drop caused by the current that leaves the adjust pin and flows through R2 alongside the set current. Texas Instruments' LM317 product page describes the part as an adjustable regulator capable of supplying more than 1.5 A over an output range of 1.25 V to 37 V, requiring only two external resistors to set the output, and notes that clamping the adjust terminal to ground programmes the output to 1.25 V.

Rearranged for the design case, R2 = (Vout − Vref) ÷ (Vref/R1 + Iadj). The set current through R1 is Vref/R1, independent of the output voltage. In constant-current mode there is only one resistor, Rset, and the output current is simply Iout = Vref ÷ Rset.

Dissipation is the ordinary power relation applied to the voltage the regulator is throwing away. OpenStax University Physics Volume 2, section 9.5 on electrical energy and power, states that the power gained or lost by any device has the form P = IV, and that the lost potential energy appears as heat in resistive material. For a linear regulator, P = (Vin − Vout) × Iout.

Work the defaults as a check. R1 = 240 Ω, R2 = 720 Ω, Vref = 1.25 V, Iadj = 50 µA. The ratio term gives 1.25 × (1 + 3) = 5.000 V, and the adjust term adds 0.00005 × 720 = 0.036 V, for 5.036 V out. The set current is 1.25 ÷ 240 = 5.21 mA. At 12 V in and 0.5 A out the regulator drops 6.96 V and dissipates 3.48 W.

Advertisement

The Heat Is the Real Design Constraint

That 3.48 W figure from the worked example is the whole story of why LM317 designs fail. A bare TO-220 package has a junction-to-ambient thermal resistance around 50 °C per watt, so 3.48 W would try to lift the junction some 175 °C above ambient. It will not get there — internal thermal shutdown folds the output back first — but a design that relies on thermal shutdown is not a design.

The lever that matters most is the input voltage, because dissipation is proportional to the difference between input and output. Dropping 12 V to 5 V wastes 58% of the power drawn; 9 V to 5 V wastes 44%; 7 V to 5 V wastes 29% and makes well under half the heat at the same load. The bar graph shows that split directly.

There is a floor, though. The LM317 needs a minimum voltage across itself to regulate at all, usually quoted as about 3 V at full current and less at light loads. Below that it drops out and the output simply follows the input down, ripple and all. So the input has to be high enough to stay above dropout at the bottom of the supply's ripple trough, and low enough that the heat is manageable at the top. That window is where a linear regulator lives, and if it is too narrow for your supply, a switching regulator is the correct answer rather than a bigger heatsink. The power dissipation calculator covers the general case of heat in a component.

Why R1 Cannot Be Any Value You Like

It is tempting to raise R1 to reduce the standing current the divider wastes. Two things push back. The first is the minimum load requirement: the LM317 needs a few milliamps flowing to regulate properly, and if the load can fall to zero then R1 has to supply that current by itself. This is why 240 Ω became the standard choice — at 1.25 V it draws 5.2 mA, which clears the requirement for common versions of the part with margin.

The second is the adjust-pin current term. Its contribution to the output is Iadj × R2, and R2 grows in proportion to R1 for a given output voltage, so making R1 ten times larger grows the error term tenfold while shrinking the useful set current tenfold. At R1 = 240 Ω the adjust term adds 36 mV to a 5 V output, under one per cent; at 2.4 kΩ it adds 360 mV, over seven per cent.

Going the other way has its own cost. A much smaller R1 wastes more current continuously and puts real power into the resistors themselves, which then need a rating to match. The resistor power rating calculator gives the wattage a resistor has to survive, and the Ohm's law calculator covers the underlying relation.

Standard Values, Tolerance and What Accuracy to Expect

The R2 that solves your target voltage exactly will almost never be a value you can buy. The tool reports the nearest E24 value and the voltage it actually produces, so you see the error before committing. If it is too large, combine two resistors, use an E96 one-per-cent value, or make part of R2 a trimmer.

Even with a perfect resistor, the output is only as good as the reference. The 1.25 V figure is a typical value, and datasheets specify a range around it. A part whose reference sits at the edge of that range shifts the whole output proportionally, so the ratio term is scaled by the same error. On top of that sit resistor tolerance, temperature drift in both the resistors and the reference, and load regulation as the output current changes.

So an LM317 with ordinary five-per-cent resistors is a several-per-cent-accurate supply, not a precision reference. If you need the output tight, use one-per-cent resistors with matched temperature coefficients and accept that the reference tolerance remains underneath. Combining values is often easier than sourcing an exact one, and the resistor combination calculator finds the series or parallel pair.

Need a website that loads fast and actually works?

Arb Digital builds free tools like this one because useful pages earn attention. If you want tools, calculators or content built for your own audience, we can help.

Browse All Free Tools Talk to Arb Digital

Common Mistakes to Avoid

  • Swapping R1 and R2 — R1 goes between the output pin and the adjust pin, R2 from adjust to ground. Reversing them gives a completely different and usually much higher output.
  • Ignoring the adjust-pin current — it is negligible at the standard R1 of 240 Ω and it is not negligible at all once R1 runs into the kilohms.
  • Designing only the voltage — the resistor pair is the easy part; the heat at the actual input voltage and load current is what determines whether the circuit works.
  • Running with too little headroom — below roughly 3 V across the part it stops regulating and passes the input through, including any ripple riding on it.
  • Relying on the load to provide the minimum current — if the load can be disconnected, R1 must supply the minimum load current on its own or the output will rise.

Related Free Tools From Arb Digital

For a plain resistive divider outside a feedback loop, use the voltage divider calculator, and for a series resistor on an LED the LED resistor calculator. Check component heating with the power dissipation calculator and the resistor power rating calculator. Build awkward values from stock parts with the resistor combination calculator, work the underlying relation on the Ohm's law calculator, and size a smoothing time constant with the RC time constant calculator. Everything is indexed on the free online tools hub.

Frequently Asked Questions

What is the LM317 output voltage formula?

Vout equals the reference voltage multiplied by one plus R2 divided by R1, plus the adjust pin current multiplied by R2. With a 1.25 V reference, R1 of 240 ohms and R2 of 720 ohms, that gives 5.036 V including the adjust term.

Why is R1 almost always 240 ohms?

Because 1.25 V across 240 ohms draws about 5.2 mA, which satisfies the regulator's minimum load current on its own even when the real load is disconnected. It also keeps R2 small enough that the adjust pin current contributes well under one per cent of the output.

Can the LM317 output less than 1.25 V?

Not in the standard configuration. The reference voltage between the output and adjust pins is the floor, so tying the adjust pin to ground gives 1.25 V and nothing lower. Reaching below it requires biasing the adjust pin negative with a separate supply.

How much heat will the regulator produce?

The difference between input and output voltage multiplied by the load current. Dropping 12 V to 5 V at half an amp puts 3.48 W into the package, which needs a substantial heatsink. Lowering the input voltage is far more effective than enlarging the heatsink.

How do I use an LM317 as a constant current source?

Use a single resistor between the output and adjust pins and connect the load from the adjust pin to ground. The regulator holds the reference voltage across that resistor, so the current is the reference divided by its resistance: 1.25 V across 3.57 ohms gives about 350 mA.

How much input voltage headroom does it need?

Roughly 3 V more than the output at full current, less at light loads, and the exact figure is specified in the datasheet for the part you are using. Below that the device drops out and the output follows the input, passing ripple straight through.

How accurate is the output voltage?

Several per cent with ordinary components. The reference itself is specified over a range rather than exactly 1.25 V, and resistor tolerance and temperature drift add to that. One-per-cent resistors improve the ratio but do not remove the reference tolerance underneath it.

What does the nearest E24 value in the result mean?

It is the closest standard resistor to the exact R2 the maths asks for, together with the output voltage that value actually produces. It exists because the ideal resistance is almost never something you can buy, and the error is worth seeing before you order parts.

This tool is provided for educational and estimating use. It applies the published LM317 relations to the values you enter and is not a substitute for the datasheet of the specific part you are using, which governs the reference tolerance, minimum load current, dropout voltage, current limit and thermal ratings. Verify any circuit against that datasheet before building it, and take particular care with heat dissipation and with any supply derived from mains electricity.

Advertisement
Advertisement

Take it further