ES-93IntermediatePremium
ESP32 Firefly Jar: Lights That Fall Into Sync on Their Own (8 LEDs + Button)
The 8 LEDs in the jar are fireflies: they flash at random first, and a few minutes later, with nobody telling them, all of them flash at once. There is one rule: a firefly that sees a neighbour flash moves its own clock a little forward. When sync arrives the jar glows for 3 seconds. A short press of the button shakes the jar and scatters them; a long press stops them seeing each other. In the fast version in the video sync takes 11 seconds. No PWM, no library.
0.0(0)

In Southeast Asia thousands of fireflies blink at the same instant at night, like an orchestra with no conductor. In this project you build the same thing on your desk with eight small lights: at first each one flashes whenever it likes, then they gather in twos and threes, and in the end they all flash together. Press the button to shake the jar and they scatter, so you can watch the sync build up again. A decoration for a winter evening and a science experiment that is a pleasure to watch.
Source Code
Premium Content
The source code, block version and FAQ of this project are open to Premium members.
- All Project Code
- Block version
- Frequently Asked Questions
