The Operating Chemistry of the Classic LM317
The LM317 is a legendary floating 3-terminal adjustable linear voltage regulator. It maintains a constant precision 1.25 Volt reference ((V_{ ext{ref}})) between its OUTPUT pin and ADJUST pin.
Voltage Regulator Mode Formula
By placing resistor (R_1) across the output and adjust pins, a constant reference current flows: (I_{R1} = rac{1.25 ext{V}}{R_1}). This current then flows through bottom resistor (R_2) to ground:
Since the internal adjust pin current (I_{ ext{adj}}) is tiny (approx 50 µA), it can be ignored when (R_1 le 240,Omega).
The Constant Current Source Mode
If you connect a single resistor (R_{ ext{set}}) between the OUTPUT and ADJUST pins, and take your load from the ADJUST pin, the LM317 forces exactly 1.25V across that resistor, creating a bulletproof constant current generator:
For example, driving a 350mA high-power LED requires: (R_{ ext{set}} = 1.25 / 0.350 = mathbf{3.57,Omega}) (with a power rating of (P = 1.25 imes 0.35 = 0.44 ext{ Watts})).