Lantern with fire effect powered by ATtiny85, ws2812b leds and the FastLED library.
The main feature is the Fire2012WithPaletteLantern pattern. It's a modified version of the Fire2012WithPalette Fastled example. A relaxing glowing fire effect is rendered.
Key components:
- ATtiny85 running at 8 mhz, ATTinyCore
- 14 ws2812b leds
- 4 reachargable AA batteries and holder
- a sacrificed lantern
My protoype version was integrated into a Ikea Solvinden solar garden lantern. Solar charging was not implemented, due to a too low voltage of the built-in solar panel (2.8 V under optimum conditions).
The ws2812b led strip is configured in two stacked rings of 7 leds, 14 leds in total. Leds 1 to 7 are in the bottom row, 8 to 14 are in the top row.
It is powered by 4 rechargable AA batteries (about 5.6 when fully charged). I added a fuse to the supply rail. Voltages low as 3 V also seem to work, as long as the current can be supplied.
Power to the ledstrip is controlled through a PNP transistor controlled by the microcontroller. This was done to reduce the power consumption during sleep.
A piezo disc with parallel resistor is used as a impact detector. It's glued into the hole of the original lamp. The battery holder rests on top of it and is secured by multiples blobs of hot glue. When it is triggered the lantern wakes up from sleep or it cycles through the patterns if it's awake. You can use a switch instead.
Batteries fully charged (5.6 V):
- rendering pattern: between 50 mA and 100 mA
- max current trough PNP transistor: 160 mA
- sleep current: 10 μA
On startup / wake up the last used pattern will be rendered by the leds at maximum brightness. Every minute the brightness is reduced one step, until the brightness reaches a lower treshold. At that point sleep mode is entered.
When the piezo is triggered hard enough, the lantern wakes up or goes to the next pattern if it was already active.
Besides Fire2012WithPaletteLantern, some other patterns are also included:
- rainbow (Fastled)
- rainbowWithGlitter (Fastled)
- confetti (Fastled)
- bulb
Example of ATtiny pin change interrupt: