There are cheap usb controlled power strips, but I have seen several that do not offer any isolation, and if you are creating a possible path for line voltage (120v here in the USA) to your mother board, and its many hundred dollars worth of over-clocked goodness. I would like some isolation.
There are current sensing power strips, One of the outlets is set up to sense current flow. When this happens the electronics in the power strip power on the other outlets. Its a good idea, but sometimes they do not sense correctly, and will not turn on the accesories. Also the electronics require yet another little power supply to be on 24/7, this we are trying to avoid.
There are well designed enterprise grade solutions with isolation, that work very well and have a very hefty price tag as well.
This circuit uses no extra power when it is not in use, and offers some hefty isolation from power surges, and does not cost a fortune to build.
Step 1: What You Will Need
The heart of this system is two things really, the actual switching is done by a DC controlled solid state relay, All the isolation is provided by a pair of fuses and some transient voltage surge supressing diodes (TVSS)
All of the other parts are really up to you, I used what I had kicking around. Which was mostly standard electrical fittings, and an old plug strip, and a heatsink from a junk processor, and a USB cable that was miss ordered with usb "A" connectors on both ends. Feel free to use whatever works for you.
All told the parts that I had to order (fuses and holders, TVSS, and Solid State Relay) were less then $30.00 USD from an online supplier.
Step 2: The Schematic!
The relay I chose was a Z240D10 from OPTO22. It has a maximum rated current of 10 amps @ 120VAC. This should be more then enough for my desk. The control input accepts from 3-32 VDC. So the 5 volts from the USB connector is more then enough. It was also chosen for its low cost. If you need more current capacity you can order a larger SSR.
The protection part of the circuit is three fold:
The first line of defense is the actual SSR. It uses an optical isolation between the power and control rated at a 4000 volts.
The second part of the circuit is a pair of 125mA fuses that will blow if over loaded.
The third part of the circuit is a pair of (1.5KE6.8CA) 7.14v transient voltage surge supressing diodes (TVSS) These are similar to a Zeiner diode. When the voltage across the terminals exceeds a limit. They begin conducting. Except unlike the Zeiner diode, they are bidirectional. So if for any reason the voltage in the control parts of the circuit exceeds 7.14v they act like a short and blow the fuses. The power dissapation for these parts is rated at 1500 watts for 1 millisecond. Which is more then enough to blow the fuses and protect the circuit. Circuits like this one are used in various communication devices that are subject to lightning and power surges.
Step 3: Enough Talking Time to Build.
The cord for the Plugstrip is cut in half and run through the electrical box. The neutral (white wire) is spliced with a crimp terminal. The grounds (green wire) are spliced and connected to the metal chassis for safety. The hot wire (black) is connected through the SSR with crimp terminals. This concludes the line voltage wiring.
The +5V and Ground from the USB cable (pins1 and 4) are are connected to one end of the fuse block, and one TVSS The TVSS diodes are simply crimped into the connectors for the fuse blocks. Simple, fast, easy. Then two wires are run from the other end of the fuses (with another TVSS) to the control terminals of the SSR. Most SSR's will have one of the control terminals marked for the positive (+) lead. Make sure to get the polarity right.
Make sure to insulate the other two wires in the USB cable from each other and the metal case. If you do not you can short out the USB buss and cause all kinds of other problems.
This concludes the wiring.
I added a small piece of plastic (recycled blister packaging) to form a voltage barrier between the high and low voltage sides of the case, as extra insurance.
Step 4: Close It Up and Test!
Troubleshooting: If it does not work check the switch on the power strip. Then check if you have the polarity from the USB cable to the SSR correct.
Hope you have enjoyed this. Its a fun little project. And has the side benefits of making your life easier, saving you money on electricity, and doing your part to save the planet.