Postmodern Sysadmin

A blog about servers and junk

My Jar of Fireflies

I’ve seen a lot of electronic fireflies on the internet. Here, here, and probably others. The theory is simple, just small LED’s charlieplexed with a microcontroller. I wanted to take it a step futher, with a light sensor, solar panel, and more complex firmware.

This is my first microcontroller project from scratch, and I got to learn all sorts of interesting things like SPI programming, Watchdog Timers, Sleep states, and many other things…


I wanted to flash more than just one firefly at a time, so I couldn’t do true PWM with all 12 with an ATtiny85. So I came up with my own way to control varying levels of brightness. Also I wanted a light sensor so the fireflies could come out slowly during the night, and the quickly disappear when the lights come on. The hardware was pretty difficult to solder, involving stripping magnet wire and hand soldering SMD LEDs.


Sorry for the poor pictures, my camera doesn’t do well in low light.

[flashvideo file=”video/fireflies.flv” /]

All the code is located here. You can check it out using svn or just download it directly. I was hoping to use a solar panel to make them self-sufficient, but they required too much power for them to be useful unless they were in direct sunlight.

The parts list and schematic and more info are on my wiki.