LM317 Voltage Regulator
Design an adjustable power supply.
The LM317 Adjustable Regulator
The LM317 is the most widely used adjustable linear voltage regulator in history. Unlike fixed regulators (like the 7805), the LM317 allows you to set the output voltage from 1.25V up to 37V using just two external resistors.
It is virtually indestructible, featuring internal current limiting, thermal shutdown, and safe-area compensation. It's the "Swiss Army Knife" of power supply design.
How to Calculate Output Voltage
The LM317 maintains a precise reference voltage (Vref = 1.25V) between the Output and Adjustment pins. This forces a constant current through R1, which then flows through R2, creating a voltage drop to ground.
Vout = 1.25V × (1 + R2/R1)
Note: There is also a small error term from the Adjustment pin current (Iadj × R2), but Iadj is so small (50µA) that it is usually ignored for general purpose circuits.
Recommended Values
R1 is typically chosen as 240Ω. Why? Because the LM317 needs a minimum load of ~5mA to regulate correctly. 1.25V / 240Ω = 5.2mA, which satisfies this requirement automatically.
Practical Applications
- Bench Power Supply: The core of most DIY variable lab power supplies.
- Current Limiter: By reconfiguring the circuit (output to adj), it can act as a constant current source for LED drivers or battery chargers.
- Pre-regulator: Used before sensitive electronics to clean up noisy input power.
FAQ
Do I need a Heat Sink?
Probably. Linear regulators burn excess voltage as heat. Power dissipated = (Vin - Vout) × Current. If you drop 12V to 5V at 1A, that's (12-5)*1 = 7 Watts of heat! Without a heatsink, the LM317 will shut down in seconds.
Why do I need capacitors?
Datasheets recommend a 0.1µF capacitor on the input (if the supply wire is long) and a 1µF capacitor on the output to improve transient response. Omitting them can sometimes cause the regulator to oscillate (ring).
What is the max current?
The standard LM317 (TO-220 package) is rated for 1.5 Amps, provided you can keep it cool. If you need more current, look at the LM350 (3A) or LM338 (5A), which work exactly the same way.