GXB20 – Homemade CC Programmable Single-Cell XHP50 Boost Driver

loneoceans

Newly Enlightened
Joined
Jan 8, 2017
Messages
9
Hello all and glad to join everyone here at Candle Power Forums. Here's a weekend project that turned out pretty nice and I thought I'd share.

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, 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.

1.jpg


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

  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.

5130dvBb66L.jpg


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.

2.jpg
3.jpg


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! :laughing:
4.jpg

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.

6.jpg


5.jpg


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 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.

7.jpg


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.

8.jpg


Finally I did a quick test – in short, it all seems to work great! :cool:

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 and suggestions!

More to come soon and stay tuned on this thread for updates as I continue to work on the GXB20!
 

LEDAdd1ct

Flashlight Enthusiast
Joined
Jul 4, 2007
Messages
3,557
Location
Hudson Valley
This is very exciting! I am definitely interested in being able to fully power a 6V LED off a single LiCo cell.

Having low voltage cutoff/protection built into the driver is very exciting as well.

Good luck, and, please keep us posted!
 

staticx57

Flashlight Enthusiast
Joined
Dec 2, 2011
Messages
1,749
Location
NJ
This is AMAZING. Next step should be 17mm and it could fit almost everything we need drivers for.
 

light-modder

Enlightened
Joined
Jul 15, 2014
Messages
599
Location
Kansas
Yes! I've been waiting for someone to do this. I thought about enlisting the help of a friend who is an electrical engineer but he's really busy already so I never asked. Super excited!
 

loneoceans

Newly Enlightened
Joined
Jan 8, 2017
Messages
9
This is AMAZING. Next step should be 17mm and it could fit almost everything we need drivers for.

Thanks for your kind words! Over the next few days I'll be trying to get time to work on the firmware and do some characterization of its performance.

However just given how it's turned out, it's definitely possible to make this fit a 17mm driver - there's still space on the board I could shrink from / I could make the PCB 4-layers / could use smaller components like 0201/01005. The concern only becomes how easy it will be to put together by hand and at that point PCB fabrication and assembly will become more expensive and difficult for the casual hobbyist. Or maybe with some clever layout I can try to get it to fit.

It is afterall an 18W driver running quite high currents and at full 18W drive, will certainly require a high-draw capable 18650. The 18650 has a diameter of 18mm, so I wasn't quite sure how useful squeezing this to 17mm would be (correct me if I'm wrong though - maybe there are lots of 17mm hosts which use 18650 batteries!). :thinking:
 

scs

Flashlight Enthusiast
Joined
Feb 9, 2015
Messages
1,803
Thank you for your efforts. Very eager to see this officially go into production. :popcorn:
 

texas cop

Enlightened
Joined
Nov 9, 2011
Messages
520
Location
Texas
Thanks for your kind words! Over the next few days I'll be trying to get time to work on the firmware and do some characterization of its performance.

However just given how it's turned out, it's definitely possible to make this fit a 17mm driver - there's still space on the board I could shrink from / I could make the PCB 4-layers / could use smaller components like 0201/01005. The concern only becomes how easy it will be to put together by hand and at that point PCB fabrication and assembly will become more expensive and difficult for the casual hobbyist. Or maybe with some clever layout I can try to get it to fit.

It is afterall an 18W driver running quite high currents and at full 18W drive, will certainly require a high-draw capable 18650. The 18650 has a diameter of 18mm, so I wasn't quite sure how useful squeezing this to 17mm would be (correct me if I'm wrong though - maybe there are lots of 17mm hosts which use 18650 batteries!). :thinking:

P60 dropins are still rather popular and uses a 17mm driver. This would allow dropins with Cree's MT-G2 along with the XHP series to be possible let alone practical. Thanks for the design. Please make lots of them.
 

solRNY

Newly Enlightened
Joined
Feb 4, 2017
Messages
3
been looking all day for a 3.7v xhp70 driver, so glad i found your incredible GXB20, please let me know if you need a beta tester?! :)
 

loneoceans

Newly Enlightened
Joined
Jan 8, 2017
Messages
9
P60 dropins are still rather popular and uses a 17mm driver. This would allow dropins with Cree's MT-G2 along with the XHP series to be possible let alone practical. Thanks for the design. Please make lots of them.
Ah I see; I'm very new to the flashlight community so a lot of reading up for me to learn more about different size hosts and what driver sizes would be most appropriate :)

been looking all day for a 3.7v xhp70 driver, so glad i found your incredible GXB20, please let me know if you need a beta tester?!
Thanks for your offer! :) The driver will certainly drive XHP70 at 6V configuration. Though IIRC, the XHP70 can be driven up to 4.8A! However, technically with say a 3.7V input voltage, this driver is technically still capable of operating with 8A input (i.e. capable of driving the full XHP70!) - though thermal considerations for the driver side will need to be studied in more detail. Certainly the components are capable and within spec though so this is a promising idea..


Anyway, today 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 - driver works great with no issues so far! 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!

Meanwhile I also ordered some more XHP50 LEDs and heatsinks for more extensive testing..
 

texas cop

Enlightened
Joined
Nov 9, 2011
Messages
520
Location
Texas
So many tricks of the trade to get LED's far past Cree's amp limits. Good Copper MCPCB's a little sanding flat parts to mate better and amp's are going up as heat is bled away.
 

staticx57

Flashlight Enthusiast
Joined
Dec 2, 2011
Messages
1,749
Location
NJ
So many tricks of the trade to get LED's far past Cree's amp limits. Good Copper MCPCB's a little sanding flat parts to mate better and amp's are going up as heat is bled away.
Indeed, XHP70s are regularly past twice that current level with no ill effects. Heatsinking is key :devil:
 

loneoceans

Newly Enlightened
Joined
Jan 8, 2017
Messages
9
Hello all,

Again many thanks for all the kind words! I've been pretty busy lately but I managed to do some comprehensive testing across 20 power level settings which folks might be interested.
The test was conducted as follows. The driver was hooked up to a constant voltage programmable Agilent power supply. In this case I conducted the test at 3.7V in across the range (driver was also tested at a variety of input voltage from 4.5V to <3V but less comprehensively). Input current and voltage was measured via Kelvin terminals to avoid errors due to lead resistances. Output current was measured across the load resistor as well as the output to find total driver efficiency.
A total of 20 constant current levels were tested and measurements taken.

9.jpg


Above shows a photo of the test in action. The XHP50 LED was mounted on a 20mm star heatsink, which was in turn mounted on a big heatsink to keep it cool during tests. As a side result, the data will likely be inaccurate as the LED die temp rises, but I really don't have so much time to do a full datasheet-style test
smiley-yell.gif


tek.png


Here's an example scope shot showing the driver output at 5 different power levels. This was achieved by configuring the on-board MCU to run a 'test program' during startup at different power levels for 1 second each. Cyan shows output voltage and yellow shows voltage across the current sense resistor. Regulation is fairly clean, as expected with the very high switching frequency.
gxb20.png


In this test, the maximum power tested was a massive 22.4W into the driver, driving the XHP50 LED at a measured 3053mA. At this power level, just putting my finger near the LED light feels very hot! Based on the specific bin of XHP50 I had on hand, this translates to a datasheet lumen output of around ~1700 lumens. Lower CRI bins less than this 90+CRI one used should yield close to 2000 lumens. As mentioned, heatsinking becomes very critical at these levels.

Maximum efficiency was measured at around 98+% efficiency at lowers loads of around 750mA out.This drops gradually to 87% or so at 3A output, meaning about 2W dissipated in the driver itself! Most of the heatsinking of the driver occurs through the ground ring around the driver so mounting it in a host properly is also critical. Increased temperature after longer runs will certainly affect the efficiency though. In all the driver seemed to regulate current just fine all the way up to the maximum 3A load.

In reality, I will likely turn operating current down to closer to 1.8A for a total lumen output of just around 1000 lumens of 90CRI light! This is due to the relatively poor heatsinking design of the host. Perhaps one day I'll mod this into a 'real' flashlight!

Overall I'm quite happy with the results as they are around the ballpark of what I expected, and most of all, I'm very glad that I didn't mess up the PCB (which is pretty rare given that this is my first run!). The next step is to work on the firmware for modes, and finish a more detailed write-up on the driver. I'll also be finally putting this LED driver into a host and do some beam comparison shots with the stock 'LatticeBright' LED and its driver, with this new driver!

More to come soon and thanks for reading.
 

loneoceans

Newly Enlightened
Joined
Jan 8, 2017
Messages
9
will you be making other sizes, say like 26mm? :D

As you might be able to tell, I made this driver just as a 'one-off' hobby kind of thing. But it appears to be getting quite a good response so I'll definitely be considering making larger drivers, though making them bigger is definitely not a problem at all! The easiest case is to just resize the PCB to make it bigger. But making it larger does allow several benifits including making components larger and easier to assemble, adding more features, and improving layout and thermals.


Right now my focus is to complete a basic firmware set and then publish a proper write-up on this driver, then if time allows, work on a 17mm version instead just for the challenge and because it's the most requested size that I've got :). What sort of features do you think the flashlight community would like in such a driver?
 

bl4kkat

Newly Enlightened
Joined
Mar 2, 2006
Messages
93
Location
Virginia Beach
Can't wait to see how all this turns out!

I can't speak for everyone but I personally would like to see a 4 - mode w/ memory function something like this:

"Turbo Mode" where it will run in overdrive anywhere from 30sec - 2min then drop down to 95% output
"High" @ 95% output
"Medium" @ 80%
"Candle Light Mode" @ 1 - 5 lumins
"Beacon" @ one flash every 3 seconds

When the light is powered down (Off) a find me in the dark kind of thing @ 1/4 lumin


If all those features are not possible the Beacon and find me in the dark can be omitted leaving a 4 mode light...
Keep up the good work :twothumbs
 
Last edited:

pc_light

Enlightened
Joined
Feb 10, 2004
Messages
600
Location
Old Dominion, USA
Great stuff, unbelievable efficiency.

A popular feature of late is to build-in a number of output "groups" and/or features that end-users can activate/deactivate through a series of switch clicks. Not to say that programmability of flashlights is new, just rare. Flashlight from vanguard designers such as HDS and Liteflux previously offered programmability/selectability, today their lights are rarefied.

Looking forward to your progress.
 

bigm

Newly Enlightened
Joined
Jul 8, 2015
Messages
26
Location
SW Wisconsin
Awesome work loneoceans! Very impressive, especially for a weekend fun project. I'm looking forward to watching the evolution of this driver, and hope to see it for sale some day soon. I've been looking for the perfect driver for my first build, and this in a 17mm would be it for sure. Many popular Convoy hosts use a 17mm driver, as well as the aforementioned P60's. Keep up the great work, and keep us posted. :)
 
Top