Top

Building an IKEA Firefly Light with ATtiny85

Building an IKEA Firefly Light with ATtiny85

Did you ever wanted your room decoration to be a smoothly fading light strip in a jar?
Inspired by the Pimoroni firefly light I built my own variation with an ATtiny and two AA batteries instead of using a Raspberry Pi Zero and a huge battery pack.

There are three LED strings that fade in a sine pattern. Two of them fade anti parallel at one of 16 adjustable speeds. The third fades differently at a second configurable sine.
This is how the final result looks like! I’ve built this thing as a birthday gift for my girlfriend, she really loves it.

After some planning I ended up buying three SÄRDAL lights and one ENSIDIG jar at IKEA for about €15.

Then after unboxing the lights, I completely disassembled them and desoldered the cables in order to attach them to the ATtiny later on. Some measuring showed that the inbuilt circuit boosts or drops down the voltage to about 2.6 V if load is applied. If the output doesn’t draw enough current the voltage jumps up like crazy. That is why I decided to power at least to strips anti parallel to manage a continuous minimum draw of one strip in sum. This means the two strips share the duty cycle of the PWM output. If one strip is of, the other one is on.
I just added a third strip to give the whole thing a more beautiful attitude. This one runs on the second PWM channel output.

All three LED strips are power directly from the controller because each of them draws about 30 mA at around 2.6 V which is in the specs of the ATtiny.

In order to make some settings I added a jumper and a push button. The push button toggles through PWM 16 different prescalers to adjust the sine frequency whereas the jumper is used to decide which PWM channel should be adjusted.

Everything you need in addition to the IKEA stuff is

  • 1x Atmel ATtiny85
  • 2x 100nF
  • 1x quite big elko around 330µF to smooth the voltage
  • 1x Push button
  • some double sided tape to attach the circuit to the battery housing

Hardware

The images below show the schematics, pin mappings and the final circuit.

Software