Variable Bench Power Supply 1.25V to 16V Using LM317 from a DC Adapter

A variable power supply is the most useful tool on an electronics bench. It lets you power a 3.3 V sensor, a 5 V microcontroller and a 12 V relay from the same box, and test circuits at reduced voltage before applying full power. The LM317 adjustable regulator makes this easy: two resistors set the output, and the chip provides current limiting and thermal shutdown.

To keep the build safe, this supply takes its input from a certified, isolated DC adapter such as a 19 V laptop adapter, so no mains wiring is involved. You will learn the LM317 output formula, why the protection diodes are there and how to size the heatsink.

Components Required

PartValue / TypeQuantity
Regulator U1LM317T (TO-220)1
HeatsinkTO-220 heatsink, as large as practical, insulating pad and bush1
R1240 ohm, 1 percent1
VR15 kilo-ohm linear potentiometer1
C1 (input)100 nanofarad ceramic + 470 microfarad, 35 V1 each
C2 (ADJ bypass)10 microfarad, 25 V1
C3 (output)10 microfarad, 25 V + 100 nanofarad ceramic1 each
D1, D2 (protection)1N4002 or 1N40072
D3 (reverse input)1N5822 Schottky or 1N54081
F12 A fuse and holder1
IndicatorLED with 2.2 kilo-ohm1 each
VoltmeterPanel voltmeter module or multimeter1
InputDC barrel socket matching a 19 V, 2 A or larger adapter1
OutputRed and black binding posts1 pair

Circuit Explained Stage by Stage

Stage 1: Input

The adapter feeds the circuit through F1 and D3. D3 protects against a wrongly wired adapter plug. C1 placed close to the LM317 input pin provides a low-impedance source, which the datasheet recommends when the regulator is more than a few centimetres from the supply's own filter capacitor.

Stage 2: Setting the output voltage

The LM317 holds a reference voltage of about 1.25 V between its output and adjust pins. R1 sits between output and ADJ, so a constant current of 1.25 V / 240 ohm, about 5.2 mA, flows through it. That current, plus the small ADJ pin current, then flows through VR1 to ground, and the voltage across VR1 adds to the 1.25 V.

V_out = 1.25 x (1 + VR1 / R1) + I_adj x VR1
(I_adj is typically about 50 uA and is usually ignored)

VR1 = 0:     V_out = 1.25 V
VR1 = 2.4 k: V_out = 1.25 x 11 = about 13.75 V
VR1 = 5 k:   V_out = 1.25 x (1 + 20.8) = about 27 V (theoretical)

In practice V_out is limited to about V_in minus 3 V, so about 16 V from a 19 V adapter

The LM317 needs a minimum load current to stay in regulation, quoted in the datasheet as typically a few milliamps and up to 10 mA worst case. The current through R1 serves as this load. Some designers use 120 ohm for R1 to guarantee 10 mA; then scale VR1 to 2.5 kilo-ohm for the same range.

Stage 3: Ripple and protection

C2 from ADJ to ground improves ripple rejection. C3 on the output improves transient response. Capacitors introduce a risk: if the input is suddenly shorted, C3 tries to discharge back through the regulator, and if the output is shorted, C2 discharges through the ADJ pin. D1, from output to input with its cathode at the input, and D2, from ADJ to output with its cathode at the output, give these charges a safe path. This arrangement follows the protection diode example in the LM317 datasheet.

LM317T pinFunctionConnection
1ADJR1 to output, VR1 to GND, C2 to GND, D2 anode
2 and tabOutputR1, C3, D1 anode, D2 cathode, output post
3InputC1, D1 cathode, from D3 and F1

How It Works and Heat

Turning VR1 changes how much voltage is added above the 1.25 V reference, so the output moves smoothly from 1.25 V up to about 16 V. The regulator drops everything between input and output across itself, which becomes heat.

P = (V_in - V_out) x I_load
Example: 19 V in, 3.3 V out, 0.5 A load
P = (19 - 3.3) x 0.5 = 7.9 W

Nearly 8 W needs a substantial heatsink. The LM317 will protect itself with thermal shutdown, but a supply that keeps cutting out is frustrating. For heavy loads at low voltage, use a lower-voltage adapter, or accept a lower current limit.

Assembly and Testing

  1. Mount the LM317 on the heatsink with the insulating pad and thermal compound. Check with a multimeter that the tab is not connected to the heatsink.
  2. Wire R1 directly between output and ADJ pins, as close to the chip as possible; this improves regulation.
  3. Add VR1, the capacitors and the protection diodes with the correct orientation.
  4. Power up with no load. Sweep VR1 and confirm the output ranges from about 1.25 V to about 16 V.
  5. Load the output with a 47 ohm, 5 W resistor at 5 V (about 100 mA) and check the voltage stays steady.
  6. Mount everything in a box with the voltmeter and binding posts.

Troubleshooting

  • Output stuck near input voltage: the ADJ pin is open. Check VR1 wiring to ground.
  • Output stuck at 1.25 V: VR1 is shorted or wired as zero ohms; check which pot terminals you used.
  • Output drops under load: the regulator is in thermal shutdown or the adapter is overloaded.
  • Output reads high with no load: the minimum load current is not met; check R1 value.
  • Oscillation on a scope: add the 100 nanofarad capacitors close to the input and output pins.

Summary

The LM317 maintains 1.25 V between output and ADJ, and the R1 and VR1 divider multiplies it to any voltage up to a few volts below the input. Protection diodes, bypass capacitors and a well-sized heatsink turn the basic circuit into a dependable bench supply.