# All-in-one LED bike light



## mattthemuppet2 (Sep 23, 2018)

last winter I felt the need for a non-flashing bar light on my commuter. I have a non-flashing light on my helmet (very helpful for the "please don't pull out and kill me" moments) and a flashing light on my bars, but the strobe effect on my bars is a bit distracting in the dark and a non-flashing bar light would get me more forward visibility and let me keep the attention catching flashing light.

The mechanic at my local bike store also gave me the guts of a Lezyne all-in-one front light (battery is part of the light), so I'll be using the control/charging board from that, which simplifies things a bunch.

anyway, design will be 2 LEDs in parallel (Cree XP-G2 and XP-L) with 10deg optics, the Lezyne Macrodrive board, 2 Panasonic NCR18650B batteries (~3400mAh each) in parallel, momentary switch at the back. This will also be my very first "from solid" bike light, now that I have a mill. One cavity on the front for the LEDs with a nice thick piece of lexan, which should also give some side lighting. One cavity underneath for the batteries and driver.

Squared up a nice piece of alu to the right size last night with my facemill (about to start the larger side)






and bevelled the edges with a 90deg router bit





next up is drilling the holes for the charging port and switch, then starting on the LED cavity


----------



## mattthemuppet2 (Oct 3, 2018)

finished the back end - hole for a charging cable and switch, plus some grooves for water breaks and cooling





cut off the excess material at the front of the light using the bandsaw





cut the overhang to size and the recess for the lexan front plate





now need to grind a face grooving cutter for the o-ring grooves and bore the recesses for the LEDs


----------



## mattthemuppet2 (Oct 4, 2018)

did the layout for the LED recesses and o-ring groove





and ground a broken 2mm endmill () into a face grooving tool





however I ran out of both clearance between the tool and the overhang and energy, so I'll grind the tool down to fit, hopefully tonight.


----------



## mattthemuppet2 (Oct 5, 2018)

ground down the shank of my face grooving tool last night and cut the o-ring grooves. 





Then drilled and started to bore one of the LED recesses. first time boring on the mill, boy it takes forever compared to the lathe! Should be able to finish off the LED recesses this weekend, after I've cut the grass, built some shelves for the shed and given my bike a service (new chainring, chain, clean cassette etc).


----------



## mattthemuppet2 (Nov 12, 2018)

took a while to get back to this, but the nights are drawing in and I'd like to get it done sometime before 2019..

finished the LED cavity bores by setting the body up in the 4 jaw on the lathe. Took longer to set up than on the mill but WAY less time to bore. Made the 1st of 4 screw ups - one cavity is 0.35mm deeper than it should be, so I may need to make a thin shim under the optic (or LED) to make sure the front plate holds the optic in place.





the 2nd and 3rd screw ups were related to drilling the holes for the LEDs and cover plate. The LED screws are slightly off center in the bores (a smidge too high) as I indicated off the outside of the light instead of the bore of the cavity. Won't do that again. 3rd screw up was a 7/64 drill that made it into the number section of my 115pc jobber drill index (it's a bitsa!) which I used instead of the #39 drill I needed for a 4-40 form tap. Still enough thread depth to hold, but annoying never the less. Got the face place drilled, countersunk and chamfered at the edges.

finished the recess for the bottom cover plate and chain drilled the cavity out with a 3/8 drill. Cleaned that up and roughed to depth with a lovely new 3/8 3 flute coarse rougher. Next up is to finish the sides with the 3/16 long reach finisher and start cutting the features in the bottom for the driver and batteries.





nice pile of chips 





screw up #4 and the biggest one of all





anyone see a problem here? Yep, messed up my dimensions and don't have enough length to fit the driver/charger board 

Oh well, guess that gives me a good excuse to build a 2 channel driver that I had designed years ago. For the charger I can use one of the microUSB charger boards that I used in my tail light build. Just have to redesign the innards to fit everything in there.


----------



## mattthemuppet2 (Nov 23, 2018)

Made some more progress on the light. Main body is almost finished, need to make a bracket to attach it to the bars, a bottom plate and a plug to seal the charging port.

channels for the batteries were cut with a rather lovely 5/8 3fl ball nose end mill. With a few thou step over each side of center a 18650 battery fits very snuggly. Small groove cut for the charging board at the back, drilled and tapped a hole for a retaining screw this morning (not in pic)





grooved the sides with a 4mm endmill for cooling and to remove a bit more weight. This light is still going to be heavy, but it's my first one piece light so I didn't want to push things too far. It'll also be bomb proof, which is important for a light that'll be used as much as this one will.









I pulled something in my lower back working on the shed last weekend, so my wife is confining me to the couch when she's around. Progress will be slower than intended.


----------



## mattthemuppet2 (Nov 25, 2018)

back is feeling a bit better and the wife is out and about, so got some more work done on the light today.

Finished the bracket, which will connect the light to a handle bar bracket. Broke a lovely M4x0.7 form tap in the process which I was very sad about.










both sides were supposed to be solid, but I overshot and went into the side relief. Oh well, it should be plenty strong enough as is.

Finished the grooves on the top of the light too. Here's what it looks like with the bracket attached. The bracket is slotted so the light can be adjusted left or right of center as needed.






next up, the bottom plate. This will be a little tricky as it will project inside the light cavity and have an o-ring groove around the perimeter of that projection. The bit projecting inside will also be relieved and have a drilled/ threaded post to mount the driver. Then the outside will have 4 countersunk holes for attaching it to the light and some more grooves.


----------



## Ulma Doctor (Nov 25, 2018)

wow matt the creation looks great!
very nice work.
i can't wait to see the end product!!!


----------



## mattthemuppet2 (Nov 25, 2018)

thanks! It's been quite the learning experience so far. I'd say this has been  the most complicated thing in terms of dimensions and fitting components together that I've done on the mill so far.

I can't wait to finish either, it's getting dark earlier and earlier, plus I need to start on the wife's christmas present pronto! Once the bottom cover and charging port plug are made, the whole lot needs to be cleaned and anodised. Then I need to reflow and program the driver. Then I can start putting it together. Hopefully by Christmas


----------



## mattthemuppet2 (Dec 2, 2018)

bottom plate is done

marked out, drilled, clearance drilled, form tapped 4-40 and countersunk all the screw holes





brought the surface down to the right height with a face mill, then cut and chamfered 3/16 grooves





bottom of the cover has a 1/16" o-ring groove around the periphery, a tapped post for the driver and the rest cut away to save weight.





and the other side





only thing left to do is make the charger port plug which I'll get to this week.

current weight of the body+bottom plate+bracket is 159g (bracket is 9g). Given that the original block should have weighed ~600g that means I've removed 75% of the original piece of metal!


----------



## Moper361 (Dec 3, 2018)

Nice work


----------



## mattthemuppet2 (Dec 3, 2018)

thanks!


----------



## mattthemuppet2 (Dec 5, 2018)

last bit of machining done thanks to HW's funeral shutting down the whole Texas A&M system.

charger port plug. The o-ring at the end is for sealing, the one in the middle fits into a groove cut into the bore of the hole that the charging cable will go through. Took some finessing to get the groove depths right that the plug fit snuggly without being hard to get out.






in place





also made the o-rings for the bottom cover and the LED face plate, using some 1.5mm o-ring cord. Both plates seal well and you can see that there is 100% squish around the o-ring for the LED face plate when the face plate bottoms out against the housing. 





This light shouldn't let water in even during one of my "biblical" bike rides where I feel like I should be swimming home instead of riding.

Next up is anodising, after that driver construction and programming.


----------



## mattthemuppet2 (Dec 6, 2018)

3 out of 4 parts are dyed and anodised. 

Thorough cleaning with acetone first then Dawn dish soap until they pass the water break test. You can't see them very well, but hydrogen bubbles are coming up from the anode.





broader pic of set up. Bubbles visible in this pic and the next are from a couple of weighted loops of tubing fed by a fish tank aerator. In the anodising tank that stops the part heating up and burning, in the dye tank is just aids in having a uniform temperature.





dye tank is coming up to temperature, should be at 140F by now





nice'n'cold anodising tank. I have a bunch of old ice packs I keep in the freezer. I stick them in the tank first thing and by the time I've finished puttering around, the tank is a good cold temperature. They're back in the freezer so that I can stick them in again before anodising the housing.





those parts are now anodised - you can see that they've turned a slight golden grey colour









20min in the dye tank then 5min steam/5min boil in water on the hob and they're done





not industry standard perfect, as they're a little patchy in places, but good enough for me!

The housing is currently in the anodising tank, that should be dyed and sealed by dinnertime or just after.


----------



## mattthemuppet2 (Dec 6, 2018)

Finished the housing













I think it turned out pretty well.

Tomorrow I'll transfer the components off of one driver onto my dual channel driver board and see if I can remember how to program the things. If that all goes well, the rest is plain sailing and I should have it done by the evening. If not, well...


----------



## Boswell (Dec 6, 2018)

It looks GREAT.


----------



## mattthemuppet2 (Dec 9, 2018)

thanks Boswell!

My plan on finishing the light on Friday turned out to be a bit optimistic! Had a major issue programming the ATtiny13 chip on the driver, in the end I had to do it off the board and then solder it back on, but the light is now finished. Time for a R+C to celebrate!

reflowing the components off a standard linear driver onto my 2 channel driver board









didn't work straight off as I put the reverse protection diode (small black thing at top right) on the wrong way round, doh. Driver worked with the original firmware for use with a clicky switch, but when I flashed my firmware for using a momentary switch it didn't work. After around 24h I figured out that there must have been something on the various boards that I had that was screwing with the programmer as programming the chip in free air was fine.

ta da!





batteries, charger, switch and LEDs wired up to a JST plug





I was worried about the batteries shifting with road vibration but they're not going anywhere. Everything is jammed in super tight in there (note to self, leave more clearance in the plans next time!).


----------



## mattthemuppet2 (Dec 9, 2018)

LED wiring. XP-L (2?) at the top, XM-L2 at the bottom. Both 5000K I think.





driver attached to bottom cover (nice big heatsink for it in effect) with the other half of the JST plug





about to be sealed up. Turned out kinda tight in there, but it's solid and nothing moves when you shake it which is a good sign





front cover on with light on low. The lexan around a couple of the screw holes had slight cracks after tightening it down (the lenses are probably every so slightly proud of the body) but the seal is good.


----------



## mattthemuppet2 (Dec 9, 2018)

beamshot inside my garage (too lazy to go ride somewhere dark to take a pic) on medium. Nice upper cut off, hopefully it'll reduce glare for oncoming road users but still give me enough reach to be useful at speed.





plugged in and charging





front view





off to go sit on the couch and have a drink


----------

