Friday, June 4, 2010

Firefly simulator on microcontroller avr

Firefly simulator on microcontroller avrThe goal of this project was to build a LED-based device running on a microcontroller chip to mimic how fireflies might theoretically synchronize their flashing in nature. The device serves as a future model on how to implement a physical form of networking using a microcontroller chip.

To implement these goals, they created a 2D matrix of 8 "fireflies". Each firefly is represented by a node in the 2D grid, and a connection between any 2 nodes is represented by a pair of 2 LEDS: an "emmiter LED" and a "sensor LED". The fireflies are able to concurrently communicate and sense the signals emanating from surrounding fireflies using a form of one-directional LED communication. Each firefly is equipped with a fixed number of emitter LEDs and a fixed number of sensor LEDS, depending on the position of the LED within the matrix. For simplicity, we assumed that the fireflies’ positioned were fixed in time, i.e. they were not able to travel. Each firefly is equipped with an individual (i.e. independent) "brain" in the microcontroller code that processes the signals that it has sensed and tries to synchronize its own flashing with these surrounding fireflies. Like in any real world situation, each firefly flashes with a random frequency and phases and it adjusts these flashing parameters to conform to the overall flashing of the localized population.