Marko Mäkelä’s electronics projects: 5 Volts from a Dynamo Hub with a Switching Regulator

Why (not) a Switching Regulator

With a step-down switching regulator, it becomes feasible to use a conventional diode rectifier bridge instead of the MOSFET bridge. Because the dynamo can work at a higher voltage, the voltage losses across semiconductors become less significant.

I originally abandoned the idea of building a switching regulator for several reasons. First, switched-mode power supplies require special coils that are difficult to obtain in small quantities. Second, linear regulators are very compact and do not cause any radio interference. Third, in essence the bicycle dynamo is a current source and the battery being charged is a current sink. As long as the output voltage of the regulator exceeds the minimum input voltage of the charger, a linear regulator should suffice. However, a step-down switching regulator can allow the dynamo to work at a higher voltage, reducing current losses.

For hobbyists and prototyping, ready-made switching regulator modules are an interesting alternative. Some switching regulator controllers feature an internal switch and do not require too many external components: a few resistors, capacitors and an inductor. There are reference designs available.

A Test Load

[Test Load]When developing something, it is good to have a testbench that allows repeatable measurements. The input power of a battery-equipped mobile device depends on too many factors, such as the level of battery charge, the discharge rate, and the ambient temperature. Jürgen Heidbreder designed a test load that simulates an ideal battery. It eats all available power, provided that a threshold voltage is exceeded.

Resistor R3 is mainly limiting the current flowing through the control circuit of the power PNP transistor T1. The input voltage of IC1 is set by the voltage divider circuit formed by R1 and R2. When IC1 sees less than 2.5 V across R1, it will act as an open circuit between the base of T1 and ground. In this mode, T1 does not conduct. When the voltage across R1 is at least 2.5 V, IC1 will pull down the base of T1 to about 2 V, making T1 conduct. The power is limited by R4=3.9 Ω and a 0.1 Ω shunt resistor across a voltmeter, to about (5 V)²/4 Ω=6 W, which should be a powerful enough sink for a nominally 3-watt dynamo.

How is the threshold voltage Vt set? From Vt=(R1+R2)·I we solve I=Vt/(R1+R2) and get 2.5 V=R1·I=R1·Vt/(R1+R2). That gives us Vt=2.5 V·(R1+R2)/R1 or Vt=(1+R2/R1)·2.5 V. With the presented values, this threshold voltage is (1+9.4 kΩ/10 kΩ)·2.5 V=4.85 V. This mimics a device that runs off a 5 V supply.

Using a Drop-in 7805 Replacement

There exist some step-down switching regulator circuits that act as a drop-in replacement of the venerable 7805. They usually have a maximum input voltage of around 30 V. The RECOM R-78Cxx series allows input voltages up to 42 V.

[The Basic Rectifier and Regulator] The basic circuit consists of a rectifier bridge (B1), a zener diode (D1) for over-voltage protection, an input capacitor (C1), a regulator (IC1) and an output capacitor (C2).

Our low-dropout linear rectifier circuit replaced B1 with a MOSFET bridge and a Schottky diode, and D1 with two 7.5 V zener diodes on the AC side. The low-voltage zener diodes will conduct already at low speeds.

The surface-mounted diode bridge MB4S can withstand 400 V of reverse voltage, which is probably more than a nominally 6 V 3 W dynamo hub can ever produce. (With no load, 100 V can be exceeded easily.) The maximum voltage of the input capacitor C1 should exceed the maximum input voltage of the regulator, and the over-voltage protection must be dimensioned so that this maximum voltage is never exceeded.

[A Silicon Rectifier and Switching Regulator]I designed a single-sided board layout for implementing the basic circuit. Unlike my other circuits, this one is intended to be plugged in when needed. Thus, the over-voltage protection should not be active all the time. The circuit is about the size of half a 9 V battery. There is a barrel connector for the dynamo input and a USB jack for the output. The board layout was designed with CadSoft EAGLE 5.12.

For the dynamo input, I chose a 5.5 mm/2.1 mm barrel connector, because there does not seem to be any suitable standard. The 2.8 mm blade connector for tail lights is good for a permanent installation, but not for frequent plugging and unplugging.

The dynamo voltage enters the board from the bottom left. The rectified voltage is fed to a capacitor in the middle and further to a RECOM R-785.0-0.5. The USB connector is on the right. Next to the capacitor, there is a diode connected from the output to the input of the regulator module, so that the module will not be damaged when a power supply is connected to the output.

[The dynamo USB stick and a 9-volt battery for scale][Shrink-wrap tubing and the circuit in various stages of assembly]Dimensioning the Components

For over-voltage protection, I chose a through-hole 5 W zener diode. I determined that 30 V zener voltage is not safe, because 34 V (the absolute maximum rating of the RECOM regulator) could be exceeded already below 40 km/h when the output current is insufficient. Since May 2012, I am testing with 1N5358B (22 V). When the output is heavily loaded, the voltage across C1 never seems to exceed 6.5 V (the minimum input voltage of the regulator). Thus, the zener diode is not reducing the output power of the circuit; it is merely wasting power when the circuit is unnecessarily plugged in.

In 2014, I serviced a circuit whose heat-shrink tubing was damaged due to extreme heat from the zener diode, because the dynamo power had been connected while there was no output load. The only damage was the hole molten in the heat-shrink tubing. It could have been prevented by installing a thermal cutoff under the zener diode.

During my test rides, I hardly saw any difference between C1=400 µF, C1=680 µF and C1=1000 µF. Also, the R-785.0-0.5 sourced about the same amount of current to Jürgen’s test load at the same speeds as the bigger R-78B5.0-1.0. It might be safer to go with the 1 A version, because the 500 mA can be exceeded already at a moderate speed. The cheap version R-78E5.0-0.5 was unusable in my tests. It would deliver a short spike of 5 V every now and then, and remain off for several half-waves, being turned off most of the time. As of June 2012, I have tested two units of each type: R-78E5.0-0.5, R-785.0-0.5, and R-78B5.0-1.0. The following approximate results are for the R-785.0-0.5 and R-78B5.0-1.0:

Output current at different speeds with SON28, 28-622
speed current power
21 km/h 500 mA 2.5 W
27 km/h 550 mA 2.8 W
38 km/h 580 mA 2.9 W

Furthermore, I made some experiments with the Schmidt Edelux lamp switched on. To account for the capacitor in the lamp, the test should have been conducted by keeping the speed constant for a longer time than I was able to. The lamp would seem to reduce the above output current by between 200 mA and 300 mA.

Using a memory oscilloscope and Jürgen’s test load, I measured the ripple voltage across the input and output of IC1. When the wheel was rotating so slowly that the voltage across C1 would drop below the minimum, IC1 would consume less current. This seemed to happen after about 20 ms from the start of the half-wave, independent of the capacitance of C1. On the 26-pole Schmidt SON28, we get 26 half-waves per wheel rotation. On a 28-inch wheel, the rotation time 26·20 ms=520 ms corresponds to about 2.1 m/0.52 s, that is, 4.0 m/s or 15 km/h. In other words, you must ride at least 15 km/h to get full output from the regulator. With a 28-pole Shimano dynamo or smaller than 28-inch wheels, the threshold speed becomes lower.

Independent of the capacitance of C1, the ripple voltage at the 5 V output was about 80 mV above the 4.8 V cut-off voltage of Jürgen’s test load. The current looked almost like a sine wave, about 400 mA·(1+sin(2π·t/20 ms)) at 15 km/h.

With the SonyEricsson Xperia™ active, the ripple was about 120 mV above 4.4 V. I did not measure the current. The ripple is big enough to interfere with FM radio reception on the device, or with phone calls. All other functions are unaffected, and even the radio does work well when the reception is good or the battery charge exceeds 95 %. The charging indicator (battery charge percentage) on the Xperia™ active starts to display at 7 km/h when the headlight is off. The charging will usually be interrupted when the headlight switches on in a tunnel.

The output ripple waveform is very similar to the input ripple waveform, but much smaller. With C1=400 µF or C1=1000 µF, the ripple voltage across C1 was about 0.4 V above the minimum input voltage of IC1. With C1=47 µF it was 0.8 V, and with C1=150 µF it was 0.6 V.

These measurements would suggest that it is useful to choose C1=470 µF or thereabouts. I have not observed any practical difference between C1=680 µF and C1=1000 µF. A larger C1 may actually reduce the efficiency, as it will cause higher current spikes at the dynamo. For the 13 mm×17 mm×51 mm prototype depicted above, I chose a 680 µF 35 V H13 SMD capacitor that I repurposed as a through-hole part. It is about 12 mm in diameter and 13 mm in height.

High-Voltage Switching Regulators

The simple zener diode solution could become even more acceptable with a high-voltage regulator. Some high-voltage step-down regulators tolerate up to 75 V. With this kind of a setup, a 1N5373B (68 V) should do at D1, and it should almost never conduct.

The drop-in 7805 replacement RECOM R-78HB5.0-0.5 produces 5 V and up to 500 mA from input voltages between 9 V and 72 V. This module has two drawbacks. First, there is no 1 A version available, and 500 mA may be insufficient for certain smartphones or navigators. Second, the minimum input voltage is considerably higher than the 6.5 V of the R-78B5.0-1.0, which means that power will not be generated at low speeds or possibly not at all when the headlights are switched on.

Over-Voltage Protection by Switch

[Rectifier, Over-Voltage Switch and Regulator] Over-voltage protection by zener diode is simple but potentially wasteful. When the voltage is exceeded, the electricity will be converted into heat. It would be better to cut the supply of C1 when the voltage is about to be exceeded. A higher-voltage zener diode at D1 would still be needed to suppress high transient voltages.

In 2011, Jürgen Heidbreder designed a circuit where an IRLD120 MOSFET switch T1 cuts the ground line between D1 and C1 when the voltage across D1 exceeds a preset threshold. The control circuit consists of an adjustable zener shunt regulator IC2 (ZR431), a zener diode D2 and five resistors for scaling and clamping the gate voltage of T1.

Resistors R2 and R3 are mainly limiting the current flowing through the control circuit. The input voltage of IC2 is set by the voltage divider circuit formed by R1 and R2. When IC2 sees less than 2.5 V across R1, it will act as an open circuit across D2. Otherwise, it will clamp the voltage across D2 to about 2 V. From V(D1)=(R1+R2)·I we solve I=V(D1)/(R1+R2) and get 2.5 V=R1·I=R1·V(D1)/(R1+R2). That gives us V(D1)=2.5 V·(R1+R2)/R1 or V(D1)=(1+R2/R1)·2.5 V. With the presented values, this threshold voltage is (1+47 kΩ/3.9 kΩ)·2.5 V=32.6 V. As long as the input voltage stays below this threshold, V(D2) will be at most V(D1), limited by the D2 zener voltage of 12 V. If the threshold is exceeded, V(D2) will drop to 2 V. The voltages are best expressed as a table:

The function of the circuit at different voltages
V(D1) V(D2) Vgs(T1) T1 conducts? V(C1) IC1 works?
6.5 V‥12 V V(D1) 2.3 V‥4.3 V yes V(D1) yes
12 V‥32.6 V 12 V 4.3 V yes V(D1) yes
32.6 V‥80 V 2 V 0.7 V no 0 V‥32.6 V yes

The resistor divider of R4,R5 is needed for ensuring that whenever the input voltage threshold is exceeded, the gate voltage will drop below 1 V, guaranteeing that the IRLD120 will be in the off state. The IRLD120 data sheet specifies the switch gate voltage Vgs(T1) as 4 V‥5 V. The 12 V zener voltage of D2 will nicely keep it in this range, because Vgs(T1)=R5/(R4+R5)·V(D2).

The zener voltage could be increased to up to 20 V (the maximum rating of IC2) in order to allow Vgs(T1) to rise towards the absolute maximum rating of 10 V. As presented, the over-voltage protection circuit would consume at most V(D1)²/(R1+R2)+V(D1)²/R3 when 32.6 V<V(D1)<80 V. This would be 43 mW to 262 mW.

When V(D1) exceeds the threshold voltage, the switch T1 will be opened and will remain open until V(D1) drops below the threshold. Theoretically, C1 could discharge and IC1 could cease to work if V(D1) continues to remain above the threshold. In practice, the frequency of a bicycle dynamo hub should be somewhere between 10 Hz and 150 Hz under normal operation. The switch T1 should be closed and C1 be charged again on the next half-wave from the dynamo.

The internal resistance of the switch may be somewhat higher when Vgs(T1)<4 V. When the input voltage V(D1) is less than 6.5 V, the step-down regulator module would not work anyway. In our experiments with Jürgen’s test load, the circuit provided a little current already at 5 km/h and 370 mA at 15 km/h. In other words, the operation between 6.5 V and 12 V seems to be acceptable in practice.

Practical Experiments

When there is little or no load connected at the power output and the lights are switched off, the threshold voltage will be exceeded and the MOSFET switch would be flipped twice on every half-wave. Switching off a load near the peak current of the dynamo coil is something to be avoided because of inductive voltage spikes. Initially, we had the voltage limit at 25 V and C1=2200 µF. This caused two Schmidt SON28 and one SONdelux to vibrate strongly at 18 km/h. Also the noise level of a cheap Shimano hub increased at this point.

At 32 V, the over-voltage condition in the idle circuit would be reached at about 24 km/h, and the change in the dynamo sound level would be barely noticeable at the tested speeds (up to 40 km/h). This circuit, using RECOM R-78B5.0-0.5 for IC1, was able to exceed 500 mA already at 25 km/h.

The prototype circuits were built in a tiny size, using a mixture of surface-mount and through-hole components and a creative way of stacking components on top of each other. This slowed down the development somewhat. If the circuit were mass-produced, the circuit board layout and the case would have to be redesigned. The prototypes were built inside a plastic tube with 16 mm internal diameter, small enough to fit inside the head tube of any bicycle.

Anyone who is interested in buying a sample of this circuit should contact Jürgen Heidbreder, j-heidbreder(a)freenet·de.

Update (June 2015): Jürgen has improved the robustness of this circuit by replacing the switch at T1 and zener diode at D1 with higher-voltage types. Instead of using the IRLD120 (100 V, DIP-4) and an 80 V diode, he now uses the IRF7492 (200 V, SO-8) and a 150 V diode.

Which method of over-voltage protection should you choose: the sophisticated switch or the crude zener diode? If you want maximum efficiency at high load, the zener diode is better, because it avoids the voltage drop across the switch T1. But, it might self-destruct from overheating if you forget to unplug the circuit for long descends. The circuit with the over-voltage switch should never overheat, but the switch is going to eat some power and the dynamo might vibrate when the voltage threshold is exceeded.