« back to projects No downloads.

Bench PSU

Linear power, baby!
Numbers check out 😎

About

It's a rite of passage. Every electronics hobbyist must make their own bench power supply.

The power supply is of course based on a linear voltage regulator (the venerable LM317) with analog voltage control. Voltage and current are measured and displayed on an OLED display.

It boasts the following features:

The information on the display in detail.

Design

The core of the power supply is the LM317 linear regulator U4, whose output voltage is adjustable through potentiometer R23. R31 provides a minimum load, and R32-R41 form the 0.1Ω current shunt.

The voltage is buffered through U5C, and then clamped to VCC and fed to the 10-bit ADC for fine voltage measurement. It's also scaled down using a 5:1 voltage divider (R14,15,48) and fed to the ADC. This provides a coarser full-range voltage measurement.

Similarly, U5A and U5D measure and amplify the voltage across the current shunt, at two different gains. These are also connected to the ADC, and they provide an accurate low-range current sense, as well as a full-range coarser sense. The MCU displays the fine-grain current/voltage when within range, and uses the coarser full-range measurement otherwise.

The rest of the circuit consists of status LEDs, fan control, a temperature sensor, connectors, and several voltage rails (including -3V obtained with a ring-oscillator-driven charge pump).

The MCU is an Atmega328P (embodied here in an Arduino Pro clone), programmed in plain C. It measured voltage and current, and shows them on the display. It uses a moving window average to ensure the fast-updating display has some stability. It also measures the temperature and controls the fan.

The schematic.
This was my first PCB layout. There's plenty of room for improvement, but it works.
What would you have done differently?

The Result

The populated board is housed in a plastic box, together with the LM317 on a hefty heat sink with fan, and a 21V laptop power brick. The box has strategically placed holes to encourage some airflow.

Laptop PSU  -  Heat sink + fan (LM317 underneath)  -  Control PCB  -  Terminals
Close-up of the populated PCB in the enclosure.
Also featured: several bodges to make things actually work.