E-switch in the tailcap mod via additional button cell

I have been playing with Toykeeper’s ramping FW on my e-switch lights and really like the features, so I’ve been thinking of ways to convert my rear clicky switch lights to e-switch. There are generally two ways to do this. You can keep the driver at the head and just route the wires for the e-switch back to the tailcap, but this requires some fancy contact engineering to be able to make and break an additional connection when you replace the battery. I’ve seen a couple threads of people doing this, here and here.

Another way is to put the driver in the tailcap so you don’t have to route the e-switch wires, but then you need a separate power source for the driver MCU and FET gate. I chose this method. I purchased a Li-ion 2032 rechargeable coin cell and got to work.

The light I chose to do the mod on is an Ultrafire F13 which I’ve modded to a triple dedomed XPL and CUTE-3 optic.

I made a pill for the tailcap consisting of the e-switch at the left attached to the 2032 cell, then a plastic spacer, then the retaining ring with the driver attached. It is lightly epoxied together.

The battery positive is connected to the LED positive, but is not connected to the driver positive. The LED negative is connected to the flashlight body/ground.

The driver ground is connected to the main battery negative, but it must be separated from flashlight body/ground in order for the FET to act as a switch. I have a plastic ring separating the driver ground ring from the retaining ring.

The output from the FET is then connected to the retaining ring and flashlight body. Coin cell positive and negative are connected to driver positive and ground, respectively. Connections are soldered to the coin cell.

I used a bleeder resistor system to keep the coin cell charged. There is a 4.7KOhm resistor in parallel with the LED, and another 4.7KOhm resistor connecting the driver positive/coin cell positive to the flashlight ground right after the FET. The resistors are placed such that when the flashlight is off the two batteries are in parallel through the two resistors and the coin cell can charge from the main cell. When the light is on the coin cell has a parasitic current through the one 4.7KOhm resistor, and it powers the MCU. Together this is about a 3mA current when the flashlight is on. The coin cell is ~50mAh (rated), so this allows for a long on-time.

The driver is a 17DDm FET+1 from mtnelectronics, but the FW on the attiny13A is FET-only so the 7135 is not used. I have been working to make this FW work with FET+1 drivers in order to get a lower low, but have not been successful yet.

I plan to do this e-switch mod on my S2+ and thrunite T10, hopefully with working FET+1 ramping FW.

Update 3-7-17:
It turns out the two 4.7KOhm resistors are much too large to keep the coin cell charged while off. I discovered this when I found the coin cell had discharged. This is because of the parasitic currents of the MCU in sleep state (~0.18mA) and from the voltage divider for voltage monitoring (~0.17mA with 23.7KOhm total resistance). I have removed the voltage divider so this leaves just the 0.18mA current to deal with. The charge current is equal to the difference in voltage between the main cell and the coin cell divided by the total resistance in the bleeder circuit. The voltage of the coin cell will settle at the value such that the charge current equals the parasitic drain of 0.18mA. This means that the voltage of the coin cell will settle to some value that is lower than the main cell voltage.

The coin cell will have a voltage that is lower by the amount:
deltaV=R(0.18mA)
where R is the total resistance of the bleeder circuit which consists of the resistor that is in parallel with the LED and the resistor on the driver that connects the driver positive to the flashlight body after the FET.

As can be seen, with the two 4.7KOhm resistors the deltaV would be 1.7V, which is too much; this is why the coin cell discharged. A lower total resistance of 1KOhm means the deltaV will be 0.18V. This deltaV is still significant but workable. It means the coin cell will always be at a lower state of charge than the main cell.

The lower resistance required means the parasitic current of the coin cell while the flashlight is on will be higher. If I choose 800Ohms at the driver and 200Ohms at the LED, that is around 3.8V/800Ohms=4.8mA from the coin cell while the flashlight is on. This is significant but again is workable if the coin cell actually has around 50mAh capacity. Also that parasitic drain is for when the FET is open 100%; in lower modes the parasitic drain would be less.

So the constraints for this system to work are narrower than I first thought. The main possible failure is when the main cell is at a low voltage. The coin cell will be at an even lower state of charge and the allowed on-time could be lower than I’d like.

Respect ! This I way beyond me so highly impressed!

Yep, what the Miller said. :slight_smile: :+1:

really like this mod.

Wow! Amazing work.

Looks like this would work with any e-switch driver.

Thanks!

It is very satisfying to see it work as I’ve put a lot of thought into it.

Yes, I think this should work with any e-switch driver.

I’d like to try to replicate this mod, but I’m not sure where everything should be wired up.

Would it be possible to post diagrams, labeled pictures, or more detailed instructions on where to wire what. I don’t want to do it wrong and have my flashlight explode.

Thanks!!! I have so many lights I’d like to try this with. :sunglasses:

Here is a topic for eswitch modding

Just add a bleeder parallel to LED and a charge resistor in front of the small battery

Sure, I can make some graphics that make the connections a bit more clear.

FYI, there are also smaller Li ion 1220 cells for smaller lights.

I looked into using a super capacitor instead of a battery, but I don’t think it would work for this purpose. They just don’t store enough charge. Super capacitors in this size range have around 0.5F, so they would store around 4V(0.5F)=2C of charge. The attiny13 takes about 2mA when it’s active, so that means the cap would have enough charge for roughly 2C/(0.002C/s)=1000s, which is only about 15 minutes of on-time. Apparently the Ti tool uses a super cap to power its tail e-switch, so I’m not sure of how that works specifically. I would guess there is less of a power requirement.

The tool only powers a fet as eswitch in tailcap
MCU is in the head

Wouldn’t it be possible to do it that way?

You just need to reverse the battery and make a negative contact area around the plus pole. The flashlight body now is the conductor for the regulated current with positive voltage.

What do you think?

I think this would work, but not with the FET drivers we normally use. I think a P channel FET is needed for this arrangement.

I realized I miscalculated the bleeder resistances necessary to keep the coin cell charged. I updated the OP with details.

I lowered the resistance of the bleeder resistors. I ended up using 470 ohms on the driver and 100 ohms in parallel with the LED. These resistances will lead to a deltaV for the coin cell of (570 ohms)(0.18mA)=0.10V below the main cell voltage.

The resistor in parallel with the LED had an unexpected effect. It lowered the lowest brightness possible with a FET only driver. It lowered the lowest brightness from ~5 lumens to 0.5 lumens, depending on the battery voltage of course, turning it into a proper moonlight mode. The lowest mode brightness can be tuned by adjusting that resistance. Adding this parallel resistance has a similar effect to adding a gate resistance, which I recently investigated to achieve the same effect.

Another solution for tailcap driver without coin cell is use the tube only as negative conductor for the LED
And use a bleeder resistor parallel to the LED that can fully power the MCU

But you need to adjust the LVP and VCC detection resistors
As well as moon modes levels need to be adjusted as the bleeder uses current thats not going through the LED

I don’t think this would work.

If you added the second bleeder resistor that I have (connecting driver positive to FET drain/body tube) it might power the driver with the flashlight off, but when the FET opens the voltage at the driver will fall to nearly zero.

It works I have a light here on the table which does exaclty this
when I measure parallel to the LED I get 33 Ohms for the bleeder in this imalent light
I bet a 100-200 Ohms will do fine as well

What are the details of this light?

If I’m reading your drawing correctly it looks like if the FET closes (becomes a short) the MCU positive and negative are shorted together.

The light must use a little PWM even on highest mode to charge a capacitor
this also leads to the relatively small bypass resistor of 33 Ohms

Actually, I still do not get this. How is the driver connected to positive when the light is running?