Hi, I know this is way late… but I finally made a version of STAR which uses memory decay instead of a capacitor to measure off time. In case anyone wants it:
I played the STAR_noinit for a while. It worked perfectly with my QX5241 buck driver but it did not work with my CL6807 ( similar to PT4115 ) driver. The driver became no memory. I thought may be the 3.3V VCC to the Attiny13A from the voltage regulator is too low for the ram retention. I will replace with a 5V regulator to test again when I am free.
I’m not aware of any sort of standard beacon, but there are a few I find useful… one is what I call a heartbeat beacon, which flashes in the following pattern:
On 5ms
Off 245ms
On 5ms
Off 745ms
repeat
Another I find useful is a looping battery check mode, which flashes once for each 25% of the battery’s current charge, then pauses and re-checks and repeats. It’s more like 100ms on-time with 400ms between, and 2-3s between cycles. If left on for a long time, the number of flashes will decrease until the light eventually shuts off.
One more thing to consider is the brightness. A signal beacon should be pretty bright, but a “find the light indoors at night” type beacon should be dim. For the latter, one popular approach is a short (~3ms) flash at a moon or low level every 2s.
The one I use the most is a stutter beacon, used on a head light or tail light while biking or skating. It stays on all the time, but changes brightness to make itself more noticeable. The pattern I use there is:
High 5ms
Low 65ms
High 5ms
Low 65ms
High 5ms
Low 65ms
High 5ms
Low 65ms
Low 720ms
repeat
So, 4 brief high-brightness blinks and then it rests at low, and repeats at 1Hz. As for the levels to use, I’ve found that 40lm / 400lm works well, or 7lm / 150lm. There must be a pretty big difference between high and low.
static void inline pwm_strobe()
{
while (1){
PWM_LVL = 255;
_delay_ms(20);
PWM_LVL = 0;
_delay_ms(90); // change the parameter 90 to up to 65535(ms you want the light to be off)
}
}
You would have to move the pwm configuration code up a bit as well, since you are using pwm here. You could just call strobe2(on, off) instead, with the values you want.
Late to the party, but great find alexvh and DrJones! This would actually work the majority of the time for me as I usually set the OTC to around 500ms. I still have a roll of probably 100 capacitors, so I'll just stick with the "traditional" method, but this is a sweet solution.
Thought I’d update this thread with some info… This brownout method for short presses works a little differently with some of the low voltage MCUs and the “standard” 10uF input capacitor. It takes a lot longer for the memory to decay. Seeing this on the 84V and 85V.
It can be useful for retaining data during long presses with off time cap, but a little annoying when function testing firmware.
tested on ak47a and now this is my favorite firmware. Love the hidden strobe. Can you add a battery voltage indicator ? and maybe a step down when voltage low :bigsmile: