D.I.Y. Illuminated tailcap

Hey TK just had a look at your tail cap firmware looks pretty concise already. Should make for an interesting new tail cap version

Yes it works sometimes, and as ToyKeeper pointed out, is very sensitive to about everything, especially the battery type. So for each combination of battery and driver you will have to figure the values out. Thusfar it never worked for 18650 batteries: I tried the same blue/red tail-board that worked well enough on a 16340 flashlight (blue fades away between 3.7V and 3.8V with red still bright) on a BLF-A6 and the blue led stayed lit brightly until the low voltage protection (2.8V?) kicked in.

Also a zener diode did not shift the voltage at which the leds started dimming: at these very low currents things appear to work different.

My current EDC (Supfire S1 host, 3-mode FET-modded AK-47 driver, sliced Nichia 219C):

16340 IMR battery, red 603 tail-led with some resistor (forgot) + dedomed XM-L2 (6A1 80CRI ) tail-led without resistor, 680 Ohm bleeder resistor on the driver. With a full battery the white led is clearly brighter than the red led, once the two leds appear the same brightness to me, the battery is half empty, between 3,6V and 3.7V, the white led fades further when the voltage is getting lower than that.

Do we need to set up a simple constant current circuit so they stay the same brightness. Would it then cut of at a specific voltage?

As is, it should spin on every button tap. I don’t know if this will be annoying.

The MCU goes to sleep after it completes a voltage readout, then stays asleep until the watchdog wakes it up. There are probably ways to reduce the power more than I did, but I consider that an optimization for later. Those steps would be added to go_to_sleep(), and the driver could be put back into a more normal state in the WDT handler.

This definitely needs to be calibrated before I expect it to work. Battcheck should be fine.

I’m guessing about a lot of things because there’s no actual hardware to test on yet. I just used something vaguely similar in hopes it’ll be close enough. And I intentionally left it pretty simple… it can get fancier later if desired, if the hardware works.

Once it’s shown as working, just throwing in a delay should remove the spin on every tap, no? Just select a delay which is longer than a medium press.

Anyone order the smart tailcap board and planing to test it out?

Nope, just ordered the dumb 6-led board.

I can not program, I can not flash. I do like to see it happen though, and oh, can it made to play music too? And project the voltage? (aspheric tailcap!) :-) ;-)

I have seen cheap little novelty clocks project the time! :smiley: I think I disassembled one many years ago and iirc it projected thru a tiny LCD (digits clear, background dark).

For the music, would a limited range midi tune be ok or do we need full range mp3s? :party:

I ordered some

I’m busy redecorating my study at the moment but once that’s done I will be ordering a load of different tailcap board to do some testing. Need to get the tail of my Red S2+ sorted out and upgrade the driver firmware to TK’s latest masterpiece.

Actually, I ordered the new dumb rings, and both sizes of smart boards. I can’t wait to get them at start testing!

I still have an empty S2+ host, so hopefully tonight I’ll have time to try some different ideas on sealing up the tailcap without blocking all the light.

Let me know how it goes. Are you using one of the light boards?

I don’t have the rings yet, but I think the 19mm Rev5.1 will work with some edge trimming because the led’s are so close into the center. I’m just going to try different things to do the waterproofing and do some dunk tests to see how it works. I’ll have to add the led’s later.

The pictures I posted earlier was just of a mock-up with a Rev4 board and zero water resistance.

Well I’m not too concerned with the waterproofness as long as its shower proof.

@TK

Thanks for your explanations, made it much clearer to me. I was stunned how fast you came up with that firmware, mad skills involved!

So, I never really asked… instead I just jotted down the first idea I had. But assuming the smart tail board works…

… what do you (anyone/everyone) want it to actually do?

It has three independent pairs of colored LEDs, probably red/green/blue. The location of each pair is likely to be sort of visible through the tailcap. It can sense voltage. It can measure time. It can make relatively simple calculations. It only runs while the main light is off (I think). So given that, what would you like it to do?

Personally, I can’t speak for the others, slight delay so that I wont flash during mode changes, blink the voltage (volts, pause, tenths) then either constant on or a beacon (can choose in firmware). The beacon could be in the different colours depending on the voltage?

That’s just me.

I think do as many different options as you have time to think up! Personally, I like simpler better. Animations are cool, but I think I’d tire of them quickly. I would like just a different color based on voltage/percent of charge. So from 100–50 it’s one color, from 50–25 it’s a different color, from 25–0 it’s the final color, then it shuts off the led’s completely. We could do that with the led’s on all the time, or have an option for just a ‘beacon’ flash every 3-5 seconds.

I think having in the firmware a choice of Animated or not would be useful. We can then turn on Animation to impress friends, and off again for normal use (for those who prefer no animation in normal use). Some of the Animations could be just for showing off, like a continuous spin, and some could be useful, like batt checks and things.

I’d also like to see a beacon flash that breathes (ramp up, then down). Bonus if it ramps up in a rotation (set one, then set two, then set three), and back down in the reverse.

For a simple, quick batt check, among other options, it might be cool to have the option of a “three bars” rough indicator. If all three sets of LED’s are on, you have great capacity left. Two LED’s would mean a middle amount. And one set would mean you need to change cells soon. Kind of like PD’s suggestion, except it wouldn’t rely on different colors of LED’s on the board.

Being able to set a universal “brightness” setting that covers all the modes would be a great feature. Then changing from Animation to plain or from batt check to a regular beacon, or whatever, wouldn’t require any further adjustment in brightness settings.

It would be great to have configuration options like TK’s other firmware, but I don’t see how that’s possible. Once the mcu is flashed and the board is installed in the tailcap we won’t have any way to input changes to the mcu. Everything would have to be decided at the time of build, unless maybe we could have a way to switch something based on grounding an mcu pin? It could be worked into the Rev4 boards with the smd switch on spring-side maybe.

So I like simple, but a “breathing” beacon would be sweet. Although I don’t think that will be possible either. :_( TK, the Attiny will only be able to output ‘high’ or ‘low’, with no steps in between, right?