LED drivers and Accessories you want, but don’t exist

If you look at a chip manufacturer’s site for switching LED drivers, you notice that there are many options for low current applications (<=700mA), but fewer chips are available for high current uses, and the highest current option is sometimes not high enough for flashlight enthusiasts. On the other side, there are many chips for constant voltage available that meet all the requirements, but output a constant voltage, completely unsuitable for LEDs that require constant current.

The usual way voltage mode converters control the voltage is with a voltage divider. The chip tries to meet a specific voltage at the voltage divider, so a constant voltage is on the output, no matter what load is connected to it (when talking about an ideal voltage regulator, a lot of factors play a part in real world). When there is a load transient (jumping current requirement), e.g. the current drops, the converter still is at the old duty cycle for the old load, resulting in rising voltage. The converter recognizes the voltage rise, because the voltage on the voltage divider at the feedback pin rises as well. The converter‘s aim is to get back to the specific voltage the chip wants to have on the voltage divider. So, in our case, we have to make a circuit that outputs a specific voltage when specific current flows through our load, which then is connected to the feedback pin.

How does current sensing work?

There are two ways sensing current:

  1. When current flows through a resistor, depending on the current (Ohm’s law), it creates a voltage drop. The more current flows through the resistor, the more voltage drop you get over the resistor.
  2. A conductor creates a magnetic field when current flows through it. The more current flows, the stronger the field is (Ampere's law). This magnetic field can be measured by hall effect sensors.

Ways to use the current sense methods for voltage mode switching

The easiest way to control the current is this one:

The sense resistor is directly connected to the feedback pin of the converter. If the feedback voltage is 1V, the voltage drop over the resistor always is 1V. It’s very inefficient, and there is just one current option possible. To improve the efficiency, we can add an OpAmp with a digital potentiometer controlled by a microcontroller, forming a noninverting amplifier. Now the sensed voltage drop over the resistor can be a lot smaller because it gets amplified by the OpAmp, and many different output levels are available, thanks to the programmable digital potentiometer:

This is not the only possible way to connect a potentiometer. One of the two resistor can be a normal one, and the other resistor can be a potentiometer as a rheostat, or a resistor before the potentiomter can be used to get some amplification even when the potentiometer is programmed to the miniumum.

This is the basic circuit. Now we get into a different topic that sometimes creates a problem: Amplification

An example: You got a converter that always tries to get 1V on the feedback pin, and you want a powerful driver that puts out 10A with 100mV maximum drop over the sense resistor to get good efficiency. The value of the resistor then needs to be: 0,1V/10A=10mOhm. So on the maximum level the OpAmp needs to amplify the signal by 10. If you want to go down with the current, you need to increase the amplification, so for 50mA we need a factor of:

Voltage drop over R: 0,01Ω*0,05A=0,0005V or 0,5mV

Factor: 1V/0,0005V=2000

We need a factor of 2000 to get to 50mA. And if we want to go down more, it gets even worse. With 10mA we need 10000. And to again half that, we need double the amplification, so the needed factor goes up exponentially. That’s why you get so many small current steps (0,1mA steps) on the low current side, if you try to get these low currents. But if you go up with the current the steps get bigger and bigger, so in the end the gap between steps could be 4A or so. But this is not our only problem. The more we go down with the current, the less voltage drop is over the sense resistor. And with 10mA current or 100µV drop over the resistor we already are below the input offset of many OpAmps, creating huge amplification errors (of course there are some OpAmps that have a very low offset voltage, but the bandwidth of them is usually pretty low). We need to get that amplification factor down.

Luckily, some chips have a special pin on them for voltage tracking. It then uses an externally connected voltage as the reference instead of the internal one. Depending on the allowed input voltages, we maybe can input a 0.2V external reference, greatly decreasing the needed factor:

0,2V/0,0005V=400

Now these are factors we can work with. But what if there is no such pin available on the chip?

This is where we add two resistors and a constant voltage source:

It basically is a voltage divider that gets biased by our feedback from before. Now, if the current rises, the voltage on the feedback pin rises, and the converter tries to lower that feedback voltage, giving us the current we want. That way we don’t need to have very high amplification factors. The formula to calculate the needed resistors is:

Now to get the problem with the current steps solved, we can use a MOSFET to change the resistance of R1 (R2 can be changed too) and use a different new feedback voltage. For low currents we can set the new voltage reference pretty low (0,05V or so) to keep that low amplification. To still get many small current steps on high current operation, we can switch off that mosfet to lower the top resistor value, and use a higher new feedback voltage (maybe 0,8V).

If you have a chip with a special pin, you can just change the voltage on that pin, but if you don’t have that, you can use this option.
Now the high new feedback voltage is for the high current part, the low new feedback voltage is for low currents, lowering the needed amplification. This way you don’t need to find a balance between really low and really high amplification factors, and get many small current steps. The problem with the OpAmp (needing really low input offset, and Rail-to-Rail operation on in- and output) still isn’t completely solved though.

And hall effect sensors?

The other option for sensing current is magnetic field sensing. There are ICs out there specifically made for current sensing, but these chips aren't an option for low current drivers. Their analog output noise is problematic (400-70mA sense error because of noise, unamplified). But on high current applications, they could be used.

This text is just about the conversion and amplification. There are other things to keep in mind, e.g. bandwidth and slew rate of the OpAmp to keep the converter stable and prevent oscillation (the higher the amplification factor, the lower the bandwidth). Another thing is compensation of the feedback (how fast and until which frequency the converter reacts to voltage changes on the feedback pin), which is sometimes internal, sometimes external (then you know the requirements of an OpAmp better).

These ideas not only apply for buck converters (as I used them on my pictures) but on any converter that works like this with a feedback pin.

I hope everything is correct. If there are any mistakes or if something is unclear, please tell me.

Too much information at once? :smiley:

:smiley: Perhaps!

All useful ideas, though, so it’s nice to have them written down here :slight_smile:

Mine is quite simple, as most of it’s features already exist in the FET+1 MTN driver and LD-4 driver, but I’d like a simpler/more accessible (i.e. made in china with free shipping) option

Regulated driver, max 3 to 4,5 amp depending on config (could be single channel, could be a 2 channel amc + another higher amp regulator). If dual sided, that the spring is narrow enough to enable the use of a retaining ring (have soldering/desoldering drivers) by letting the AMCs sit closer together. Bleeder resistor for illuminated tailcap, plus ATtiny25 and OTC for Bistro compatibility

If I understand correctly, two of the main roadblocks right now are waiting for gcc and avrdude to support the 1616/1617 chips?

The driver will likely also need some acupuncture holes or pogo pads to facilitate flashing.

As for firmware, I’ve got a lot of the hardware abstraction already done, to enable e-switch firmwares to run on a variety of driver types. I just haven’t used it on anything beyond tiny25/45/85 with 7135 and/or FET PWM channels, so the first other driver type will likely require some additional plumbing work.

In any case, all the FSM UIs should work with little or no change once the toolkit itself has had a new driver added.

I’d be happy with a simple 1×AA 1-mode 1A+ driver for LEDs, even if it’d require NiMH over alkaleaks. Highest output I can find is for 800mA (FT driver).

Better for 1- or 2×AA, eg, 1V-3V.

It’s a bit out of my league / over my head, but i think i understand generally what you’re saying.
The problem is ‘lossless current sensing’ if i’m not mistaking.

Maybe you can increase the magnetic field enough to use a hall sensor.
Maybe by making a small electro magnet with a couple of windings of 0.8mm copper wire?

Which FT driver would that be? The good old Nanjg 102?

Think this is the one I use for matchmods:

https://www.fasttech.com/product/1127402-12-aaaaa-1-mode-800ma-linear-booster-led-flashligh

At least it’s what I could find right off. :smiley:

There’s the 5-mode which just populates the blank spot for the µC.

It’s not just lossless sensing, but building a circuit to amplify the current signal without creating too much error is difficult as well. Another thing is to get small current steps on the high levels (you may end up …0.5A, 1A, 5A or so).

You create a coil (called solenoid), which is what we have to avoid. Even if the inductance is really low, I don’t want to try that. A coil (with all of it’s effects) on the output of the converter between the led and ground maybe could even prevent a buck or boost converter from working at all. The converter could oscillate because of the inductance, it would never reach the wanted current. And I don’t even want to know what self-induction could do to a GND signal and it’s connected chips…

Let’s see, maybe I can do something about that. 17mm diameter?
——

For the firmware people:

To make all the DigiPot buck and boost designs work (maybe some more changes in the future are needed, but just to make it work, this is required), we need a change in the firmware. Instead of a pwm signal on the output of the MCU (like in many firmwares), we need the MCU to put out an SPI or I2C signal for a DigiPot (I think SPI is easier to implement). Very often you don’t even need a real SPI signal, but rather 3 pins with the first beeing a “device select” pin, the second pin is just oscillating, and the third pin puts out the data (8-16 bit length).
——

Another thing: I have now found a pretty easy way to make a switching converter work with e.g. bistro or biscotti (in theory, hopefully it works in practice), but it’s limited: It needs 2 DigiPots (there are chips with 2 in 1 package), so more surface area. I think the difference of the forward voltage created by the LED (lowest to highest mode) shouldn’t be more than 1V or so, to keep the current steps small.

Yep. 800mA is okay (for 3V from alkies, or 2.4V from NiMH), but it’d be nice to be able to run a bit higher from NiMH cells that can put it out pretty reliably. 2 eneloops in a modded MiniMag would kill, if enough light output would result. Even 1.5A or so would help.

One other item on my wishlist would be a decent 1-mode (as to not complicate things) so that a single 18650 or 26650 could decently drive an XHP. An F13 that can dissipate some decent heat could make good use of an XHP35 or XHP50. Right now, I’m using this to drive a regular XM-L or XP-L (forgot what’s in there) from a 26650.

I see no reason a decent cell can’t push more regulated power through a decent chip. 2.8A into an L or L2 is great, but it could use a little more oomf it the host can handle it.

The F13 takes a 22mm driver, the P60/P90/D26 in the MiniMag a 17mm. 20mm is common enough in other lights, too, eg a SK98.

First try on a 1-mode Buck-Boost converter for 2-3AA or 1 LiIon cell:

It uses a TPS63020. You have to calculate max current yourself (see page 13 in the datasheet), but it can do more than 800mA, even worst case. The current can be programmed via one resistor. There’s a jumper as well to choose between normal mode and low current high efficiency mode (see figures 10 and 11 in the datasheet).

How do the spring pads work? They appear to be seprate from the rest of the underside, is that simple so the IC can be heat sinked with those vias or are they V+ and ground?

From what I see the left pad with the vias is V+, the right pad is floating and is just to hold the spring, and the middle vias go to the ground ring and are there to heatsink the IC.

Jensen567 got it right :+1:

I just stumbled upon a tool to program attiny1616 and other tinyAVR chips:

I’m not that involved into this, how can we program the new Tinys then? With an USB to TTL adaper? How does this work on the software-side to get the code sent to the MCU?

Now this is something more powerful:

This is a 1-Mode boost converter with an MP3431 on a 17mm board, powered with 1×18650 or something similar (max. input current 19A!). Current is set with one resistor, like the 1-Mode buck-boost circuit before (of course you can change the current sense resistor as well).
If it doesn’t get too hot, this circuit could supply (calculated values) up to 6-7A to an XHP50/50.2/70 (the lower the forward voltage of the LED the better), or a bit over 3A to an XHP35.
Heat probably will be a problem, but for short bursts, it should work.

Liking the nice fat copper traces going to the SW, GND, and OUT pins, and especially the nice short path from the chip GND pin to the driver ground ring. In a host with a retaining ring for the driver, or soldered driver, you should get good heat transfer out of it for high current.

Nice thread!
I’d like to see a 10~12mm sized driver for 10440 flashlight with high cri nichia. Preferably e-switch with Narsil or comparable ramping firmware, blinking out the voltage and supporting lighted tailcap. With a true moonlight and direct drive mode. Thermal regulation would be nice, but I think can only be accomplished with the driver behind the MCPCB.

(Being able to run it on AAA as a fallback would be a nice bonus, but definately too much to ask for. )

To build something as amazing as CRX did here Lumintop Tool Ti
but running Narsil would make me a very happy man!