The LM317 is a 3-terminal adjustable linear voltage regulator capable of supplying over 1.5A of load current across an output range of 1.25V to 37V. It requires only two external resistors to set the output voltage, making it a staple on workbenches for prototyping and low-noise analog power rails. However, because it is a linear topology, it burns excess voltage as heat. If you do not calculate dropout headroom and thermal resistance correctly, the IC will trigger its internal thermal shutdown—or worse, fail catastrophically.
This guide provides the exact design math, thermal derating formulas, and topology comparisons you need to implement the LM317 reliably in your next power supply design.
Linear vs. Switching: When the LM317 Wins (and When It Melts)
Before committing to the LM317, you must decide if a linear regulator is appropriate for your load, or if you should use a switching buck converter like the LM2596. The choice hinges on four criteria: efficiency, heat dissipation, output noise, and component cost.
| Criterion | LM317 (Linear) | LM2596 (Switching) |
|---|---|---|
| Efficiency | ~41% (Vout/Vin) | ~85% - 92% |
| Heat Dissipation | 7.0 Watts (Requires large heatsink) | ~0.8 Watts (No heatsink needed) |
| Output Noise / Ripple | Microvolts (µV) - Excellent for RF/Audio | Millivolts (mV) - 150kHz switching ripple |
| Component Cost & Footprint | ~$0.60 (IC + 2 resistors + caps) | ~$1.50 (IC + large inductor + Schottky diode) |
| Complexity | Trivial (2 passive components) | Moderate (Requires PCB layout care for EMI) |
The Verdict: Choose the LM317 when your load is under 500mA, your input-to-output voltage differential is small (under 3V), or your circuit is highly sensitive to noise (e.g., precision ADC references, audio preamps, or RF synthesizers). Choose a switching regulator when stepping down high voltages at high currents, or when operating from a battery where efficiency dictates runtime.
Design Example: 12V to 5V @ 1A Power Supply
Let us design a 5V, 1A power rail from a 12V DC wall adapter using the LM317. We must calculate the resistor divider, verify the dropout headroom, and select the correct capacitors for ripple control.
1. Dropout and Headroom Math
The LM317 requires a minimum voltage differential between the input and output to maintain regulation, known as the dropout voltage. According to the Texas Instruments LM317 datasheet, the maximum dropout voltage is 2.5V at 1.5A, and typically around 1.7V at 1A.
- Vout: 5.0V
- Dropout (Vdo): 2.0V (using a safe margin)
- Minimum Vin: 5.0V + 2.0V = 7.0V
Our 12V wall adapter provides 7V of headroom (12V - 5V). This is well above the 2.0V minimum, ensuring the regulator will not drop out of regulation even if the wall adapter sags to 9V under load.
2. Resistor Divider Calculation
The output voltage is set by the internal 1.25V reference (Vref) and two external resistors, R1 and R2. The formula is:
Vout = 1.25V × (1 + R2/R1) + (Iadj × R2)
The adjustment pin current (Iadj) is typically 50µA and is usually small enough to ignore for basic calculations, but we will include it for precision. We select a standard R1 = 240Ω (this draws ~5.2mA, satisfying the LM317's 5mA minimum load requirement).
- 5.0V = 1.25V × (1 + R2/240) + (0.00005A × R2)
- 3.75V = (1.25V / 240Ω) × R2 + 0.00005 × R2
- 3.75V = 0.005208 × R2 + 0.00005 × R2
- 3.75V = 0.005258 × R2
- R2 ≈ 713Ω
Since 713Ω is not a standard E24 resistor value, you can use a 715Ω (1% tolerance) resistor for an output of 4.99V, or a 750Ω resistor for 5.16V. For exact 5.00V, use a 500Ω fixed resistor in series with a 500Ω trimmer potentiometer.
3. Ripple Rejection and Capacitor Selection
The LM317 inherently rejects input ripple, but its Power Supply Rejection Ratio (PSRR) degrades at higher frequencies. To maintain low noise:
- Input Capacitor: Place a 0.1µF ceramic capacitor as close to the IN pin as possible to bypass high-frequency noise, paired with a 10µF to 47µF electrolytic bulk capacitor if the supply leads are longer than 6 inches.
- Output Capacitor: A 1µF to 10µF solid tantalum or low-ESR ceramic capacitor is required for transient stability and to prevent high-frequency oscillation.
- Adjustment Pin Capacitor: Placing a 10µF electrolytic capacitor between the ADJ pin and ground bypasses the thermal noise of the R2 resistor, boosting ripple rejection from a baseline of ~65dB up to 80dB at 120Hz.
Thermal Reality Check: Heatsinks and Derating
Linear regulators dissipate excess power as heat. In our 12V to 5V @ 1A example, the power dissipation (Pd) is:
Pd = (Vin - Vout) × Iout = (12V - 5V) × 1A = 7.0 Watts
A standard TO-220 package without a heatsink has a junction-to-ambient thermal resistance (RθJA) of roughly 50°C/W. At 7W, the junction temperature (Tj) would rise to 350°C above ambient (25°C + 350°C = 375°C). The LM317's internal thermal shutdown triggers at ~165°C. Without a heatsink, this circuit will shut down in seconds and the package will be hot enough to cause second-degree burns.
To keep the junction temperature safely below 125°C (leaving margin below the 165°C shutdown threshold) in a 25°C room, you must calculate the required heatsink thermal resistance (RθSA).
The Thermal Equation:
RθSA = ((Tj_max - Ta) / Pd) - RθJC - RθCS
- Tj_max: 125°C (Target maximum junction temp)
- Ta: 25°C (Ambient room temperature)
- Pd: 7.0W
- RθJC: 3.0°C/W (Junction-to-case for TO-220)
- RθCS: 0.5°C/W (Case-to-sink, assuming thermal paste and a mica insulator)
RθSA = ((125 - 25) / 7.0) - 3.0 - 0.5
RθSA = 14.28 - 3.5 = 10.78°C/W
Actionable Spec: You must source a TO-220 heatsink rated for 10°C/W or lower. A standard 2-inch long extruded aluminum finned heatsink (like the Aavid Thermalloy 577202B00000G) typically rates around 8°C/W to 12°C/W depending on airflow, making it the exact physical form factor required for this 7W load.
Protection, Input Range, and Reverse Currents
The LM317 is rugged, but it is vulnerable to specific fault conditions. As noted in All About Circuits' linear regulator guides, external diodes are mandatory in certain topologies to prevent internal junction burnout.
- Maximum Input-Output Differential: The absolute maximum voltage difference between the IN and OUT pins is 40V. If you are regulating 48V down to 5V, the LM317 will suffer dielectric breakdown. For high-voltage drops, use a pre-regulator or a high-voltage variant like the LM317HV.
- Protection Diode D1 (Input Short): If the input is shorted to ground while the output capacitor is fully charged, the output cap will discharge backward through the LM317's internal junctions, destroying the IC. Place a 1N4004 diode in parallel with the regulator (anode to OUT, cathode to IN) to provide a safe discharge path.
- Protection Diode D2 (Output Short / Inductive Loads): If you place a 10µF capacitor on the ADJ pin and the output is suddenly shorted, the ADJ cap will discharge through the internal reference. Place a second 1N4004 diode (anode to OUT, cathode to ADJ) if your adjustment capacitor is larger than 1µF and your output voltage exceeds 25V.
LM317 Voltage Regulator FAQ
Why is my LM317 voltage regulator output drifting higher than calculated?
Output drift in an LM317 circuit is almost always caused by failing to meet the minimum load current requirement. The LM317 requires a minimum of 5mA (and up to 10mA over the full temperature range) flowing from the OUT pin to ground to maintain regulation. If your load is a high-impedance microcontroller in sleep mode drawing only 2mA, the output voltage will float upward toward the input voltage. The standard 240Ω R1 resistor naturally draws 5.2mA (1.25V / 240Ω), solving this issue. If you use a higher value for R1 to save quiescent current (e.g., 1kΩ), you must add a dedicated bleed resistor from the output to ground to guarantee the 10mA minimum load.
Can I parallel two LM317s to get 3 amps of current?
No, you cannot simply wire two LM317s in parallel. Because each IC has a slightly different internal 1.25V reference voltage (tolerance is typically ±1%), the regulator with the slightly higher reference will attempt to supply 100% of the load current, overheat, and trigger thermal shutdown. Once it shuts down, the second regulator takes the full load, overheats, and shuts down, resulting in a continuous oscillating failure. If you need more than 1.5A, use an external PNP pass transistor (like a TIP32) to boost the LM317's current capacity, or switch to a higher-rated regulator like the LM338 (5A) or LM350 (3A).
How does the LM317 handle ripple and noise compared to an LDO?
The LM317 is an older bipolar design, not a modern Low Dropout Regulator (LDO). While its baseline ripple rejection is excellent at low frequencies (around 80dB at 120Hz when the ADJ pin is bypassed), its PSRR rolls off significantly above 10kHz. Modern CMOS LDOs (like the TI TPS7A47 or Analog Devices ADM7150) maintain high PSRR well into the MHz range. If your load is a high-speed RF transceiver or a 24-bit audio DAC that is sensitive to high-frequency switching noise from an upstream SMPS, a modern LDO is a better choice than the LM317.






