D.I.Y. Illuminated tailcap

1813 posts / 0 new
Last post
pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

Joat wrote:
Has anyone tried adding a diode in series with the LED to increase the total Vf? that might make the drop off with battery voltage steeper.

It was tried pretty early on, Rev1 of my boards I think. It didn’t appear to anything different than having a higher resistor in series.

You’re always welcome to give it a shot though, maybe I missed something

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Joat
Offline
Last seen: 10 months 3 weeks ago
Joined: 06/13/2013 - 23:43
Posts: 524
Location: Minnesota

At some point I’m going to have to start doing some board design, I’ve stacked SMD parts off pads and air wired before but 0805 parts are tiny.

pyro1son
pyro1son's picture
Offline
Last seen: 7 months 4 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

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

Pastebin                                      &nbs

djozz
djozz's picture
Offline
Last seen: 6 hours 16 min ago
Joined: 09/07/2012 - 17:04
Posts: 17993
Location: Amsterdam

pilotdog68 wrote:
SciFiFreak wrote:
OK, so the consensus seems to be that using the LED Vf to prevent over-discharge probably won't work. What are your thoughts on the dual LED that should shift its combined color spectrum as the voltage falls?
I think Djozz actually tried to jerry-rig something like that. Djozz?

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 Cool) 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.

pyro1son
pyro1son's picture
Offline
Last seen: 7 months 4 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

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?

Pastebin                                      &nbs

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 15 hours 40 min ago
Joined: 01/12/2013 - 14:40
Posts: 10761
Location: (469219) 2016 HO3

chouster wrote:
That colorful swirl… it does it on every boot. So would it start blinking on every short press?

When is the MCU sent to sleep? If watchdog wakes it up every x seconds, basically all the functions like ADC (and that other stuff on page 32 in the t13A datasheet) could be turned off and the port pins can be set to inputs before going to sleep for power reduction, right?

I think we would need a firmware for calibration, right? Could we just use battcheck for that, or would we need something different here?


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.

Halo...
Halo...'s picture
Offline
Last seen: 5 years 2 months ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

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?

djozz
djozz's picture
Offline
Last seen: 6 hours 16 min ago
Joined: 09/07/2012 - 17:04
Posts: 17993
Location: Amsterdam

Halo... wrote:
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!) Smile Wink

Halo...
Halo...'s picture
Offline
Last seen: 5 years 2 months ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

I have seen cheap little novelty clocks project the time! Big Smile 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

pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

Halo… wrote:
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?


I ordered some

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

pyro1son
pyro1son's picture
Offline
Last seen: 7 months 4 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

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.

Pastebin                                      &nbs

mattlward
mattlward's picture
Offline
Last seen: 11 hours 58 min ago
Joined: 06/19/2015 - 09:20
Posts: 3160
Location: Illinois, USA

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

EDC rotation:
FW1A, LH351D 4000k (second favorite)
FW3A, LH351D 3500k
FW3A, SST20 FD2 4000k
FW3A, Nichia 4000k sw40 r9080 (favorite light!)
FW3A, Cree XP-L Hi 5A3
Emisar D4V2, SST20 4000k
S2+, XM-L2 T6 4C

pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

pyro1son wrote:
Need to get the tail of my Red S2+ sorted out…

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.

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

pyro1son
pyro1son's picture
Offline
Last seen: 7 months 4 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

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

Pastebin                                      &nbs

pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

pyro1son wrote:
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.

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

pyro1son
pyro1son's picture
Offline
Last seen: 7 months 4 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

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

Pastebin                                      &nbs

chouster
Offline
Last seen: 7 months 1 week ago
Joined: 02/20/2014 - 15:05
Posts: 746
Location: germany

@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!

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 15 hours 40 min ago
Joined: 01/12/2013 - 14:40
Posts: 10761
Location: (469219) 2016 HO3

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?

pyro1son
pyro1son's picture
Offline
Last seen: 7 months 4 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

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.

Pastebin                                      &nbs

pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

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.

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

DavidEF
DavidEF's picture
Offline
Last seen: 2 weeks 2 days ago
Joined: 06/05/2014 - 06:00
Posts: 7699
Location: Salisbury, North Carolina, USA

pilotdog68 wrote:
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.

The Cycle of Goodness: “No one prospers without rendering benefit to others”
- The YKK Philosophy

pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

DavidEF wrote:
pilotdog68 wrote:
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?

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

pyro1son
pyro1son's picture
Offline
Last seen: 7 months 4 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

Just use your switch board as a star. Switch one way and the star is joined ect…

Pastebin                                      &nbs

pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA
pyro1son wrote:
Just use your switch board as a star. Switch one way and the star is joined ect…

Yeah that’s what I mean. I think it would require a re-work of the Rev6 board and obviously added to the firmware though.

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

SciFiFreak
Offline
Last seen: 6 months 2 weeks ago
Joined: 02/11/2015 - 21:43
Posts: 109
Location: Boise
pilotdog68 wrote:
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.

+1

chouster
Offline
Last seen: 7 months 1 week ago
Joined: 02/20/2014 - 15:05
Posts: 746
Location: germany

Would it be possible to make a board with a slot next to the spring, between spring pad and outer ring, where we could insert a smd-switch, that’s soldered on the backside and can be switched from the spring-side? Don’t know if there’s enough space or if it’s a good idea at all, it just came to my mind…

edit: I took a look at the sizes of that smd-switch and the board and it seems that’s quite unmanageable.

pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA
chouster wrote:
Would it be possible to make a board with a slot next to the spring, between spring pad and outer ring, where we could insert a smd-switch, that’s soldered on the backside and can be switched from the spring-side? Don’t know if there’s enough space or if it’s a good idea at all, it just came to my mind…

Well….
We already have Rev4 (and Rev5a). See Post 565 and Post 613

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

chouster
Offline
Last seen: 7 months 1 week ago
Joined: 02/20/2014 - 15:05
Posts: 746
Location: germany

Yes, I knew that. I just thought with the slot-idea the spring would stay compressible all the way and maybe it would’ve been easier to solder, but again (see the edit), it was not one of my good ideas, sorry, I’ll just keep calm and let the experts talk, because I can contribute little to nothing anyways.

pilotdog68
pilotdog68's picture
Offline
Last seen: 5 months 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

chouster wrote:
Yes, I knew that. I just thought with the slot-idea the spring would stay compressible all the way and maybe it would’ve been easier to solder, but again (see the edit), it was not one of my good ideas, sorry, I’ll just keep calm and let the experts talk, because I can contribute little to nothing anyways.

Yeah I don’t think it would work very well to try to mount it on the back. For the record though, the SMD switch is very low profile, I really don’t think it affects the switch compression any more than our usual spring bypass.

Keep the ideas flowing!

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 15 hours 40 min ago
Joined: 01/12/2013 - 14:40
Posts: 10761
Location: (469219) 2016 HO3

pyro1son wrote:
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?

This is very do-able, with only small changes to the current firmware. You’d still have to select everything at compile time though.

This gives me another idea too. It could potentially spend the first few seconds acting as an OTC approximator. By that, I mean it could stay off for 0.5s, then turn one color until 1.5s, then start its normal standby routine. This might help people understand the short-medium-long button press timing better. That is, assuming the button timings are properly calibrated.

pilotdog68 wrote:
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.

Also very do-able. It doesn’t currently shut off the LEDs below a minimum voltage, since it’ll still have the MCU’s sleep / standby current being drained and it might lead the user to think it’s actually “off”, but it could be done anyway.

Otherwise, this is trivial to do. It uses 5 colors instead of 3 right now, but that’s an easy change.

DavidEF wrote:
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…

I’d also like to see a beacon flash that breathes (ramp up, then down).

… 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.

Being able to set a universal “brightness” setting …


Runtime config options are probably not feasible. It could do like the main driver and change behavior based on timing of button taps, but that would kind of interfere with the main driver. A solderable star (or switch) somewhere could be used, but it needs a PCB change and would be limited to only one toggle option since there is only one pin left. So, it’ll mostly have to be configured at compile time.

Ramping or “breathing” beacon might be possible but it’s not exactly easy. The LEDs are on pins which only have “on” and “off” states, so ramping would mean manually trying to do PWM on pins not intended for it.

The three-bar indicator is very do-able too. It might draw more power with more LEDs on, but this remains to be seen. It also would be limited to only three levels unless the board were modified to use 4 LEDs instead of 6.

Brightness can only be meaningfully adjusted in hardware. The attiny can’t do PWM while it’s asleep, and it should probably spend as much time as possible asleep to avoid draining the cell too fast.

On my Ferrero Rocher driver, I measured about 1.23mA with one LED on and the attiny awake. I measured about 0.36mA with one LED on and the attiny asleep. And 0.33mA with one LED in a kludged “low” mode with the attiny asleep. (mis-used hardware features to get a 100% “high” mode and a ~2% “low” mode, but this isn’t supposed to be possible) So, there’s a big difference between being awake or asleep.

Pages