[[ GXB20 Driver – Homemade Constant Current Programmable XHP50 Single-Cell Boost Driver! ]]

Loneoceans, welcome aboard. For me your timing couldn’t have been any better. I’m working to get a bit more life back into the P60 style flashlights. A machinist is currently building a prototype host for the newer 20700/21700 lithium-ion cells. This would allow dropins another host with more potential. Your 17mm driver combined with the new Cree XHP50.2 would push this project to a pretty decent level. I can only hope your driver comes to life in 17mm’s soon.

I think you wont be able to put out more than 1.8A with this inductor.

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!

Respect go to you loneoceans :smiley:

when are they available to purchase ? :slight_smile:

Amazing work! Thanks for sharing it.

I am a fan of boost drivers and buck/boost drivers. I like the predictable output levels they provide. In some ways, I am a throwback. For flashlights that use low-voltage emitters, such as the Cree XP-L, I would rather have a well-behaved boost driver—and the flat runtimes it produces—than a FET driver that runs "direct drive" in its highest modes. I don't need a flame thrower that pushes an emitter to its limit.

Yes, I know. That makes me the oddball around here!

In one fell swoop, you’ve managed to address several longstanding limitations of running lights off single cells:

  1. Lack of a widely available open source boost driver (allowing high voltage LEDs)
  2. Lack of a programmable current controlled driver
  3. Perhaps a shift away from dependence on 7135s
  4. A programmable board with a smaller QFN package (Most drivers here use the larger SOIC-8)

Welcome to BLF! This may be the beginning of a new wave of drivers.

To answer your question, most flashlights have a reverse-click switch on the tailcap that handles the full current. The other common type is an e-switch, where a single low-current electronic switch (often side mounted near the driver end) controls the modes with the battery permanently connected, variations on the theme include having 2 buttons or a magnetic ring as a switch.
There are some rarer lights with the e-switch mounted on the end, but these require a carrier for the battery with a separate signal wire going to the tailcap.

Welcome to BLF! This is truly a wonderful first post. Thanks for sharing this with us! I hope you enjoy your stay!

A few thoughts I have:

  1. Learn about Direct Thermal Path MCPCB boards for LEDs. This will help you tremendously with heat issues.
  2. Have you thought about using solder paste and re-flowing the components on the driver board? If done right, it’s a lot easier than individually soldering tiny components with a soldering iron.
  3. 17mm really is the most common driver size we see in most flashlights. So getting your design into a 17mm footprint will certainly make it more universal.
  4. Other sizes are nice, too. If you’re interested, the easiest way to make multiple sizes is to lay out for the smallest possible size, then keep the same layout and only extend the board diameter for the “larger” driver sizes.
  5. Have you thought about making a single-cell 12V boost driver? We could certainly use one for the XHP-35!

^ about 12V, i think he(we) can modify the Feedback Resistor, so the voltage can change
if only this driver is 17mm

Btw , the led you use is a LatticeBright (not original Cree xhp50) , i hope you know :slight_smile:
Well i don’t know , i only commented the led on the photo :stuck_out_tongue:

no, he reflow the XHP50 on the old MCPCB

Especially with 18W on a 5050 package you need a DTP star

Also a spring bypass should improve the lights performance as you get less voltage drop and heat

Oh yeah, thanks Lexel! I forgot to mention the spring. I knew there was something else! The spring needs to be upgraded at least! Or, as Lexel says, a “spring bypass” can be done. Look that one up. There are a few ways to do that, and it’s definitely a big improvement for high wattage lights!

I’m certainly interested in the schematics. Are you going to release them too?

@ loneoceans,

Welcome to BLF.

You certainly know how to make a Good 1st Impression.

Most of this stuff is beyond me, but good to see someone addressing the needs of the Members.

I’ll be interested to see how this all pans out.

Cheers,
Splott-Light :slight_smile:

P.S. If you get your “Milla” off Raccoon City, you’’re then “Officially” in!

As a first post and “weekend project” Saying Welcome to BLF and thanks for your contributions so far is not enough.

Thank you and welcome to BLF.

Lot of information through these pages. And we’ll mug you with it all. So just ask when needing component sources or already researched material.

Thanks for the warm welcome DavidEF and everyone here :). Thanks for the heads up for DTP heatsinks!

I reflowed the old XML LED off the original heatsink and replaced it with a XHP50 but as I've found, it gets very hot very quickly. As a result I've in fact ordered a few 20mm copper 'Sinkpads' for additional testing. I did some reading up and it appears that Noctigon is another good brand? These should perform better and I plan to do a quick thermal comparison test to try to quantify the improvements. Would appreciate additional suggestions for good heatsinks (short of just making my own! Though I'd like to keep to the spirit of this project which was to do a simple modification of an existing low-cost flashlight).

For reflow - I do reflow in an over on a regular basis, but I didn't send stencils to be made for this project just yet! I suppose if this project is successful enough I'd make a stencil so I can do a small run perhaps ^_^.

Again thanks on the input for 17mm, I'll definitely be trying to see how I can optimize the design for 17mm. One thing I'm concerned about is the drivers thermal performance and I tried to take as much care as possible during layout to ensure that the power components have good thermal sinking to the ground planes (and eventually to the outside ring to the host). For larger driver sizes I think it makes more sense to optimize it for even better components for less loss and to add some nice to have features such as larger packages for easier soldering and programming. But I'll like to focus on the GXB20 first, then perhaps 'GXB17' :)

Finally, with very minimal work (or in fact... none at all!), this driver can certainly drive 12V LEDs! This is a constant current driver so it will easily generate 12V to match the desired load current. I'll have to re-check the components (e.g. the output capacitor needs to be replaced with a higher voltage one, safety protection features need to be adjusted etc) but making it a 12V driver will certainly work. The reason I went for 6V was due to the fact that (1) commonly found XML heat-sinks have footprints compatible with XHP50 in 6V configuration and (2) I did some quick simulations on the boost drive and it's a little bit more efficient at 6V output compared to 12V output (across the range).

Will do - I'll try out with some Sinkpad IIs I purchased earlier (http://www.sinkpad.com/datasheet-sinkpad-2.php(link is external)) though it also seems like Noctigon is great too! I'll also document the spring bypass and additional methods I can do to improve efficiency. Speaking of springs, does anyone have any recommendation for good springs I can use which are not too large? For example the one I'm using now has a fairly large 8.5mm base spring which limits PCB space. I was looking at some springs like the 5mm or 7mm base springs on (http://www.mtnelectronics.com/index.php?route=product/category&path=25_81) - are these good or do you know of better ones?

Finally, I've been reading a little bit more about the different modes in flashlights and it made me wonder - would a 'moonlight mode' be something useful? And if so, what the typical brightness that people like?

Thanks again to everyone for the encouragement and kind words and for following this project. I do appreciate your time

I like the small Convoy driver spring on my C8 or other drivers
Its around 4mm in diameter

The tail spring does the most of the job being higher snd softer

If you got problems with heat on a 17mm driver you can put the MCU and other non power parts on a slave board similar to this

welcome to BLF!

you found the right spot for your great project!


Moonlight is definitely a useful mode. There are disagreements about how low it should be, however. I find that around 1 - 3 lumens works fine for me. More than a few lumens can get into being too bright for moonlight mode use. Some want <1 lumen, which is IMHO more of a firefly mode and not useful to those of us who don’t have ToyKeeper’s super night vision. :stuck_out_tongue: