Intermediate
4 hours
DIY Adjustable Variable Power Supply (LM317)
A variable power supply is one of the most useful tools on any electronics workbench. The LM317 is a positive adjustable voltage regulator that outputs voltage set by a simple resistor divider. This project builds a supply with a potentiometer for smooth voltage adjustment, a digital voltmeter display, current-limiting protection, and a proper filter capacitor for clean, stable output.
What You’ll Need
- LM317T voltage regulator (TO-220 package)
- 240 Ω fixed resistor (R1)
- 5 kΩ potentiometer (R2, linear taper)
- 2200 µF / 50 V electrolytic capacitor (main filter)
- 0.1 µF ceramic capacitor (output stability)
- 1N4007 diodes (×2, for protection)
- Heatsink for LM317 + thermal paste
- DC input: 24–35 V transformer + bridge rectifier (or use an existing DC supply)
- Digital panel voltmeter module (0–30 V, available cheaply online)
- Project enclosure with ventilation holes
- Banana jacks for output terminals
Step-by-Step Instructions
- Understand the circuit: Vout = 1.25 × (1 + R2/R1). With R1=240 Ω and R2 = 0–5 kΩ, output ranges from 1.25 V to ~27 V.
- Build on stripboard: Mount LM317 off-board on a heatsink. Connect input pin to filtered DC input. Connect output pin to R1, then junction to R2, then R2 other end to ADJ pin. Vout taken from output through a 0.1 µF cap to output terminal.
- Add protection diodes: D1 across input-output pins (cathode to input) prevents damage if output capacitor discharges into the device. D2 across ADJ-output prevents negative voltage at ADJ on short circuit.
- Add filter cap: 2200 µF electrolytic across the DC input (after bridge rectifier) to smooth the ripple.
- Wire voltmeter: Connect the panel voltmeter across the output terminals. Most panel meters need their own power supply — use a separate 9–12 V supply or tap from the input rail through a 7812.
- Mount in enclosure: Ensure the LM317’s heatsink has airflow. Add an on/off switch and a mains fuse on the AC input side.
- Test: Apply input voltage, turn pot from min to max, verify output sweeps the full range on the panel meter.
Safety Notes
- If building with a mains transformer, have a qualified electrician wire the AC input, or use a pre-built DC supply as your input. Mains AC is lethal.
- The LM317 dissipates significant heat at high current/voltage differential — an adequate heatsink is not optional.
- Always fuse the input — both AC and DC sides.
Tips & Troubleshooting
- Output voltage doesn’t reach expected maximum: your input DC is too low — Vin must be at least 3 V above Vout for the LM317 to regulate properly.
- Voltage fluctuates under load: increase the output capacitor value or add a second stage LC filter.
- For a dual-rail supply (±15 V) add an LM337 for the negative rail.