DIY hub dynamo usb charger

June 10th, 2010 by Arend Leave a reply »

This is a step by step guide on creating your own USB compatible charger using your bicycle’s hub-dynamo as the power source.
It’s a work in progress and I will update this post along the way.
All images link to full resolution originals.

Requirements:

Tools:

  • Soldering iron + tin
  • (optional) Multimeter
  • (optional) Soldering clamp
  • (optional) wire stripper

Parts:

Note that these prices are ex FAT and I ordered them in larger volumes, ymmv.

components overview

Poor man’s (ms-paint) diagram

Step 1: saw a piece out of the veroboard, approximately 17 x 40 mm (the board below is too long, approx 65 in length)
Veroboard

Step 2: Solder the two tantalum bead capacitors on the voltage regulator. Be careful to not overheat the components, polarity is essential. Long leg is positive.
Place the 22uF Capacitor on the right,  the .47 uF on the left. Negative polarity combined in the middle.

Step 3: prepare capacitor C1 with the heat-shrink tubing, bend the pins (long leg = positive) as seen in the photo. Keep the legs as long as possible for flexible placement of this component inside the ABS case.
capacitor
Step 4: place the components on the veroboard:
Looking at the first picture below; the middle three parallel stripes on the board serve as the main electrical paths for the components. The stripe on the left corresponds with the positive side on the diagram.
– C1: the long leg (+) should be placed on the left of the three middle stripes. The short leg should go in the middle. (in reference to picture 1)
Picture 1:
step 4 picture 1

The bridge rectifier output legs should be placed as follows: The + (as indicated on the component) should go on the left of the three middle strips.
The – (negative) output should go in the middle. The AC input legs can be placed on the outer stripes of the board. (left and right in reference to picture 1)

step 4 picture 2

step 4 picture 3

And finally solder the voltage regulator as well.

step 4 picture 4

IMAG0254

Before going any further, check to see if it’s working properly.
Prepare the cable that runs to the dynamo, and connect it on the input legs of the bridge rectifier. Polarity is of course of no concern as we are dealing with an alternating current. Connect the dynamo to this kit, swing the wheel and measure the output voltage on the + (Vout) and – leg of the output regulator.

test output 2

IMAG0256

We should measure around 5 Volts

Test output

If it doesn’t work, carefully check the polarity of the capacitors and other components.

We can now safely cut the remaining component legs form the veroboard, and bend C1 to fit inside the ABS case.

I connected the heat-sink using a blind rivet this is ideal as it does not need any additional space (especially height).

Before connecting the cables, drill a small hole for the Cable Gland Locknut, connect the Cable Gland Locknut and route the wires through it.

Next, connect the USB A receptacle or if you like a mini or micro USB cable directly to the voltage regulator output legs. Connect the dynamo cable to the bridge rectifier.

In order for this whole package to fit inside the box, I had to saw one of the corners from the veroboard.

When using the same ABS case as listed in the requirements section, be sure to cut the two screw holes at the bottom of the case for more room.

That’s pretty much it. I will seal the case of with a polymer resin, to make it water proof. Be sure to only do this after you are absolutely sure everything works.

Revision 2 with grommets

That’s it! Let me know if you take on the challenge to build one yourself, or if I need to explain anything in more detail.

73 comments

  1. Adam says:

    Great writeup! Even an electrical dummy like me should be able to follow it!

  2. olivier says:

    Hello Great ! Clear and Easy ! Do you think it’s possible to charge an iphone 3gs with your solution ? Thanks you

    • Arend says:

      If you can charge your phone by plugging it into a regular USB port, then yes. If that is not the case, it might still be possible by using the right USB cable. It seems to be necessary (for iphones/ipods) to place a resistor between the two data pins of the USB cable. I can look it up if need be.

      • olivier says:

        Hi,
        I tried but impossible to charge my iphone 3gs with this
        [5v+]—(100k)—[D+]—(50k)—[D-]—(100k)—GND
        Have you got an idea ? Thanks

        • olivier says:

          With [5v+]—(100k)—[D+]—[D-]—(100k)—GND my iphone 3gs charge but not my 3g or 4 bizarre

          • Arend says:

            I don’t have an iPhone to test with, but I know it can be a real pain in the $#@.

          • Andrew Norris says:

            I would like to build this for my 3gs. Could anybody explain what is meant by

            “[5v+]—(100k)—[D+]—[D-]—(100k)—GND”

            Is there a name for this terminology, a link which could explain it?

            I fear without this my 3gs will not charge. Glad to hear someone got it working!

  3. slimbo says:

    thanks for such a detailed write-up on an immensely useful project. i plan to build the same, but i want to integrate a switch that will allow me to power a headlight (not at the same time as the gps). any thoughts? also, approximate cost for the project as listed above?

    • Arend says:

      I think the easiest way would be a switch before this unit (on the AC cable). I updated the post with prices, mostly from Farnell.

  4. M says:

    Wij willen een GPS tracker maken om te voorkomen dat m’n fiets gestolen wordt (of om die terug te vinden). Maar de batterij moet opgeladen worden, en dat zou dus via dit moeten… maar dan werkt het voorlicht niet meer?

  5. Arend says:

    Je hebt inderdaad niet genoeg vermogen om beide apparaten tegelijk van stroom te voorzien. Je zou wel een lichtsensor in kunnen bouwen die er voor zorgt dat overdag de accu opgeladen wordt en ‘s avonds de verlichting van stroom voorziet.

  6. alice says:

    I was looking for something completely different,got your page DIY hub dynamo usb charger » arenddeboer.com and found it Interesting.Nice Post on resistor electronics…

  7. Matt says:

    Thanks for this article. I’ve just made one of these and it works a treat.
    I was thinking of putting a switch in for a headlight, but in the end I didn’t and my LED headlight works whilst my phone is charging.

  8. Paolo says:

    thank you very much for this perfect project! I made it about two days ago and it works great!

  9. Dave says:

    Thanks for the detailed instructions. I have enjoyed building the charger and have been testing it out for the last week. I seem to be having a problem with it though. Any device that I plug in to the charger displays that it is charging, but the battery still appears to be slowly losing its charge because the device will eventually die and the device will turn off if I ride long enough. I tried it with both my cell phone and portable xm receiver, both with the same result. Any idea what is going on or what I might have done wrong? Thanks.

    • Arend says:

      Hi Dave,

      It’s hard to judge what could be wrong. Keep in mind that it only delivers 400-450 mA at a decent speed. It might not be sufficient for your hardware.
      I would start troubleshooting by checking the current with a multimeter while driving at 16km/h.

      • Dave says:

        I checked the current output and I am only getting about 200 mA when pedaling full speed, so that appears to be the problem, but I have no idea where to go from here. I am using a bottle dynamo instead of a hub, would that matter?

        • Arend says:

          Yep, bottle dynamos are in general less efficient. There are more powerful bottle dynamos but they are as, or even more expensive than a decent hub dynamo. It might be worth it to order a rim which includes a hub dynamo like I did. Go for the 3Watt (vs 2.4W) version if you decide to do so.

  10. Dom says:

    Great write up! I’m going to build this next week, I have a little bit more room for my project (altoids tin) so I’m going to add some rechargeable batteries, I’ll let you know how I get on.

  11. Ktronik says:

    Your new circuit has lost the boost caps, since the first circuit w the 4 diodes… This will reduce the current output in the system

    your system is not protected against an unloaded hub, while the circuit is connected, these voltages can be as high as 100v

    I worked with Martin, who did the circuit that was copyed, buy the people that you copyed. To incress the current output try a 200uf bipolar cap, smaller but still keeps the boost function

    btw this hub has no problem putting out over 500ma when using a boost cap.

    My test show that you can get 12w peak if needed.

    Hope this helps

    ktronik

    • Arend says:

      Thank you for your input. I’m no wizard when it comes to electronics so I will just have to try this out. Do you have a diagram of a more optimized version ?

      Are you saying that Simon Galgut copied the diagram from Martin ?

      This is what I used the first time, but it didn’t boost the output more than the current version: http://www.arenddeboer.com/bike-mounted-usb-charger/

      Thanks

  12. Ktronik says:

    That circuit you had is most defo a lift from the one on his site

    It’s like this…

    Martin is a good mate…I found out back in the day, that his bottle dynamo circuit could be used to get way more power from a Shimano hub, 12w infact…told Martin, he was very surpised….

    We have work on many varaitions of his basic circuit together, I now have adapted my own version and power curve, that I like…his system is very conservitive, as that’s the way he work…he is a very smart guy.

    If u use a smaller boost cap other than the one he uses, 470uf, and use say 200uf you should see a higher current, for the circuit I use with out the Lin 5v reg, direct to my LEDs it works a treat, I can get 11v @1A

    I just puts it to to the max, that’s me…so get way more power from the hub than him buy having peaker curves…

    I say 100uf bipolar for road, 200 bipolar for off road…

    Check out my old website…on the specs page you should see power curves ect of the 100 & 200uf system…

    http://Www.cncdelite.com

    • Arend says:

      Thanks, it’s definitely something to try out. The the temps are on the rise here so it’s about time to install my charger again. A bit more juice is appreciated as my HTC Desire sucks the battery dry in no-time. Will report back.

  13. ktronik says:

    But use not 2 big caps and blead resistor, but 2 small 100Uf bi-polar in parellel (200uf) or just one for a fast power curve (100uf) in same place, we used bigger ones as they have a higher overall ripple rating, not really needed for low powered USB stuff.

    your unloaded circuit will give 1v per 1km/hr and could blow the head off the voltage reg, to help here, just put a switch on the AC side of the dynamo, thus to stop any power getting to the circuit, its then OK remove the load

    hope this helps

    ktronik

  14. jim says:

    Hi Arend, have you tried this out on the HTC Desrie HD? If so how did it perform and is there any mods required to overcome the power consumption of this phone. Any diagrams etc will be appreciated. Thanks.Jim

    • Arend says:

      Nope, I have the S class Desire. I reckon the HD will consume even more power.
      I hope to free up some time at the end of this month to experiment with ktronik’s suggestions. I will report back.

  15. ktronik says:

    BTW, this ‘tuning cap’ method has been tested with the SON and shimano dynamo hubs.

    can be build ‘dead bug’ style, (if that makes sense) very very small, if using bi-polar cap…

    see below pic link to get your head around ‘dead bug’ style…

    http://ktronik.com/misimages/dyno_circuit_pic.jpg

    have a look at the bottom pic (no LEDs for your one, 5v reg in its place) see how I have orientated the 4 diodes, bi,polar on the back of that, then smoothing cap and reg…tiny…below pic is of what it looks like rather than a circuit diagram…

    K

  16. Caveman A says:

    HI, I just commented on one of your other posts… once again, Great stuff!

    I was researching and found this guy on ebay selling a regulator circuit below.

    My understanding is the input from the Hub generator can go up to 60 volts. So, yes, I am awaiting the answer if it will take the input voltage of a hub dynamo:

    http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=320676273028&ssPageName=ADME:X:AAQ:US:1123

    (this link is FYI, you might want to edit it out of the final post as they -ebay links- die pretty quick)

    • Arend says:

      Hi Caveman,

      For me, charging a battery with a battery is too inefficient, but I agree there are use cases where this is the best option. Let me know if that solar power charge controller is up to the job.

      • Caveman A says:

        Think of the four AA batteries as a big capacitor between your generator and your device. It’s not really the efficiency of it. It’s more for the safety of the attached device.

        Depending on the battery chemistry, you really want a constant current to charge your phone/gps/etc. The batteries between your charging circuit and your device take care of that. And of course there’s the battery power when you’re not moving. Finally, it’s much better to ruin $5 or $6 worth of AA nimh batteries than your Iphone battery.

        I am guessing your circuit probably takes care of “cleaning” the power, it’s just not constant with the starts and stops.of riding.

  17. Ktronik says:

    I strongly agree that 4 series wired batterys is a great soluition, as it would “clean up” the power, to make it way less choppy, and would provide more peak power than out than the circuit

    I worry about recitifed ac, as it’s just not great for nice electronics, and wonder if a few filter caps are enough to smooth it out…

    So the more peak power it gained from allowing your load string to be charged to a higher voltage…

    So for my 10.5v led string I push in to it 800-1000mA, from hub depending on what bi-polar cap I use..

    If I had a 4 series battery I would be charging my 4.8v nimh string, 6 series would give a 7.2v string, and as the voltage is higher would be charged with more power…

    But the problem is stoping over charge of battery string, no the case with cap’s…

    So we use sub C nimh batts. Would take a while to fully charge these, and we add a led that comes on at the right voltage, like a I am charged led….

    That way your get more output power from hub, to charge battery string. And get way more power into your system than any of the Ac/USB devices…

    Just another was as caveman said…

    K

  18. kels says:

    Hey Arend.. I’m a first year engineering student and we had to come up with a mechanical cell phone charger and then theoretically design and test it. I just wanted to ask your permission to use your intellectual property, with the proper recognition of course? I’d appreciate it if you’d get back to me on that. Thank you.

  19. Henk says:

    Awesome info on this page! I was almost ready to start building this thing, until I’ve read the comments about unloaded hubs that generate 100v.

    I don’t know what an unloaded hub is, but I’m sure my Garmin will fry with that amount of voltage on the USB input. Will that be solved with your new build?

    Also, a cheap 4x NiMH battery addon would be great since my Dakota automatically switches off when USB power is not available. Very annoying.

    Thank!

    • Arend says:

      Hello Henk,

      All I can say is that I have used, and still use this setup without problems on my HTC Desire, and previously on my HTC Touch HD (Blackstone). In my opinion, the 100v is never able to reach the USB-connector as it is regulated by the LM2940CT (even though it has a max input of 26V). Frying the LM2940CT will probably break the electrical path to prevent damage to the load. This could easily be tested and will only set you back the cost of one LM2940CT.

      The “new build” that I might try only has an additional boost cap. I am not interested in an additional battery in front of the battery already in my phone.

  20. ktronik says:

    Unloaded means that nothing is plugged into the USB circuit…not a issue if you just add a switch as in bottom of this post… ;)

    I am now developing a battery system that will be charged via the dynamo hub, and offer USB 5+ and 12v out for a separate charger, and full LED battery level indcator, so you can use the power you collect when you now moving, in the tent, doing it for a customer on a 5000km trip, dynamo hub is on the rear of his bob trailer…

    your unloaded circuit will give 1v per 1km/hr and could blow the head off the voltage reg, to help here, just put a switch on the AC side of the dynamo, thus to stop any power getting to the circuit, its then OK remove the load

    • Arend says:

      An even better answer :-P

    • piccas says:

      hi, i was trying to change this circuit and adding separate control for the lights, and an extra 9v exit for a sw/mw radio. since i see your project is very similar i would really need a few clues on the best schematics. i am a bit disorientated on wich is the best place to place the battery, since i would only need it when i am not riding. also, i will make this with a bottleneck wich i have measured spinning the weel with the bike upside down and at maximum gave 28V so i think i have to change a lot of the components from this circuit.
      the problem is that i’m not too sure on wich components i can be sure to use.
      i thought for c1 a few 50V 470uF that i got from old electronics wired in parallel
      then from the positive before the 5V regulator i was thinking of placing the 9v regulator wich charges a 9v battery (and a switch before it).

      —,–*—,—————–5v—,—,– +
      | sw | | |
      c1 9v——°, | c2 c3
      | | 9Vbatt | | |
      —‘–*—-‘——°———-‘—-‘—-‘– –
      where i connect the lights in * and the 9v plug in °
      this is just a sketch as you can imagine but any help would be appreciated :)

  21. sebD says:

    Hi Arend,

    Many thanks for theses intructions. I have just built mine and it looks like its working. I’m about to leave for a big bicycle trip and was dearly looking for a way to get all this otherwise wasted energy put to good use.

  22. Arend says:

    Something to consider while building this unit is adding a 200 Ohm resistor between the D- and D+ data pins of the USB connection. This allows your PDA to switch between USB charging and a more powerful charging mode. After adding this resistor (you can also short the pins, not sure what difference it makes) the charge bumped from 380 mA to 450 mA at 23 km/h

  23. Claudio says:

    Hi, Need to contact you about fixed ftp upload IP cam script you posted in Foscam site. Please write me at : wtscaracas (in gmail)

    Not for free its commercial use.

    Thanks,

  24. Ktronik says:

    Part 123587 on dx will do the job.

  25. Ktronik says:

    Oops 123582 from dx is a data pin translator

  26. Andres says:

    Hi, this DIY project is exactly what I’ve been looking for. I have a question, is it possible to replace the LM2940CT for a typical LM7805 instead?

    Thanks!

  27. Andrew Norris says:

    This is awesome! I would like to build it for my 3gs. Could anybody explain what is meant by
    “[5v+]—(100k)—[D+]—[D-]—(100k)—GND”
    As it appears this is needed to make it work on a 3gs?

    Is there a name for this terminology, a link which could explain it?
    I fear without this my 3gs will not charge. Glad to hear someone got it working!

    PS. Hope don’t mind but I asked this before in reply to a comment, but have posted it here as a general comment, so more may read it and perhaps help out with this issue.

    I really want to build as will be doing some long distance touring soon on my bike!

  28. Arend says:

    Guys, sorry for the late responses but I am very busy. Also I am not that good with electronics, so if anyone else can add something to the questions please do.

  29. Gareth says:

    Hi,
    Thanks for the circuit info. I have built it, and it seems to work, but unfortunately only for about 10 seconds, and then the phone stops charging. I’ve tried it on an ipod touch and HTC Wildfire S. Testing with a multimeter and I still have +5V on the USB output, so it seems to be something about the devices I’m charging. I’ve set 2V on each of the data pins to get the ipod to charge as suggested. Would be interested to hear if anyone else has come across this.
    Cheers

  30. Jacek says:

    Hi,
    thank you very much for the tutorial, I like it for its simplicity. I’ve just finished my USB charger and it works although I had nothing to do with electronics before. I would like to share this tutorial with other people in Poland if you don’t mind. Do you think that I could translate it to polish? I’d like to show it to people at Bike’s Day in Kraków, so that they see how simple it could be and that advanced knowledge is not essential. Please answer if you have anything against.
    Jacek

    • Arend says:

      Please share. It’s not like I invented this circuit. The more people use / build it the better.
      Thanks for letting me know, good to see it being used!

      Regards,

      Arend

  31. wanda says:

    For every compenend you linked to the farnell website, which is great.
    However for the C5 22uF Tantalum bead, this is not the case. Can you also create a link to the farnell website for this?
    I would like to order the components.

  32. George Holland says:

    Brilliant, thanks for the detailed guide. Just finished mine and amazed it works. Using to charge a battery pack to then charge phone. Now off to the wilderness….

  33. Gus says:

    Great work. Thanks for sharing. Is there a specific reason for most folks out there build a usb charger that cannot work along with the lights on?

    • Arend says:

      For me it was just about simplicity and I didn’t have hub powered lights. But a simple switch (charge/light) shouldn’t be hard to implement. Using light and charging together, I think, does not work well as there isn’t enough”juice”

  34. miki says:

    Hi,
    Have you actually tried this circuit without the phone connected? There is no overvoltage protection, and unless you have one externally (like in the generator or something like Shimano’s DH10) this circuit is likely to give smoke.

    • Arend says:

      I have used this circuit for quite an extended period with and without a connected phone. No problem. (Shimano DH-3R30) The LM2940 also has over-voltage, mirror-image insertion and thermal overload protection.

  35. Umesh says:

    cant we use some other capacitors except Tantalum bead capacitors?just like aluminum electrolytic capacitors? 0.47uf 60V .because its hard to find tantalum capacitors

    • Arend says:

      Yes, shouldn’t be too much of a problem I think. Regular electrolytic caps are just a bit less efficient and bulky.

  36. Gregory Strauch says:

    I am so busy preparing for my trip, I doubt if I have time to build this myself, are there any commercially-available ones?

  37. wincent says:

    i had no knowledge about circuit design
    but i wish to build a dynamo handphone charger based on yours
    can i ask what is the function of capacitor in this thing
    and why you use two type of capacitor
    that is tantalum and electrolye
    what is the different ??

Leave a Reply


5 × = forty five