Firefly jars

My family is having a “no bought gifts” Christmas this year. So, we decided to make a bunch of tappable firefly jars as presents. They had to be cheap and easy to assemble.

I’m really happy with how they’ve turned out.


In the dark, they’re quite hypnotic.

We used old glass jars, diffused with some spray on paint. Inside, there’s an MSP430G2221, 7 LEDs, 2 resistors and a piezo transducer (to detect tapping). Cheap and simple.

I prototyped everything on TI’s MSP430 Launchpad before home-etching some single sided PCBs.
Here are the Eagle CAD design files. Admittedly, the Launchpad is only $4.30, but, I didn’t want the bulk.

Here’s the first prototype:

Each jar contains seven lights, which slowly synchronize with each other over time, like real fireflies. Tapping the piezo transducer in the lid makes them all flash and randomises the pattern.

Real flies synchronize with pulse coupled oscillators. Here’s a good overview. I use a simple algorithmic version.

And here’s my firmware image for anyone wanting to make their own: fireflies.elf.gz.

Here’s my source code (compile with mspgcc).