Standlight and Martin's Circuit 12 help please!

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
Once i have it working properly, I will try it with the XMLs again. But I think it could be the difference between a whole light head from AliExpress costing £7 (The XML light) verses the Carlco optic on genuine Cree leds from a reputable supplier. One XPG cost more than the entire light from Aliexpress!

I did manage to measure some voltages, at the higher speed where the second set of LEDs should be ON.
Pin 10 to GND on the mulitvibrator should be low at high speed. Correct?
Under the threshold ( @ 12mph), it is 4.8V. Over the threshold ( @ 24mph), its 5.2V
Vdd seems pretty stable at 5.6v. Which should be as only two LEDs are being powered.
I haven't measured any other voltages as I suppose I need to find out why Pin 10 is still high when above the speed where it should be LOW.
Thing is, i KNOW it used to work. I have checked the continuity, the LEDs are hooked up directly to the board, all seems ok. Should I be measuring Pin 10 to GND with it disconnected from Q5? would that make any difference?

On your older schematics, when you were using Q_not instead of Q, you had a little 'what's happening' on the drawing. I cant quite get my head around how Q5 makes Q7 conduct between Source and Drain. Is that what is happening when the LEDs are shorted out?

The days are getting shorter quickly. I ride to work in the dark and even with only two of the LEDs lit, its great!
 

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
Once i have it working properly, I will try it with the XMLs again. But I think it could be the difference between a whole light head from AliExpress costing £7 (The XML light) verses the Carlco optic on genuine Cree leds from a reputable supplier. One XPG cost more than the entire light from Aliexpress!

ah! I didn't know you were using parts from "low cost providers", as some people term it. Yeah... you never know what is actually inside the device, regardless of how it is advertised. Some folks weed out the really bad providers and know which ones are reputable, but I prefer to just buy stuff that I know is quality.

I did manage to measure some voltages, at the higher speed where the second set of LEDs should be ON.
Pin 10 to GND on the mulitvibrator should be low at high speed. Correct?
Under the threshold ( @ 12mph), it is 4.8V. Over the threshold ( @ 24mph), its 5.2V
Vdd seems pretty stable at 5.6v. Which should be as only two LEDs are being powered.
I haven't measured any other voltages as I suppose I need to find out why Pin 10 is still high when above the speed where it should be LOW.
Thing is, i KNOW it used to work. I have checked the continuity, the LEDs are hooked up directly to the board, all seems ok. Should I be measuring Pin 10 to GND with it disconnected from Q5? would that make any difference?


For reference, let me just include the last/best schematic....

7483782976_bfdfeb28ee_c_d.jpg


Measuring from pin 10 to ground is correct.
Have you checked to be sure that pin 10 is connected to ground?
If nothing else works out, it's good to take the schematic and start checking every connection. A bad solder joint can occur due to vibration, thermal stress, etc., and it's not always obvious.
It is also possible that the parts could be physically damaged. Surface mount capacitors can easily crack if the board flexes even a tiny amount. I've seen surface mount resistors crack too, but they are more robust than the ceramic caps.
Q5 isn't a concern... R4 will limit the current sufficiently so that pin 10 should have the same voltage as if it wasn't hooked up to anything.

On your older schematics, when you were using Q_not instead of Q, you had a little 'what's happening' on the drawing. I cant quite get my head around how Q5 makes Q7 conduct between Source and Drain. Is that what is happening when the LEDs are shorted out?

In general, I'd say that you should ignore that part of the schematic, because it was just a case of doing things the hard way. :)
However... Q5 was turned on when I wanted all 4 LEDs to be powered.
Q5 sank current (i.e. conducted current to ground), which pulled Q6's base lower than Vdd, which turned on Q6 (since it is a pnp transistor).
When Q6 is on, it pulls the mosfet's gate within 0.2v (or so) of Vdd, which ensures that the mosfet (Q7) is turned off.
Technically, it works, but there are toooo many parts! The new design is much simpler and just as functional (and smaller and cheaper, etc).

The days are getting shorter quickly. I ride to work in the dark and even with only two of the LEDs lit, its great!

Two LEDs aren't bad at all, but I will admit that 4 LEDs are a little better... not twice as good, but better.
My next goal is to make a little buck converter so that I can take the dynamo power to drive a single LED at 1 ampere, and use the optics from a proper StVZO (?) compliant headlight. It should(?) be even better! I just have to find someone who will donate the body & optics of a dead B&M headlight in order to perform my little Frankenstein-esque experiment. :)
 

Byteseven

Newly Enlightened
Joined
Dec 27, 2016
Messages
1
I have been following this thread with great interest after starting to build my own front wheel with a Shimano dynohub. It has been a while since Piesoup has updated it and I'm keen for them to post an update.

Also, I hope Steve K will humour me by answering a few questions about his circuit. I think I have got to grips with most of the circuit that you suggested to Piesoup but would like to make a few modifications for my own.

U1 seems to be set up in a two stage voltage detection scheme. When the voltage on Pin 4 and Pin 12 is above a certain level (speed) it switches Q5 to turn on the additional LEDs. I guess I could use a 556 chip in a Schmitt trigger configuration to accomplish the same task? I would prefer to do this as I have a few 556/555 timers knocking around, rather than having to order a specific chip for this project.

For the standlight part of the circuit I was thinking of getting rid of U2 and replacing the (single?) 1.2V NiCd/NiMH with a NiMH 3.6V battery pack such as:

[[https://]]www.buyabattery.co.uk/3-6...MeOO3zZtcKZQ47PHji4q96ZZEcCHucBdYQaAiZZ8P8HAQ

(I have butchered the https://, assuming the forum does not allow new users to post links).

This battery pack would hopefully be capable of running a single led without being boosted. Would this be a reasonable assumption?

Thanks for any input.
 

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
....

U1 seems to be set up in a two stage voltage detection scheme. When the voltage on Pin 4 and Pin 12 is above a certain level (speed) it switches Q5 to turn on the additional LEDs. I guess I could use a 556 chip in a Schmitt trigger configuration to accomplish the same task? I would prefer to do this as I have a few 556/555 timers knocking around, rather than having to order a specific chip for this project.

hi Byteseven,

In my circuit, U1 is a CD4538, which one of the old 4000 series CMOS family of ICs. It is dual one-shot, and Digi-key is telling me that it is obsolete...
http://www.digikey.com/product-detail/en/fairchild-on-semiconductor/CD4538BCM/CD4538BCM-ND/977963

the CD14538 is an equivalent part, which TI still sells.
http://www.digikey.com/product-detail/en/texas-instruments/CD14538BPWR/296-12018-2-ND/404253

The first stage of the dual one-shot is looking for the edge of the dynamo waveform. Over the years, I tend to forget the details of how the two one-shots work together. Fortunately, I have my design notes to fall back on.....

"The dynamo signal is fed into the first one-shot. If the frequency is high enough, it keeps the one-shot retriggered and the output can't change state. If the input frequency is low, the one-shot times out and a pulse goes to the second one-shot. It has a much longer time constant, and will turn on the mosfet, thus shorting out two leds."

Hard to say how easy it will be to use 555's or 556's to replace the CD4538. The plain bipolar 555 can handle the high supply voltages, which is a good thing.


For the standlight part of the circuit I was thinking of getting rid of U2 and replacing the (single?) 1.2V NiCd/NiMH with a NiMH 3.6V battery pack such as:

[[https://]]www.buyabattery.co.uk/3-6...MeOO3zZtcKZQ47PHji4q96ZZEcCHucBdYQaAiZZ8P8HAQ

(I have butchered the https://, assuming the forum does not allow new users to post links).

This battery pack would hopefully be capable of running a single led without being boosted. Would this be a reasonable assumption?

Thanks for any input.

This would work. I chose a single AA because it was enough to keep the standlight powered for the time I needed.
One downside of using 3 cells in series is that it is harder to keep them all at the same state of charge. I wasn't able to use the link to the battery you were considering. If it has some built-in balance circuitry, that would take care of that problem.

There's also the issue of not over-discharging the three cells and causing one cell to reverse-charge. It's not a consideration with one cell, but could happen with three cells driving a single LED.

Of course, you would still need some sort of circuit to control the current delivered to the standlight LED, as well as something to turn off the current when the dynamo is running.

good luck!
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
I have been following this thread with great interest after starting to build my own front wheel with a Shimano dynohub. It has been a while since Piesoup has updated it and I'm keen for them to post an update.

Also, I hope Steve K will humour me by answering a few questions about his circuit. I think I have got to grips with most of the circuit that you suggested to Piesoup but would like to make a few modifications for my own.

U1 seems to be set up in a two stage voltage detection scheme. When the voltage on Pin 4 and Pin 12 is above a certain level (speed) it switches Q5 to turn on the additional LEDs. I guess I could use a 556 chip in a Schmitt trigger configuration to accomplish the same task? I would prefer to do this as I have a few 556/555 timers knocking around, rather than having to order a specific chip for this project.

For the standlight part of the circuit I was thinking of getting rid of U2 and replacing the (single?) 1.2V NiCd/NiMH with a NiMH 3.6V battery pack such as:

[[https://]]www.buyabattery.co.uk/3-6...MeOO3zZtcKZQ47PHji4q96ZZEcCHucBdYQaAiZZ8P8HAQ

(I have butchered the https://, assuming the forum does not allow new users to post links).

This battery pack would hopefully be capable of running a single led without being boosted. Would this be a reasonable assumption?

Thanks for any input.


Hi there

First thing, Steve's circuit works perfectly. Any issues I have had have been my fault!!

I used cheap LEDs from the East, and didn't get good results. Using genuine ones have reduced a lot of the flicker, if not all of it.

I do need to rebuild the board as for some reason the high speed LEDs were not lighting up any more. I made a few mistakes on my PCB too, I hope to redraw it when I have time.
I have used the NiCad battery like Steve mentioned. It started off being a huge 2500mA job, but I don't need the stand light on for that long. Now I have a little 1/2AA size 650mA, which will be plenty. I could only buy them in packs of ten, so I can always double up if I find I need it to be a little longer.

I have printed a housing on my printer for the PCB and battery. I'll post up pics when it's done
 

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
I have used the NiCad battery like Steve mentioned. It started off being a huge 2500mA job, but I don't need the stand light on for that long. Now I have a little 1/2AA size 650mA, which will be plenty. I could only buy them in packs of ten, so I can always double up if I find I need it to be a little longer.

I have printed a housing on my printer for the PCB and battery. I'll post up pics when it's done

There are 1/2 AA's? Neat! I don't have a history of reworking my existing lights to take advantage of new stuff, but will keep this in mind. The big supercap in my most recent light is working out nicely, but it really is huge. I'm not sure whether I'd recommend nicads or supercaps to someone starting a new design.

The 3D printed housing sounds like fun! Let us know how it works out. Curiously, a person might think that the electronics of a LED light would be the hardest part, but I think I've spent more time just getting the mechanical details worked out. The ability to design & make a plastic housing could be quite useful.
There have been times in the past when I've just coated the circuit board in a few layers of Plasti-dip, glued it onto a mounting bracket, and called it good. Not pretty, but worked much better than it had a right to. :)
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
There are 1/2 AA's? Neat! I don't have a history of reworking my existing lights to take advantage of new stuff, but will keep this in mind. The big supercap in my most recent light is working out nicely, but it really is huge. I'm not sure whether I'd recommend nicads or supercaps to someone starting a new design.

The 3D printed housing sounds like fun! Let us know how it works out. Curiously, a person might think that the electronics of a LED light would be the hardest part, but I think I've spent more time just getting the mechanical details worked out. The ability to design & make a plastic housing could be quite useful.
There have been times in the past when I've just coated the circuit board in a few layers of Plasti-dip, glued it onto a mounting bracket, and called it good. Not pretty, but worked much better than it had a right to. :)

Light Box by

Yes, those little 1/2AA batteries are perfect for this, and small enough to add a second one if needed.
There is a render of the housing. I have printed one in black. It will mount under the stem, with two holes for the cable gromets and one for the stand light switch. Zip tie holes on the under side. It will be waterproof but I'll still plasti-dip the board once it's working correctly.
Sometimes the mechanical mounting can be more challenging than making the light, I agree!
 

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
I'm assuming the three holes in the housing are for LEDs... if so, how do you provide heatsinking for the LEDs? Perhaps we've discussed this before... my brain is telling me that the light might be coupling the heat to the stem.

the only other issue that springs to mind is the need to adjust the tilt/elevation of the light. Did you work this out prior to completing the design, or is there a method for adjusting it? The easy method would be to just add a little shim material between the light and the stem.
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
Nooooo!!!!
That's just a plastic housing for the circuit and the battery. Two holes for the cables in and out, one for the switch. I'm still using the Magicshine housing for the actual light. It's mounted on the end of my aerobars, ahead of all my luggage.
It's a Chinese housing but 'proper' LEDs and optics.
 
Last edited:

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
sorry... I was thrown off by the use of equal size holes. :)

Clearly, I need to see this all built up and installed! Looking forward to photos!
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
That's ok, it does look like some of the available light housings.
I'm desperate to get it finished, then I can start riding to work again. There will be pictures galore when it's finally done!
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
Untitled by , on Flickr

This is what it'll look like. I rebuilt the circuit with new components, checked that every trace on the circuit is correct. I THINK I had a few more errors on my first build. It's ready for testing tomorrow evening...
 

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
Neat! Always good to see something turn out the way you hoped, as well as being pretty good looking.

I'm a little jealous of those who've done a 3-D project like this, but I'm still trying to develop my LT Spice skills and find time for various projects. Plus... I don't have a need to have something 3D printed either, but that's not really a show stopper. :)
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
Well, not good news. I rebuilt the board with new components, except for D1 which I reused. The high speed LEDs still do not turn on.
I did some fault finding and worked out; (all voltages measured to GND)
All four LEDs can work when the link to short out the top LEDs is removed.
With four LEDs burning, V_LED is only 2.9v (~11mph on a 700c wheel)
With two LEDs burning (other two shorted by Q7), V_LED is 2.1v

VDD is at around 5v all the time, regardless of speed
Pin 10 (output that drives Q5) is around 4v regardless of speed. This never goes LOW when over threshold speed. This is the problem.
Pin 9, always 0v
Pin 6 rises with speed, always lower than Pin 10.
Changed the value of R1 from 78k to 50k, hoping to see a change, nothing.
I removed the connection to the IC on Pin 4, all four LEDs burn as expected.
I found that as soon as the wheel turned, the 4 leds flashed, but then Q7 shorted the two as soon as it was powered sufficiently. As expected in the current situation.

Could the charging / standlight part of the circuit effect the upper part of the circuit??? I'm going to cut the traces that are either side of the third LED just to eliminate it.

This is annoying me. The circuit DID work. It lasted a 24hr mountain bike race. Even the brand new board, populated with new components and new LEDs, doesn't work. It'll be a glaringly obvious error, but I just cant see it!
 

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
there shouldn't be any interaction between the standlight circuit and the switching of the two LEDs.

I'm not sure why you are seeing a lower voltage across each LED when two are shorted, versus a higher voltage when all four are powered (I presume that the dynamo is running at the same speed in each case). Is 2.1V even enough to produce any light? It wouldn't be much at all.

It's hard to troubleshoot stuff remotely, but before you get too destructive, I'd recommend using a magnifier to examine the board for any metallic debris, especially tiny solder splash/solder balls. It's amazing how much crap can be on a board without it being obvious to the naked eye. This stuff can cause all sorts of trouble. Since my prototype boards are made by cutting slots in copper-clad board, I've probably got a lot more experience with finding stray bits of metal hiding on the board and causing trouble.

I also had trouble with a Maha battery charger, with intermittent misbehavior. In the middle of troubleshooting one problem, a low-resistance shunt caused one critical signal to get pulled to ground, and I ended up tearing up a bit of the circuit to try to find it. It appears to be located at a transistor that is surrounded by tall parts, and I can't get to it. My guess is that the original trouble was due to 10 years of dust and goo accumulating and causing a shunt conductance. It caused one battery to overcharge and leak acid onto the board, and I've been trying to clean that up and checking the operation. While examining the board, I found more than a few little solder balls scattered around IC pins and such. I'm buying a replacement charger, but I think I'll have to spray some conformal coating on the board to keep this from happening again.

I'd recommend checking the voltages and waveforms on the circuit and writing it on the schematic. This usually helps me track what looks right and what looks wrong. I'd be hesitant to cut traces.... my preference is to lift a pin or pull off a resistor. Or maybe pull stuff high or low with a wire soldered to power or ground?

Can you post a schematic? That might help me evaluate the signals that you measured.
 

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
some more thoughts....

post #102 has my schematic. I'll assume that the speed detection portion is the same as Mr. Piesoup's.

Let me respond to some of Mr. Piesoup's observations..... (and I'm just guessing that I've got the html commands for quotes right??)

All four LEDs can work when the link to short out the top LEDs is removed.
With four LEDs burning, V_LED is only 2.9v (~11mph on a 700c wheel)
With two LEDs burning (other two shorted by Q7), V_LED is 2.1v

The fact that opening the link (the traces for the transistor) to short the top LEDs leads to getting roughly the correct voltage across the LEDs is a good sign that the problem is with the speed detection circuit.
With only two LEDs powered, and at a decent dynamo speed, there really should be 2.9V across each LED that is powered.

VDD is at around 5v all the time, regardless of speed
Pin 10 (output that drives Q5) is around 4v regardless of speed. This never goes LOW when over threshold speed. This is the problem.
Pin 9, always 0v

Vdd should be roughly equal to the total voltage across the LEDs, or to the zener diode voltage. Where is the 5V coming from, or determined by?
Pin 10 is stuck high, and pin 9 is stuck low. Since they both indicate the same state, that suggests that the output of the 2nd one-shot is working correctly.
Of the things that might cause this, the first thing that comes to mind is the Reset pin, pin 13. It should be pulled high, to Vdd. Is this being done? ...and has the voltage at pin 13 been measured?
The other culprit would be Input B. If it goes low, this should force Q high, although I'm not sure that it would keep Q high after the normal pulse duration. It wouldn't be a bad idea to check the voltage on the B input, though (pin 11).

Pin 6 rises with speed, always lower than Pin 10.
Changed the value of R1 from 78k to 50k, hoping to see a change, nothing.
I removed the connection to the IC on Pin 4, all four LEDs burn as expected.
I found that as soon as the wheel turned, the 4 leds flashed, but then Q7 shorted the two as soon as it was powered sufficiently. As expected in the current situation.

Pin 6 should be pulsing high when it gets an input from the dynamo. Assuming that it is being measured with a voltmeter, then it should look like it is lower than Vdd (which is what pin 10 should be measuring as). Based on this, it seems that the first one-shot is working at low speeds.
What does the first one-shot do at high speeds? Pin 6 should stay high, and pin 7 should stay low. An incorrect selection of the RC values might cause it to expect a much higher speed before it stops shorting out the two top LEDs.
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
Thank you for the detailed response!
I can drive the front wheel by resting it on the chuck of my lathe, so when I measure the voltages mentioned above, I know the speed will be constant.
I too, in my limited knowledge of electronic circuits, was baffled by the 5v VDD and the low voltage measured at V_LED. I'll measure it again tomorrow evening.

Thank you for explaining the workings of the circuit too. Before, I had no idea of what each component did, now I have a fairly good idea! Pins 1 & 2, 6 & 7 is the first one-shot, correct?
 

Steve K

Flashlight Enthusiast
Joined
Jun 10, 2002
Messages
2,786
Location
Peoria, IL
......
I too, in my limited knowledge of electronic circuits, was baffled by the 5v VDD and the low voltage measured at V_LED. I'll measure it again tomorrow evening.

under normal circumstances, Vdd should be equal to the total voltage across the LEDs. If you have just two LEDs on, and there is 2.5V across each, then it makes sense. However, it still doesn't make sense to not have roughly 3V across each LED.

Thank you for explaining the workings of the circuit too. Before, I had no idea of what each component did, now I have a fairly good idea! Pins 1 & 2, 6 & 7 is the first one-shot, correct?

yep, the first one-shot has pins 1, 2, 6 & 7. This is where the clipped dynamo voltage is fed into.
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
Only a quick question and I HOPE it's the cause of the problem...
at 11mph, 147 wheel rpm I measure 31Hz from the dynamo. But I ALSO measure 31Hz at V_LED / VDD at the same speed. Shouldn't it be double that?? Hence the one-shot never sees a freq high enough to change state? That would explain the flicker too.
I will measure it again in the morning to be doubly sure. Then it's something to do with the the FETs. Hopefully!
 

piesoup

Newly Enlightened
Joined
Oct 31, 2008
Messages
114
Location
East Anglia
Yip, the frequency is exactly the same before and after the fets. PLEASE PLEASE PLEASE tell me it should be double the freq after the FETs!
 

Latest posts

Top