A 540 lumen Luxeon Star Endor Rebel bike light powered by a Makita 18V Li-ion battery.
This project is a combination electronic/mechanical design. In fact, there's a lot more time spent on the mechanical design and machining than in the simple Atmel AVR µController. I'll be presenting this project in three major parts: The battery pack adapter; the light housing; and the AVR control circuit. In the project sources, I provide the full AutoCad 2008 3D models, and some simple 2D working drawings (not complete prints, just enough information for me to machine the parts).
I've seen quite a few LED bike headlights presented on the Web (i.e. HOW TO - Make the ultimate 18v Bike Light!, Google for more), but I always thought they could be made much smaller and more professionally.
First, was a quick web search for high output LED modules. The one that really stood out in front was the 540 lumen Luxeon Star Endor Rebel. Really nice additional benefits were the pre-engineered, extremely small, buck power bricks available, as well as lenses to focus all the light energy from the LED module. I placed an order for some LEDs, a couple of BuckPuck drivers, and some lenses.
The BuckPuck drivers are really neat. In addition to the given constant current output, they provide output short and open protection, regulated 5V to run a µController, are dimmable, and have an input which shuts of the LED output without having to disconnect power to the module. All this at 95% efficiency and no additional heatsinking required!
With the business-end taken care of, it was now time to think about how to feed it. I really did not want to manufacture my own battery pack and come up with a homebrew charging system when there are many rechargeable tool battery packs and chargers easily found, and inexpensively bought, on eBay. A quick trip to the home center to look at rechargeable power tools, and I selected the Makita LXT 18V battery system because of the availability of a smaller 1.5AH battery, the lightness of Li-i0n compared to Ni-Cad, no memory effect, and the battery/tool attachment method. The battery attachment method was critical because I needed to "reverse engineer" the tool base to make a battery holder for the bike.
The Battery Holder
I scored a two pack of brand new Makita BL1815 batteries and a DC18RA charger off of eBay for a steal. The first step once I had the batteries in hand was to take dimensions from them and create an AutoCad 3D model of the corresponding female receptacle. Power connection to the light is via a 2.5mm coaxial power plug like that commonly found on wall-wart power supplies. I bought a short power extension cable molded ends and cut the ends off to use on the bike light. The female straight connector pressed into a hole in the battery housing, and the right angle male end attached to the light module.
The adapter housing was machined from black Acetal Homopolymer (Delrin™). The battery contacts were machined from copper bar-stock, tin plated, and attached with 4-40 screws. Along the back of the battery terminals is a small PC board with two 0.110" female spade terminals to act as a receptacle for a 2A ATM Mini fuse.
The battery adapter mounts on the threadless handlebar stem of my bike with a cap attached by four stainless 4mm SHCS, and the Makita battery just slides in and locks in place the same as on the power tools. You can either use the smaller BL1815 1.5Ah battery as I have, or you can use the larger BL1830 3.0Ah battery. The 1.5Ah battery should provide about 3 hours of lifetime on the High setting, 6 hours on Medium, and 46 Hours on low.
You probably already noticed that there's a mixture of metric and imperial fasteners on this project. I'm an American Expat living in China, so this is made with what I had on-hand and what was available in the street markets around here.
The only machine tools used were a manual Bridgeport milling machine, and a manual engine lathe. I wish I had CNC equipment available - it sure would have made life easier. 5 minutes of CNC cutting turns into 8 hours worth of work when you have to generate chord segments in Excel and crank machine handles to 30 individual coordinate locations to approximate one single arc!
Here's a little photo montage of the battery housing construction:
I start by squaring up the stock, then milling the profile for the bottom.
I next cut the pocket and the recesses into the bottom, and tap the holes.
Here I've taken the tin-plated contacts and installed them.
And here's the battery assembly.
The Light Housing
The Endor Rebel LED generates some heat as we pump 0.7A through it at 9V. Therefore, it needs a heatsink, so that pretty much means the housing we design needs to be made out of Aluminum and needs good physical contact with the LED's aluminum base. So, again we start with a 3D CAD model. The first thing we need to do is model the actual Rebel LED since everything else grows from there.
Since the BuckPuck supply was a nice compact design, I envisioned combining the LED emitter (yellow object on right) and lens (cyan pyramid on the right), power supply (gray rectangle in the center), and control circuitry (PCB is magenta on the left), in one package. The challenge was how to keep this entire package water resistant. To keep the water out, I've sealed the lens to the housing (green) with a 21mm OD x 1mm thick O-ring (gray), and covered the electronics end with a vinyl cap (blue). The flexible vinyl cap (Mocap P/N HT201-002 1.250" Dia x 0.5" long high temperature vinyl) also lets us operate the dimming pushbutton (black square and gray rectangle on left) simply by pressing the outside of the cap.
The cyan part at the bottom of the image above is one of the lucky finds on this project. My wife's bike has a little CatEye single LED light. It's okay for around the town where there are streetlight to light the way and the bike light is really only used for others to see you, but it has a great mounting system. A quick check of their website turns up replacement parts - you can get the complete handlebar mount for around $5.00 (H-32 Bracket and spacer)!
The blue plate just left of the LED emitter is a heat conductor. It conducts the heat from the LED to the outer case. While making the light water resistant was one challenge, the biggest one was fitting all the parts in such a small space and mechanically fastening the who assemble together. As you can see, the red screws take up a lot of the space and the ones inside the housing are already #4-40, so I didn't have a lot of room to throw in a bunch of fasteners.
The whole thing is held together by the two screws on the left. Those pass through the PCB, then a spacer which locates the BuckPuck retaining plate which goes on next, and finally another short spacer. This all presses up against the heatsink plate and threads into the housing squeezing everything together. A little thermal grease behind the LED and a little more around the face of the heatsink plate where it seats against the housing, insure that the LED stays below the smoke point.
Here's a parade of pictures machining the housing. First I started with the LED mounting plate, then onto the internal portion of the housing. Because of the partial holes in the housing needed to clear the LED mounting screws, those holes need to be drilled before the bores are made. So, the stock was faced off in the lathe then moved to the mill where the six small holes were drilled. Then, back to the lathe for finishing the internal boring. The part was then sawn off from the stock. The remaining stock was used to turn a mandrel that was first used to turn the OD of the PCB.:
The mandrel was then split and a pipe plug was used to make it an expansion arbor. Short pins were inserted in the tapped holes used to mount the PCBs. These pins located the #4-40 tapped holes in the housing interior, and the whole thing transferred back to the lathe to turn the housing OD Back to the mill and the mandrel and part are mounted on a rotary table to add the holes to the outside and do the finning:
The final piece to be machined was the CatEye mount adapter (yellow at bottom of the section image). These two are aluminum, but the one in the assembly photos was machined from some scrap Delrin left over from battery housings.
One change from the CAD model was the substitution of Phillips pan head screws for the SHCS that were modeled. Again this was necessitated by availability and required turning down the OD of the fastener heads. Phillips #4-40 screws are also used to secure the CatEye adapter plate to the bottom of the housing. The heads of these screws must also be turned as the fit into recesses on the top of the CatEye spacers to prevent the spacer from turning.
The Electronics Package
Compared to the machining, the electronics are a piece of cake. I'm using an Atmel AVR ATTiny13 to control the brightness. +5V Power for the µController is provided by the BuckPuck, the BuckPuck brightness control pin is driven by a PWM signal generated by the µController, and the human interface is a single pushbutton.
There are three connectors on the board; one for the BuckPuck, one to connect the LED, and one for incoming power from the battery. The battery and LED connections use 3-pin connectors to prevent reversing power and ground. Unfortunately, there is nothing to prevent hooking the connectors up backwards, but they are labeled.
The ATTiy13V is socketed since there was no room on the board for an ISP connection and programming will need to be done off-board. Luxdrive recommends a 200µF filter capacitor. Because of space constraints, this was split into two 100µF capacitors. The switch was trimmed at final assembly to just clear the vinyl cap.
Following are the PCB assembly photos and the electronics package construction:
The 3021 BuckPuck with Control/Dimming capability can adjust the output current to the LED based on a 0-5V control signal. Based on the datasheet, full output current is available when the control signal <= 1.65V +/-5% and output current is 0 when the control signal is >= 4.2V +/-5%. LED current is linear between 1.65V and 4.2V. However, this does not seem to be the case when working with a PWM signal. A 0-5V PWM signal provides full control from 0% to a 100% duty cycle.
It should be noted that the frequency of the PWM signal does not appear make a difference in the efficiency of the BuckPuck; it does make a difference in the response curves. A higher frequency PWM signal flattens the PWM % vs. Output Current curve at the low current end giving finer control over low light levels. The graphs on the left show the relation of input current to the BuckPuck, output current to the LED, and PWM frequency as a function of the PWM value from 0 to 255 (PWM of 0 is full on, 255 is no light output). You can see the yellow and cyan curves denoting a 4.69KHz PWM frequency flatten out above a PWM value of 234.
These graphs will also let you estimate run times of the light at various light output levels. For my bike light, I chose to have three levels available. A high output useful for blinding anyone in the vicinity resulted in a current draw from the battery of 508mA giving right at 3 hours of light at this level. My medium level, which I use most of the time, draws 228mA resulting in 6 hours of battery life, and when in town, I use the low output which is still much brighter than my wife's CatEye EL320 which has a claimed 1000 plus candlepower. This gives me over 45 hours of runtime.
A final note about output levels has to do with the "off" setting. Turning the light off does not really turn the device itself off. The BuckPuck and the µController are still running and consuming around 7mA of current. Don't worry, if you forget to unplug the light's power cord from the battery at the end of your ride, it will still stay powered up for another 9 days or so.
A single pushbutton is used to control a software implemented state machine. Currently there are three steady brightness levels and two pulsed brightness levels. The pulsed modes are used to increase other's awareness of the rider without periodically completely extinguishing illumination as some flashing bike lights do. It is hoped that this will still increase the riders visibility to others without the rider having to deal with his path going dark ever second or so.
The BikeLight remembers the last used mode before power off and returns to that mode after the first button press to power it back on. A shortcut mode enables one to quickly go to steady full-on mode at any time without cycling through the remaining modes.
The shortcut mode toggles between steady full on and the previously selected mode. To enter the shortcut mode, the pushbutton is held for 1-second. A 1-second press turns on steady full on mode, and the next 1-second press reverts to the previous mode.
To turn off the LED, press and hold the button for 2-seconds. The BikeLight is in standby mode in this state and will continue to draw approximately 7ma To completely power down the BikeLight, disconnect the battery. To turn the light back on, or to change between output modes, a quick press is all it takes.
The Finished Product
And we'll end with a few photos of the final assembly and the finished bike light:
A Little Anecdote about Chinese Quality
Take a close look at this photo to the right. I bought a handful of the power cord extensions at a local electronics market in Suzhou, China where I live. I put these on my first bike light I made and spent a good couple of hours scratching my head why the damned thing wouldn't work. I finally narrowed it down to where it couldn't be anything else, so out came the X-Acto knife and I dug out the truth.
In the closeup, you can actually see where the over-mold plastic flowed around the cut ends of the wires and into the receptacles's center conductor where one of the wires should have been soldered. The whole batch was this way. Like a lot of things in China, it just needs to look OK to make a sale, it doesn't really have to work!
Disclaimer and License
It worked for me so it should work for you, but no guarantees. Feel free to use the schematics, drawings, and information on this page as you see fit, but a little attribution would be appreciated.
Questions about, or problems with this site?