Flashlight Firmware Repository

You could just attach directly to pin 3 for the lighted switch. I believe the 17ddm board has a tiny pad as well to that pin.

Thanks fellas. :beer:

Just a few potentially helpful notes:

From Spaghetti-monster.txt

THERMAL_WARNING_SECONDS might be worth investigating, it appears to only be a default 5 second minimum delay, but testing a 1 might be worth a shot incase halfspeed or declocking the MCU is messing with it.

adc.c

adc.h

TBH though I think you may need an answer from TK because I simply dont know enough about the underlying code of the temp control functions. What doesnt make sense to me though is that it works fine on Narsil.

Just for kicks, do you have a Q8, D4S or another eswitch light lying around that you could flash your prototype build to just to see if regulation works properly?

I have a Q8 I could try it on I suppose. I can try that tomorrow morning if I have some time.

Yeah, I kinda figure that TK will be needed to sort this out. I really want to use Anduril and this seems like it would be a fairly simple bug to fix.

I pretty much don’t buy lights anymore, not enough time and after I finish the work on project lights I have been too burnt out to even think about messing with my own. I have a whole shelf full of lights that need work but have not gotten to any of them lol.

I think this is a really good idea.

Without seeing yours I made my own as well, on paper at least.

Nice one.

In the meantime, I just built it by hand.

After looking at yours I am not convinced mine is better in any way, but I did want to post it to get the ball rolling a little bit for the community

Love it. If it works, then it is good. :slight_smile:

OK. I have a request. I was going to start a new thread, but then I thought I should mention it here first and see what may come of it. If I don’t get my request met here, I will still start a thread on it. The request is simple. Here’s what I want:

  • Candle mode from Andúril ported to ATtiny13.

Now for the explanation, if you care to read it. I want to make a small “driver” board for a flickering candle light. I had the idea of using a cheap RGB LED (like THIS one) to make the light change tint as it “flashes”. I would probably use a set of three resistors to set each color channel to a “base” level, with different levels for each color channel. Those would be fed directly from the source power when the candle is “on”. Then I would use another set of resistors to set the “top” level of the “flicker” and those outputs would be added to the “base” levels at the output. By doing it this way, I could use lower levels of green and blue for the “base” color of the flame, leaving it looking more red/orange. Then, add more blue and green to make it whiter/yellower at the top of the flicker flash.

Here are the exact levels I was considering…

Base:

Red….10mA
Blue……0mA
Green…5mA

Flicker (added to the Base):

Red….10mA
Blue….10mA
Green…15mA

Which would make the totals range:

Red….10 to 20
Blue……0 to 10
Green…5 to 20

By using resistors to set the output levels this way, I don’t need anything fancy for the programming. Just the wonderful Candle mode of Andúril, which I need to have ported to ATtiny13. The reason I want it ported isn’t because of cost. It isn’t even that I want to exclude all the other modes and things that Andúril can do (although it’s true I don’t need them). It’s the size. I can get an ATtiny13a MMU from Mountain Electronics which is super tiny, so I can make the candle driver really small, which gives me more choice of what size(s) to make my candle(s).

Since there’s a lot more room even on the ATtiny13 than is needed just for a Candle mode, if you wanted to get fancy, you could re-code it to use both PWM output channels of the MCU. One PWM channel could feed the “Base” output bank. The other PWM channel could have the Candle flicker. Then, some configuration options could be added, making the firmware more useful to more people. Also, since all the outputs are controlled by the MCU this way, the driver could use 7135 chips, or FET, or other means to send PWM controlled power to the outputs. If there’s room, the Andúril lightening mode could be added to the firmware as well, with some relevant config options, making the driver even better.

If anybody is willing to make this firmware mod, I’m willing to pay you for it. I don’t know anything about writing firmware. I don’t even know how, nor have the equipment, to flash the firmware. So, I need somebody to flash it to the chips for me as well, I guess, for which I will also pay.

Nice idea!
Only a quick note since I’m in a hurry: what do you think of a couple of WS2812 or similar mounted in a row (or a short lightstrip with this LEDs). Then you could even simulate a flame gettting higher and lower. I’m planning to do something like this mounted in an small 3d printed housing but the realization would need some time since I’m pretty busy for the rest of the year after finishing my contest project. I wouldn’t mind to publish code and circuit (if it gets realized finally). I’ve done similar projects for the mentioned RGB LEDs before with Arduinos and I might be able to squeeze it into an Attiny13.

Edit:
Sorry David, haven’t read your post carefully, what I mentioned seems too large for your project.

Flashy Mike, no need to apologise. I like your idea too! I’m probably not going to have any chance of getting my idea realized before the end of the year either. If you can squeeze the code that you are talking about into ATtiny13 then I can probably still use it for my project(s). I would love to see what you come up with.

Ok, I’ll see what I can do.
Do you already have a specific design in mind? Which power supply do you intend to use?

I printed this samples with different filaments today. Its a special print technique, only a single wall is printed as a spiral upwards which means you don’t see any seam. Its pretty tough though, could easily be printed shaped as a candle flame:

Im game for a BLF Candle project.

thats basically all my Q8 does anymore.

You can get an Attiny25/45/85 in a small package as well if you really want to.
https://www.digikey.com/product-detail/en/microchip-technology/ATTINY85-20MUR/ATTINY85-20MURCT-ND/2774367

Ah! Good to know! :partying_face:

In fact, I’ve probably seen that part before and forgot about it. :person_facepalming:

I don’t really have a design in mind, and I haven’t begun choosing parts. That huge post of mine this morning was really as far as I’ve gone. It was coming fresh as I was typing it. I simply had a thought and started putting it down in words so I wouldn’t forget it myself, and also so hopefully somebody would be willing to help me make it happen. :smiley:

However, I was thinking of “traditional” sizes of candles, particularly the skinny cylindrical candles used as Christmas lights. This is mostly because I was first thinking of LED Christmas string lights, and ended up thinking of candles too. I was also pretty much thinking of using “normal” cylindrical Li-Ion cells to fit in the cylindrical candle “hosts”. But pouch cells and other types, shapes, and sizes of cells could be used. Even a button cell, or a stack of them, could work for a votive or tealight candle.

Mostly, I guess, my goal was/is to make a more realistic flame using colored LEDs and the candle flicker mode of Andúril. I’m really flexible about the size and shape of the thing. I just really like the thought of pushing the realism as far as possible. That’s why I like your idea of the “climbing” flame too.

I’m going down a very similar path you are: Anduril Candle DIY Project

This was centered around an 18650 so there’s tons of space you can reduce. This is about the size of two stacked cells. I’m curious about the 1800k to 6500k cct would make it seem candle like using the lantern branch of FSM with the tint mixing option. Then playing with ramps.

Thanks for chiming in! :partying_face:
How did I miss that thread? :person_facepalming:

A note for anyone else trying to build Anduril on MacOS using a homebrewed avr-gcc:

Use “avr-gcc@4” rather than the default version to get around this issue without having to change the source.

On a related note, I should be sharing a patch and a hex for Anduril on the Astrolux S43 driver in the next few days.

Did you also fix the wrong PWM frequency? If not, take a look at this branch: HW-HAL-bugfixes : Code : Flashlight Firmware Repository