Understanding the LM317 Voltage Regulator
The LM317 is a versatile three-pin integrated circuit that maintains a stable output voltage despite variations in input voltage or load current. Its three terminals are the input (from the unregulated power supply), output (where regulated voltage appears), and adjust pin (connected through resistors to ground).
Inside the chip sits a voltage reference of 1.25 V and an internal error amplifier that continuously adjusts an internal pass transistor to keep the adjust-to-output voltage constant at that reference value. This clever design allows external resistors to set any output voltage above 1.25 V without modifying the chip itself.
Common applications include:
- Variable DC power supplies for bench testing
- Backup battery charging circuits with regulated current
- Stabilized outputs in audio amplifiers and instrumentation
- Industrial equipment requiring programmable voltage levels
LM317 Output Voltage Formula
The output voltage depends on two external resistors and the internal 1.25 V reference. The relationship is linear and straightforward to calculate:
Vout = 1.25 × (1 + R₂ ÷ R₁)
V<sub>out</sub>— Output voltage from the LM317 (volts)R₁— Lower resistor from adjust pin to ground (ohms); manufacturer typically recommends 240 ΩR₂— Upper resistor from output to adjust pin (ohms); determines voltage gain
Practical Design Considerations
When choosing resistor values, start with R₁ at 240 Ω or 270 Ω (standard manufacturer recommendations reduce quiescent current from the adjust pin). Then calculate R₂ using the formula rearranged:
R₂ = R₁ × (Vout ÷ 1.25 − 1)
For stability, keep both resistor values between 100 Ω and 10 kΩ. Larger resistances increase adjust-pin leakage effects and noise; smaller values waste input current.
The minimum input-to-output voltage difference (dropout voltage) is 3 V, and the absolute maximum input voltage is 40 V. Always include bypass capacitors: 0.1 µF ceramic at the input and 1 µF electrolytic at the output to suppress high-frequency noise and stabilize the feedback loop.
Common Pitfalls and Design Tips
Avoid these mistakes when working with LM317 regulators.
- Ignoring the dropout voltage requirement — The input voltage must exceed the output voltage by at least 3 V. Attempting to regulate 12 V input to 11 V output will fail. For near-unity regulation, use a low-dropout (LDO) regulator instead.
- Omitting or undersizing output capacitor — Without a capacitor at the output, the regulator can oscillate and become unstable. A 1 µF electrolytic capacitor is the minimum; use 10 µF or more for high-current applications or when the load is far from the regulator.
- Selecting resistors with insufficient precision — Standard 5% tolerance resistors can shift the output voltage by ±5%. For critical applications requiring stable voltage, choose 1% metal-film resistors instead.
- Exceeding 1.5 A output current without a heat sink — The LM317 in a TO-220 package can dissipate roughly 20 W without a heat sink. Higher currents generate heat that may exceed safe junction temperature. Always calculate power dissipation: P = (V<sub>in</sub> − V<sub>out</sub>) × I<sub>out</sub>.
LM317 Applications in Real Circuits
The LM317 appears in thousands of commercial and DIY designs. Variable bench power supplies often use it as the main regulation stage, allowing users to dial in any voltage from 1.25 V to 30 V. In battery charger circuits, a series resistor connected to the adjust pin replaces R₂, turning the regulator into a precision current source—useful for charging lithium cells or lead-acid batteries at exactly the right current.
Network equipment like Ethernet switches and industrial controllers rely on LM317 variants to generate multiple stable voltages from a single unregulated input. Audio circuits benefit from its low output impedance and good rejection of power-supply noise, reducing hum and interference in sensitive microphone preamps.