Build a $10 Adjustable Power Supply with LM317
Every electronics workbench needs a good adjustable power supply. Not because it's flashy — but because without it, you're constantly scavenging wall adapters, hoping the voltage is close enough. That stops today. The LM317 adjustable voltage regulator is one of the most elegant ICs ever made: feed it anything from 4.25V to 40V in, dial in your output from 1.25V to 37V, and it holds that voltage rock-solid regardless of load. This project costs under $10, teaches you real power supply theory, and produces something you'll actually use for decades. Let's build it.
What You'll Need
Keep your parts list tight. Every component here earns its place:
- LM317T voltage regulator IC (TO-220 package)
100μF 16Velectrolytic capacitor × 20.1μFceramic capacitor × 2240Ωresistor × 1 (sets minimum output voltage)5kΩlinear potentiometer × 1 (output adjustment)1N4007diode × 2 (protection)- DC barrel jack (input)
- Binding posts or output terminals × 2
- Heatsink for LM317 (essential — don't skip this)
- Perfboard or breadboard for prototyping
- 12V–24V DC wall adapter or bench input source
- Multimeter
How It Works
The LM317 has three pins: INPUT, OUTPUT, and ADJUST. Here's the beautiful part — the IC constantly works to maintain exactly 1.25V (its internal reference voltage) between its OUTPUT and ADJUST pins. That's it. That's the whole secret.
You exploit that behavior by placing a resistor divider between OUTPUT and ADJUST and ground. A fixed 240Ω resistor (R1) connects OUTPUT to ADJUST, and your 5kΩ potentiometer (R2) connects ADJUST to ground. The output voltage follows this formula:
Vout = 1.25 × (1 + R2/R1)
With R1 = 240Ω and R2 sweeping from 0Ω to 5000Ω, you get an output range of roughly 1.25V to 27V from a 24V input. The two 1N4007 diodes protect the IC from capacitor discharge if the input is suddenly removed. The capacitors smooth out ripple and keep the output stable under changing loads. Simple. Elegant. Bulletproof.
Step-By-Step Build
- Orient your perfboard horizontally. Mark a clear power rail (positive) at the top and ground rail at the bottom.
- Insert the LM317T near the center of the board, flat face forward. Pin 1 is
ADJUST, pin 2 isOUTPUT, pin 3 isINPUT. - Attach your heatsink to the LM317's metal tab now, before soldering. This is non-negotiable — the IC will overheat within seconds under load without it.
- Solder the
240Ωresistor (R1) betweenpin 2 (OUTPUT)andpin 1 (ADJUST). - Connect one leg of the
5kΩpotentiometer topin 1 (ADJUST)and the other leg to your ground rail. The wiper doesn't connect here — this is a two-terminal rheostat connection. - Place the first
100μF 16Velectrolytic capacitor between theINPUTpin and ground. Observe polarity — positive leg to INPUT. - Place the second
100μF 16Velectrolytic capacitor between theOUTPUTpin and ground. Same polarity rule applies. - Solder a
0.1μFceramic capacitor in parallel with each electrolytic. These handle high-frequency noise the big caps miss. - Install the first
1N4007diode fromOUTPUTback toINPUT— cathode (banded end) toward INPUT. This protects against reverse discharge. - Install the second
1N4007fromOUTPUTtoADJUST— cathode toward ADJUST. - Wire your input DC barrel jack: positive terminal to the LM317's
INPUTpin, negative to ground rail. - Wire your output binding posts: positive from
pin 2 (OUTPUT), negative from ground rail. - Double-check every solder joint. Cold joints on power circuits cause maddeningly intermittent behavior.
Testing & Calibration
Before connecting any load, verify your build in stages. Set your multimeter to DC voltage.
First, connect your input source (12V or 24V). Measure across the input capacitor — you should read your supply voltage cleanly. No reading? Check your barrel jack wiring.
Now measure across the output terminals with the potentiometer turned to minimum resistance. You should see approximately 1.25V. Slowly rotate the potentiometer — watch that voltage climb steadily. At full rotation with a 24V input, you should reach somewhere near 27V. If the sweep is smooth and stable, your circuit is healthy.
Connect a simple load — a 10Ω 1W resistor works perfectly. Set output to 5V and confirm voltage holds steady under load. A drop of more than 0.2V suggests a weak solder joint or undersized input source.
Troubleshooting
- No output voltage: Check that your LM317 is oriented correctly. Pin 3 is INPUT — confirm your supply voltage reaches it with a meter probe.
- Output stuck at 1.25V and won't rise: The potentiometer connection is likely open. Resolder the joints at the ADJUST pin and verify the pot itself measures variable resistance with your meter.
- Output voltage unstable or oscillating: One or both electrolytic capacitors are missing, reversed, or faulty. Electrolytic orientation matters — positive leg to the higher-voltage node.
- LM317 gets burning hot immediately: You're missing a heatsink or asking it to drop too much voltage at too much current. Power dissipated =
(Vin - Vout) × Iload. Reduce the input voltage or add thermal compound under the heatsink. - Voltage drops heavily under load: Your input power supply can't deliver enough current. The LM317 itself handles up to
1.5A— make sure your wall adapter matches or exceeds your current needs.
Upgrades & Modifications
Once the basic circuit is running, the fun really starts. Here's how to evolve it:
- Add a digital voltmeter module: A cheap
3-wire DC voltmeter displaywired across the output terminals turns your supply into a proper bench tool. Now you see exactly what you're delivering without reaching for a multimeter. - Parallel an LM338 for higher current: The LM338 is the LM317's big brother — identical pinout, same formula, but rated to
5A. Swap it in, upgrade your heatsink, and you can power motors, LED strips, and more demanding projects. - Add a current limiting circuit: Place a
0.1Ωsense resistor in series with the output and wire a comparator circuit to fold back voltage when current exceeds your set limit. This protects both your supply and whatever you're building. It's the difference between a toy and a proper instrument.
You've just built something real. Every time you reach for those binding posts and dial in exactly the voltage a circuit needs, you'll feel the satisfaction of having made the right tool yourself. That's what this craft is about.
Watch the full build walkthrough on CircuitMasters YouTube →