My life, my software, and everything else
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:
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.
You will need the following in order to successfully proceed with this project:
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.
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.
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.
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
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:
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.
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.
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.
When the power supply is running normally,
POWER_GOOD is high and
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,
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"):
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:
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:
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.
Just follow the diagram in the next section
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.
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.
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.
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.)
Connect the green wire coming from the chip assembly to one terminal of the power switch;
PS_ON wire to it as well. Then, connect the other terminal of
the switch to a black ground wire.
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.
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.
Now that the power supply has been built, it should be tested.
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.)
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.
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.
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.
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.
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.
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 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.
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.)
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.)
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.
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.
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.
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.
Just kidding... this is extremely dangerous! Do not attempt.
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.
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.
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.
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.
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!