Programmable Boost LED Driver
Single-Cell Programmable Constant Current Boost LED Driver
This project was born from the desire to create a simple, compact,
low-cost, but very bright LED torchlight with high-quality light. The
result of this was the creation of a custom, extremely compact yet
powerful and full-featured LED driver which I've named the GXB20. This page documents
the development and engineering choices of this driver.
A couple of years ago, I found a nice deal online for a single AA LED
flashlight for just a few dollars. It wasn't extremely bright, but I
liked how compact it was, that it used only a single AA
battery and had a zoom lens. It was actually pretty bright compared to
regular incandescent flashlights I previously used, and had a light
output of probably something around 100+ lumens (which sounds a bit dim
in 2016!). Several years passed and LED technology
has progressed significantly - it's time for a brighter flashlight!
In 2016, I did some research about flashlights and found that manufacturers like Zebra Light, Nitecore and Fenix
etc were making some really bright, >1000 lumen torchlights using very
good quality LEDs (and by good quality, I mean those which are not only
efficient, but also having a high Colour Rendering Index). However, they
were very expensive, typically around the ballpark of $100. At the same
time, I also found some nice, cheap single-18650 torchlights on Amazon
for just a few dollars each. This made me wonder - is it possible to
create not just a cheap flashlight but a powerful one as well?
The result of this was the creation of a LED driver which I have named the GXB20
- G denoting my name, X denoting the fact that Cree's line of 6V/12V
XHP50/70 LEDs were the motivation for creating this driver, B denoting
the fact that this is a boost driver, and 20 denoting that the PCB
diameter is 20mm.
The V1 driver went through a minor revision in early 2017, and the
newest revision as of writing is V2.
Quick links to the sections below:
GXB20 (v2) Feature-List
- Single-cell (e.g. 18650) 2.7 to 4.3VDC input (6V
- Boost Driver + True Constant Current Limiting
- Nominal 18W out (6VDC at 3000mA), (9VDC at 2000mA) or (12VDC at 1500mA)
*note error in silkscreen on PCB above*
- Designed primarily for XHP50/XHP70 CREE or Nichia 144M-series LEDs running in 6V configuration
- 20mm Driver Board Size
- Low-Battery-Voltage cut-off
- Programmable with ATtiny84A MCU and 6-pin SlimStack header
> Configurable modes with EEPROM memory
> Real-time temperature sensing and cut-off
> Two extra GPIOs for Mode Select
> E-Switch capable with firmware
- Over 90% efficiency throughout most output ranges
- 256 levels of true constant current brightness levels
- Off-time Capacitor and mode-memory
In this page, I'll outline the motivations of this project, how I
designed this driver, and how I put them all together. Hopefully this
will also be a useful resource for many like-minded hobbyists around the
world who are also fascinated by flashlights and power electronics :-).
The heart of this project is to create a suitable boost
driver, and we need to do some electrical engineering to get us there.
So let's begin! But first, we need some constraints to frame our
engineering decisions. We will start by determining where we want to fit the driver
into, and what it will drive.
One of the main motivations of this project was to be
able to modify low-cost existing flashlights to make them better. I found that the 'SK98 UltraFire
XML-T6', which retails for just a few dollars each, was an excellent
flashlight to base this project upon.
It has a reasonably compact size, houses a single 18650
Lithium cell, has a zoomable lens, and best of all, costs only $12 for two!
I bought a pair of them on
Amazon and proceeded to take them apart to see how we can modify
them. Note that this particular flashlight was just one of many with the
same generic housing, perhaps all being made cheaply by the same Chinese
supplier. Regardless, it was a good, commonly-available host and a good
place to start.
XML and XML-2 LEDs from Cree - notice the difference in substrate, bond
wires, and phosphor texture
Now these flashlights supposedly come with a 'Cree XML LED'
in them. If genuine, the XML range is one of the best performing 5x5mm
single-die LEDs on the market at time of writing! Unfortunately they turned out to be
non-genuine XML LEDs, made by LatticeBright instead. Don't get me wrong
LatticeBright by itself is a completely legitimate company producing
quality LEDs, just typically at a lower price point and consequently
lower performance. I only say non-genuine since they are often marketed
as Cree LEDs. When running the torch, I found that they were both
drawing around 6.7W - significantly less than the 10W maximum power that
genuine XML LEDs can be driven. There a
few things we can do about this:
1) Replace the LatticeBright LED with a
better one (e.g. XML-2) with better CRI and at desired colour
2) Modify the driver to run the LEDs at higher current to make it
3) Create a new driver to use even better LEDs to make the flashlight
The first 2 are easy to achieve, and in fact I did
modify one of them and replaced it with a genuine XML-2 LED with high
CRI and warm colour temperature (see below). The second is easy to
achieve by simply changing out the current limiting resistor(s). Next of
course, we will try to see if we can do (3) - make a whole new driver
Disassembly of the SK98 UltraFire Flashlight
Disassembly of the flashlight was actually quite
straightforward since everything just unscrews apart. Doing this will
allow us to take a look at the internal construction, the LED in detail,
as well as the driver IC.
The construction of this flashlight is extremely simple
and everything came apart very easily.
In about a minute, we were in! The LED is soldered to a
metal-backed aluminium PCB and is held down to the pill via a screw
holder, squeezing it down for good thermal contact. The pill also houses
the press-fit 20mm diameter driver PCB, where the spring is also
soldered on to.
Replacing the LED with a genuine Cree XML
Now let's take a closer look at the LED. We can
basically see that the LED is not in fact a true Cree LED, but an
alternative part by LatticeBright. They do make decent LEDs, but not
quite as good as a genuine Cree (but cheaper).
Notice the slightly different die size, phosphor
application and bond wires between the green LatticeBright LED and the
genuine Cree XML-2 LED. In this example, I replaced the LB LED with a
Cree one - they have the same size as well as solder pads. This was done
easily using a nice fat-tip on my soldering iron heating up a copper
sheet, where the aluminium MCPCB sits on. The new LED was reflowed on
the same way.
Let's take a closer look at the driver board. It's
labeled YN-20-3, and essentially only has one 1uF capacitor, one SOT23-3
IC, and 4 resistors! How curious!
Clearly all the smarts are done entirely inside the
SOT23 IC with part numbers GY02-45. I could not find anything about this
IC, but it seems nothing more than a very basic PWM-based LED driver
with likely a small integrated FET inside, including some smarts with
off-time memory using C1. I've drawn the schematic above for reference.
It's really built down to a price!
Now we have seen the SK98 disassembled, we can design a
new driver for it.
XHP50 and 144M LEDs
One of the goals of this project was specifically to utilize the extremely high performance
Cree XLamp XHP50 LED in our torchligh, and when they are later released, the
XHP50.2 LEDs (update-
the XHP50.2 LEDs were later released shortly after writing this page). Alternatively,
the 144-series LEDs from Nichia are even more impressive candidates and
also require a 6V drive, and have even better colour temperatures, but
with slightly lower power handling capabilities.
Note- For the majority of this project, I focused on
the CREE LEDs (instead of Nichia) since they were easily available on consumer electronics
sites like Digikey and Mouser, unlike Nichia who do not distribute their
LEDs in low quantities to regular consumers.
The Cree XHP50
LEDs come in a 4-die package and can be driven in a 6V or 12V
configuration depending on PCB layout. I'd like to think XHP stands for
'eXtremely High Performance'. :-)
From left to right, the XHP50.2, XHP50 and XML-2 LEDs (photos by Cree)
As mentioned previously, the Cree
XML-2 LEDs are already some of the highest performing single-die 5x5mm LEDs on
the market today. The XHP50 bumps this up a step further by placing 4 dies on
a same-size 5x5 mm substrate and by adding a widened dome, allowing a maximum luminous
flux of just about 2400 lumens at maximum nominal drive (with the highest
efficiency 70 CRI LEDs) - this is twice as bright as the brightest XML-2. In
addition, the XHP50 come in some very nice high CRI (>90) of different
color temperatures. Finally the XHP50.2 LEDs which were just
announced at time of writing pushes this up to 2654lm max at up to
165lm/W and again with up to 90+CRI (these may be a little difficult to
get until they start to become easily available on the market).
In order to achieve this performance over XML2 LEDs, Cree placed two parallel
strings of 2 LED dies on the same package, so now instead of a Vfwd of
~3V, we have an option of running it at 6V or 12V depending on PCB
layout. So one cannot simply
replace a XML LED with a XHP one since the drive voltage required is
As an example, let's take a look at the XHP50A-00-0000-0D0UH250G, which
is a >90CRI 5000K XHP50 LED with 1032lm at 25C (900lm at 85) with a 12V 700mA
/ 6V 1.4A drive current, and available on Mouser for just about $10 per
piece in 1x quantities. This should give us just around 1900lm with a ~6V
3A drive current.
Chart from Cree - XHP50A Datasheet
There are 3 main brightness settings I'd like to figure
out - full brightness, medium, and a dim brightness for extended run
time or thermal cut-off. I picked these 3 arbitrarily:
1900lm - Full brightness - 3000mA Drive, 6.125Vfwd
770lm - Half brightness - 1000mA Drive, 5.725Vfwd
200lm - Low brightness - 250mA Drive, 5.3Vfwd
Assuming a drive efficiency of 90%, that we use 90% of
battery capacity, and that we use a 3.7V 2500mAh 18650 battery, we can
conservatively say we will get roughly 25mins of run time at the highest
power, 1hr 20min at 'half brightness' and up to 6 hours of run time at
We will use these values later when designing our power
There exist many LED drivers on the market which you can
buy to fit into a flashlight host. Most of them
are typically simple constant current LED drivers. These drivers work well
and are often based on the AMC7135 which is a 350mA low-dropout constant current
regulator. To increase current handling capability, several of
them are usually used in parallel. In simple single-die LEDs, this is a good
and easy solution to achieve Constant Current (CC) operation.
However, they don't address the main challenge we face -
to drive a 6V LED from a single cell (3.7 to 4.2V), we need a
boost converter capable of boosting the voltage up to 6V
(or 12V) to drive the LEDs of our choice (e.g. XHP50) from a single
18650 battery. And at the same time, it needs to be able to handle the high currents required
(3A at 6V). Fitting an 18W DC-DC converter in a small space is
Boost Converter Requirements
- Input voltage - single Li-ion cell
- Be as efficient as possible
- Be as small as possible to fit on a small PCB to fit inside the host
- Output voltage boosted to at least 6V
- Some sort of constant current limit and/or capable of controllable limit
- Capable of at least 3A output (i.e. something like ~7A on the input)
Turns out, Texas Instruments makes an integrated PMIC
(power management IC) which looks as if it was specifically designed for
this purpose! This is the TPS61088 10A fully-integrated
Synchronous Boost Converter! I won't go through all the details here
(check out the datasheet for yourself for all the details), but it not
only checks all the boxes in our requirements, but also adds several
cool features such as thermal shut-down and programmable soft-start.
Best of all, it comes in a fully integrated package with
in-built high and low side FETs for synchronous operation, and comes in
a very small 4.5 x 3.5 x 0.9mm package!
Boost Converter Design
Next we will need to configure our boost converter, and
this depends on how we would like to drive it. So let's determine the
constraints and design around them. To determine the values, I used TI's
excellent WEBENCH designer to do a quick reference design and modified
the suggested values:
Soft Start and Enable
In order to prevent high-inrush current during startup (which will
be enabled via the EN pin connected to our microcontroller), the
TPS61088 has a soft start function controllable by a capacitor on pin
SS. Lets arbitrarily choose a soft-start time of around 10ms - in this
case we can use a 47nF capacitor for a ~11.3ms start-up time.
Switching frequency can be varied between 200kHz to 2MHz, and is
set via a resistor between SW and FSW. In this case, lets just use the
recommended value of 267kR, which gives us a switching frequency of just
around 600 to 595kHz.
Peak Current Limit
In order to protect both the battery and the TPS61088 from a fault
condition, we can set a peak current limit. Assuming a poor 90%
efficiency driving the LED at 3Apk (6.125V Vfwd) and a battery voltage
of 3V, we can see something around 7A from the battery. Due to device
variation, we can add ~1.3A from the datasheet to give us 8.3A, adding
another ~10% safety gives us about 9.2A so let's set a current limit of
9.2A using a 110kR resistor to ILIM.
The TPS61088 can operate in both forced PWM and PFM mode. However,
considering that we will likely not be driving the LED below something
like 200mA, the efficiency shouldn't drop below 90%. Forced PWM also has
slightly higher typical efficiency, so this will be the mode we will be
using. The MODE pin will be connected to GND to run the device in FPWM.
I bolded the title for this section because I think this is a
critical part of LED control. LEDs have an unusual characteristic
whereby changing the applied voltage across the LED corresponds to an
exponential-ish change in current draw (and thus brightness). In
addition, manufacturing differences and thermal effects result in
Constant Voltage LED control to be quite finicky, usually leading to
potentially dangerous situations with thermal runaway, over-current
drive and large LED brightness variation.
Instead, there is a much more linear relationship
between the current draw of the LED and its brightness. It seems
advantageous to approach LED drive with a Constant Current source, which
varies the applied voltage such that the current flowing is at a desired
level. But how to achieve this given that the feedback for the TPS61088
is based on a fixed output voltage (i.e. constant voltage?) - and how to
make this adjustable?
It turns out that there is a way. Since all the feedback
pin cares about is a certain voltage, all we need to do is to create a
system to convert a certain current to a voltage. So what I did was to
drive the LED via a small 30mR current sense resistor. Running a full 3A
through it will give us 90mV. This is too small to feed into the
feedback pin, so all we need to do is to amplify this, and I used a
simple non-inverting op-amp and paired the feedback via a digital SPI
controlled potentiometer. By hooking this up to a microcontroller, we
can adjust the gain of the amplifier on the fly, and therefore use this
method to essentially convert our controller to a Constant Current
Now the benefit of this is that we can now use our
microcontroller to not only adjust the brightness of the LED by
increasing the gain of the amplifier, we can also use it to perform some
interesting custom effects like candle flicker. This can be coupled with
the EN pin of the TPS61088 to also create flashing effects, all without
requiring an additional FET for PWM brightness control, saving us BOM
cost and PCB space.
The main driver board needs to,
at a minimum, house the boost converter and drive the LED at some sort
constant power level. However, it would be nice to have
additional features such as different LED brightness modes, flashing
effects, temperature sensing, battery cut-off and so on. Yet PCB space is at a premium
and we need to be able to fit everything in a really small area.
I searched for some of the smallest possible micro-controller units
(MCUs) I could find on the market which where hobbyist-friendly and still possible to
hand-solder without reflow (i.e. not BGA). Immediately, the Atmel ATtiny13
Micro-Controller Unit (MCU) comes to mind.
The ATtiny13 comes in a diminutive
3x3mm 10 pin 'QFN/MLF' package, and not only works down to 2.7V (1.8V
for the V version), but also has a small amount of EEPROM for memory
functions and has a 4 channel ADC. It's also compatible with the
hugely popular Arduino
environment. There is in fact another smaller version - the
ATtiny4/5/9/10 coming in with a very small SOT23-6 or 2x2mm UDFN
package, but unfortunately lacks EEPROM. (The ATtiny45/85 is another IC
I'm quite fond of but unfortunately it's smallest package is a 4x4mm QFN).
But considering that the 10 MLF package measures 3x3mm,
I thought I'd do another quite search to see if Atmel offered any other
controllers in a QFN package of the same size, and I found that the more
had exactly what I needed! (Note the A version is an identical drop-in
replacement of the non-A version, but the A comes in a few power
improvements with new manufacturing processes, and importantly comes in
a small 3x3mm package which the non-A versions don't).
Using the 20M2 VQFN package gives us the same 3x3mm
footprint as the ATtiny13, but has an additional 5 GPIO pins to use, as well as several more
features over the ATtiny13 (though we probably won't need to be using
them). I arbitrarily decided on some pin functions and wrote them down
to help in schematic capture:
PA6 - ISP Programming MOSI & Master Out for SPI
PA5 - ISP Programming MISO
PB3 - ISP Programming /Reset
PA4 - ISP Programming SCK & CLK for SPI
VCC - 3V from LDO Voltage Regulator
GND - Ground
PA7 - CS for SPI
PA3 - Boost Converter Enable
PA2 / ADC2 - RC Network for momentary mode change
PA1 / ADC1 - Thermistor / Temperature Monitor
PA0 / ADC0 - Battery Voltage Monitor
For PA3, we'll use this for toggling the enable pin on
the TPS61088 high or low. The TPS61088 has a 1.2V threshold so it will
work well with the 3V logic level we will be using for the ATtiny84. CS,
MOSI and SCK will be connected to a SPI digital potentiometer adjusting
the gain of our amplifier. ADC0 can be wired to a resistor divider to
monitor battery voltage to make sure it does not fall dangerously low.
Finally, ADC2 can be used during start-up to sense the voltage at a pin
connected to a large RC network. This node will be charged up to logic
high when the light is running. When power is turned off, a capacitor
will store charge for a while, discharging slowly through a resistor. If
the microcontroller is started up within say ~1s of turning off, it will
see a high voltage here during start-up, and then change the flashlight
to the next mode. The modes of the LED can then be stored in EEPROM for
PCB Design (v1)
With the main design and schematic completed, I proceeded with
PCB layout. (Note - Version 1 has been replaced with V2, scroll
I started off by doing some careful measurements of
where it needed to fit into the flashlight host and settled on
the main dimensions. First I decided on a 19.9mm diameter to fit
into 20mm hosts. This would allow a snug fit with not much
filing - heat-sinking and ground connection is accomplished via
compressive screw fits so I saw no need for a tight
circumference fit. Next I gave a 1mm border ring around the board as the main
ground connection to the case of the flashlight, and placed a
~8.5mm diameter truncated pad in the middle for the main spring
connection to the battery. With the main constraints in place, I
could then drop in all the components and begin routing.
Ideally I'd like to do a 4 layer board with ~2oz copper
thickness, but I
tried to do the best I could to fit everything in 2 layers, and
wound up with the above result with a reasonable minimum 6mil
trace and 5mil spacing. To increase current carrying capacity,
some of the large traces also have solder mask removed for
additional solder. Finally I was able to use no smaller than
0402 components, which should make soldering a little easier
(although the tiny QFN packages will be more difficult to solder
but still doable by hand and a magnifier).
After a day of work I was mostly done. The result for the top
and bottom of the boards looks a bit like this:
A little bit of a squeeze, but I there's actually still quite a
bit of space left on the board!
I could probably do a bit
better but I was quite happy with the result. Some things I
tried to do include placing the NTC as close as possible
to the side for connection to the host wall, as well adding a
50mil 6-pin header-pad for programming the ATtiny84A
microcontroller (which is in fact a regular 6-pin AVR ISP header but
half sized). The main power electronics are on one side and the
logic is on the other, with some care taken to avoid high
current loops being near the controller and peripherals (but it
was difficult to completely avoid this without going
It's always nerve wrecking to check through the PCB to make sure
there are no errors but after looking through the board for a
while, I sent it off for fabrication and hoped I didn't make any
mistakes too big to fix!
PCB Design (v2)
After putting together V1 of the GXB20, I plugged it in and
fortunately everything worked exactly as intended! However there
were a few things that needed to be tweaked and improvements to
be made. Some of these include:
- I wasn't too happy with the layout and felt that it
could be improved a fair bit
- The variable gain amplifier suffered from high wiper resistance when
the voltage dropped
- The variable gain amplifier had a fairly small range (less than 256
- Current measurement was low-side instead of high
- Programming via the 6-pin header could be better
- Wanted to add more features including E-switch operation and mode
The power side stayed mostly the same, but I added a new
high-side current monitor, tweaked the current amplifier
feedback system, replaced with digital potentiometer to a
better, smaller device with an internal boost, added a new 0.4mm
SlimStack programming header and completely re-did the layout
for even better performance. The result was GXB20 V2.
With the new PCB completed, I sent it off for fabrication!
Scroll to the next section to see how it turned out. :-)
PCB Assembly and Testing
Assembling the PCB (v1)
With the PCB layout done, I sent the boards for
fabrication and they all came in good order. The smallest component on
the board here are 0402 passives, which are fortunately still solderable
by hand with very small soldering irons and needle tweezers.
The first GXB20 driver came together without too much
difficulty. Ideally I would be reflowing the board but the
component count was low enough that I decided to do this by
hand. The only component which I soldered with hot air was the
TPS61088 which required a good bond to the thermal pad.
With the driver assembled, I programmed it with the firmware
(after firmware development which took a while), and assembled
it into the SK98 host.
The good thing about the SK98 is that it accepts the commonly
available 20mm 'star' MCPCBs. I purchased a few excellent copper
SinkPAD-II brand MCPCBs and reflowed some CREE XHP50 LEDs I
bought on Mouser. These MCPCBs are particularly high performance
with a direct copper bond from the center heat-tab to the MCPCB
core, but requires a lot of heat to solder.
Assembling the PCB (v2)
After testing out the GBX20 V1, a few changes were made
and the board was completely redone for better layout and with an
updated design. The boards arrived and I assembled a few of them for
Having had more experience, the GXB20 V2 drivers came together
more quickly and I was very happy with the result! Now it's time
to put it to the bench and to see if it actually performs.
Fortunately there were no electrical errors on the PCB but I did
mess up the silkscreen and the driver mistakenly says "3V 6A"
when it should say "6V 3A". Besides the layout changes, note the
addition of a new 6-pin MicroStax header for programming (this
turned out to be a poor choice), a new high-side current
monitor, a smaller digital potentiometer and better layout.
Above is a side view of how the driver looks like.
The new driver requires a small tweak in the firmware, but I got
it up and running in no time and fortunately with no mistakes in
This was assembled into the SK98 host the same way. Note the use
of Arctic silver thermal paste between the MCPCB and the
aluminium pill. The result is a new GXB20 V2 flashlight with a
90CRI CREE XHP50 LED - almost 2000lm of light from a single
18650 in a compact form factor!
In order to test the driver, I needed a way to program the
ATtiny84A on board. The Atmel AVR microcontrollers are easily
programmed via the AVR ISP 2 programmer, which comes as a
standard 6-pin 0.1" pitch header. There's no space on board to
mount a 6-pin header of that size. Instead, I populated the
board with a 0.05" 6-pin pad instead. Next, I soldered up a
simple little connector consisting of a 0.1" 6-pin male header
to a 0.05" 6-pin female header, and soldered a 0.05" male header
to the PCB (temporarily). This then allows me to program the
board easily, especially for debugging. Once I've figured out
the firmware, subsequent programming of the boards can be done
really easily by just pressing the programming header to the
pads and programming it the usually way.
Above you can see how programming the GXB20 V1 works. The
problem though was that the 0.05" header needed to be soldered
on and off each time I wanted to move the driver to the host.
For the GXB20 V2, I used a 0.4mm SlimStack header instead! This
allowed me to program the board much more easily. However I
needed to spin another small PCB which would allow breakout from
the corresponding 0.4mm female header, to the standard 0.1"
6-pin header of the AVR programmer.
To help ease programming, notice I also modified by AVRISP
header to output 5V or 3.3V on the VCC pin, powered via the USB
bus. However, care must be taken when powering the board as
such, because there is reverse diode protection across the
TVL700 LDO regulator, which then feeds directly to the boost
circuit. Therefore some sort of current limiting may be required
when programming in this method. The usual method of powering on
the driver via battery is of course the recommended method in
The first thing I did was to verify basic functionality - can
the driver turn the LED on? And there-after, can the driver
control the LED brightness via adjustable current limiting? If
these two basic requirements are met, we can then test for
low-battery cut-out, over-temperature, as well as off-time mode
memory. I'm definitely not the best firmware writer but I quite
clobbered together a quick firmware and was well on my way to
testing out the driver.
How does the driver do in real life? To find out, I set
up the driver on my bench and got started.
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
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
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.
Test across 20 current
Test of LED current (blue) and datasheet light output (orange) against
20 different current levels, as well as overall driver efficiency
I also spent some time and conducted a little more
reasonable test at 20 arbitrary but equally-spaced constant current
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.
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. There are many limitations of course of this test, specifically
since all efficiency values were with 3.7V at the input. However I don't
have that much time to do a full comprehensive test across different
input voltages and temperatures etc.
Finally, keep in mind that this efficiency number should probably
be treated more as a guideline. I expect the efficiency to actually be
better since there probably is non-trivial ohmic losses in connection
points / spring, and a properly seated driver in a good host with a good
switch should do a little better. So this efficiency is the measured
system efficiency, driver efficiency should be a little higher (esp on
the high currents). Finally the shape looks roughly in-line with my
simulations should it at least gives me a good confidence in my
Overall approaching 90% system efficiency is still pretty
good for me! 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. Overall I'm quite happy with the results as they are around
the ballpark of what I expected.
The proof of the pudding is in the tasting - did the
GXB20 live up to its intended designed purpose?
The goal of the project was to modify a cheap flashlight
to accept a powerful and superior LED, and to develop a driver capable
enough to drive it. I wanted to
find a way to characterize and compare the results. Unfortunately I do
not own a light-meter nor can I quantitatively measure the quality (CRI)
of the light from a flashlight, so what I've done instead is to take a
series of photographs which should hopefully be a useful tool to
determine the brightness of the torch as well as to give an idea of how
it 'looks' like.
For this initial test (and subsequent ones), I decided
to lock on an exposure (which seems very low) in order to prevent
saturation of the image, and to allow easy comparison of the
'brightness' of the image. All photographs will be taken with my camera
with a 35mm focal length set to an aperture of F3.6 with ISO fixed at
400, Daylight white balance (6500k), and an exposure of 1/60 in a dark
room (kitchen). All flashlights were zoomed all the way out.
Let's take a look at how the GXB20 driver performs:
Test above numbered from top left to bottom right
||E44320 Greenlite LED Bulb
||CREE 2016 15W LED Bulb
||Modified SK98 UltraFire with Cree XML2 LED
||Modified SK98 UltraFire with
GXB20 and XHP50A
||LatticeBright 'XML-T6'' LED ~>7000K?
||XMLBWT-00-0000-000HT30E7 80CRI 3000K
|XHP50A 90CRI 4000K LED (G2-Bin)
||Eneloop HR-3UTG AA
||LGDBHE21865 20A 18650 Lithium Ion
||LGDBHE21865 20A 18650 Lithium Ion
||LGDBHE21865 20A 18650 Lithium Ion
I compared the two SK98 18650 flashlights with each
other - one with the original Lattice Bright LED - and another which I
had modified with a genuine 3000K 80CRI XML LED from Cree, along with my
old trusty (but somewhat dim) SK68 single AA flashlight. These were
compared against regular 800lm and 1700lm LED bulbs and of course the
GXB20 light. All batteries were charged to full prior to the
photos being taken (e.g. 18650 charged to 4.2V open-circuit voltage, and
likewise ~1.4V for the NiMH Eneloop). All voltage and current
measurements were conducted using 4-wire terminal method for accurate
You can judge the images for yourself; but what stood out
to me (and via looking at the histograms) was that the genuine XML2 LED
was slightly brighter than the Lattice Bright LED by a hair, but they
all paled in comparison to the modified SK98 with a GXB20 V1 driver and
a G2-bin CRI90 XHP50 LED! The project is indeed a success!
In addition, I did another test by zooming the
flashlights all the way in and to compare how bright they are at maximum
throw. The flashlights were placed at the same distance from the wall.
was certainly quite dim, but it was able to make a tighter beam using
the zoom on the lens, but also due to the smaller die size. Finally,
it's interesting to see how the XML2 die is in fact quite a bit larger
than the Lattice-bright LED die. Finally, the same 'speckly' pattern can
be observed between the genuine CREE LEDs (XML2 and XHP50), but the
4-die arrangement is very obvious in this case! I think it's a pretty
interesting pattern (which only really becomes annoying at max zoom), so
I don't really mind it at all given how much light it provides!
Overall, the GXB20 driver project is a success in terms
of light output! Time to put in a XHP50.2 or Nichia 144 when I can
purchase some of them!
Firmware, Modes and Real Life Usage
Having completed the GXB20 in early 2017, I've since
brought it out in the field and am pleased to say that it has met my
expectations! I've also settled on an -ok- firmware which has
served me well in the field and seems to work w.r.t. the safety and
Above is the overall firmware modes in what I hope is
Overall I'm very happy with how this project turned out!
I certainly never made the GXB20 driver to be commercial in mind, and
really was a just-for-fun project and for me to try my hand at creating
something fairly tricky (i.e. a high power DC-DC converter in a very
small package). I've learned a lot from this project, and it's really a
bonus that I get a few really high-performance flashlights as a bonus!
BudgetLightForums - Thread of this project as it progressed
Jaxman E2 -
CPF) A flashlight with very high CRI 5700K Nichia
Fasttech - SK68 AA Flashlight for $3.85 and free shipping!
Digikey - A contender for an excellent linear regulator
Maxim - Reverse current protection
- Copper MCPCBs
Fonarevka - Russian Boost Driver
Operational Smoke - DIY Microscope
Gough Lui - Philips Bulb Teardown
Back to main page
(c) Gao Guangyan 2017
Contact: loneoceans [at] gmail [dot] com