# Dynamo 2 LED with 555 VCO step-down regulator

#### formdeformed

##### Newly Enlightened
I finally got my new circuit out for its first test ride and thought it would be nice to share it and get some feedback.

It's a step-down regulator with timing controlled by a CMOS 555. The 555 is setup in astable operation as a voltage-controlled oscillator by placing the two white LEDs at the control voltage pin. Those two LEDs also turn the NPN at the discharge pin on. This prevents the stand-light capacitor across the main LEDs from discharging through the timer chip.

Using the control voltage pin in this way alters the RC charging formula which determines the length of time the output it high. It does not alter the RC discharging formula. Consequently, the off time remains constant and the on time decreases as the voltage increases. Meaning, the duty cycle is high at low voltage ~ 90%, and decreases as the voltage rises. R1 is the main variable. Formulated a best approximation then experimented to determine the best value. 11.25k is a 12k and 180k in parallel. 10k and 12k were both good, but not quite great.

At low speeds the current through the LEDs is the same as a basic 2 LED circuit with the resonant caps. Going faster than the resonant peak around 12-13 mph the timer maintains a lower duty cycle which keeps the current at the peak.
Typically, with the 270uF resonant caps, the current peaks around 0.9-1.0 amp but fades to 0.55-0.6 at 20+ mph.

The results from this circuit.
8 mph = 0.46 amp
10 mph = 0.76 amp
12 mph = 1 amp
16 mph = 1.13 amp
20 mph = 1.10 amp

Measurements are per a Klein MM600 DMM.

I wrote up a lot of explanation that I've decided to cut from this post to keep it at a reasonable length. Let me know what you think?

555-VCO-STEP-DOWN-2-LED Schematic

- Cory

Last edited:

#### formdeformed

##### Newly Enlightened
The XPG3 in the schematic is what I used on the testing circuit. But on the bike it's two separate headlights in parallel.
I bought the Spanninga Axendo 60 XDO specifically for this purpose. With the two LEDs and two reflectors I suspected it would be fairly simple to pull its circuit board out and access its LEDs for my circuit. And luckily it was.
I wanted a light with a cutoff and the Axendo seemed like the simplest (and relatively cheap) solution. Its beam is decent. My understanding is that it's based on the discontinued Philips Saferide. Others have hotrodded the Saferides and noted that at higher power the artifacts of the beam are fairly bad. This is true of the Axendo as well.
That's partly why I've included the second headlight with TIR optics. It fills in the dark spaces of the Axendo's beam very well. My intention is to add a switch or potentiometer to the XPL2 unit so that I can dim it for oncoming traffic.
Also, the XPL2 has a lower Vf than the Rebels which allows the XPL2 unit to draw more of the current and keeps the Axendo closer to its intended power and beam pattern.

#### gilesa

##### Newly Enlightened
It's good to see a different idea presented. I would like to see the long explanation as I am puzzled by Q2-Q4 and C2. It would be good to see a graph of output vs speed, with the simpler circuit included for comparison. Also, what generator are you using?

#### formdeformed

##### Newly Enlightened
I added a couple charts to the flicker album.

First, a more thorough explanation of the circuit. I'm a noob at this who has spent a very large amount of time reading through these forums and electronics information. I've drawn up a lot of circuits with a similar intent and this is the first that has shown enough promise to actually bother putting on a bike. Previously I wired up a lot of manually switched circuits.
Anyway, I'll get down deep with the explanation although I'm sure most people reading understand 95-100% and hopefully can provide guidance and insight to improve it. But we're all quarantined right now with nothing better to do, and two hands on the keyboard means I've got to put the drink down.

The generator I'm using is a Schmidt SON 28.

At the left of the circuit are the resonant capacitors to help match the inductive reactance of the generator.
D1, D2, D3, and D4 are 1N-5818 Schottky diodes which form a full wave rectifier. Q5 and Q6 are N-Channel MOSFETs which perform the low side of the rectification with less voltage drop than those two diodes while preventing C1 from discharging through the generator.

C1 is a smoothing capacitor for the rectified voltage. It's 330uF in this circuit for the simple reason that it was the same size as the 270uF caps used for the reactive resonance. I'd prefer to fit a larger cap here but I haven't seen that it's any benefit. I had a 4700uF on my test circuit but it was 50V rated and huge!

The two LEDs (labeled XPG3), 220uH inductor, and NTD4858N N-Channel MOSFET form the main power path of the step-down regulator.

D5 is another 1N-5818 schottky diode which conducts the inductor current when the NFET is turned off.

C2 is a 1 Farad, 7.5 V super-cap to provide a good buffer for the LED power and a usable standlight.

Q2 is actually two NPN transistors in parallel. A BC547 and a BC517 darlington. My thinking was that the Darlington would provide the big surge of current to turn the NFET on. Then, the BC547 would allow the gate voltage of the NFET to get a little higher since the BC547 would only have a Vbe of 0.7 while the BC517 Vbe is about 1.4 or so.

Q3 is the opposite. Two PNP transistors in parallel. A BC557 and a BC516 darlington. The theory being the same as above except the PNPs are pulling the gate of the NFET low to turn it off.

Q2 and Q3 form a totem pole to provide greater current to switch the NFET than the 555 timer output could provide. This allows faster switching because the NFET spends less time turning on and off and results it better efficiency of the circuit. Or so I've read and assumed. I don't have any way to measure and confirm much if any of this.

R3 is 470 ohms. That's to keep the output of the 555 from exceeding its limit. It may be internally limited but I wasn't sure and R3 didn't seem to negatively affect the performance. So hopefully it keeps the circuit from burning out.

The 555 timer claims that the internal voltage divider is comprised of nominal 100kOhm resistances.
https://www.renesas.com/us/en/www/doc/datasheet/icm7555-56.pdf

It is set up in astable mode.

Time off (output low) is set by the 470pF capacitor discharging through R2 and the internal discharge transistor to ground. The threshold voltage is set by the two 5mm white LEDs + Vbe of Q4 = 2 x 2.9V + 0.7V = 6.5V..

The lower trigger level is half the threshold voltage = 3.25V.

Time for a capacitor to charge/discharge through a resistor is Time= R * C * Ln [(Vo – Vi) / (V1 – Vi)]
Vi being V infinity or the voltage it would reach if left indefinitely.

So while discharging through R2 = 15kOhm and ignoring the voltage offset through the discharge transistor and Q4, Vi = 0, therefore Toff = R2 * C * Ln(2) = 0.7 * R2 * C

First, I chose the inductor to have a large value to allow slower switching frequency, and a low resistance and small foot print. I found a 220uH that fit the bill.

It seemed preferable that the circuit operate in continuous conduction mode. I assumed a low speed current of 500mA. Then I assumed an off-state forward voltage of two LEDs + one Schottky = 6.0V. I read that a good rule of thumb for a step-down converter in CCM is to allow a current drop of 30%. So Toff = 220uH * 500mA * 30% / 6V = 5.5uS (microseconds).
Plug that back into the Toff formula for the 555. Toff = 5.5uS = 0.7 * 15kOhm * 470pF
Close enough. Since the trigger voltage is always half of the threshold voltage the Toff is independent of the input voltage. So Toff remains the same as the circuit voltage ramps up with speed.

Typically, the control voltage at Pin 5 is not used. Therefore, the threshold voltage is set by the internal resistor divider network and is 2/3 of the supply voltage. In that scenario, the time to charge the capacitor from Vin through R1 and R2 is also independent of the supply voltage. However, I've used the control voltage to set the threshold voltage very close to the forward voltage of the two power LEDs. Plug in various values of Vi into the above charge/discharge formula for the capacitor with Vo = 3.25 and V1 = 6.5 and you'll see that Ton moves inversely to Vi.

Duty cycle = Vout x Vin = Ton / (Ton + Toff)
At low speeds a low input voltage is dropped and the duty cycle is high. Ton >> Toff
As speed increases, a larger input voltage is dropped across the circuit and Ton decreases.

So the end result is a step-down converter with a duty cycle that reacts to speed. At low speed 0-12mph, the power output is similar to a simple two LED circuit with resonant capacitors.
However, in a simple two LED circuit the power would drop above the resonant speed (set with the 270uF capacitors). I measured it and the current dropped to 600mA at 20mph. This circuit maintains the current (and thus power) above the resonant frequency by changing the duty cycle of the timer instead of adding LEDs in series or changing the resonant capacitance.

Q4 has an affect on the control voltage but its intended purpose is to block the 555 from reaching ground when the bike is stopped. C1 is fairly small, so when the generator stops it loses charge fairly quickly. C1 is then not able to forward bias the two 5mm LEDs and the base of Q4. When Q4 turns off it blocks C2 (which is large) from discharging through the resistor divider of the 555 and the body diode of the NFET instead of through the two power LEDs which is its intended purpose.

That's a good place to stop for now.

#### formdeformed

##### Newly Enlightened
Further explanation of my intent.

I chose two LEDs in series because that yields good power and light a low to mid speeds.

Also two LEDs in series are about 5.2-6.0 V. That provides a good PTO for 5V USB output. I think. Haven't tried yet.

I don't need much slower speed power for my everyday riding around home. But it is nice to have higher power when out cruising dark trails with vermin scampering around. Where I live is flat (on average) but I climb plenty of hills that slow me down to my lowest gear. Hills or legs, maybe blame both. This circuit works nicely for my fast bike which I don't intend to load up with much extra weight. That bike is on 27.5x2.1 tires.

I've also been swapping the light onto my Krampus, with 29x3.0 tires. That has an SP PD-8 hub. I have not recorded all the data as I did with the SON but I intend to. However, I can say that I've been very happy with it's performance. Previously, I had the same dual XPL2 light on it with a third LED to switch in manually. I typically left the third LED switched on for the flat loops and it was fine, but that wasn't a good option for much climbing.

Now, moving forward.
First, I would like the circuit to change the resonant capacitance. I swapped out capacitors on my test board and the same circuit with 110uF caps hits 1.6amps at 20mph. I've had some success with building frequency monitors from 555 timers wired as missing pulse detectors. Where I've struggled is using that monitor to switch the capacitors on/off on the AC side.

Second, for my touring rig, I would like more power at lower speeds. Like singletrack with a loaded bike climbing speed. Maybe 4-5mph. A single LED puts out more power than two at speeds below about 8-9mph.
So I would like to either short one LED or switch the two into parallel with MOSFETs at slower speeds. I have not done much experimenting with this yet.

I like having two LEDs because I can use two different lenses. Shorting one out at low speed would require choosing the better lens to keep at slow speeds. Not a big deal. It would also mean that the other LED would not have a standlight capacitor across it. But it would be pretty easy to control with just one MOSFET.

Switching the two LEDs as series/parallel with standlight caps across both of them would require two FETs minimum with a diode separating them while in series. Another FET could be included in parallel with the diode to lower the Vf of the series, but this will complicate the switching considerably because it's important to make sure that the FETs turn on and off in the correct sequence to prevent shoot through of the current if all were on simultaneously.

When changing between one and two LEDs it would be important to change the control voltage of the 555 timer appropriately. So in addition to changing the power LED arrangement, the speed sensor should change the control voltage at the timer as well.

Why change between one and two LEDs? Why not just have the step-down converter run at a lower duty cycle?

Well, it would be reasonable to just use a single LED or multiple in parallel for improved slow speed light. However, as the duty cycle drops for higher input voltages the percentage of time that the freewheeling diode conducts (the NFET is off) increases. With two LEDs I'm only dropping the duty cycle to about 50%. With a single LED I'd want to drop it to 25% or less. At 25%, the freewheeling diode is conducting 75% of the time and is also a greater percentage of the overall forward voltage.

Consider the Schottky to have a Vf of 0.3V and the LEDs to have a Vf of 2.7V.
2x LED at 50% duty means 0.3/5.7 x 50% = 2.6% voltage dropped at the diode
1x LED at 25% duty means 0.3/2.7 x 75% = 8.3% voltage dropped at the diode.
Hmm. That's less significant now that I type it out. Perhaps I'll go that route instead of shorting one of the LEDs.

Of course, there are other losses, but also replacing the freewheeling diode with another FET would improve the efficiency. I'd just have to control the timing of the two FETs.

Finally, the ideal solution should change both resonant capacitors and the LEDs/duty cycle.

#### gilesa

##### Newly Enlightened
Thanks for all the detailed description. I somehow interpreted the circuit as operating at a much lower frequency, so Q2/Q3 looked like over-design. (Did you update the diagram?)
That does raise the question of how you chose the inductor value and frequency?

The overall design makes a lot of sense to me. I am curious if it can be modified to give a further rise in output with speed. The close approximation of the theoretical voltage/duty cycle curve may leave the dynamo free to "choose" its operating point. Would reducing R1 raise the rectified voltage and output at higher speed? I guess measurements of rectified voltage at different speeds are needed.

> Where I've struggled is using that monitor to switch the capacitors on/off on the AC side.
I guess this is the problem of driving a MOSFET whose source voltage is bouncing relative to the control circuit. I think there is a circuit buried in this sub-forum that does that. IIRC, the idea is a parallel RC between gate and source with time constant long compared to dynamo frequency but short compared to capacitor switching intervals. The capacitor discharges through the resistor for off, and is topped up on the peaks through a diode and transistor in the controller.

Published versions of the Forumslader charger used relays to switch capacitors.

An alternative is to use an independent control circuit for capacitor switching, powered by half-wave rectification of the dynamo output voltage. I have not yet tried it in practice, but it works well in simulation.

#### formdeformed

##### Newly Enlightened
Yes, I did update the schematic, as I noticed one of the transistors was flipped. This was my first time drawing up a schematic in CAD, but I figured I better give it a try to make it more legible than my hand sketches. I used Scheme-it on digikey. Seemed straight forward enough. Other free schematic software recommendations?

As for the frequency. I wanted to keep it relatively low since my understanding was that the time required to turn the FET on and off accounts for much of the wasted power. I read through a lot of 555 datasheets in addition to the one I am using, plus other tutorials on using the 555. Those documents point out minimum sizes for the timing capacitor and appropriate ranges for the resistors, and all that seemed to confirm the plan for keeping the frequency low. Then, I narrowed down available inductors by physical size, DC resistance, shielding, current rating... The 220uH donut inductor I'm using was just a good compromise for all that criteria while having a relatively large inductance value. With the 220uH chosen, I then set the off time for the FET such that its current only drops about 30% during the off cycle at slower speeds.
30% of 0.5A = 0.15A.
dT = L * dI / V = 220uH * 0.15A / 6V = 5.5 microseconds
So that was the starting point for setting up the timing components for the 555.

Yes, lowering R1 does exactly as you mentioned. However, lowering it too much causes it to drive up the voltage at a lower speed, which results in lower LED current. I had begun switching R1 as speed changed, and it worked well. I was using 556 timers set as missing pulse detectors to perform the frequency/speed switching. That was in conjunction with trying to change the resonant caps. But it was getting pretty complex and I decided I needed to get the simpler version out of the basement and into the wild, and get it shared on here so others could provide further insight. For all I knew, it was going to blow up going down hill, because I only ever got it slightly over 20mph spinning in a truing stand.
Changing the control voltage also has a big (as expected) effect on the rectified voltage. At first, I just had the two 5mm LEDs at the control voltage. I added the NPN to those later one. That added the Vbe of the NPN to the control voltage. Which seems like a fairly small change, however, it resulted in R1 dropping from 22k to 11k.
In addition to just wanting to get the circuit on a bike and usable, I was also making sure not to push the rectified voltage too much higher since the 555 sees all of it. It's rated for 18V but it's recommended to keep it at 15V or below. Since, I wasn't all that confident in what it would do at higher speeds, I felt it was best to be conservative. The rectified voltage hits 12V in the mid teens mph, and then stays level at speed increases. When I lowered R1 and allowed the voltage to climb to 15V the current got up around 1.35A at 20mph. I was very happy with that, but it is also possible to achieve that by changing the resonant caps. Changing the resonant caps will result in more power lost in the hub, but it's less likely to result in the voltage running away and burning out the timer and transistors.
All this makes the concept seem somewhat delicate. I don't think it is. Perhaps it should have overvoltage protection. I don't know yet! There are still a lot of questions to answer. I've tested it with a few different LEDs having different Vf profiles and it's appeared to function well with each. Now, how will it function at 100F in the summer or -20F in the winter. I intend to find out if it'll work, but I'm not going to have the MM strapped to the bars.

I'll have to keep working on the AC switching with the FETs. I think it's got a lot of potential. I had considered trying relays, but that's another item I haven't learned much about yet.
I did not try the capacitor between the gate and source yet. I'll need to start running the numbers on it.

Thanks for the input. Let me know what other comments and suggestions you have.

#### gilesa

##### Newly Enlightened
I have little experience with circuit drawing software, but Kicad seems tolerable, and is free.

For testing at higher speeds, I found driving the tyre with a small grinding wheel mounted in an electric drill works well.

If R1 is lowered for better high-speed performance, one way to restore the low speed output might be to add an always-on low-speed mode by delaying the turn-on of Q4. Perhaps a resistor from Q4 base to ground would work, coupled with a high-value (1Meg or more) resistor from the rectifier output to the 555 output to charge the FET gate. Imprecise, but a simple modification.