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

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:

  1. 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 :)

  2. 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 :beer:

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!

Very nice!!! Welcome to BLF……… :slight_smile: …. :+1:
I also would love to get a couple of these………. :wink:

I would take one in parts, can do solder job on my own

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 :stuck_out_tongue:

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! :+1:

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. :+1:

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!