USB charging on a bike
February 20, 2012
I’ve spent way too much time and money tinkering with bicycle electronics, but I am so incredibly pissed at off at the high price and mediocre quality that you get if you buy retail instead of DIY. I had a clever idea yesterday that would allow easy, simple combination of a USB charger with a cheap, brain-dead rectifier/doubler.
Most of them are intended to fit in a skinny place (like a seat tube) so that they are protected and out of sight.
This is how the capacitor is (permanently) attached to the PCB, aligned to fit in the seat tube. Epoxy is gobbed into the PVC, where it sets up. Careful not to crunch the capacitor too hard when you clamp it:
This how it’s supposed to work:
However, I also wanted to take a shot at running a USB charger; one of the more complex circuits (which includes a microprocessor, which is empowered to make fire-starting decisions, so, not simple) was designed to support a USB charger.
There are two problems that need to be solved to run the USB charger. First, the charger has to have priority over the lights, when you are charging, because otherwise there is not enough power. A USB charger draws about 2.5W, a hub is nominally rated at only 3W, though it is possible to get more out. Second, when the charger is NOT charging (and this could be the result of an arbitrary decision from the device plugged into it), there has to be “someplace” to dump all the hub’s power, otherwise voltage will soar and components will be destroyed, possibly accompanied by bad smells and/or fire.
The GREAT IDEA was to realize that the USB charger will run just fine with a supply of only 7 volts, which a rectifier-doubler can produce at a relatively low speed. If the LEDs on the bicycle require more than that to illuminate, say 8 volts, then they will only light up when the bicycle produces enough power for both. And if the bicycle has two white LEDs and one red in series, that’s 8 volts.
But, will it work? How fast will a bike need to go to produce enough power to make the supply happy?
And I put it all together, running off a Raleigh dynamo hub (and drum brake), and hand-spinning the wheel at 5-6 mph, the iPod declared that it was plugged in to a charger. And it was happy when the voltage came and went; it would stop and start charging gracefully. The lights clearly showed that they were competing for power, and losing; rather than coming on bright, they flashed. This is a consequence of the LEDs’ forward voltage depending on temperature; then they are cold, their forward voltage is higher (so the 3 LEDs in series might not conduct till, say, 8.5 volts), but when they are warm, it declines. Turning on the LEDs warms them up — so they stay cold, and off, until 8.5 volts accumulates, then they turn on, heat up, their forward voltage drops, and they continue to conduct until the voltage falls enough to turn them off. They cool off, the voltages rises, and the cycle repeats. If the device decides it is charged, that is fine, it just dumps power to the lights.
The circuits are pretty simple:
This below is a minor correction to the original; proper choice of diode, a little more room to lay the capacitor down sideways, and dedicated places for the iPod/iPad/iPhone 500mA charge-specifying resistors.