Lighting control circuit, fixed, working.
April 25, 2009
(2010-12-30) I’ve continued to work on this, if you are seriously interested, see also:
Light fabrication (older)
More light fabrication
More compact PCB, circular Just a picture of a PCB, but pretty.
Standlight switch PCB
Standlight and its (now obsolete) software
Packaging the PCBs appropriately The board has to go in something to protect it from the weather. This is my best effort so far.
I’ve been tweaking the resistor values, and software, haven’t gotten around to publishing any of it yet.
When I finally tested this circuit on a real bike connected to a real hub, it didn’t work right. I got light, but it was flickery when slow, and I seemed to notice a little more drag (this had to be in my head) than the old 350mA system, and more important, the system voltage never made it above 9 volts; no chance of charging standlight batteries using this design as a starting point. The discrepanies from the plan (too much power to lights at lower speeds) pulled too much current from the hub, so it did not run in the more efficient mode.
I figured out the difference between the model and reality, tweaked the model, and then it tracked observations. With that, I could test a fix before soldering it in, and it worked just fine.
First in-the-field update — vibration cracked off the lead to one of the LEDs, which allowed a test of the voltage shunt. It worked — 300+ lumens from the overvoltage shunt, POW. So the shunt works, too. I haven’t yet managed to activate it with mere speed, up to about 25mph (and now my speedometer is busted, so further measurements need to wait on that).
The fix was to realize that I had not included the resistors used to set the precision voltage sources in my model — they’re voltage sources, PLUS a resistor.
This yields this graph of circuit behavior, which checks out against the actual board. It’s not exactly what I want because the current rises above 200 milliAmps before the cutoff knee, but it’s not far off, and it tests ok in real life.
On the actual bicycle, it has the following desirable attributes:
- Flicker stops between 3 and 3.5mph (5-5.5 kph)
- Lights are on “pretty bright” at 5mph (8kph)
- The system voltage is around 20 volts at 10mph, rising to about 24 volts at 20mph
- The shunt has not yet proved necessary. It trickles about a half a milliamp through the dump, which is more than planned, but not enough to care. This is enough to put the barest light into a power LED.
I have not yet run it down a big straight hill to see if I can force enough current through the shunt to get serious light out of the shunt power LED. The circuit below is the old one, with the obvious repair of the wrong choice of op-amp pinout. For grins, if you view the image and remove the width limit (“?w=700″), you can check my solder work. It’s uneven in two places — the diodes have big wires, in the middle of big pads of copper, and the replaced resistors were done outdoors in the breeze, with a new (and somewhat unfamiliar) soldering iron.
It could still be improved, of course; the board is relatively big and non-compact (then again, that made it easy to work on, so no complaints) and a standlight function would be ducky. I’ll work on that next, in my copious free time.
If you want one of your own, you can get the parts from Digikey, and the PCB from BatchPCB.com. You’ll need to refer to the schematic and board pictures below to get the component values right. Be sure to get an LM258 (not LM358) if you intend to use this in freezing weather.
New board, with fixed opamp selection, and fixed resistor values.
If you want to play with this, here’s all the files.