A good lab power supply can run you well over $100. However, you can build one yourself with about $25 worth of parts. There are dozens of tutorials out there for converting a computer power supply into a lab bench unit, so what makes this one special? This one has a more comprehensive set of indicators and (in my opinion) a better front panel layout.
Due to the size of this guide, I have split it up into 3 main sections:
Just follow the instructions step by step to build your own lab power supply.
This is the design of the logic circuit that controls the "Standby", "On", and "Fault" indicator lights.
Enough with the boring stuff! Here are some cool ideas that you can add to your existing power supply.
There are three reasons for building your own supply: price (a cheap computer PSU costs around $15), practice, and self-expression. You'll end up with a strictly regulated high-current supply at a fraction of the cost of a "real" one, and it will be uniquely yours. This supply will output +3.3V, +5V, and +12V – 3 common voltages in digital electronics design – in addition to -12V and possibly -5V. You can combine these voltages by connecting two voltage terminals together; the final voltage will be equivalent to their difference.
Yes, this is a very long and technical article, but I hope you can get something out of it. You don't need to understand the explanations as long as you follow the instructions properly.
Read through this entire tutorial before you begin.
1. Gather parts and tools
You will need the following in order to successfully proceed with this project:
- ATX power supply, approximately $15 from Newegg.
- Insulated binding posts, preferaby in different colors. You'll need one for each voltage rail, which makes 4 or 5, and an equal amount of grounds (for a total of 8 or 10)
- LEDs: I used one dual-color red and green with a common cathode, and one yellow.
- Resistors: One 5 Ω 10W "sandbar" resistor; several 100 &Omega 1/4-watt resistors for LEDs. (Use a higher resistance for dimmer LEDs.)
- SPST round-hole mount switch for use as a power switch.
- TTL IC 74LS02 and DIP chip holder, use is described below
- Soldering kit with an iron, solder, and possibly a de-soldering vacuum
- Heat shrink and electrical tape. Heat shrink is preferred, but tape can be used as well.
- Cable ties, which will come in useful later
- Screwdriver, for removing screws. The type of screwdriver needed depends on the type of screws found in your particular power supply.
- General wire tools including a wire cutter, wire stripper, or scissors.
2. Remove the circuit board
Remote the cover of your power supply. Be careful not to touch anything inside. Insert the black probe of your voltmeter, preferably an analog one, into any black wire in a Molex connector. Set the meter to 500V DC and touch the red probe to various points on the circuit board, including heatsinks (they may not be insulated), and most especially, capacitor leads. If you notice the needle go above zero, the capacitor will need to be discharged using a resistor.
Grab the bundle of wires going out of the supply and gently lift it out of the hole in the front of the unit. You may clip these now; leave about 6 inches to 1 foot of each wire. Then, find any other wires inside the unit. Some units have daughterboards mounted to the sides (just remove the board). All units have at least 2 wires connected to the AC input; de-solder them from the connector (not the circuit board) and unlatch them. You may instead opt to remove the connector itself, such as the 115/230V switch. Also remove the fan by loosening the screws from outside the case.
When all wires are accounted for, remove the 4 screws holding the circuit board to the casing. Lift the board by one or both of the heatsinks (after making sure they're not somehow "accidentally" connected to a capacitor!) and being careful not to accidentally touch anything. Remove the plastic membrane on the bottom of the board and save it; this is often the only thing preventing the board from shorting out.
3. Drill holes and place components
Mark and drill holes for the binding posts, LEDs, and switch. Make each hole just big enough to allow the component to go through (I needed 1/2" for the switch, 13/64" for the LEDs, and 5/16" for the binding posts.) Be careful when drilling metal; you may need to start with a smaller drill bit and go through several until you get the hole the proper size.
De-burr the holes using a counter sink bit, a metal file, or sandpaper. Make sure there are no small steel filings lying on the bottom of the box; these might cause a short.
Finally, replace the circuit board; be certain that the plastic membrane is in place. I actually ended up rotating the board 180 degrees because the heatsinks were otherwise blocking some of the binding posts. Re-solder any AC wires; you might need to extend them if you moved the board. Ensure that there is no way for a short to happen, since 120 volts can be very dangerous.
4. Circuit design
The defining feature of my power supply is a comprehensive set of indicator lights – "Standby", "On", and "Fault". You don't need to understand everything in this section – in fact, unless you have some circuit design knowledge, you probably won't get much – but it explains the principles behind the way I designed my supply.
ATX wires
An ATX power supply contains a green wire (known as PS_ON
) which is used to turn on
the supply. A pull-up resistor ensures that this wire carries a TTL-compatible "logic high" (or logic 1) value,
which a small circuit within the supply monitors. Connecting this wire to ground (a black wire)
causes the voltage to drop down to logic low (0), and the monitoring circuitry starts up the supply.
Another interesting wire is the gray POWER_GOOD
or PG
wire. It is high
when the power supply's monitoring circuitry determines that the supply is outputting proper voltages;
it is low when the supply is off and when there is a potential fault, such as a voltage dip or a short.
The rest of the wires supply power, as follows:
- Black: Ground
- Orange: +3.3V
- Red: +5V
- Yellow: +12V
- Blue: -12V
- White: -5V. (Note that many modern power supplies do not have this. Mine did.)
- Purple: +5VSB. This wire always provides a small current, even if the power supply is otherwise off.
Some supplies also have a brown wire, known as "3.3V sense", which simply monitors the voltage of the 3.3V rail. This needs to be connected to any of the orange +3.3V wires in order for the supply to work properly.
"On" indicator
The "On" indicator LED can simply be connected to POWER_GOOD
(with an inline resistor).
It will light up when the power supply is on and giving proper voltages.
"Standby" indicator
The PS_ON
wire is at logic 1 when the power supply is off, and at logic 0 when the supply
is on, making it perfect for controlling a "Standby" indicator. However, due to the extremely low
amount of current in this wire, connecting an LED may bring the voltage down to ambiguous levels
(somewhere between "low" and "high"). In my case, when I wired the LED to this wire, the power supply
would "randomly" turn on if I was connecting and disconnecting things, and would not turn off even
with the switch in the "Off" position.
The solution to this problem is a logic device known as a "noninverting buffer". A buffer provides a high-impedance input, and its output is an "amplified" version of the input, at the same logic level. (OK, whew, that probably went over everybody's head... so basically, a buffer provides more "juice" for other devices in the circuit so that they don't affect a weaker signal.)
Buffers can be built using transistors, or by joining two inverters (NOT gates) together. This may seem silly on paper, but in practice, there is a physical limit on how much current a single device can output before the voltage drops.
"Fault" indicator
When the power supply is running normally, POWER_GOOD
is high and PS_ON
is low. When the power supply is off, POWER_GOOD
is low and PS_ON
is high.
And when something is wrong, but the power switch is in the "On" position, POWER_GOOD
is brought low, for the purpose of telling the computer to halt the CPU – this is the condition
that should make the "Fault" indicator turn on. These results can be
summarized in table form, for those of you whose heads are probably hurting by now (0 means "logic low"
or "indicator off"; 1 means "logic high" or "indicator on"):
PS_ON | PG | Output |
---|---|---|
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
Those of you who know binary logic will probably recognize this as the NOR function. (a NOR b is true
whenever both a and b are false; it is false otherwise.) Luckily for us, NOR gates are extremely
common. Here is our circuit thus far:
Chip considerations
NOR gates usually come in packs of 4 on a microchip. However, it would be wasteful to just use one gate on a chip. Following this logic, we can make use of 2 more gates:
- A NOR gate can act as an inverter if its two input pins are connected to the same source
- Two inverters connected in series will effectively create a buffer
- Therefore, two NOR gates connected in series can effectively act as a buffer.
Here is the final circuit. Note that I connected the NOR gates' second inputs to ground instead of combining them with the outputs of the previous one, because this will draw less current from the input.
tl;dr
Just follow the diagram in the next section
5. Wiring
Now the fun part: actually wiring the beast. I've broken it up into several steps, which ideally should be followed in order, since some components are harder to access than others.
Binding posts
Separate 4 or 5 black wires, and one of each red, orange, yellow, blue, and white (if you have it). Strip each wire, form a loop using needle-nose pliers, and tin it with solder. Connect each to the appropriate binding post, making sure that there are no short circuits.
Load resistor
Connect a red (+5V) and black (Ground) wire to a 5 Ω 10W "sandbar" resistor, and heat shrink or tape the connections. Mount it on a heatsink or on the side of the power supply chassis. This will provide a 1-amp load, which should be enough to make the power supply work properly.
Microchip
Standard DIP (Dual Inline Package, i.e. 2 rows of pins) chips have pins numbered counterclockwise, with pin #1 being the one immediately to the left of the notch if the chip's pins are pointing down. If the chip is upside down (pins facing up towards you), as in the above diagram, the pins will be numbered in "reverse" order. If you connect a chip improperly, you could fry it, so make sure you know exactly which pin number is which.
Use spare wires from the motherboard connector to make the connections here. Ideally, you can use a circuit board, but I simply used the point-to-point method by soldering and heat-shrinking wires to the chip holder. Do not attempt to solder wires directly to the chip; you will most likely damage it. Use the chip holder instead, and be sure its orientation is correct.
Solder the purple +5VSB wire directly to pin #14, unless you are going to be using it somewhere else. Use pigtail connections if a given wire goes into more than one place. (A "pigtail" is a connection where all but one wires in a group are twisted together, the last wire is connected from the other direction, and the bundle is soldered.)
Power switch
Connect the green wire coming from the chip assembly to one terminal of the power switch;
connect the PS_ON
wire to it as well. Then, connect the other terminal of
the switch to a black ground wire.
Indicators
LEDs are diodes; that is, they only allow current to flow one way. Therefore, it is important to not connect them backwards, or they won't light up. Identify the cathode (shorter leg, connects to ground) and anode(s) (longer leg(s), connect to positive voltage). When wiring LEDs, be sure to use a resistor in series with the power or signal wire, or you may burn out the LED. (100 Ω is good for logic signal wires; you will need 330 Ω or more if you are connecting directly to a power wire.)
Instead of using separate red and green LEDs, I chose to use a two-color LED, as shown in the diagram.
You can also choose to use separate red and green LEDs; see inset.
Connect the red anode ("Standby" LED) to the orange wire coming from the chip. Connect the green anode
("On" LED) to the gray POWER_GOOD
wire. Connect the yellow "Fault" LED's anode to the
yellow wire coming from the chip. Don't forget the resistor! The cathode is the shortest wire on an
LED; this should be connected directly to ground without a resistor.
Ensure that there are no exposed leads; bring the heat shrink (or tape) as close to the base of the
LED as you can.
Poke each LED through the hole you drilled for it. In my case, the tension of the wires held it in place; you may need to add a small dab of hot glue to hold it securely.
Others
If you have a brown wire, connect it to any orange one. If you can't find a brown wire anywhere (I didn't), don't worry: not all power supplies have them.
After making sure that everything is connected securely, and that you have used all of the wires you need, clip the remaining wires as close to the base as possible. Then, replace the cover of your power supply and plug it in.
6. Operation and Troubleshooting
Now that the power supply has been built, it should be tested.
Indicators
When you plug in the power supply, the "Standby" LED should light. Flip the power switch to the "On" position. The "Fault" indicator should briefly illuminate, and then the "On" indicator should light.
The "Fault" indicator should briefly light during startup; this happens when the power supply is performing internal diagnostics or stabilizing its output voltages. This is actually a sign of a healthy unit; it's not a cause for alarm. (Compare this to the "Check Engine" light briefly lighting up when you start your car.)
Voltage rails
Test each voltage rail with a multimeter. If you get a reading of 0 volts for any terminal, you may have a loose connection. Be sure to label the outputs appropriately; you can go anywhere from using a Sharpie to laser-etching metallic labels.
Unit not turning on
If the "Fault" indicator stays on and the "On" indicator never lights, you may have a short circuit inside the unit, or it may be otherwise bad. If you don't get any output from the voltage rails or indicators, make sure the AC wiring is properly attached.
Repairs
Before opening the power supply to make connections, put it in Standby mode, unplug it, and immediately turn it on. Never work on your power supply when it is plugged in, even if it is "off"; that's a sure way of electrocuting yourself.
Replacing the circuit board
So you accidentally your whole power supply. You saw sparks and now your room smells like burnt electronics. All is not lost: simply buy an identical or similar model of power supply and "borrow" its circuit board. You can reuse the old metal case with the binding posts and LEDs that you painstakingly attached, and you don't even need to re-solder most of the wires on the chip.
7. Limitations
For $25, this is a pretty amazing little lab power supply. However, there's a reason that "real" ones cost hundreds of dollars.
For one, the power supply I built only outputs 5 voltages. They can be combined to form several "in between" voltages, but this doesn't beat a true variable voltage supply. Note that the negative rail(s) have a disproportionately small current-carrying capacity compared to the positive ones.
While this is a fairly well regulated power supply, it still may not be suitable for extremely picky and delicate electronics. Additionally, using a cheaper base unit will likely result in lower performance and noisier outputs.
Also note that such a power supply isn't built to the rigorous standards of professional units. Do not use this power supply where its failure can cause a significant loss of property, or any injury or death to human beings; this includes any medical application.
Upgrade ideas
Here are some ideas I've been playing around with which you can choose to include in your own power supply project. Some are quite simple and practical, while others may not be worth the time and effort to implement, so use your own discretion here.
Fuses
Fuses are generally required for delicate electronics work – to protect your circuit. ATX power supplies have perfectly functional short circuit protection (which will trip the supply and light the "Fault" indicator), but pushing 15 amps through a breadboard is a sure way of melting something or, worse yet, starting a fire.
You will need to wire a fuse for each non-ground rail. (DO NOT connect a fuse to ground.) Remember, these are for protecting your circuits, not for protecting the supply; thus, you may mix and match the ratings as needed. Ideally, you'd want to mount round fuse holders inside the power supply, but you should be able to get away with an inline fuse for each binding post in use.
Remote turn-on
Use a DPDT center-off switch for the power switch. Connect the common terminal on one side to
PS_ON
, connect the top to ground, and connect the bottom to another binding post,
preferably a bright green one labeled "Remote Sense". Use the second half of the switch to
wire an indicator LED that lights when the switch is in the "Remote" position (down) by connecting
the purple +5VSB wire to the center of the second pole and connecting an LED with
an inline 330 Ω resistor to the bottom and ground.
To turn the power supply on, flip the switch up. To turn it off, put the switch in the middle. And to enable remote switching, flip the switch down. In order to turn the supply on, your circuit or project just needs to bring the "Remote Sense" wire down to TTL low (i.e. by connecting it to ground.)
5V standby power
This is a perfect complement to the "Remote turn-on" option. Simply add a (preferably dark purple) binding post labeled +5VSB to your supply. You might also want to add a switch and accompanying LED to selectively enable and disable this standby power, since it will always be on even if the supply is "off". (Alternately, you can use the DPDT on-off-remote switch and connect the +5VsB binding post to the second pole so that it turns on only when the switch is in the "Remote" position.)
Optional load resistor
A switching power supply requires a minimum load, which is why we connected a 5 Ω sandbar resistor to the +5V rail. However, this resistor just sits there wasting power; you don't need it if you have a large enough load connected externally. You can thus make the resistor "optional" by adding a switch to connect and disconnect it.
Wire a switch (SPST is fine here) to a +5V connector, and connect the 5 Ω resistor to the switch. Also connect an LED with a 330 Ω resistor to the same switch, parallel to the load resistor, to indicate when the internal load is active.
Any half-decent computer power supply will simply refuse to power up (or shut down within seconds of powering up) if there isn't enough of a load. Thus, the "Fault" indicator will light up if you forget to properly load the power supply, with no harm to the unit itself.
Variable voltage
Connect a linear regulator and a potentiometer to a 12-volt rail. Add another pair of binding posts marked "Variable". You should be able to obtain voltages from approximately +2V to +10V. This is an inefficient method and your new variable voltage rail won't support very high currents, but it's definitely better than nothing. Note that I have not tested this method; I've only read about it online.
Variable voltage display
Use 7-segment displays and an ICL7107 chip as outlined in the article ICL7107 / ICL7106 Digital Voltmeter from Electronics-DIY.com to add a visual indicator of the actual voltage being output by the variable voltage rail described above. Depending on your skill level, you can either mount the display on the outside of the unit somewhere, or you can cut a nice rectangular hole and mount the display there. Again, I cannot vouch for this.
Chassis ground
This binding post will simply connect to the mains ground wire, or "true earth". I'm not sure why you'd need this for most electronics projects, but I've seen it on many professional power supplies and it's easy enough to wire: simply attach a (preferably dark green) binding post to a screw within the power supply case. The case should already be properly grounded with the third prong of the power input connected to a screw on the bottom.
120V AC terminal
Just kidding... this is extremely dangerous! Do not attempt.
AC line indicator
OK, this isn't a true AC line indicator in that it doesn't connect to the AC terminal... but it will light up whenever your supply is plugged in and receiving power. Note that such an LED is not necessary if you already have a comprehensive standby/on/fault trio (one and only one of these will always be on).
Wiring is extremely simple. Connect an LED to the +5VSB rail in line with a 330 Ω resistor, and ground it. The LED will light up whenever the power supply is receiving power, regardless of whether it is on or off.
Recommended color coding
Finally, I present the recommended color coding for binding posts and LEDs. Note that this isn't always possible – 35 ¢ SparkFun binding posts only come in red and black, for example – but if you have access to any color imaginable, I'd recommend the following.
- Black for Ground
- Orange for +3.3V
- Red for +5V
- Yellow for +12V
- Blue for -12V
- White for -5V
- Gray for variable voltage
- Dark Green for chassis ground
- Bright Green for Remote Sense
And for LEDs, which should be easy enough to find. Avoid using the same color for two distinct indicators. Since it's doubtful that you would have every single LED in use, there are duplicates in the list.
- Red for Standby
- Green for On. Note that you can use a single red/green LED to indicate both On and Standby, as I did.
- Yellow for fault indication
- Blue for Remote indication
- Amber for the optional load resistor
- Amber for AC.
Of course, you should ultimately pick whatever colors look best to you, since it is your own supply. The colors specified above are based loosely on the ATX standard, especially concerning the voltage rails.
Conclusion
This tutorial should have given you enough information to build your own unique power supply that you can not only use for your logic design, but also can show off to your friends. Feel free to post any suggestions, tips, or pictures of your own supplies in the comments below!
Comments (8)
Best regards from Poland!
You can try adding a 3rd LED for the fault detection logic. Alternately, you could wire it to display only the green one when there is a fault, but that goes against intuition color-wise -- still logically valid though. 2 LEDs can display 4 possible states.
@Ron It's -5V. Most newer ATX power supplies no longer have it.
I had one question though... When had the actual circuit board out of the case... all my readings were at about 80% of what they should have been 12 to 7.76, 5 to 3.5, etc. I was dumbfounded, but on placing it back in the case... everything went back up to what it was supposed to be. DO you have any idea as to why there would be this voltage/amp drop? Also when i added the sandbar, depending on the rail used, the overall voltages would decrease again. Just.... a little confused.
Great website. Keep up the awesome work.
Did you use a digital or analog multimeter? I find that digital ones occasionally produce erroneous readings when there is a grounding issue. Best to check with more than one meter if you are unsure.
When measuring, you DID have a load connected, correct?
Leave a comment