Developing a customizable driver

I considered a charge-pump to get above 4.5V but the good compact drivers didn’t separate power-in from control-in.

The microcontroller on my test board uses a 10-bit ADC to measure current and a 10-bit PWM to set output voltage. The compact PIC I’ll be using has a 16-bit PWM but I haven’t determined yet its speed versus resolution so I’m not sure how granular it’ll be on the final product, but even 10 bits is 0.1%

Nice, TPS63020. That’s the same part I was looking at for a potential buck/boost driver.

Hi, this sounds like an interesting project. I’m happy to hear the plan includes making the source code public.

People can be very picky about user interfaces. As you said, UI issues are much of what prompted this project… and different people like very different interfaces. So if possible, I’d suggest trying to make sure the driver has code available and can be reflashed pretty easily.

That concern may be a bit lower-priority for this though, if the goal is to make a tactical-style light with just one or two modes on a rear clicky switch, with a minimum of 25 to 50 lumens. There doesn’t seem to be a lot of overlap between the tactical crowd and the fancy firmware crowd.

It would probably be a good idea to include low-voltage protection though, and possibly thermal regulation too. Zoomies and P60 hosts like the WF-501B don’t have very good thermal dissipation, so 2.5A sustained could cause damage.

The microcontroller I’m planning to use does have an internal temperature indicator. It’s not terribly well calibrated so would be best as a threshold monitor rather than a continuous-range thermometer. Provision for ramping down power or even a full disable above a certain temperature would not be difficult. A more complex driver could utilize an external sensor on an I2C bus but that would require a micro with more IO.

For my own use, I’ll probably stick to single-mode or, at best, a two-mode with low and high. My code commenting is thorough so adding or editing brightness modes as a third party should be fairly simple. I’ll probably code in a strobe mode as an example but won’t use it past testing. Implementations with single-mode, multi-mode brightness and multi-mode including strobe modes will be available for customization.

When you say “tactical-style”, what exactly does that entail? I’m really just looking for a particular size that’s handy to put in a pocket. I don’t like all the modes and I don’t like all the jagged protrusions things specifically advertised as “tactical” seem to require. If I did go in on a batch of something like the 501b bodies I’d see about custom-maching the bezel to get rid of pocket-snaggers.

I’m finding it difficult to locate a zoomie light body with a smooth bezel also. The one I have to test with has an aluminum pill that threads into place so it should be better than the P60 at transferring heat to the body. That insert in the 501b has me worried about its ability to clear heat. But I won’t be able to do burn-in tests until my PCBs are in hand. Just found out they’re completed but haven’t shipped yet.

Regarding fancy firmware: feature creep is not my friend.

Right, there’s more than one definition of “tactical”… but I’m not talking about “tacticool” with sharp edges everywhere designed to hurt people. I just mean something with a mechanical tail button for overhand or cigar grip, and a very simple UI. Usually these have forward clickies (tap while off for momentary use) instead of reverse clickies (tap while on to change modes), but not always. Usually they have one mode, or a small number of modes without memory, with high first.

The entire category of P60 lights is a popular type of tactical lights. They were originally designed to protect incandescent bulbs from shock and insulate the user from its heat, while also making it easy to swap out the light engine. With LEDs though, the P60 design has become far less popular and many people migrated to smaller designs with integrated pills for faster thermal transfer.

As for what is popular these days… er, Zak and /r/flashlight maintain a nice list of popular lights.

If SolarForce was still around, I’d suggest looking there for P60 hosts. They made some of the best, and for pretty decent prices… but they closed and I’m not sure if anyone is making quality P60 hosts any more. It seems like most of that market moved to tube lights like the Convoy S2+.

About zoomies, the best one I’ve used is a Jax Z1. It may be a bit large though, and zoomies in general are typically somewhat specialized instead of general-purpose. I mostly use mine to scare away noisy owls without disturbing the neighbors.

Simple tailswitch, simple UI, sounds about right.

If I’m looking at the right thing, that Z1 is definitely without sharp edges, but my pocket won’t accomodate a two-inch bezel. The lights I have to play with are in the 25-30mm neighborhood which is pretty comfortable so I’d like to stay in that size range.

It’s probably pretty crappy by y’alls standards but back around 2012 I picked up a couple of single-mode lights in some branding or other (I believe Small Sun ZY-C84) of this body. One was stolen and the other burned out but I still have the body and it was about the only thing I found that fit all my criteria for size, general appearance, function and non-stabbyness.

I wouldn’t mind being able to offer a fixed reflector option as well in a similar form-factor. P60 body is just what I have on hand to mess with (and also what I know I can acquire in bulk) but isn’t a design requirement. I lack the machining infrastructure to make my own at present, but maybe someday.

I would guess, based on your linked list of popular lights, that 18650 “Duty lights” would be most likely the category I’d try to work in. “Simple operation” and “reliability” are two of my favorite things to design for. My best friend is a first responder, daughter of a cop and an ambulance driver, and she’s already asking about getting some lights for volunteer firemen and as door prizes at fundraisers. I would enjoy being able to offer customizable packages for her people.

Also got word my prototype PCBs should arrive on Monday so I’ll get to start testing next week. Still need to adjust my code for the different microcontroller but that shouldn’t take long.

Hi Sidehack, welcome to BLF!

Is your initial design for 1S?

Yeah, single-cell only.

Couple sample bodies arrived from the factory yesterday so hopefully soon I’ll get a board populated. It’ll take a few hours to update the program for the right microcontroller but hopefully next week I have something working.

I will be waiting for that 8A+ 1S boost driver you will make one day (;

Not sure how I didn’t notice when tracking down parts, but the micro I had in spades in 8-SOIC and have been programming with for years is also available in the tiny QFN package so I’ll just be getting that one instead and not have to adjust the program. There’s a lot of benefits to coding in assembler but the main drawback is lack of portability. Should have some results next week.

My regular work has been slowing down, and I know I’m new to the community and have zero reputation but I’m considering looking at design work and bidding small-batch jobs. I get PCBs from a US factory and have pick-and-place and reflow equipment with my assembly business, so I can bid small manufacturing runs of outside designs if anyone’s interested.

5-6A good enough? Might have a few more projects coming up since I got a bunch of time now.

There is a pretty economic 5A driver from Convoy:
https://www.aliexpress.com/item/33021024834.html?spm=2114.12010612.8148356.9.3d8c3cf19IZ0B2

The emitter that are usually paired with these drivers are the Cree XHP70.2 because it is very efficient and very high output in 1 single emitter package.
The Convoy M3 is an example. The Convoy M3 does not have very good thermals.

The convoy M3 uses a 30mm diameter driver board. However if you could make a 20mm board which the Convoy L2 host uses, it would be exceptional host because the entire head is a solid pill for the emitter.

If you are designing an economic driver for mass production, probably 5A is a good balance. But if you are looking for something special, 8A+ would have a unique demand.

XHP70.2 is what I’m looking at for the project, so that’s just about right. I’m still working with 17mm but if it’ll fit in 17 it’ll fit in 20. I’ll start with what I’m looking at for a 4-5A boost (with thermal-limit ramping) and if it works well I can start digging up a design for a bigger one. If I want to.

Looking at a 6A high-efficient buck driver also. Nothing exotic so not terribly expensive.

I’ve been told I should look into a FET tailswitch for Convoy builds too, which will definitely help with efficiency for those high draws. Guess I should buy some Convoy lights so I know what everyone’s talking about.

Yes, convoy is truly economic. If anyone is going to mod, they will most likely start with one of their designs.

Are you talking about thermal management for driver only or LED also?

A FET switch would be a great boost to efficiency. Looking forwards to seeing that.

Figured it was safest to put temperature sensing on the MCPCB. Driver heat is both less prevalent and less critical than LED heat.

I’m working with a little zoomie right now I want to see about building into a 3-mode low/high/stupid with a FET tailswitch. What would be the best Convoy body to look at for a FET switch also? Not going fancy, no blinky lights, just on/off.

[quote=Lexel]

Very interesting new driver. Is that buck/boost driver is similar to lume1 or is total new design compatible with existing Bistro HD and Anduril firmwares?
For mosfet switch seems Convoy S2+ tailcap have enough room for that from what i see from that thread:

So what started as a single modest project has turned into a bit of a project family for me. Regular work has slowed down so there’s plenty of time now.

I’m looking at somewhat standardizing a control package, which means microcontroller, current sense amplifier, error-amp and temperature sensor set up in a fairly repeatable/reusable configuration. To start, I like the three-setting “low/high/stupid” where “stupid” is basically the max that the LED or driver will sustain, temperature-limited by a sensor placed near the LED. Software of course is flexible, so additional modes are possible. The microcontroller is intentionally fairly minimalist so there aren’t extra lines for fancy stuff, but sufficient to integrate one channel of 10-bit current setting, battery monitoring, temperature monitoring, one regulator en/disable and an off-time-capacitor read for mode switching, plus EEPROM for persistent memory settings. Everything I care about is possible.
I’ll also see about building a FET tailswitch for efficiency, but that’s not immediately necessary.

For current drivers, I’m looking at 1S voltages for input and would start with 17mm size. Attempts will be made at:
2.5-3A buck (existing project)
6A buck
4-5A boost (6V)
8A boost (6V)

My cousin and his mechanic friends have requested a decent penlight so I’ll also be working on something there. I’ve got some samples of a buck/boost that’ll pretty fully utilize 2xAAA voltage range.

Found a decent dual-phase driver for the 6A buck which will take up a bit more board space for inductors, but the resulting drop in conduction losses and reduced input and output capacitance requirements should more than make up for it.

The 8A boost will be fun, if it’s even possible. I’m looking at using a non-exotic controller and external FETs for increased flexibility, better heat handling and easier sourcing of parts. Eats up more board space so it may not fit in a 17mm but I won’t find out until I try.

8A out of 17mm would be ambitious to say the least! Usually it’s limited to 6-7 amps at 6v and in 20mm and more sized drivers. I’d love to see that a reality since you could make an absolutely amazing C8 out of it! That xhp70.2 would be upwards of 5500-6000lm. Thermal regulation would be critical though.

Looks like loneoceans has designed an 8A boost on a 17mm board but I’m not sure if anyone’s building it. I currently have no real use for this but it’s an interesting challenge. Low priority at present.

Thermal regulation would be implemented, as currently planned, by a SC70-5 temp sensor mounted on the MCPCB close to the LED and relaying directly to an ADC line on the microcontroller. The micro can use its internal temp indicator to trigger a shutdown based on driver PCB temperature, but current regulation would be done by limiting the max temp of the LED board, ramping down to maintain a maximum temperature (value TBD).

One thing to consider with the control package will be current sampling. I can either measure it directly from the low-side resistor and then use a resistor divider to scale my PWM output accordingly, or use a current-sense amplifier (ie INA199A1) to measure from a low- or high-side resistor. The former approach reduces parts and complexity but also reduces noise immunity and increases measurement error. The latter approach should result in a more precise setpoint at the cost of more parts, both passive and active, but should also allow for a smaller current-sense resistor and therefore a better efficiency. Amplifier sampling with kelvin connections will minimize ground-current errors also, and the higher voltages in use will reduce input offset voltage error. I assume the increase in precision (and marginal efficiency gain) is worth the extra effort?