Flutterby™! : USB power supply

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

USB power supply

2008-04-14 04:06:55.176129+00 by Dan Lyke 3 comments

On the Tandem@Hobbes[Wiki] list I mentioned that it was easy to build a USB device power supply for a hub generator. Thom called my bluff, so I sent a "how to" email with the caveat that "if this works, you have to make a web page". Here's how to make a power supply that runs off of a hub generator. My original description was for a USB device, this is for a plug for a set of powered speakers, but the design is easily adaptable: Just cut open a USB cable, find a pinout for your connector, http://pinouts.ru/Slots/USB_pinout.shtml has a good diagram. Pin 1 is +5, pin 4 is ground, so attach the outputs from your LM7805 appropriately.

[ related topics: Hardware Hackery Bicycling - Tandem ]

comments in ascending chronological order (reverse):

#Comment Re: made: 2008-04-14 04:08:01.139514+00 by: Dan Lyke

For completeness, here's my original message. This should work for roughly anything from 6 to 25 volts input, AC or DC:

So, you need:

  1. A bridge rectifier. You can either build one out of four diodes, or get one that's usually a square piece with 4 leads. Your hub generator is probably putting out less than 25 volts, but the only issue with going with a basic 50 volt part is size, so just get one of those.

On the Wikipedia page: http://en.wikipedia.org/wiki/Diode_bridge

Down under "Basic operation" you see the lines marked with the squiggle: Those are the AC in from your hub generator. The other two are the DC going out to the next part of the circuit.

  1. An electrolytic capacitor. Again, size doesn't matter much, this is just to smooth out the DC signal a bit. I grabbed whatever I had in my parts bin. It is *critical* that you get the polarity right, otherwise (and I've actually never had this happen to me but I have been told) it may explode with some force. Solder the positive lead to the positive output from the rectifier, the negative lead to the negative output from the rectifier.
  2. An LM7805. With the tab facing away from you and down, the leftmost pin is pin 1. Solder the "+" output from the bridge rectifier to this pin, solder the "-" lead from the bridge rectifier to the middle pin.
  3. A USB cable. Clip it in the middle and separate the wires out a bit. Hold the mini plug that goes into your device, looking at the end of it with the rounder side of it up. Using your ohm meter or continuity tester, figure out which wire goes to the leftmost pin and which goes to the rightmost pin.

http://pinouts.ru/Slots/USB_pinout.shtml has a good diagram. Pin 1 is +5, pin 4 is ground, which means...

Solder the wire that goes to the leftmost pin (pin 1) to pin 3 of the LM7805 (the one that doesn't yet have anything soldered to it), the wire that goes to the rightmost pin of the USB cable to pin 2 of the LM7805 (which also goes to the negative pin of the bridge rectifier).

Just to double-check, spin the wheel and put the black probe from your volt meter on pin 4 of the USB plug and the red probe on pin 1, you should measure very close to 5 volts.

Plug that into your device and ride on!

#Comment Re: made: 2008-04-14 04:33:23.251929+00 by: Jim S [edit history]

If you get no charging, be aware that some USB devices won't take power unless they are sure the host computer is competently offering the number of milliamps they require. Since there is no host, then these devices won't work. The Adafruit Mintyboost pages document a number of problematic devices... http://ladyada.net/make/mintyboost/ Some can be worked around with appropriate resistor ties, others you are just out of luck, though I wonder if maybe powering through a tiny, powered USB hub would trick some of them.

#Comment Re: made: 2008-04-14 12:58:15.438706+00 by: Dan Lyke

Thanks, Jim, both for the link and the info. I've only seen a few devices tried (a Garmin bike computer, I think it was a 305, and a digital camera that I don't remember the brand of), and both of 'em worked.