A tea break challenge to you
For the purposes of clarity I have to reveal at this point I occasionally make dynamo-powered bicycle lights, and that the last two An Engineer in Wonderland entries are parts of this winter’s planned front light: the Mark V
Safety note: Do not charge Li-ion cells below 0°C, as they can be damaged, and sometimes behave dangerously, unless you are sure the specific type you are working with allows this.
Eventually the whole thing will be linked up by a microcontroller, but as I have yet to finish testing a surprisingly large amount of code – I finally rewrote the whole thing using a state-machine rather than the rat’s nest of flags that graced the MkII.
So I need a nice simple hardware controller to road test the analogue bits now.
The criteria for input and output of the mystery box are:
Moving – led power comes separately from dynamo
Pulses at the input
Output low to hold off current source.
Stopped – led power needs to come from current source
Pulses stop, input stays high.
Output high to make current source feed led.
Parked – button push initiates micro-power shut down.
My solution is below.
This blank bit is in the interest of not spoiling your fun if you want to have a go without mental contamination.
If you can’t wait, and still have some curiosity, scroll down now.
Here is my solution – as yet untested – it uses half a hex Schmidt inverter chip and a whole lot of discretes.
I also have a version of the above using many discrete NPNs and PNPs, but my feeling is that there must be a much simpler answer, likely using a programmable unijunction transistor or some other wonder that most folks have forgotten about.
If not that, at least a circuit with fewer components.
If I have got it right, the circuit will work like this:
Schmidt S1 and the RC on its input acts as a movement detector.
S1 output goes immediately high when the NPN receives pulses indicating movement and discharges the capacitor through the diode.
Through the output capacitor, S1 flips the state of the flip-flop formed by the other two gates turning off the current source.
The RC time constant is long enough to keep S1′s input below its 66% switching threshold until pulses stop, a time constant of half a second should be fine.
When it does time-out, S1 output through the capacitor flops the flip-flop and turns the current on again.
The other diode is a belt-and-braces way to keep the flip-flop holding off the current source during motion, and the push-button acts on the same point to turn off the current source when parked.
A benefit of the circuit, I claim, is that nothing interesting happens if the button is pushed when the bike is parked so kids will get bored if they mess with it.