Home » Projects » How I Built a Variable DC Power Supply (2V–14V) Using LM317

How I Built a Variable DC Power Supply (2V–14V) Using LM317

This project guides you through the design and construction of a variable DC power supply that can provide output voltages ranging from 2V to 14V DC, adjustable via a potentiometer. It’s powered from the standard 115V AC, 60Hz wall outlet and is a great bench tool for hobbyists or students working with low-voltage electronic projects.

Project Specifications

ParameterValue
Input Voltage115V AC, 60 Hz
Output Voltage2 – 14V DC
Regulator TypeLM317 Adjustable Linear Regulator
Max Output CurrentUp to 1.5 A
EnclosureRectangular Metal Enclosure

Project Objective

This project aims to create a low-cost, reliable, and adjustable DC power source that can serve as a test supply for electronics circuits. It converts high-voltage AC from the wall into a low, variable DC voltage using a step-down transformer, rectifier, filter capacitors, and an LM317 linear voltage regulator.

This project not only demonstrates circuit design, simulation, and PCB layout but also provides insight into linear voltage regulation and thermal management.

Components

All components for this project were procured from DigiKey. A full Bill of Materials (BOM) is available below:

Bill of Materials (BOM)

QuantityReference designatorDigiKey Part #Manufacturer Part NumberDescription
1C1493-1110-NDUVR1H471MHDCAP ALUM 470UF 20% 50V RADIAL TH
1C3P5178-NDECA-1HM100CAP ALUM 10UF 20% 50V RADIAL TH
2J1/J2A98472-ND4DB-P108-02CONN BARRIER STRIP 2CIRC 0.325″
1C4493-1111-NDUVR1H102MHDCAP ALUM 1000UF 20% 50V RADIAL
1C2P5568-NDECA-1HHG220CAP ALUM 22UF 20% 50V RADIAL TH
6D1 – D61N4001GOS-ND1N4001GDIODE GEN PURP 50V 1A AXIAL
1POT987-1301-NDP160KN-0QC15B10KPOT 10K OHM 1/5W PLASTIC LINEAR
1R1CF14JT1K00TR-NDCF14JT1K00RES 1K OHM 5% 1/4W AXIAL
1R2CF14JT560RTR-NDCF14JT560RRES 560 OHM 5% 1/4W AXIAL
1IC1497-1575-5-NDLM317TIC REG LINEAR POS ADJ 1.5A TO220
1283-BK16-HTJ-601I-NDBK16-HTJ-601IFUSE HOLDER 1/4″ 10A SLDR TERM
1F4256-ND0217001.TXPFUSE GLASS 1A 250VAC 5X20MM
1Q335-ND703W-00/07PWR ENT RCPT IEC320-C14 PANEL QC
4WM18353-ND191440003CONN SPADE TERM 18-22AWG #4 RED
2A27856CT-ND3-520406-2CONN QC RCPT 14-16AWG 0.250
1314-1204-NDBU-P2269CONN DBL BANANA JACK TURRET
1T1HM520-ND166L12PWR XFMR LAMINATED 31.5VA TRANSFORMER
1TL451-NDP006-003CORD 18AWG NEMA5-15P – IEC320 3′
1Sayal ElectronicsMETAL ENCLOSURE

Circuit Design and Analysis

Schematic Capture (Fusion 360 Electronics)

I recreated the entire schematic in Fusion 360 Electronics to design and fabricate an efficient PCB (Printed Circuit Board).

Here, the schematic includes:

Connection from the output of the transformer, followed by:

  • Bridge Rectifier to convert AC to DC
  • Filtering Capacitors to smooth out ripple
  • LM317 Regulator circuit
  • Adjustable Potentiometer for output control
  • Output terminal connection for connecting test loads

Note: The two filter capacitors (1000µF and 0.1µF) are present in the schematic but were accidentally left unlabeled. Also, if you’re wondering, a diode is placed between the output (OUT) and input (IN) of the LM317 to protect the regulator from damage during shutdown or capacitor discharge.

PCB Design

PCB Layout Features

  • Board Dimensions: 1.51″ x 2.15″
  • Board Shape: Rectangular
  • Layer Count: Single-sided (Bottom Layer Only)
  • Trace Width: 32 mils (for up to 1.5A current)
  • Component Mounting: Through-hole for DIY-friendly soldering
  • Material: FR4 copper-clad board

Typically, you send Gerber files generated from the software to a PCB manufacturer or “PCB house.” These files contain essential details such as copper layers, solder masks, silkscreen, and other key design elements. But for this project, I just used my school’s in-house manufacturing facility to obtain a simple PCB.

PCB Assembly and Soldering

In my PCB design, the LM317 and filter caps are positioned for optimal thermal performance, and wide traces are used on the power line to reduce voltage drops. Additionally, a heatsink can be attached to the LM317 to handle thermal dissipation.

Design Tips

  • Keep high-current paths short and thick.
  • Place filter capacitors close to the regulator’s input and output pins.

Parts Assembly

Parts List
ItemQtyPart Number
11Main Enclosure Body
21Transformer Part
31PCB Board
414mm Black Banana Terminal
514mm Red Banana Terminal
6119mm POTENTIOMETER KNOB
71Potentiometer2
81Part 1
91SF372 10A 250VAC Fuse Holder
101Enclosure Lid

Before starting the assembly and wiring process, I ensured the enclosure was properly prepared first. This preparation led to a cleaner, safer, and easier assembly, making future troubleshooting more straightforward despite the compact size of the enclosure.

1. First, I marked and drilled holes for all major components within the enclosure, such as the transformer and PCB mounting holes. This included making holes for the voltage adjustment knob, fuse holder, AC input socket/plug, DC output terminals, and ground terminal.

2. After drilling the holes, I first mounted the transformer into the main enclosure. Then, one by one, I installed the PCB assembly and other parts, including the fuse holder, output connectors, ground connector, potentiometer, and AC plug connector.

3. Now I’m ready to wire them. I connected the components according to the schematic. I began by wiring the AC input side, then proceeded toward the DC output side, while observing correct polarity and securely insulating all AC connections.

4. The transformer has three output wires — two outer wires and a center-tap (CT). I connected the two outer terminals to the AC inputs of my bridge rectifier (PCB Assembly). The center tap (CT) is connected to the dedicated terminal within the enclosure. Also, I made sure there is a proper grounding between my PCB assembly and metal enclosure.

5. Once the wiring is complete, there should be labels for key areas of the power supply. (Here, I forgot to put labels for my DC output and adjustable knob). This step ensures safe usage and clear understanding for anyone who operates or services the unit.

Dimensions

Output Voltage Test

Using a multimeter, I adjusted the potentiometer and measured output voltages ranging from 2V to around 14V under no-load conditions. With a small load (e.g., a 12V fan), the voltage remained stable with minimal ripple thanks to the filtering.

Safety and Reliability Testing

Additionally, after full assembly, my variable DC power supply should undergo a series of validation and stress tests. These ensure the device is electrically safe, mechanically secure, and robust enough for real-world use.

Hi-Pot Test (High Potential Test)

This is to verify that there is sufficient insulation between the AC mains circuitry and the low-voltage DC side or chassis. This is a critical safety test used to detect breakdown or leakage paths.

Drop Test (Mechanical Integrity Test)

Its purpose is to check if the enclosure and internal parts survive a drop from normal bench height (simulating real-world accidents).

Pull Test (Wire and Terminal Strength Test)

This is to ensure all connectors and wire terminations can withstand physical stress and won’t loosen or disconnect under regular use.

Conclusion

This project offers a practical, compact, and effective solution for a bench power supply that’s capable of powering small electronics projects. It’s an ideal first project to learn about:

  • AC to DC conversion
  • Voltage regulation using LM317
  • PCB layout for power electronics
  • Safe handling of AC and high-current circuits