Thursday, December 22, 2011

Flashing dynamo light prototype

As I've discussed previously, I'd like to build a dynamo powered lighting system with a powerful standlight and the option of having the lights flash.  This is a feature that doesn't seem to be available on commercially available dynamo lighting systems, which don't flash and typically have rather weak standlights.  It took me a long time to develop the circuit and I got a lot of help from the fine people on CPF, particularly in this thread.  After a couple of months of tinkering I had a working circuit breadboarded.  It charges a 20F supercapacitor using a current limiting load switch and uses a Zetex boost driver to power the LEDs while stopped.  A high side P-channel MOSFET switches the LEDs between dynamo power and capacitor power and a low-side N-channel  MOSFET is used to flash the LEDs with the output of a (special low-voltage CMOS) 555 timer.

Now the challenge was to turn the breadboarded circuit into something that could fit into the housing of a vintage lamp.  This is what I started with:

Breadboarded dynamo circuit with standlight.
First, I needed to capture the schematic:

Schematic of flashing dynamo standlight circuit (click to enlarge)

I used EagleCAD to do this, which is a very capable and free piece of schematic capture and PCB layout software.  Most of the components I had to make in my own custom library, which I'll eventually post someday.  Most standard packages (SOT23, 0805, SOIC, etc) are already available.  I placed the parts as logically as I could and used the autorouter, which did a pretty darn good job of routing everything in a circle about 1.6" in diameter.  My design rules included larger minimum trace widths and more generous spacing around components than the default rules. After much revision, I wound up with a two-sided PCB design:

PCB layout in EagleCAD
Sparkfun has an excellent PCB layout tutorial using EagleCAD.  I sent the Gerbers off to BatchPCB and a few weeks later received the boards:

BatchPCB boards. Not bad for $3 each!

Now came the hard part.  In order to keep things small I chose all surface mount parts.  I don't have much experience soldering SMT components, but there are several tutorials on Youtube plus some from Sparkfun.  After a couple of hours I felt I had the hang of it and wound up with a reasonably good looking board.   For most components I used a soldering iron and occasionally would resort to using a hot air rework station.

Populated PCB. Huge 20F supercapacitor dominates!


It really wasn't as bad as I thought it would be.  Fine tweezers are essential!  Having a stereomicroscope didn't hurt either (all the time I spent dissecting fruit fly larvae brains and injecting zebrafish embryos is finally paying off...).

To my amazement, the whole thing worked on the first try.  The only problem was that I didn't include an input capacitor for the 555 timer which I had on the breadboard.  Without it, the 555's output is very erratic while the supercapacitor is charging.  I soldered a 10µF leaded capacitor across pin 1 (GND) and pin 8 (Vcc) of the 555 and it worked exactly as it did on the breadboard.  Revision 1.1 of the PCB will have to correct that!

The 6.8V Zener, which regulates the input voltage, gets darned hot as it shunts all the dynamo current during the off cycle in flashing mode.  This could cause a potential failure of the Zener.  I need to test it extensively to see if it fails. If it does, then I'll have to figure out what to do with the dynamo voltage when the LEDs are disconnected during the off period of the flash.  No ideas yet.

Another potential pitfall is that the LEDs are connected in series, so if the rear light becomes disconnected, the  series circuit will be broken and the front light won't work.  The advantage of being in series is that both LEDs get the same current, simplifying the standlight circuit. For now, I think it's a good compromise.

1 comment:

Jason P said...

Perhaps you could use an LM317 for your main regulation, instead of a Zener diode. I was under the impression that the Zener should have a resistor in series to the input voltage.
Nice blog btw. :)