Monday, February 18, 2013

DIY USB Power Strip

Somewhat predictably, I happen to own quite a few pieces of personal electronics that I need to keep charged. Fortunately, the vast majority of devices have moved towards the standard of being charged via USB. Until recently, I made do with charging my devices from a spread of computer ports, wall USB chargers, and the convenient USB port on the back of my Chumby. This worked acceptably well until one of my friends was visiting and went to charge his iPhone from my Chumby, which burnt out the Chumby's 5V 2A wall adapter.  Incredibly ironic, when you consider how many other ways the iPhone has already killed Chumby.

In any case, now I'm down  my most-used USB charging port, and a Chumby. I considered simply replacing the power supply and carrying on, but having a few more bed-side USB ports would be handy. I therefore opted to build myself a USB power strip.
 It's shown with the top cover removed. On the right is a 2.1mm barrel jack to accept standard 12V wall warts (which I've made a standard of as many of my projects as possible), and on the left is 5 "dumb" USB ports for charging devices.  Originally, USB wasn't at all designed to be a charging port, and required quite a bit of intelligence on both ends of the connection to negotiate how much power the client device can consume.  Manufacturers had no interest in spending the extra cost to make a phone charger that intelligent, so each manufacturer came up with its own bastardization of the USB spec (usually via random resistors between various pins).

This was little-to-no-fun, so the USB spec eventually caught up with reality and defined "dedicated charging ports," which are dumb USB ports where the two data pins are simply shorted together to indicate to the client that they do nothing except provide power.  Manufacturers like this because they no longer need to add a 15 cent IC to their chargers, and us hobbyists like it because shorting the two data pins together is a much easier way to build USB chargers than trying to reverse-engineer every manufacturer's creativity on the issue (see Lady Ada's work on the subject).
This was a quick one-evening project out of my junk box, but I've found it rather handy. The 12V input is regulated down to 5V 3A with an LM2596 switching regulator module, which can be had on eBay for less than $2 shipped. At $2, these modules are a great deal, and I've found them handy to have laying around for projects like this, but you do need to appreciate what you get for $2. When received, this board had several cold solder joints, which made for frustrating intermittent operation.  A quick going-over with a soldering iron solved this issue, and it has been running fine ever since.

The one point of interest that I added to this was 600mA polyfuses to four of the ports. These are solid-state fuses that don't permanently blow, but will reset themselves after the load is removed. I left the fifth port un-fused, since I'm using it to power my Chumby via a hacked-together male-USB-to-whatever-tiny-barrel-connector the Chumby uses. The Chumby typically only draws 0.5-0.7A, but will momentarily draw in the >1A range (particularly while booting).

  • 2.1mm female barrel jack to mate with standard 12V 1.5A router wall wart
  • Red LED + panel mount fitting + 4.6k current-limiting resistor
  • LM2596 switching regulator (<$2 complete module on eBay + repair)
  • 4x 600mA trip-current polyfuses (Digikey)
  • 5x Panel-mount female USB sockets

In hindsight, the fuses were a good idea that work out great, except that Apple seems to hate every spec they didn't invent themselves.  Dedicated charging ports are unable to digitally tell client devices how much power they can deliver (500mA? 1A? 2.5A?), and instead simply shut down the port when this limit is exceeded. It is then the client's job to figure out where this limit is and to do the best it can to stay below it.  It appears that in the case of my 4G iPod Touch, when it sees the USB port's voltage start to droop below 5V, instead of reducing its current load like it should, it simply displays a notification "Charging is not supported with this accessory" and gives up.  This means that when my iPod happens to be discharged far enough to draw >600mA when I plug it in, instead of waking up to a charged iPod, I get the pleasure of discovering that it instead gave up after a minute and sat there doing nothing all night.

I haven't had any issues with any other devices plugged into these DCP USB ports, and hopefully future devices will tend to be more standards compliant. Shown in the first picture of this post is this power supply charging my iPod 4G, my EnV3 dumb phone, my BaoFeng Amateur radio, my Kindle (on the bottom shelf out of view), and running the Chumby, all at once. This was certainly one of those DIY projects where I have the satisfaction of using this every day, and with the exception of Apple being a bunch of jerks, has made my life better. Having 5 USB ports next to my bed is nice, and has the added advantage that if I ever lose power (due to natural disaster, etc), re-purposing this to run off of any 12-35V DC power source is trivial.

29 comments:

  1. How is fast charging (1A, more for tablets) for Android devices supported? The polyfuses trip at 600mA so is it reserved for the next version? I guess you could use two or three switching regulator modules, have one or two ports on each.

    Cool work :)

    ReplyDelete
    Replies
    1. In a word, it wouldn't fast charge. The expected behavior is for a device to draw as much current as it likes, until it trips the polyfuse, then back off its current draw until it falls below 600mA, and draw that indefinitely. 5V * 3A is about all the power my 12V wall warts can deliver. If you need more than 15W, it likely makes sense to use an ATX power supply or dedicated 120VAC to 5V power supply.

      Delete
    2. I have a bunch of old 20-30V wallwarts from old inkjet printers. I don't know the amperage off hand but I bet they would do the trick if the regulator can handle it.

      Delete
  2. MeanWell has quite OK power supplies for that. Closed frame and needing no active ventilation. They work.

    ReplyDelete
  3. Cool project. And yes on Apple - they do things THEIR way. Friends found this out recently when the audio amp dock they bought wouldn't work with their Touch or Iphone anymore. The culprit - Apple's IOS 6.0.2.

    Wait, what? The Baofeng radios can be charged via USB? Damnation. It's about time manufacturers of Amateur Radio gear got with the program.

    It would solve so man problems. For example, my Yaesu VX-7r has a barrel connector charging port, and to connect to the radio you need a four conductor banana plug to USB adapter. Putting a fully functional USB jack on the radio would solve both problems.

    ReplyDelete
    Replies
    1. I wouldn't give BaoFeng too much credit. The only way to charge it is via the large docking bay it comes with, so charging it anywhere but at home is a pain. The cable is just USB to a barrel jack, so that they could include a cheap USB wall wart for power. To program it, you still have to use a Kenwood-style programming cable.

      Delete
    2. I have a VX-7R as well and mostly agree with you however, in Yaseu's defense the 7R is pretty old now and at the time it came out I can't think of any devices that charged via USB. Also, the 7R is supposed to be waterproof (although I would hate to test that after this many years) Have you ever seen a waterproof USB connector?

      Delete
  4. Very nice sir. Definitely going on my to-do list (but maybe with ~1 A per port).
    Where did you source the female USB sockets?

    ReplyDelete
    Replies
    1. eBay? I got a bag of 20, so you can probably source them from me.

      Delete
  5. What's with the black capacitor looking thing in the upper right of the second picture?

    ReplyDelete
    Replies
    1. At a guess, an output barrel connector to the Chumby

      Delete
    2. It's a large filter capacitor to keep my Chumby happy when I plug in other USB devices.

      Delete
  6. this might help you adapt this project to charge apple products: http://blog.curioussystem.com/2010/08/the-dirty-truth-about-usb-device-charging/
    a resistor network is required on the d+/- pins for apple to recognize the charge current

    ReplyDelete
    Replies
    1. CyberJon's got the Apple answer for you (leave it to Apple to "customize" the USB standard). I had found the LadyAda mod the builder/author mentions that I plan on using on a bench power supply that's mostly complete. I like the polyfuse idea... I may have to steal that one too. Nice build! Thanks for sharing.

      Delete
    2. Yep. I'm about to get rid of my iPod and upgrade to a Galaxy S3, so I'm putting up with it until then.

      Delete
    3. Kenneth, did you ever consider buying an Xperia Z?

      Delete
  7. Looks a great project!
    For a while I wanted to build a desktop power strip for devices like hard-disk drives and so, inside a power socket.
    Could you please post some schematics for the less saviors as me? :)
    Thank you!

    ReplyDelete
    Replies
    1. 12V barrel jack ---> Voltage regulator ---> poly fuse ---> USB socket.

      Short together the two middle pins on the USB connectors, look up the pinout online to get the 5V vs ground order correct, and then connect together the grounds of the USB connections, the voltage regulator, and the input barrel jack.

      Delete
  8. Is it a bad idea or not to run usb hubs from an old at psu?

    I run one 12v usb3 3.5 hard disk enclosure, a usb 3 12v hub, a usb2 5v hub for 5-7 devices and one hub with faulty logic for powering leds/breadboard from usb breakout cables. the supply is speced at a max 20a 5v, 10a 12v! so plenty of headroom. Also it makes a nice monitor and tablet stand.

    ReplyDelete
  9. The thing is that USB charging spec is supposed to hit a current limit, not a polyfuse, so the device can actually use the droop in voltage to reduce the heat generated internally when charging a totally flat battery.

    ReplyDelete
  10. Hi, can I use this DIY to make a portable battery pack for galaxy s3? any changes do i have to make? and how many 1.5v cells do i need to use?
    thank you.

    ReplyDelete
    Replies
    1. I use it for my S3 every night. You'll need an input voltage higher than 5V, so 6V may work, but I'd recommend at least 7.5V.

      Delete
  11. thanks for the tip.I'm gonna make one and toss it in my backpack.is fuse a must? I couldn't find it here.any alternatives?

    ReplyDelete
  12. I am fairly new to electronics from a making them standpoint so this may be a dumb question for which I apologize. Would it be possible to get a wiring diagram or a short explanation of how to wire everything together? Thanks.

    ReplyDelete
  13. Are the usb ports held in by tension? I'm thinking about building this right into my IKEA bedside table.

    ReplyDelete
    Replies
    1. They have slight clips for sheet metal mounting. I glued mine in place since the plastic was too thick.

      Delete