Thanks everyone for your kind words and comments! Hopefully when I get this driver done people will find it useful!
This really wasn't my intention and I plan to release all this open source if people find it useful!
However if enough people are interested I can find a way to see if I could get a batch of them fabricated, so do let me know! Assembling by hand takes a little too long since soldering does take a while, so I'll have to see what sort of assembly options there are before I can give a price estimate. :) Unfortunately I wasn't able to put up an OSHpark order since the PCB spec is a little smaller than OSHpark... (trace / spacing limitation).
Also, just thought I'd ask - are there any companies whom I might be able to do some sort of collaboration with to offer these for sale who can help with assembly and distribution? I'm just doing this for a hobby and I'd be happy to have people solder up their own drivers but this driver does have a few pretty challenging components to solder due to the small pitch QFN packages.
I specifically designed this (as a quick weekend project!) as a mod for my cheap flashlight from Amazon which only has a single tail-end switch. However this necessarily requires the switch to handle the full current. Fortunately it can be easily modified using the internal boost converter fet as the main switch for true low-current button operation. The Attiny84A is also much more capable than the usual ATtiny85s often used so there's a lot of overhead available. Regardless, I'm very new to the budget/flashlight community so I'd like to understand these kinds of topologies better - do such flashlights have 2 switches? Or just 1 switch having the main power from the battery permanently connected to the driver?
Thanks for the background! Once I make sure the 20mm driver is working fine, I'll definitely look into doing a 17mm version. So any features / suggestions / thoughts are most welcomed :)
That was a concern I had as well - how to find an inductor small enough to fit!? Fortunately this mighty inductor has a 12A rating with 13 DC saturation current rating! Based on my simulations with 3.9V input and 6V 3A output at my operating parameters, the inductor only sees between ~5.7 to 6.2A and well within spec.
But the proof of the pudding is in the eating! So I managed to do more work and run it at full power - it works great with some ~6+A at the input side!
I was able to spend a bit more time to work on the firmware, with the idea of keeping it as simple as possible and avoid making it far too complicated with too many modes. It's still far from complete, but I was able to test basic functionality of different brightness values and under-voltage sensing and protection.
I was also able to run it for a while at its full 18W (6V 3A) output driving the XHP50 LED! The LED (on the 20mm heatsink) gets - extremely hot - really quickly, so the limiting factor of running a XHP50 at its highest power certainly seems to be more of a heatsinking issue than being a challenge for the driver! :) The LED is of course, very beautiful and bright!
Next step is to tidy up the firmware into something presentable (I'm sure lots of people here can do a much better job than I can!) and then I'll put it into the host and see how it performs!