The LM317 is a three-pin adjustable linear voltage regulator that lets you set the output anywhere from 1.25 V to 37 V with two resistors. On the TO-220 version, with the printed face towards you and the legs pointing down, the pins from left to right are 1 ADJ (adjust), 2 OUT (output) and 3 IN (input); the metal tab on the back is connected to OUT. OUT always sits about 1.25 V above ADJ. Put R1 (usually 240 Ω) between OUT and ADJ and R2 between ADJ and GND, and the output becomes about 1.25 × (1 + R2 / R1) volts; with a potentiometer as R2 you set it by turning a knob. It delivers up to 1.5 A with at most 40 V between input and output. The input must be at least about 2 V above the output (the maker recommends 3 V). A few milliamps must always flow from the output; a 240 Ω R1 draws about 5 mA on its own. Extra voltage becomes heat, (input − output) × current; above about 1 W fit a heat sink. Use 100 nF on the input and 1 µF on the output. Unlike the LM7805, it gives an adjustable output instead of a fixed 5 V and has no GND pin.

