This instructable gives a solution and shows how this synchronization can be achieved.
I have always been fascinated by self organization of insects. A couple of years ago I wrote a Java-Applet that simulates a square of thousands of fireflies. It worked well and was fun to watch. This time I have done it in hardware.
Credits for inspirations goes to Keso and his Jar of fireflies http://www.instructables.com/id/E7U5HYMSVIEWP86SAL/.
Any comments or corrections are welcome.
Update 2008-09-12: There is a new version of the fireflies online at Synchronizing Firefly Howto. It has a custom PCB for every firefly. And you can buy a kit at the Tinker Store.
Here is the video:
Remove these ads by
Signing UpStep 1How it works
What can be observed is that the fireflies start with random blinking. But as time goes by, they are able to slowly synchronize with their nearest neighbors. And these neighbors are synchronizing themselfes with their neighbors and so on an so on. Until the whole tree or the whole valley blinks in the same cycle.
And what is it good for? It is used to attract other specimen. With all the blinking in sync it is much easier to find a partner.
One of the easiest algorithm to explain this behaviour goes like this: You have a value that holds the power to flash. As time passes this power will slightly raise. If the power reaches a certain level, the firefly flashes and the power is consumed. The rate at which the power raises is nearly the same for all fireflies. So they have the same frequency but not the same point in time to flash.
While slowly charging with power the firefly is able to detect a flash of another firefly nearby. It adds then a higher value to its power value. Some kind of power boost, if you wish. That means the next flash will occur earlier than the one before. And next one even earlier, until these two are flashing exactly at the same point in time and with the same speed.
You can find more on this algorithm e.g. here:
Firefly Synchronization Ad Hoc Networks
The Hardware
I decided to use my previous instructable (Programmable LED) as starting point. It consists of a microcontroller, an LED and an Light Dependent Resistor (LDR). That should be enough to simulate a simple firefly. It is able to flash, to see and to count.
I just had to modify the program and the orientation of the LED and the LDR. LED and LDR must been placed in a way that one firefly circuit is able to interfere with another. So one LDR must be able to "see" the LED of another firefly. And it should not only see one neighbour but more. That can be done by letting the LED and the LDR pointing up from the ground and use some white paper to reflect the flashes.
| « Previous Step | Download PDFView All Steps | Next Step » |














































I remembered an old german tv documentary (maybe Spektrüm) about non-linear and chaotic systems, fractals and some structures called "cooperative aggregation" or "cooperative memory" (i don't know exact term), if you remove a little pixels of a picture after iterations lost information can be repaired (rebuilt). brightness of each pixel is sum of neighbors brightness with particular weight. a focused camera on a tv was setup of this idea. do you know about this?
If you find it somewhere, please let me know. Sounds interesting.
You use the 13 digital outputs to create a grid for the LEDs 6x7 = 42 max leds. You use the 6 analog inputs with 7 stacked resistors (making a grid array of inputs) with the light sensors. Or you can use less leds, and have the extra digital pins as part of the analog input array.
Since the LEDs don't need full power, or constant power to look ON... You turn on each led in the grid, of each row, while you cycle through the grid. (Look up the 3D LED array, and you will see what I am talking about.) Additionally, adding a capacitor to the LED will help it appear ON and brighter between grid cycles.
Plus you get the added bonus of being able to scroll letters and do a-life programs!
Love this setup BTW. Would be neat with them all freely inside a jar, frozen in epoxy or mounted on a screen in the jar.
True circuit:
pin1: 10k to vcc
between pin2-3: LDR(best 10k LDR)
between 3-4: 1k resistor
pin4:GND
pin 5 and 6 not connected
pin7: green led by 220 ohm to GND
pin8:vcc
Thank you anyway
i have a tiny13 and want to put in te program of the fire flies but with mikroc PRO for AVR it doesn't work. Witch programmer have jou used for the program?
Kluzze
I'd really like to see this.
Is there a way to "talk" to each firefly (ie ask one to turn itself on or off)?
try this at digikey: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=PDV-P9001-ND
Maybe you have to adjust the resistor connected to the LDR.
Cheers,
Alex