Hello all and glad to join everyone here at BudgetLightForums!
Here's a weekend project that turned out pretty nice and I thought I'd share. Introducing the GXB20 Boost Driver!
* Above shows the assembled GXB20 v2. Note typo on silkscreen which reads 3V / 6A - should be 6V / 3A instead, spring not soldered on yet *
TL;DR:
I designed and made a simple constant current single-cell (e.g. 18650) XHP50/70 (6V 3A) Programmable Boost LED Driver. I’ve called this driver the GXB20. This is a true constant current driver which takes feedback from the drive current and regulates the output to match the desired current. I designed the driver to have a 20mm diameter to fit cheap 18650 LED flashlight hosts from Amazon/Ebay. The driver is fully programmable with an on-board ATtiny84A and includes other features such as temperature sensing and cut-off, 256 levels of LED brightness adjustment via constant-current limiting (no more PWM flickering!), battery voltage sensing, memory for various modes, and is designed to be able to supply the full 6VDC 3A output with ~95% efficiency via a boost circuit running off a single 3.7V lithium battery. The GXB20 has undergone one revision and is now in its second version.
Update:
The GBX20 undergone a small update with improved layout and functionality and is now in the GXB20 V2 revision. Functional drivers were assembled and they are now currently driving two of my flashlights! As of May 2016, I have started to focus my efforts on the smaller GXB17 and will pause on working on the GXB20.
Sales and Others:
Unfortunately I am currently unable to provide drivers for sale. However I do have a bunch of GXB20 v1 PCBs available for sale if desired for $2 a piece.
I also wrote a quick temporary page of the GXB20 v1 with the BOM, firmware, schematics etc: http://loneoceans.com/labs/sales/gxb20v1
[The following is from my original post and reflects the progress of the GXB driver starting from V1]
As of right now the main functionality is working and I hope to tidy up the V1 of this driver and release it open source for all to use . In addition, I’m also writing up a detailed page on its operation and hope to publish it on my webpage soon (www.loneoceans.com/labs/).
Introduction & Problem
This project was motivated by the desire to:
- Use some of the new XHP50 LEDs from CREE which are not only ridiculously bright, up to 2000 lumens per package, but also comes in high CRI (>90) bins
XML2 LEDs only go to just about 1000 lumens per package! Need more light - Run this LED from a compact, single lithium-cell flashlight. The main problem with this is that the XHP50 LEDs require 6V or 12V (depending on wiring configuration), and this requires a boost circuit to produce the 6V from the 3.5-4.2V from a single-cell 18650. In addition, the XHP50 LED can take up to 3A of drive, so the driver needs to be able to support 18W of power in a small package.
The other motivation for this project was the fact that I found some really cheap 18650 LED flashlights from Amazon/Ebay, which claim to use an XML LED. I took them apart and found that they (appeared) to use Cree XML LEDs but were driving them with a very simple current-limiting resistor + FET for PWM brightness control, and were only about ~600lm.
These flashlights had space for a 20mm PCB driver board, so I decided to design a driver around this constraint and to replace the XML LED from the flashlight (using the same heatsink since they have the same footprint as the XHP50 in 6V configuration), and also to replace the driver with my driver. The goal was to build a simple ~1500 to 2000 lumen single-cell flashlight at a low cost!
The result is a the GXB20 driver – G after my name, X referring to the XHP50/70-series LEDs, B being a boost driver and 20 being a 20mm driver.
Design and Operation
Since I was going to be designing the board from scratch, I figured that the main things I wanted was:
- (1) proper constant current operation and brightness modes
- (2) programmability
- (3) safety features (mostly over-temperature cut-off!).
For adjusting brightness, a simple way and what is often done is to have a fixed boost voltage, run the LED across a current limiting resistor, and then use a FET and PWM to control LED brightness. This works OK, but due to the V_fwd inconsistencies of LEDs, this can lead to widely differing LED brightness. In addition, PWM generates flashing/strobe effects, which is not as pleasant as a true constant-current limiting circuit. After some thinking, I came up with a simple method - the LED I_fwd current is constantly sampled across a small current-sense resistor. This value is then amplified via a digitally variable amplifier (controlled via an Attiny84A) and fed into the boost power circuit. The boost circuit then regulates the voltage to maintain the desired current!
Next for programmability, I decided to go for an Atmel ATtiny84A instead of an Attiny85 due to the fact that it came in a very small 3x3mm QFN package, has EEPROM for storage of memory modes, allows me to use the hobbyist-friendly Arduino environment for sharing / open-source, and comes with a lot more GPIO for additional features.
These new features includes things like battery sensing (so I can turn off the LED drive if the battery voltage falls too low), as well as real-time temperature sensing for dynamic LED brightness control if it gets too hot.
So late last December during a somewhat boring weekend, I sat down and quickly came up with a design, did up the schematic, created a board layout and sent the PCBs to be made. Over the last week, I finally got the PCBs and components, quickly assembled them, and wrote some initial firmware to test it! Now looking back, the board -does- still have some space left, so a 17mm board might be possible too…
Programming and Testing
Soldering this together with traditional tools is possible with a bit of practice, but I was able to get access to a bench microscope which helped a lot!
Together with needle-nose tweezers and a small-tip soldering iron, I was able to put together the PCB without too much trouble. After-all, the smallest component on board is a 0402 resistor/capacitor, so it’s actually quite doable by hand. The small ICs are probably easier done via hot air or via very small soldering irons.
Next, I used a copper-plate and a large soldering iron to reflow the XML LED off the star-heatsink which came on my cheap Amazon LED flashlight. I replaced it with a 90CRI XHP50 (5700K) LED from Cree. Then I soldered it up to the main driver board. Notice I also reused the spring on the original driver board and moved it over to the new one.
For programming, I’m using the standard 6-pin AVR ISP 2 programming header. The default header is very large at 0.1” pitch, so instead I made a 0.05” 6-pin ‘adapter’ using a 0.05” 6-pin female header to a 0.1” pitch header.
Notice that the driver board has 6 pads for soldering on a 0.05” header. For this developmental board, I simply soldered the header on (which I can desolder later). Once I finalize the firmware, I can simply press-and-hold the header onto the pads during programming of the microcontroller.
Finally I did a quick test – in short, it all seems to work great!
Right now, I'll be mostly working on firmware and verifying its operation, as well as hopefully adding some interesting effects such as ‘candle-mode’ etc..
This project turned out to work out quite nicely even though I only spent a short weekend on it! As a result I'm sure there are a lot more improvements and things to change which I can make in upcoming revisions, and I appreciate any thoughts,comments, suggestions and questions!
More to come soon and stay tuned on this thread for updates as I continue to work on the GXB20!
Grat work ! I want one !
Welcome to BLF
Nice!! Can’t stand the wait to see these kind of drivers for sale. Would you consider selling some drivers here?
Omg… I want one! Put a price on it, please. Btw, welcome!
EDC rotation:
KR4, SST-20 FA3 4000k (favorite!)
FW3A, Nichia 4000k sw40 r9080 (second favorite)
FW1A, LH351D 3500k (third favorite)
FW1A, XP-L Hi 3A
FW3A, LH351D 3500k
FW3A, SST20 FD2 4000k
FW3A, Cree XP-L Hi 5A3
Emisar D4V2, SST20 4000k
Emisar D4V2, brass E21A 3500k (night light of choice)
Very nice!!! Welcome to BLF……..
….

I also would love to get a couple of these……….
You never know how a horse will pull until you hook him up to a heavy load./"Bear" Bryant
.................................. "Slow is Smooth, Smooth is Fast" ...................................
Texas Lumens Flashlights / M4D M4X Deals : sign up - save $$$$
Rudeness Level _ mΩ _ {width:70%} _ LightWiki _ LED Tint Chart
Xlamp size chart _ BatteryU _ Flashaholic? Need Professional Help??? TheOriginal _ TAB _ LightSearch _ BatterySearch _ 14500's _ DiCal
I would take one in parts, can do solder job on my own
[Reviews] Miboxer C4-12, C2-4k+6k, C2, C4 / Astrolux K1, MF01, MF02, S42, K01, TI3A / BLF Q8 / Kalrus G35, XT11GT / Nitefox UT20 / Niwalker BK-FA30S / Sofirn SF36, SP35 / Imalent DM21TW / Wuben I333 / Ravemen PR1200 / CL06 lantern / Xanes headlamp
[Mods] Skilhunt H03 short / Klarus XT11GT, XT12GTS / Zebralight SC50+ / Imalent DM21TW / colorful anodisation
[Sale]
Drivers: overview of sizes and types
DD+AMC based drivers Anduril or Bistro OTSM 12-24mm, S42, 24-30mm L6, Q8, MF01(S), MT03, TN42
Anduril or Bistro 8A buck driver for 20-30mm, MF01/02/04, TN40/42, Lumintop GT, MT09R
UVC and UVC+UVA drivers
programming key
Remote switch tail DD board with FET
Aux boards:
Emisar D1, D1S, D4, D4S, D18, Lumintop FW3A, Fireflies ROT66, Astrolux MF01, Tail boards like S2+
That has got to be the most amazing “first post” I have ever seen.
Sounds marvelous, I can’t wait to hear about the real-world experience!
I agree with everyone else, I want
Very nice…finally good runtime by using a 18650 instead of two 18350s!!
Is it compatible with low current button? Or can be easy modified for it?
Welcome to BLF. Subbed!
Absolutely brilliant!
I’d bet you have some other great projects we’d love to see too.
Welcome and Wow! I very much look forward to seeing how this works out, You have our attention.
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.
Low-cost copper pills, spacers, optics, drop-ins.
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!
www.loneoceans.com/labs/
- Next-gen Switching Drivers: Lume X1 and Lume1
- High Power Boost Drivers: GXB100 GAN 100W, GXB172 17mm 50W
- Others: GXF22, GFS16, GXB17 & GXB20 / Random items for Sale / Manker MK38
Respect go to you loneoceans
when are they available to purchase ?
Nico -.-
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:
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
^ about 12V, i think he(we) can modify the Feedback Resistor, so the voltage can change
if only this driver is 17mm
Forgot my pen
Btw , the led you use is a LatticeBright (not original Cree xhp50) , i hope you know

Well i don’t know , i only commented the led on the photo
- George
My Reviews : KDlight C8 / ThruNite Archer 1A V3 / Thorfire C8s / ThruNite TN12 (2016) / Utorch UT01 / Utorch UT02 / Jetbeam WL-S2 (xp-l) / ThruNite TC12 V2 / Massdrop Brass AAA / Manker LAD / Lumintop SD26 / ThruNite Mini TN30 (3x xm-l2) / Qualilite D81 / Nitecore MH20GT / Odepro TM30 / Klarus XT30R / Nitecore NU20 CRI / Ultrafire XM-L2 / Foursevens Mini MK II / Manker E02 / Manker E14 II / Teekland Flashlights / Lumintop Elfin / Thorfire S70S / ThruNite Neutron 2C / Jaxman M8 / KDLITKER C8.2 / Zanflare F1 / Nitecore Concept 1 / Emisar D4 / Astrolux MF-01 / ThruNite TC10 V3 / Amutorch JM70 (xpl hi)
no, he reflow the XHP50 on the old MCPCB
Forgot my pen
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
[Reviews] Miboxer C4-12, C2-4k+6k, C2, C4 / Astrolux K1, MF01, MF02, S42, K01, TI3A / BLF Q8 / Kalrus G35, XT11GT / Nitefox UT20 / Niwalker BK-FA30S / Sofirn SF36, SP35 / Imalent DM21TW / Wuben I333 / Ravemen PR1200 / CL06 lantern / Xanes headlamp
[Mods] Skilhunt H03 short / Klarus XT11GT, XT12GTS / Zebralight SC50+ / Imalent DM21TW / colorful anodisation
[Sale]
Drivers: overview of sizes and types
DD+AMC based drivers Anduril or Bistro OTSM 12-24mm, S42, 24-30mm L6, Q8, MF01(S), MT03, TN42
Anduril or Bistro 8A buck driver for 20-30mm, MF01/02/04, TN40/42, Lumintop GT, MT09R
UVC and UVC+UVA drivers
programming key
Remote switch tail DD board with FET
Aux boards:
Emisar D1, D1S, D4, D4S, D18, Lumintop FW3A, Fireflies ROT66, Astrolux MF01, Tail boards like S2+
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!
The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy
I’m certainly interested in the schematics. Are you going to release them too?
https://www.flickr.com/photos/akrylamid/
@ 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
P.S. If you get your “Milla” off Raccoon City, you’‘re then “Officially” in!
Ouchyfoot to a New Member: Welcome CJ. Now you have to learn about buying an inexpensive flashlight and modifying it until it either blows up, or starts small fires on the moon…………
Hugh Johnson:
I, too, once lived a tragic and empty life. Then I found [portable] light.
You forgot to mention clothes. I sold most of my clothes to fund my light collection. This is actually fine, since I only go out after dark, and most people can’t see me.
Finally, I got my priorities straight.
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.
View BLF with NO Commercials Here!
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
www.loneoceans.com/labs/
- Next-gen Switching Drivers: Lume X1 and Lume1
- High Power Boost Drivers: GXB100 GAN 100W, GXB172 17mm 50W
- Others: GXF22, GFS16, GXB17 & GXB20 / Random items for Sale / Manker MK38
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
[Reviews] Miboxer C4-12, C2-4k+6k, C2, C4 / Astrolux K1, MF01, MF02, S42, K01, TI3A / BLF Q8 / Kalrus G35, XT11GT / Nitefox UT20 / Niwalker BK-FA30S / Sofirn SF36, SP35 / Imalent DM21TW / Wuben I333 / Ravemen PR1200 / CL06 lantern / Xanes headlamp
[Mods] Skilhunt H03 short / Klarus XT11GT, XT12GTS / Zebralight SC50+ / Imalent DM21TW / colorful anodisation
[Sale]
Drivers: overview of sizes and types
DD+AMC based drivers Anduril or Bistro OTSM 12-24mm, S42, 24-30mm L6, Q8, MF01(S), MT03, TN42
Anduril or Bistro 8A buck driver for 20-30mm, MF01/02/04, TN40/42, Lumintop GT, MT09R
UVC and UVC+UVA drivers
programming key
Remote switch tail DD board with FET
Aux boards:
Emisar D1, D1S, D4, D4S, D18, Lumintop FW3A, Fireflies ROT66, Astrolux MF01, Tail boards like S2+
Pages