# Custom DeWalt LED work light ...



## wquiles (Aug 11, 2014)

After making this light, I got contacted by somebody who asked me to make him one to use at work.  His main requirement was to make it brighter.  So I looked back at the compromises I made with mine, and decided to see what can I do better in this one.


So I started by buying a new host for this project at the local Lowe's:








To keep costs lower, I always try to reuse left-over stock, and I happen to have a rod of aluminum of about the right diameter:








First face off and prep for knurling:
















This is the side that will hold the electronics:
















Then thread the ID to match the OD on the plastic host.  It was not quite 16 nor 18TPI, but I picked 18TPI, and checked often after each pass:








Not too bad:














This internal cut will be for the electrical post (details later):








HUGE chunk of Aluminum, but we are not done yet:








My customer wanted his light to be brighter than mine, so I went to XP-G's, specifically the second generation, (XP-G2), and I opted for a mix of the cool white and warm LED's, to give more output than on mine, while still preserving color rendition:








So I started work on the LED side, of course making sure the OEM plastic lens would be completely enclosed:
















To hold the electrical post, I am drilling a hole in this side for a retainer screw:








Since these 18Volt packs come out at 20Volts fully charged, and since this is a PWM-dimmed, direct-drive configuration, I decided to go with 6x LED's in series:








Using my laser for positioning on the indexer:








Lots of machining:












Picking the right end-mill for the next machining operation - this will give me a little bit more throw:












Getting LED's ready for reflow soldering:












Time for the thermal epoxy:












Wire then up and test them:
















You see here both the flood, and a little throw as well - this worked better than I expected:








Work on the electrical post took a long time.  The idea is to "replace" the bulb, so that both the positive and negative contacts run through this post, so that the head can be interchanged without any wires/connections.  This will allow this head to be used with other similarly threaded DeWalt hosts, as long as they are running from an 18Volt pack:












Drill and tap the base:
















Then work on the battery side:




















Then work on the Delrin piece which will hold the positive contact:












Press fit:
















As designed on paper, nearly identical to the bulb it will be replacing:








Hole for the electrical positive wire:












Positive contact:




















This is how it looks when inserted into the plastic host:










Then started work on the electronics.  I needed a few extra boards, a few extra LED's, so I do them all at the same time since it is all surface mount components:
















My Tiny85 controller boards and FET switches (for the PWM dimming) ready to go:








For the negative side of the battery, I drilled and tap a hole in the side:








Test fit of the boards.  The micro controller board monitors both the battery voltage AND the temperature of the heatsink, to adjust the output automatically, and to prevent over-discharge of the pack (although one should not leave it turned on, as the pack will still have parasitic drain):








Testing phase (looks like a miniature operating room, right?):












Epoxy boards and wires in place.  I am using thermal pads in each board to provide thermal path and to isolate the boards electrically (heatsink is at ground/negative potential):








More testing:








Completed module (without lens), compared to my first (prototype?) conversion:












Note the back of the controller board (white board) has all of those small holes - those are the programming pins for the Tiny85.  I am in dialog with my customer via email to define his default preferences/values, as this software I wrote has 3x output levels (cycle ON-OFF-ON to cycle the levels), and also has optional memory for last level used.  This makes the head re-programmable by me during this final phase of testing:








Mine/original on the left, my customer's on the right:








After all of this mambo-jumbo machining/electronics - how does it work?


(camera on manual exposure)


Old on high, then new on high:














Another set.  Still a flood light, but the new one also has some throw:














From the side (note silver heatsink on right-most side of the picture):












I hope the new owner likes his new work light


----------



## Pontiac Freak (Aug 11, 2014)

Wow! Beautiful work!


----------



## mattthemuppet2 (Aug 11, 2014)

wow, that's a work light and a half! I bet it'll last for pretty much forever on low but still put out way more light than the original. Running the LEDs mule style makes the most sense for what it'll be used for. I put a 4B or 4C XP-G2 in my headlamp (replacing a Nichia 219) and it has a lovely tint, slightly warmer than the usual 5000K NW LEDs I tend to use but not too yellow or orange like a lot of WW LEDs. With a 45deg optic on top it has a very useable narrow flood without any obvious spot.

Love the machining too, it's always a pleasure to see your work!


----------



## wquiles (Aug 11, 2014)

Thank you guys


----------



## wquiles (Aug 30, 2014)

OK, an update, now that I am doing the final, final testing. Yes, I know, I was doing final testing two weeks ago ...

But in talking to the owner of this work light, he mentioned he had access to a special setup that allows extended run-times by having 3x cells in parallel. Since 3x packs would hold high voltage levels longer, he and I talked about what could be done to make this light work on that setup. 

As I mentioned earlier in this thread, this work light runs in direct drive mode, but with PWM adjustments/dimming, temperature monitoring, and of course battery voltage monitoring. But with the 3x packs in parallel, I suggest the owner to try software-controlled PWM levels proportional with the battery voltage - basically a crude "regulation" software control system.

I had the first version working 1-2 weeks ago, with voltage monitoring and PWM adjustments every 0.5 volts, and it worked great. BUT, the transition from one level to the next was a little noticeable. Not a night and day, but it was not "good enough" for me. So I asked the owner a little more time to try a different approach, and he agreed.

I approached my electronics mentor (who makes the great TaskLED LED drivers), and he suggested using a table, since the Tiny85 I am using doesn't do floating point directly. I consulted a couple of web sites, and found a way to simulate the voltage vs current equation for LED's [ current = a * e^(b*voltage) ], and then I empirically found and adjusted the constants to work with the voltage range of this pack. So I wrote new software for this method of operation over the last 1-2 weeks, and finally got it running well. For those interested, here is the link to the Excel template I used as a basis:
http://newtonexcelbach.wordpress.com/2011/01/19/using-linest-for-non-linear-curve-fitting/

The new monitoring system has 10x more discrete PWM values, adjusted every 0.1 volts, plus I also incorporated a new state in the control/monitoring loop to transition from one PMW value to the new one, so make it a little bit smoother. This new software of course can't match true regulation like that achieve with an LED current regulated driver, but it is nearly 100% efficient since the MOSFET switching element is always either ON or OFF, so efficiency is about maximum throughout the whole battery range.

The only transition that is quite visible is when the temperature monitoring finally quicks in, and switches the output from HIGH (default level, per the customer request), to MED. This helps prevent the head/heatsink from getting hot enough to burn the skin and of course helps protect and prolong the life of the LED and electronics. Once the temperature drops, the output resumes at the HIGH level (built-in hysteresis).

This was my programming setup during the testing/debugging of the software:








Atmel AVR development platform:




Example of the PWM waveform (about 1Khs frequency, so it is not easy for the eyes to tell the flicker - some folks are sensitive at the lower/common 256Hz). Here the duty cycle is at about 73%:




I tested as high as 22.5 volts, which should be well above these rechargeable packs. I will admit that I don't have one of the newer LiIon packs, so I have no idea what would happen with those packs. Here I am testing the temperature hysteresis, by cooling the heatsink, and watching the output go back up to HIGH level:





I sealed the OEM plastic lens with a thin coat of clear silicone:





I am targeting shipping to my customer on Tuesday, so that he can "play" with it. If he needs minor adjustments/changes, I can quickly re-program it for him on my development/programming setup.


----------



## Tony Wells (Aug 31, 2014)

Very nice work. I dabble just a little in electronics, so I can appreciate the processes you used to arrive at the final product. Looks very impressive. I just wish I had time to build something like that.


----------



## wquiles (Aug 31, 2014)

Tony Wells said:


> Very nice work. I dabble just a little in electronics, so I can appreciate the processes you used to arrive at the final product. Looks very impressive. I just wish I had time to build something like that.


Thanks Tony.  This was done over the source of a couple of months - I don't have the time either to do all of that at once.  Plus the lessons learned, and of course the software are "reusable" in future projects 

Will


----------

