Parts

LM317 regulator: pinout, the R1/R2 formula, heat and the LM337

By Bulan Sarkar

An LM317 in a TO-220 is ADJ, OUT, IN: printed face toward you, leads down, the adjust pin is on the left, the output in the middle and the input on the right. The metal tab is the output as well, so a heatsink bolted to it sits at the output voltage.

Two resistors set the voltage, and the heat decides almost everything else. Below are the formula, a 5 V supply from 12 V worked through to the heatsink, and the LM337, the negative version, whose middle pin is the input. The numbers come from TI's SLVS044Z and SLVS047L and ST's DS0433 and LM337 datasheets.

Datasheet: Texas Instruments LM317 3-Pin Adjustable Regulator, SLVS044Z (PDF)Ask Datasheet Guru about the LM317T

Advertisement

Pinout by package

LM317 TO-220 · TI1=ADJ 2=OUT 3=IN
tab =outputprinted facetoward youADJ1 AdjustOUT2 OutputIN3 Input

Printed face toward you, leads down: adjust, output, input from left to right. The tab is the output.

Source: Texas Instruments LM317 3-Pin Adjustable Regulator, SLVS044Z, p. 5 (Figure 5-2, KCS/KCT TO-220, and the pin table: ADJUST 1, OUTPUT 2 and TAB, INPUT 3)

LM317T TO-220 · ST1=ADJ 2=OUT 3=IN
tab =outputprinted facetoward youADJ1 AdjustOUT2 OutputIN3 Input

Printed face toward you, leads down: adjust, output, input from left to right. ST prints "Tab connected to OUTPUT".

Source: STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 2 (Figure 1, TO-220 pin connections: INPUT, OUTPUT, ADJUST, "Tab connected to OUTPUT"); STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 13 (Table 6, order codes: LM317T is the TO-220)

LM337 TO-220 · TI1=ADJ 2=IN 3=OUT
tab =inputprinted facetoward youADJ1 AdjustIN2 InputOUT3 Output

Printed face toward you, leads down: adjust, input, output from left to right. The tab is the input.

Input and output swap places against the LM317. The tab is the input here, not the output.

Source: Texas Instruments LMx37 3-Terminal Adjustable Regulators (LM237, LM337), SLVS047L, p. 3 (KC and KCS TO-220 drawings with the tab marked INPUT; pin table ADJUSTMENT 1, INPUT 2, OUTPUT 3); STMicroelectronics LM337 Three-terminal adjustable negative voltage regulators, DocID2167, p. 4 (Figure 2, TO-220 pin connections: OUTPUT, INPUT, ADJUST)

Which one do you have?

LM317T is the TO-220 most shops sell, in ST's order codes as LM317T or the double-gauge LM317T-DG. TI's TO-220 parts are the KCS and KCT packages, which TI lists as its "legacy chip"; its newer die comes in SOT-223 and TO-263, with the same pin numbers and the tab still on the output. ST also sells an LM317 in a fully moulded TO-220FP (order code LM317P) with the same pin order.

Letters in front of the number name a temperature grade, not a different circuit: the LM217 is rated for a −25 to 150 °C junction and the LM317B for −40 to 125 °C. TI also lists an LM317M (0.5 A) and an LM317L (0.1 A) in its comparison table; those come in other packages with their own datasheets, so check their pins before you swap one in. A part marked only "LM317" with no maker's logo is anybody's; the bench check further down tells you whether it behaves like the datasheet.

Ratings

Both makers allow 40 V between input and output, about 1.5 A, and a junction between 0 and 125 °C in normal use. TI prints 150 °C as the absolute maximum for the TO-220 but recommends 125 °C; design to 125 °C.

Ratings from each maker's datasheet; the LM337 column is TI's
ParameterLM317TO-220LM317TTO-220LM337TO-220
Input-to-output voltage VI − VO40 V40 V−40 V
Input-to-output voltage, recommended3 to 40 V2.5 to 40 V (where VREF is tested)−2.5 to −37 V
Output current, recommended IO10 mA to 1.5 Ainternally limited10 mA to 1.5 A (P ≤ 15 W)
Power dissipation PDinternally limitedinternally limitednot listed
Junction temperature, absolute maximum TJ150 °C125 °C (0 to 125 °C operating)150 °C
Junction temperature, recommended TJ0 to 125 °C0 to 125 °C0 to 125 °C
Junction to ambient, TO-220 RθJA23.5 °C/W (JEDEC test board)50 °C/W24.8 °C/W (JEDEC test board)
Junction to case, TO-220 RθJC15.9 °C/W (top), 0.1 °C/W (bottom)5 °C/W3 °C/W (top)
Storage temperature Tstg−65 to 150 °C−65 to 150 °C−65 to 150 °C

The thermal figures are where they part company. TI lists 23.5 °C/W from junction to air for its TO-220, a number computed for the JEDEC standard test board. ST gives 50 °C/W for the bare package and 5 °C/W from junction to case. Use ST's pair: a regulator standing on two legs in a box is closer to ST's case than to a test board, and the worked example below uses those two numbers.

Reference, adjust current and headroom

Limits at 25 °C unless marked; min / typ / max where three figures are given
ParameterLM317TO-220LM317TTO-220LM337TO-220
Reference voltage, OUTPUT to ADJUST VREFfull load and temperature range; from 3 V across the part (TI), 2.5 V (ST)1.2 / 1.25 / 1.3 V1.2 / 1.25 / 1.3 V−1.2 / −1.25 / −1.3 V
Reference voltage at 25 °C VREF1.25 V typnot given separately−1.213 / −1.25 / −1.287 V
Adjust pin current IADJ50 µA typ, 100 µA max50 µA typ, 100 µA max65 µA typ, 100 µA max
Minimum load current|VI − VO| = 40 V3.5 mA typ, 10 mA max3.5 mA typ, 10 mA max2.5 mA typ, 10 mA max
Current limit|VI − VO| ≤ 15 V1.5 A min, 2.2 A typ1.5 A min, 2.2 A typ1.5 A min, 2.2 A typ
Current limit|VI − VO| = 40 V, 25 °C0.15 A min, 0.4 A typ0.4 A min0.15 A min, 0.4 A typ
Line regulation at 25 °C3 V to 40 V across the part0.01 %/V typ, 0.04 %/V max0.01 %/V typ, 0.04 %/V max0.01 %/V typ, 0.04 %/V max
Load regulation at 25 °C10 mA to 1.5 A, |VO| ≥ 5 V0.1 % typ, 0.5 % max0.1 % typ, 0.5 % max0.3 % typ, 1 % max
Ripple rejection, 120 Hz, 10 µF on ADJVO = 10 V (−10 V for the LM337)62 dB min, 64 dB typ (legacy chip)66 dB min, 80 dB typ66 dB min, 77 dB typ
Dropout, typical, 25 °Cread from ST Figure 4TI asks for up to 3 V headroomabout 1.9 V at 500 mA, 2.3 V at 1.5 ATI asks for at least 2.5 V

The reference is the voltage the LM317 holds between OUT and ADJ: 1.25 V typical, anywhere from 1.2 V to 1.3 V over load and temperature. Every output voltage is that number scaled by the divider, so a part at the edge of its limits moves a 5 V output by about 4 % either way.

The adjust pin leaks 50 µA typical, 100 µA at most, into R2. With a few hundred ohms there it adds a few tens of millivolts. With tens of kilohms it adds volts, which is one reason R1 and R2 stay small.

0 V2 V4 V6 V8 V10 V12 V0250 Ω500 Ω750 Ω1000 Ω5.02 V at 360 ΩR1 = 120 ΩR1 = 240 ΩR2, the resistor from ADJ to 0 VRed bar: the spread from the 1.2 to 1.3 V reference
Figure 1. Output voltage against R2. The red bar is how far a 5 V setting can move across the 1.2 to 1.3 V reference limits.

The regulator also needs current to stay in regulation: 3.5 mA typical and up to 10 mA with 40 V across it. The divider can supply that by itself, which is why the worked example uses 120 Ω for R1 rather than the 240 Ω in TI's drawing.

Headroom is the last limit. TI asks for up to 3 V between input and output. ST's typical dropout curve sits lower, near 1.9 V at 500 mA and 2.3 V at 1.5 A at 25 °C, but that is a typical curve, not a limit. Plan on 3 V.

What it is good for

  • Odd voltages no fixed regulator offers, from 1.25 V up to 37 V.
  • A bench supply with a pot as R2. The LM317 calculator finds the resistor pair for any voltage.
  • A constant-current source: one resistor from OUT to ADJ, and the current is 1.25 V divided by that resistor (TI section 7.3.3). It is a common way to run an LED string or charge a small battery at a fixed current.
  • Cleaning up the output of a switching module, a volt or two below it.

It is the wrong part for a big step down at more than a few hundred milliamps. Every volt it drops turns into heat, as the example below shows. For 12 V to 5 V at an amp, a buck regulator such as the LM2596 wastes far less. For 3.3 V from 5 V at small currents, the AMS1117 needs less headroom.

Worked example: 5 V at half an amp from 12 V

A 12 V adapter has to give 5 V to a 10 Ω load, about half an amp. The circuit is TI's Figure 8-1 without the optional parts: R1 from OUT to ADJ, R2 from ADJ to ground, 100 nF on the input and 1 µF on the output.

1. Pick R1 for the minimum load. 1.25 V / 120 Ω = 10.4 mA, just over the 10 mA worst case, so the output holds even with nothing else connected. TI's 240 Ω gives 5.21 mA: enough for a typical part, not for every part.

2. Pick R2. R2 = R1 × (5 / 1.25 − 1) = 360 Ω, an E24 value. With the adjust current added, VOUT = 1.25 × (1 + 360/120) + 50 µA × 360 Ω = 5.02 V. Over the reference limits and up to 100 µA of adjust current it lands between 4.8 V and 5.24 V.

3. Check the headroom. 5.02 V + 3 V = 8.02 V is the lowest input that keeps it regulating. 12 V leaves 6.98 V, plenty.

4. Work out the heat. The regulator carries the load current, 502 mA, plus the divider's 10.4 mA: 512 mA in all. P = (12 − 5.018) V × 512 mA = 3.58 W, with the adjust current adding well under a milliwatt.

5. Try it without a heatsink. At ST's 50 °C/W the junction would rise 179 °C, to 219 °C in 40 °C air. It never gets there: the thermal protection shuts the output down first, and the supply cuts in and out.

6. Size the heatsink. (125 − 40) °C / 3.58 W = 23.8 °C/W in total, junction to air. Take off 5 °C/W junction to case and 1 °C/W for a greased insulating pad, our allowance since neither maker gives one: the heatsink must be 17.8 °C/W or better. A 17 °C/W part puts the junction at 122 °C.

3 IN 2 OUT 1 ADJ LM317 +12 V C1 100 nF R1 120 Ω R2 360 Ω 5.02 V C2 1 µF RL 10 Ω
Figure 2. The 5 V regulator from the example. The simulation of this drawing gives 5.02 V out and 3.58 W in the LM317, the numbers in the steps.
12 V in5.02 V load6.98 V across LM3178.02 V: lowest inputwith TI's 3 V headroom3.58 W of heat; 41 % of the input power reaches the load
Figure 3. Where the 12 V goes. More than half of it is dropped across the regulator and leaves as heat.
Junction to air, °C/W (shorter is cooler)50No heatsink (ST TO-220)23.8Most allowed23Junction to case (ST): 5 °C/WGreased pad (our allowance): 1 °C/WHeatsink: 17 °C/W
Figure 4. The heatsink budget for 3.58 W. The bare package is twice the resistance the heat can afford.

The LM317 calculator runs the same resistor sums for any voltage and supply. The regulator thermal design and heatsinks lessons go deeper into the heat side.

Worked example in numbers

Output voltage
5.02 V
Heat in the LM317
3.58 W
Heatsink needed
≤ 17.8 °C/W
Efficiency
41 %

The LM337: the negative version

The LM337 makes a negative rail the same way: −1.25 V between OUTPUT and ADJUSTMENT, scaled up by R2 over R1. With the same 120 Ω and 360 Ω it gives -5 V; TI's design procedure uses 120 Ω for R1 for the same minimum-load reason, 10.4 mA through the divider.

The pins are not the LM317's. In the TO-220 the LM337 is ADJ, IN, OUT, and TI marks the tab as the input. ST's sheet shows the same pin order. The negative supply therefore sits on the tab and on any heatsink bolted to it.

One more difference: the LM337 needs an output capacitor to stay stable. Both makers ask for 1 µF solid tantalum or 10 µF aluminium electrolytic on the output, and 1 µF tantalum on the input when the regulator sits more than 10 cm from the supply's filter capacitor. ST rates its TO-220 at 70 °C/W junction to air and 3 °C/W junction to case.

LM317front1ADJ2OUT3INtab = OUTLM337front1ADJ2IN3OUTtab = IN
Figure 5. Same package, same adjust pin, but the middle pin and the tab change from output to input.
Advertisement

Tips and checks

  • Solder R1 straight across the OUT and ADJ pins and run R2's ground end to the load's ground. ST recommends exactly this for the best load regulation.
  • A 10 µF capacitor from ADJ to ground raises the ripple rejection: ST quotes about 15 dB, and TI's 120 Hz figure goes from 57 dB to 64 dB on the TO-220. Add TI's protection diode across R1 with it, so the capacitor cannot discharge into the adjust pin.
  • The tab is live. Use an insulating pad and bushing if the heatsink touches anything else, or treat the whole heatsink as the output rail (the input rail for an LM337).
  • Keep R1 at 120 Ω or lower unless the load always draws 10 mA. A light load on a 240 Ω divider can let the output creep up.
  • Without a heatsink, keep the heat under about 1.7 W in 40 °C air (85 °C of rise at 50 °C/W).

Substitutes

The LM217 and LM317B are the same regulator in other temperature grades and drop straight in. For the LM337 the LM237 does the same job. Nothing in this list fixes the heat; a part that runs too hot as an LM317 runs just as hot as an LM217.

Pin order on the TO-220: printed face toward you, leads down, pins 1, 2, 3 from left to right
PartPinsVerdict
LM217ADJ-OUT-INThe same regulator in ST’s sheet, rated for a −25 to 150 °C junction instead of 0 to 125 °C. Same pins, same 1.25 V reference; a direct swap.STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 3; STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 5
LM317BADJ-OUT-INST’s −40 to 125 °C grade. Same pins, but its reference is specified only up to 500 mA, so treat it as a half-amp part on paper.STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 3; STMicroelectronics LM217, LM317 1.2 V to 37 V adjustable voltage regulators, DS0433, p. 7
LM237 (for an LM337)ADJ-IN-OUTThe wider-temperature LM337, rated −25 to 150 °C. Same pins as the LM337, which means the opposite middle pin to an LM317.Texas Instruments LMx37 3-Terminal Adjustable Regulators (LM237, LM337), SLVS047L, p. 3; Texas Instruments LMx37 3-Terminal Adjustable Regulators (LM237, LM337), SLVS047L, p. 4

A bench check before it goes in

  1. Power off, meter on continuity: the tab should read 0 Ω to the middle pin.
  2. Wire the 120 Ω and 360 Ω divider, feed 12 V from a current-limited bench supply and measure the output with no load. It should be between 4.8 V and 5.24 V.
  3. Measure across R1. That is the reference: 1.2 V to 1.3 V. A part outside it is not behaving like an LM317.
  4. Add the load and watch the output for a minute. If it sags or starts cutting out, the heat is the cause, not the resistors.

The common mistakes: the LM337 wired like an LM317, R1 at a few kilohms with no load so the output floats up, no heatsink on a 3 W job, and the heatsink shorted to a grounded case through a missing insulator. The linear regulators lesson explains why the heat follows the voltage drop, and the voltage divider covers the R1/R2 arithmetic.

What we'd do

Use the LM317 for odd voltages, adjustable bench supplies and current sources, with R1 at 120 Ω and R2 from the formula. Work out the heat before choosing it: under about 1.7 W it runs bare, up to a few watts it needs a proper heatsink, and beyond that, or for 12 V to 5 V at an amp, buy a buck module instead. For a negative rail use the LM337, and check its pinout twice.

Questions people ask

What is the LM317 pinout?

In TO-220, with the printed face toward you and the leads down: pin 1 adjust, pin 2 output, pin 3 input. The tab is the output.

How do I calculate R1 and R2 for an LM317?

VOUT = 1.25 V × (1 + R2/R1), plus a small error from the adjust current. Fix R1 at 120 Ω and solve for R2: R2 = 120 × (VOUT/1.25 − 1). 5 V needs 360 Ω.

What input voltage does an LM317 need?

The output plus about 3 V, and no more than 40 V above the output. For 5 V out that means at least 8 V in.

Does an LM317 need a heatsink?

Multiply the voltage it drops by the current. Below about 1.7 W in warm room air, no. Above it, yes: 12 V to 5 V at half an amp is 3.6 W and needs about 17 °C/W.

Can an LM317 drive LEDs at a constant current?

Yes. Put one resistor between OUT and ADJ and take the current from the far end of it: I = 1.25 V / R. 62 Ω gives about 20 mA. The input has to cover the LED string, the 1.25 V across the resistor and 3 V of headroom.

What is the difference between the LM317 and the LM337?

The LM317 regulates positive voltages, the LM337 negative ones. The LM337's middle pin and tab are the input, and it needs an output capacitor to be stable.

Buying the LM317 in India

LM317T in TO-220 is stocked by almost every component shop and sold loose. Ask for the LM337 by name, since some shops keep only the LM317, and ask for a named maker. A part with no logo may still work, but run the bench check above before you trust it with anything expensive, and buy the heatsink and insulating kit at the same time. Our guide to buying electronic components in India compares ten online sellers and covers how to spot fakes.

Advertisement

One email a month from the bench

New circuits, lessons, part guides and calculators, on the first Sunday of each month.

We'll send one email to confirm. Every email has a one-click unsubscribe. Privacy policy

Used in these lessons

Lessons that go deeper

Datasheets this page was checked against

Makers revise datasheets. If the copy you download has a newer revision and a number here disagrees with it, the datasheet wins, and we would like to hear about it.