Tuesday, January 1, 2013

Using a PC power supply for Raspberry Pis

Now that I had determined that I need to be able to provide approximately 500 mA of current at +5 V of voltage per unit, which adds up to needing the capability to draws about 9 A when all boards are on, I needed to come up with a way to make that happen. A quick experiment with a multi-port USB hub with external power quickly made it beyond obvious that was not going to work. The hub ran out of juice after four Pi's, and I need to be able to power a dozen or more.

Rather than coming up with something complicated, I decided to convert a PC ATX power supply and strip out everything I don't need. PC power supplies are cheap and they provide a range of voltages (+12 V, +5 V, + 3.3 V, to name a few). My power supply is capable of 22 A at +5 V, which is plenty for my purposes.

Fortunately, all wires are color coded, and that was going to be helpful. There are a few things worth mentioning:

1) A PC power supply will not work without some form of a load over the +5 V line
2) In order for the power supply to turn on, the switch wire (green) must be connected to ground

With that knowledge; we can by removing all wire ties and connectors from the cables sticking out of the power supply. Once that is done, we can start opening up the enclosure. Be careful, there are some large capacitors in there that can hold quite a nasty charge. You don't want to be on the receiving end.



Since a normal PC power supply is turned on and off by the master switch on the PC enclosure, we want to bring in our own switch. I like to have a visual confirmation of the fact that the power is on, so I included an indicator LED also.

For both the switch as well as the LED, I needed to drill holes in the enclosure. Make sure that when you do that, metal shavings don't short out any of the components in there, and make sure that the drill doesn't go too far and damage stuff on the circuit board.

On the left-hand side, from top-to-bottom, we see the toggle switch (Radioshack 275-603), the load resistor (Radioshack 271-132), two banana plugs (that I ended up not using) and the LED (Radioshack 276-271).

The first thing to do is remove all wires that we know for a fact will not be used. In my case, I removed all but the black, red, and green wires. Using wire cutters, clip the wire as close to the circuit board as possible and pull out the clipped ends. You'll still have quite a few red and black wires left; don't trim any of those until you are doing putting in place what you need; it is much harder to unclip than it is to clip ;)

Step 1) Cut back one black (ground) wire and one red (+5V) wire and strip about 1/2 inch of the insulation. Don't go back all the way to the circuit board; but go short enough that it fits in the enclosure comfortably. Slide pieces of heat shrink tubing over the trimmed wires.

Step 2) Solder the 10 ohm resistor to the wires, move the heat shrink tubing over the exposed leads and apply some heat to shrink them into place. If you can avoid having live leads exposed, why not do so? I found that the best place to mount the resistor is next to the cooling fan, and zip-tied to the grating. Your mileage may vary.

Step 3) Figure out how to position your switch and, using a multi-meter, measure what leads you'll need to use. Remember; a switch in the down position is usually off, a switch in the up position is usually on. Cut the green wire (power switch) and a black wire back far enough that you can reach the switch leads comfortably. Keep in mind that there usually is only one green cable; you don't get a second chance if you cut it too short, so err on the side of caution! Slide the heat shrink wrap over the wire, solder to the switch, position the heat shrink tube and apply heat to shrink.

Step 4) Identify a red cable and a black cable and cut it to size to fit your LED. Slide on heat shrink tubes. Note: unlike light bulbs, LEDs are polarized. Make sure you solder the wires to the right leads, or it won't work. The LED that I used had a resistor included with it, so I didn't have to worry about that. If you are using separate LEDs, you'll have to put a resistor in series. Don't forget to position the heat shrink tube and apply heat.

At this point, you should be pretty much done. Cut back all but two red wires and all but two black wires. Make the cuts as close to the circuit board, taking care not to damage anything in the process.

Next, you can take the two red leads and twist+solder them together, and do the same for the black. Before closing up; it probably wouldn't hurt to grab your multi-meter and just test some leads. Apply your line voltage. If your fuses didn't pop, you probably didn't short out anything. Go ahead, and see if you get +5 V over the wires. If you do, you're done. If not, it is time to troubleshoot.



My final product looks like shown above. You can see the 10 ohm resistor sitting next to the bit heat sink, held in place by two tie wraps. The front of the enclosure has the toggle switch and the LED indicator. My +5 V wires hang out the back, and measure as +5.06 V.

Next: Raspberry Pi board power design

1 comment:

  1. Hi,
    I am using also ATX PowerSupply to power up my Raspberry PI. But when im measure the actual voltage on Raspberry PI (TP1 & TP2) it measures only 4.7V (no other usb devices attached except the ethernet cable)
    I read some information on some websites that 4.7 was not good enough to operate normally on raspberry. As much you can maintain the 5V it will be good for the raspberry pi.

    ReplyDelete