When I ran across the Jar of Fireflies Instructable sometime this past summer, I knew I had to build it. Full credit to Keso for an excellent set of instructions! I wouldn't have gotten to the point of developing the firefly behavior without such a solid base for building the hardware, as well as firmware to start it out with. If you have already built a firefly jar according to those plans, it should be straightforward to reprogram it with my firmware to change its behavior.
I wanted to go a step farther when I built the firefly jar as a Christmas present. My goal was to have multiple fireflies interacting, including males that sometimes synchronize with each other, and females that respond to the flashes of males. I also wanted to base it on the behavior of our backyard firefly, Photinus pyralis , the common Eastern firefly, which is also one of the best studied. I wrote my own software for the microcontroller to simulate this behavior. The full project is documented here , but this Instructable should be enough to follow.
The latest version of the firmware is available on GitHub .
A means to program it. I use a 6-pin header connected to a USBtinyISP.
Both of these are outside the scope of this Instructable. For the first, please refer to the detailed instructions at the original Jar of Fireflies . If you need help with programming the AVR, a good place to start is the AVR tutorial from Adafruit .
I tried making a video to demonstrate the flashing behavior. The quality isn't great (it's from an iPhone, and I reduced the quality to upload it):
The only changes I made to the original hardware were the addition of a push on/push off switch (scavenged from a stick-on LED light) and a 6-pin programming header to allow reprogramming of the jar after it had been built. To make testing and debugging easier, I also built a prototype board on a 2"x2" perfboard with the same schematic, so it is electrically identical but easier to see what it's doing, and less fragile. I've added a view of the point-to-point soldering on the back of the prototype board in case that is helpful to anyone. The prototype board can also be used as a target board for programming ATtiny85 (and -45) chips for other purposes. In the real jar, the switch and header are fixed to the underside of the lid with J-B Qwik to keep them well attached.