Monday, July 23, 2012

Super RGBW Light

I bought this awesome triple-emitter monster light when I was in China at the SEG market in Shenzen. I think it’s a TrustFire TR-500. I couldn’t leave it in its stock “500 lumen” configuration (which is definitely a lie – I measured emitter current at 700mA, which, from the XR-E datasheet, should come out to 3 x 1.70 x 87.4 = 446lm for Q2 parts, and that’s just emitter lumens. Probably around 300 out the front). The first thing was to up the drive current. The stock driver is a boost converter to run 3 series emitters (~9.3V) from 2 18650 cells (~8V). Luckily the main FET still had its markings intact, so I could look it up. It was a surprisingly oversized part with a 50A rating, so I just replaced the current sense resistor with one calculated to hit 1.5A, and it worked. I used 3 T6-binned XM-Ls in cool white, which should give me 551x3 = 1653lm, and probably around 1200 out the front.

I wasn’t happy with the modes that the stock driver had, so I poked around with the scope until I found the pin on the (unmarked) microcontroller that was doing the PWM. They put a big 8-pin micro on there, so I didn’t want to just remove it in case it had some functions other than the modes, so I just cut the PWM pin. From there I just steal 5V from its power pins and run my own PWM into the previously-connected pad on the board.

Plain white light isn’t quite awesome enough, so I needed to add red, green, and blue. I wasn’t willing to give up one of my XM-Ls for a color multi-die emitter, so I milled spots for the extra emitters in the gaps around the edge of the reflector piece, and drilled wire conduits down to the back of the reflector. There wasn’t enough room to put any kind of optic in there. I had to cut out some tiny circular star boards from full-sized ones.

 There was enough room inside the driver cavity to add my own board above the stock driver. I used one of my simple flashlight boards that has an 8-pin micro (PIC12F615), 4 FETs, and 4 current-limiting resistors. For this light I only use three of the FETs and route PWM from one of my micro pins down to the driver board to run the white LEDs.

The color LEDs are a royal blue XT-E and red and green XP-Es. There was a ton of wiring coming out of the back of the reflector but I managed to fit it. I wrapped my added board with electrical tape to prevent shorts. I had all kinds of problems with shorts on the XM-Ls that I fixed with a bunch of carefully cut kapton tape on the underside of the reflector.

The finished product came out great. The code is a modification of my flashlight driver code that I use with color MC-Es, so some of the modes are hilarious with the white so much brighter than the colors. Mode selection is done with a half-press on the switch, and it times out after about 4 seconds and reverts to the first mode. Here are the modes:


High white – the 3 XM-Ls run at 1.5A
Low white – 3 XM-Ls at 10% duty
Low red – the red at 25% duty
RGB stunner – my imitation of the DHS Dazzler. Strobes R, G, B, and combinations at randomized time intervals
Color shift – gradually fades through colors made from combinations of R, G, and B
Color freeze – pauses on a color selected in color shift mode
Firelight – mixes white, red, and green to create light that flickers and imitates fire light
Red –
Green –
Blue –
Police – alternating strobing white and blue
Red beacon – briefly blinks red about twice a second
All on –

Here’s the code. A side note on software: This uses a neat trick I developed for flashlight drivers—instead of the normal means of detecting power loss to cycle modes (with a diode and a big cap), I use RAM retention. When each mode is entered, a RAM location is written with a value that will send the light to the next mode. When power is lost, the micro stops running when its cap drains below 1.8V. RAM is retained until 1.0V, and the power draw is miniscule once the oscillator stops, so this RAM location stays valid for quite a while. When the micro boots up as power is restored, it checks the RAM location for the direction to go to the next mode. If power is left off for a while, the RAM location gets wiped and the micro starts back at mode 0.

No comments:

Post a Comment