# Superb Lab Power Supply

45,127

500

2

From my point of view one of the best ways to get started in electronics is to build your own laboratory power supply. In this instructable I have tried to collect all the necessary steps so that anyone can construct his or her own.

All the parts of the assembly are directly orderable in digikey, ebay, amazon or aliexpress except the meter circuit. I made a custom meter circuit shield for Arduino able to measure up to 36V - 4A, with a resolution of 10mV - 1mA that can be used for other projects also.

The power supply has the following features:

• Nominal Voltage: 24V.
• Nominal Current: 3A.
• Output Voltage Ripple: 0.01% (According to the specs of the power supply circuit kit).
• Voltage measurement resolution: 10mV.
• Current measurement resolution: 1mA.
• CV and CC modes.
• Over current protection.
• Over voltage protection.

## Step 1: Parts and Wiring Diagram

Apart from the Image, I have attached the file WiringAndParts.pdf to this step. The document describes all the functional parts, icluding the ordering link, of the bench power supply and how to connect them.

The mains voltage comes in through an IEC panel connector (10) that has a built in fussible holder, there is a power switch in the front panel (11) that breaks the circuit formed from the IEC connector to the transformer (9).

The transformer (9) outputs 21VAC. The 21 VAC go directly to the power supply circuit (8). The output of the power supply circuit (8) goes directly to the IN terminal of the meter circuit (5).

The OUT terminal of the meter circuit (5) is connected directly to the positive and negative binding posts (4) of the power supply. The meter circuit measures both voltage and current (high side), and can enable or disable the connection between in and out.

Cables, in general use scrap cables you have in house. You can check the internet for appropriate AWG gauge for 3A but, in general the thumb rule of 4A/mm² works, specially for short cables. For the mains voltage wiring (120V or 230V) use appropriately isolated cables, 600V in USA, 750V in Europe.

The series pass transistor of the power supply circuit (Q4) (12) has been wired instead of been soldered to allow an easy installation of the heatsink (13).

The original 10K potentiometers of the power supply circuit has been replaced with multiturn models (7), this makes possible a precise adjustment of the output voltage and current.

The arduino board of the meter circuit is powered using a power jack cable (6) that comes from the power supply circuit (8). The power supply board has been modified to obtain 12V instead of 24V.

The positive pin of the CC LED from the power supply circuit is wired to the mode connector of the Meter Circuit. This allow it to know when to display CC or CV mode.

There are two buttons wired to the meter circuit (3). The Off button “red” disconnects the output voltage. The On button “black” connects the output voltage and resets OV or OC errors.

There are two potentiometers wired to the meter circuit (2). One sets the OV threshold and the other sets the OC threshold. These potentiometers do not need to be multiturn, I have used the original potentiometers from the power supply circuit.

The 20x4 I2C alphanumeric LCD (1) is wired to the meter circuit. It shows the present information about output voltage, output current, OV setpoint, OC setpoint and status.

## Step 2: Power Supply Circuit Kit

I bought this kit that is rated as 30V, 3A:

I am attaching an assembly guide I found in the Internet and an image of the Schematic. Briefly:

The circuit is a linear power supply.

Q4 and Q2 are a Darlington array and form the series pass transistor, it is controlled by the operational amplifiers to maintain the voltage and the current at the desired value.

The current is measured by R7, adding this resistance in the low side makes the ground of the power supply circuit and the output ground different.

The circuit drives a LED that turns on when the constant current mode is on.

The circuit incorporates the Graeth bridge to rectify the AC input. The AC input is also used to generate a negative biasing voltage to reach 0V.

There is no thermal protection in this circuit, so appropriate dimensioning of the heatsink is very important.

The circuit has a 24V output for an “optional” fan. I have substituted the 7824 regulator with a 7812 regulator to get 12V for the Arduino board of the meter circuit.

I have not assembled the LED, instead I have used this signal to indicate the meter circuit if the power supply is in CC or CV.

## Step 3: Power Supply Circuit Kit Assembling

In this circuit all parts are through hole. In general you must start with the smallest ones.

• Solder all the resistors.
• Solder the rest of the components.
• Use pliers when bending diodes leads to avoid breaking them.
• Bend the leads of the DIP8 TL081 op amps.
• Use heatsink compound in when assembling heatsinks.

## Step 4: Meter Circuit Design and Schematic

The circuit is a shield for Arduino UNO compatible with R3 versions. I have designed it with parts available at digikey.com.

The output of the vkmaker power supply circuit kit is connected to the IN terminal block and the OUT terminal block goes directly to the binding posts of the power supply.

R4 is a shunt resistor in the positive rail valued 0.01ohm, it has a voltage drop proportional to the current oputput. The differential voltage R4 is wired directly to RS+ and RS- pins of IC1. The maximum voltage drop at maximum current output is 4A*0.01ohm = 40mV.

R2, R3 and C2 form a ~15Hz filter to avoid noise.

IC1 is a high side current amplifier: MAX44284F. It is based in a chopped operational amplifier that makes it able to get a very low input offset voltage, 10uV at maximum at 25ºC. At 1mA the voltage drop in R4 is 10uV, equal the maximum input offset voltage.

The MAX44284F has a voltage gain of 50V/V so the output voltage, SI signal, at the maximum current of 4A, will value 2V.

The maximum common mode input voltage of MAX44284F is 36V, this limits the input voltage range to 36V.

R1 and C1 form a filter to suppress 10KHz and 20KHz unwanted signals that can appear due to the architecture of device, it is recommended in page 12 the of datasheet.

R5, R6 and R7 are a high impedance voltage divider of 0.05V/V. R7 with C4 form a ~5Hz filter to avoid noise. The voltage divider is placed after R4 to measure the real output voltage after the voltage drop.

IC3 is MCP6061T operational amplifier, it forms a voltage follower to isolate the high impedance voltage divider. The maximum input bias current is 100pA at room temperature, this current is negligible to the impedance of the voltage divider. At 10mV the voltage at the input of IC3 is 0.5mV, much bigger than its input offset voltage: 150uV at maximum.

The output of IC3, SV signal, has a voltage of 2V at 40V input voltage (the maximum possible is 36V due to IC1). SI and SV signals are wired to IC2. IC2 is an MCP3422A0, a dual channel I2C sigma delta ADC. It has an internal voltage reference of 2.048V, selectable voltage gain of 1, 2, 4, or 8V/V and selectable number of 12, 14, 16 or 18bits.

For this circuit I am using a fixed gain of 1V/V and a fixed resolution of 14bits. SV, and SI signals are not differential so the negative pin of each input must be grounded. That means that the number of available LSBs are going to be half.

As the internal voltage reference is 2.048V and the effective number of LSB are 2^13, the ADC values will be: 2LSB per each 1mA in the case of current and 1LSB per each 5mV in the case of voltage.

X2 is the connector for the ON push button. R11 prevents the Arduino pin input from static discharges and R12 is a pull-up resistor that makes 5V when unpressed and ~0V when pressed. I_ON signal.

X3 is the connector for the OFF push button. R13 prevents the Arduino pin input from static discharges and R14 is a pull-up resistor that makes 5V when unpressed and ~0V when pressed. I_OFF signal.

X5 is the connector for the overcurrent protection set point potentiometer. R15 prevents the Arduino input pin from static discharges and R16 prevents the +5V rail from a short circuit. A_OC signal.

X6 is the connector for the overvoltage protection set point potentiometer. R17 prevents the Arduino input pin from static discharges and R18 prevents the +5V rail from a short circuit. A_OV signal.

X7 ins an external input that is used to get the constant current or constant voltage mode of the power supply. As it can have many input voltages it is made using Q2, R19, and R20 as a voltage level shifter. I_MOD signal.

X4 is the connector of the external LCD, it is just a connection of the 5V rail, GND and I2C SCL-SDA lines.

I2C lines, SCL and SDA, are shared by IC2(the ADC) and the external LCD, they are pulled up by R9 and R10.

R8 and Q1 form the driver of K1 relay. K1 connects the output voltage when powered. With 0V in -CUT the relay is unpowered, and with 5V in -CUT the relay is powered. D3 is the free wheeling diode to suppress negative voltages when cutting the voltage of relay coil.

Z1 is a Transient Voltage Suppressor with a nominal voltage of 36V.

## Step 5: Meter Circuit PCB

I have used the free version of Eagle for both the schematic and the PCB. The PCB is 1.6 thick double sided design that has a separate ground plane for the analog circuit and the digital circuit. The design is pretty simple. I got a dxf file from the Internet with the for the outline dimension and the position of the Arduino pinhead connectors.

I am posting the following files:

• Original eagle files: 00002A.brd and 00002A.sch.
• Gerber files: 00002A.zip.
• And the BOM(Bill Of Materials) + assembly guide: BOM_Assemby.pdf.

I ordered the PCB to PCBWay (www.pcbway.com). The price was amazingly low: \$33, including shipping, for 10 boards that arrived in less than a week. I can share the remaining boards with my friends or use them in other projects.

There is a mistake in the design, I put a via touching the silkscreen in the 36V legend.

## Step 6: Meter Circuit Assembling

Although most of parts are SMT in this board, it can be assembled with a regular soldering iron. I have used a Hakko FX888D-23BY, fine tip tweezers, some solder wick, and a 0.02 solder.

• After receiving the parts the best idea is to sort them, I have sorted capacitors and resistors and stapled the bags.
• First assemble the small parts, starting with resistors and capacitors.
• Assemble R4 (0R1) starting with one of the four leads.
• Solder the rest of parts, in general for SOT23, SOIC8, etc. the best way is to apply solder in one pad first, solder the part in its place and then solder the rest of the leads. Sometimes solder can join many pads together, in this case you can use flux and solder wick to remove the solder and clean the gaps.
• Assemble the rest of through hole components.

## Step 7: Arduino Code

I have attached the file DCmeter.ino. All the program is included in this file apart from the LCD library “LiquidCrystal_I2C”. The code is highly customizable, especially the shape of progress bars and the messages displayed.

As all arduino codes it has the setup() function executed first time and the loop() function executed continuously.

The setup function configures the display, including the specials chars for the progress bar, inits the MCP4322 state machine and sets up the relay and the LCD backlight for first time.

There is no interrupts, in each iteration the loop function does the following steps:

Get the value of all the input signals I_ON, I_OFF, A_OC, A_OV and I_MOD. I_ON, and I_OFF are debounced. A_OC and A_OV are read directly from the Arduino´s ADC and filtered using the median part of the last three measurements. I_MOD is read directly without debouncing.

Control the turn on time of the backlight.

Execute the MCP3422 state machine. Each 5ms it polls the MCP3422 to see if the last conversion finished and if so it start the next, successively gets the value of voltage and current present at the output.

If there are fresh values of output voltage and current from the MCP3422 state machine, updates the status of the power supply based on the measurements and updates the display.

There is a double buffer implementation for faster updating the display.

The following macros can be adjusted for other projects:

MAXVP: Maximum OV in 1/100V units.

MAXCP: Maximum OC in 1/1000A units.

DEBOUNCEHARDNESS: Number of iterations with a consecutive value to guess it is correct for I_ON and I_OFF.

LCD4x20 or LCD2x16: Compilation for 4x20 or 2x16 display, the 2x16 option is not implemented yet.

The 4x20 implementation shows the following information: In the first row the output voltage and the output current. In the second row a progress bar representing the output value relative to protection set point for both voltage and current. Int the third row the current setpoint for overvoltage protection and overcurrent protection. In the fourth row the current status of the power supply: CC ON (On in constant current mode), CV ON (On in constant voltage mode), OFF, OV OFF (Off showing that the power supply went off because of a OV), OC OFF (Off showing that the power supply went off because of a OC).

I have made this file for designing the chars of the progress bars: https://drive.google.com/open?id=1ych5bmo9lfsu44W...

## Step 8: Thermal Issues

Using the right heatsink is very important in this assembly because the power supply circuit is not self protected against overheat.

According to datasheet the 2SD1047 transistor has a junction to case thermal resistance of Rth-j,c = 1.25ºC/W.

According to this web calculator: http://www.myheatsinks.com/calculate/thermal-resi... the thermal resistance of the heatsink I have purchased is Rth-hs,air = 0.61ºC/W. I will assume that the actual value is lower because the heatsink is attached to the case and the heat can be dissipated that way too.

According to the ebay seller, the thermal conductivity of the isolator sheet I have purchased is K = 20.9W/(mK). With this, with a thickness of 0.6mm, the thermal resistance is: R = L/K = 2.87e-5(Km2)/W. So, the thermal resistance case to heatsink of the isolator for the 15mm x 15mm surface of the 2SD1047 is: Rth-c,hs = 0.127ºC/W. You can find a guide for these calculations here: http://www.myheatsinks.com/calculate/thermal-resi...

The maximum allowable power for 150ºC in the junction and 25ºC in the air is: P = (Tj - Ta) / (Rth-j,c + Rth-hs,air + Rth-c,hs) = (150 - 25) / (1.25 + 0.61 + 0.127) = 63W.

The output voltage of the transformer is 21VAC at full load, that makes an average of 24VDC after diodes and filtering. So the maximum dissipation will be P = 24V * 3A = 72W. Taking into account that the thermal resistance of the heatsink is a little bit lower due to the metal enclosure dissipation, I have assumed it is enough.

## Step 9: Enclosure

The enclosure, including shipping, is the most expensive part of the power supply. I found this model in ebay, from Cheval, a Thay manufacturer: http://www.chevalgrp.com/standalone2.php. In fact, the ebay seller was from Thailand.

This box has a very good value for money and arrived pretty well packaged.

## Step 10: Mechanizing Front Panel

The best option for mechanizing and engraving the front panel is using a router like this https://shop.carbide3d.com/products/shapeoko-xl-k... or making a custom plastic cover with PONOKO, for example. But as I do not have the router and I did not wanted to spend much money I decided to make it the old way: Cutting, trimming with file and using transfer letters for the text.

I have attached an Inkscape file with the stencil: frontPanel.svg.

• Cut the stencil.
• Cover the panel with painter tape.
• Glue the stencil to the painter tape. I have used a glue stick.
• Mark the position of drills.
• Drill holes to allow the fret saw or coping saw blade get into the internal cuts.
• Cut all the shapes.
• Trim with a File. In the case of round holes for potentiometers and binding posts it is not necessary to use the saw before filing. In the case of the display hole the file trimming must be the best possible because this edges ar going to be seen.
• Remove the stencil and the painter tape.
• Mark the position of the texts with a pencil.
• Transfer the letters.
• Remove the pencil markings with an eraser.

## Step 11: Mechanizing Back Pannel

• Mark the position of the heatsink, including the hole for the power transistor and the position of the holding screws.
• Mark the hole for accessing the heatsink from the interior of the power supply enclosure, I have used the insulator as a reference.
• Mark the hole for the IEC connector.
• Drill the contour of the shapes.
• Drill the holes for the screws.
• Cut the shapes with cutting pliers.
• Trim the shapes with a file.

## Step 12: Assembling Front Panel

• Strip out a multiconductor cable from scrap to get cables.
• Build the LCD assembly soldering the I2C to parallel interface.
• Build the “molex connector”, wire and shrinkable tube assembly for: potentiometers, pushbuttons and LCD. Remove any protuberance in potentiometers.
• Remove the pointer ring of knobs.
• Cut the rod of potentiometers to the size of the knob. I have used a piece of cardboard as a gauge.
• Attach the push buttons and power button.
• Assemble the potentiometers and install the knobs, the multiturn potentiometers I have bought have a ¼ inch shaft and the one turn models have a 6mm shaft. I have used washers as spacers to trim the distance of potentiometers.
• Screw the binding posts.
• Put double sided tape in the LCD and stick it to the panel.
• Solder the positive and negative wires to the binding posts.
• Assemble the GND terminal lug in the green binding post.

## Step 13: Assembling Back Panel

• Screw the heatsink to the back panel, although paint is a thermal isolator, I have put heatsink grease to increase the heat transfer from the heatsink to the enclosure.
• Assemble the IEC connector.
• Position the adhesive spacers using the power supply kit circuit.
• Screw the power transistor and the insulator, there must be thermal grease in each surface.
• Assemble the 7812 for powering the arduino, it is facing the case to allow heat dissipation, using one of the screws that hold the heatsink. I should have used a plastic washer like this http://www.ebay.com/itm/100PCS-TO-220-Transistor-... but I ended up using the same insulator as the power transistor and a bent piece of the case.
• Wire the power transistor and the 7812 to the power supply circuit.

## Step 14: Final Assembly and Wiring

• Mark and drill the holes for the transformer.
• Assemble the transformer.
• Stick the adhesive legs of the enclosure.
• Stick the DC meter circuit using adhesive spacers.
• Scrape the paint to screw the GND lug.
• Build the mains voltage wire assemblies, all the terminations are 3/16” Faston. I have used shrinkable tube to isolate the terminations.
• Cut the front part of the holder of the enclosure in the right side to get space for the power pushbutton.
• Connect all wires according to assembly guide.
• Instal the Fuse (1A).
• Put the output voltage potentiometer (the VO potentiometer), to the minimum CCW and adjust the output voltage the closest possible to zero volts using the multiturn fine adjusting potentiometer of the vkmaker power supply circuit.
• Assemble the enclosure.

## Step 15: Improvements and Further Working

Improvements:

• Use grower style washers to avoid screws get loose with vibration, specially the vibration from the transformer.
• Paint the front panel with transparent varnish to prevent letters to be wiped out.

Further working:

• Add a usb connector like this: http://www.ebay.com/itm/Switchcraft-EHUSBBABX-USB-... in the back panel. Useful for upgrading code without disassembly or for making a small ATE controlling the On Off functions, get status and measuring using a PC.
• Make the 2x16 LCD compilation of code.
• Make a new power supply circuit, instead of using the vkmaker kit, with digital control of the output voltage and current.
• Perform the adequate tests to characterize the power supply.

First Prize in the
Power Supply Contest

## Recommendations

• ### Large Motors Class

10,509 Enrolled

## 2 Discussions

Hi Daniel!

What is S1 in your circuit, between GND and AGND?

Thanks

Paulo