Close

First flash...

A project log for Electronic Fireflies

A simple electronic firefly simulation

AmosAmos 06/27/2019 at 07:212 Comments

I couldn't find the issue of Elektor I had with the original article, but that's not a problem, I'm pretty sure I can make things up as I go along.

What I need for the fireflies is an oscillator that blinks on a regular schedule and some way to kick that blink along when a nearby firefly is detected. If, each time a firefly "sees" a nearby firefly blink it speeds up the current cycle a tiny bit, over time all nearby fireflies should start to synchronise. At least that's the theory as I understand it.

The Elektor fireflies used an LED for the flash and four pairs of IR LED + phototransistor to communicate with nearby fireflies. I think this is a bit of overkill. Back in the day when I built some of these, I can remember thinking how expensive they were - IR LEDs and phototransistors were not exactly cheap and this design used four of each! All up, including the 555 timer, 9V battery and other components I think I costed the units out to around $10-12 each - that's why I only ever built two or three of them. (I must try to find where I have stored them...) Apart from the cost, the Elektor fireflies were on a square PCB (to be fair, the easiest option at the time) and could "see" 360°. I think I want to take a different tack...

My fireflies, I have decided, will be as simple as possible. While components are significantly cheaper than they were in the mid 90s, I still want to minimise cost and make these easy to build. I also want to try and simulate real fireflies a bit better than the clunky square jobbies in the Elektor article. So, with that in mind, I intend to use only one or two detectors, placed at the front of the design and have an LED at the rear. If I choose to use IR LEDs to signal other fireflies, these will be placed near the visible LED, but I am favouring a simple photoresistor (or two - use them as eyes) for the detection.

Because it is trivial to have fancy shaped PCBs made these days, I am picturing a PCB in the shape of a real firefly. The head can have two detectors mounted as eyes, and an LED, possibly an 8mm or 10mm one, on the tail. The choice of phototransistor or photoresistor wouldn't affect this layout, so I can defer that 'til later.

For the blinky-blinky I started building a 555-timer based flasher, but that wasn't particularly satisfying. The problem with a standard 555 blinky is that the LED is either ON or OFF. I'd like to try to get a pulse effect happening, which will look a bit more like a real firefly. A nice little circuit that creates satisfying pulses of light is a ring oscillator. IIRC, Yann Guidon was experimenting with a ring oscillator-based firefly some time ago, so great minds, etc. ;^)

The last time I played around with ring oscillators, I seem to recall that they seem to work best with MOSFETs rather than BJTs, so I threw together a simple design and started pulling out parts. Of course I couldn't find my stash of MOSFETs, but after some cursing and redesigning a BJT circuit, I found the MOSFETs hiding in the wrong parts bin. 8^/

And with that I had a nice little blinky circuit. It even works nicely on 3V, which is a bonus!

I like the slow fade of the LED, but I would like a bit faster attack and maybe a bit shorter fully lit time. I'm not sure I can tweak the various parameters with a ring oscillator though, so I may explore other designs. Can I make a 555 flasher decay? Or even simpler, could I use an astable multivibrator circuit with just two transistors, a couple of caps and a handful of resistors? A fully discrete solution is attractive, so I might play with an old-school multivibrator to see if I can introduce a bit of decay to the flash... Any thoughts on this? 8^)

Discussions

Ken Yap wrote 06/27/2019 at 08:15 point

See if a Garner oscillator will suit your application: https://hackaday.io/page/5877-garner-oscillator

  Are you sure? yes | no

Amos wrote 06/27/2019 at 08:22 point

That looks interesting - nice and simple too! I will see if I can find time to play with it tonight. 8^)

  Are you sure? yes | no