Yet Another Electronic Lampyridae

and I ain't using a '555. Self-organising CMOS ring oscillators are cooler !

Similar projects worth following
File under "educational material" as I now use this circuit to teach electronics basics to beginners at LOREM(.org)


As a teenager I saw a french translation of this article :
Moss F Garver W. Elecronic fireflies. Scientific American, 269:128–130, 1993.
But I have always been reluctant to use a '555.

And yesterday I came across a complementary MOSFET-based low-frequency ring oscillator...
No programming, no integrated circuit, just like Mother Nature intended ;-)

I'm sure @Bruce Land will enjoy it: it's perfect for introductory courses in bioelectronics (or electro-biology ?) with a dirt-cheap, extremely simple system with no hidden or obfuscated parameter.

The flight part is left as an exercise to the reader.


The PCB is now available as an Eagle file or prepanelized at DirtyPCB (see the links)

It all started while I was investigating why my complementary MOSFET oscillator wouldn't oscillate. Crawling around in the googlesphere, I found these pictures:

(from Talking Electronics' excellent page about MOSFET)

(from Wikipedia's page about Ring Oscillators and I wonder why the output is after the resistor...)

Let's just merge these two circuits, in a way that saves power and let's add a single, bright white LED (or yellow/green if you prefer, but I have white 1W modules) at the final stage (power LED are more energy efficient due to larger die, hence more light than normal LED when undervolted). Power it with a couple of AA batteries and you have a nice slow blinker.

How can we bring group synchronisation ? Add a light sensor. Well, that's a great way to use the batch of LDR (photoresistors) I bought on eBay. Add one LDR in series with one 1M resistor (at the right place) and voilà !

Warning ! the diagram above is flawed because it is missing a pull-up resistor in parallel with the LED

The LDR I have has a resistance higher than 2M Ohms when in the total dark, so a single ring will oscillate slowly. If it picks up some light from a nearby ring, the frequency will drift until it's in phase. 3 rings might give crazy chaotic patterns, but if more circuits interact, they'll finally go all in sync, like a clapping audience...

1. First blink
2. Oscillation coupling
3. Coupled oscillations
4. Locking to bi-alternance
5. Family Fun !
6. First layout
7. My first group course at LOREM
8. Today a boy made me feel proud
9. Board v2
10. Board v2 has been delivered
11. Board v.3


Eagle5.7 PCB layout

brd - 10.88 kB - 09/05/2016 at 18:13



Eagle5.7 Schematics

x-kicad-schematic - 142.84 kB - 08/05/2016 at 00:55



Eagle5.7 PCB layout

brd - 9.67 kB - 08/05/2016 at 00:53


  • 1 × 1W white LED (or 3 white/blue/pink LEDs if you prefer, 3 or 5mm diameter)
  • 3 × BS170 (N-MOSFET) (2N7000 is possible but reverse the pins) Discrete Semiconductors / Diode-Transistor Modules
  • 3 × 1M resistors
  • 3 × 330K resistors
  • 3 × 1uF capacitors

View all 9 components

  • Board v.3

    Yann Guidon / YGDES09/05/2016 at 18:09 0 comments

    The new version simply adds a footprint for a CR2032 battery holder on the backside. I had to reshuffle things a bit and I corrected tiny blunders. Here is the result :-)

    I don't know yet when I'll send it to factory.

  • Board v2 has been delivered

    Yann Guidon / YGDES08/03/2016 at 18:23 0 comments

    The PCB has been manufactured by DirtyPCB (along with the 10TFF modules) and the results are pretty nice :-) I should now test the solderability but I don't worry about it. I'll use these boards for soldering workshops.

    Update 20160805:

    Soldering was a breeze and 5mm LEDs also work instead of 3mm LEDs (I should add a polarity sign to the LED though). The circuit worked right away when powered on !

    You can watch a video there :

  • Board v2

    Yann Guidon / YGDES07/08/2016 at 03:05 0 comments

    I tuned the layout, using the experience from the #Yet Another (Discrete) Clock 10TFF module.

    For example, I enlarged the pads of the standard parts to ease soldering. Plated holes help soldering too but the larger pads allow more heat transfer.

    I reduced the size to 50×20mm to make it easy to manufacture. You can fit 2×8 boards on a 160×100 (Europe) format, or 2×5 on a 10×10mm format.

    I added 2 LEDs because they help check the circuit progressively, during soldering.

    The schematic is barely changed :

    The layout is much better, though:

    Hopefully, it is not too intimidating to beginners.

    Another enhancement would be to add a Lithium coin cell footprint, to replace the 2 pads for an external power supply.

  • Today a boy made me feel proud

    Yann Guidon / YGDES05/28/2016 at 23:46 0 comments

    As I hold workshops, I'm learning as much as the kids do. I would like to bring more and be in tune with them, so they get the best possible experience and perspectives. And today I asked a kid what he remembers from the circuit that I have explained.

    "We can make a LED blink without using an Arduino."


    He will turn 11 in a few days and he got the essence of my message !

  • My first group course at LOREM

    Yann Guidon / YGDES05/15/2016 at 05:00 0 comments

    I have made my first workshop with the kids and we have had a great time !

    Saturday afternoon (20160514) from 2PM until 6PM, I have explained, shown, demonstrated, how the few components of the MOSFET ring oscillator work. That's the resistor, potentiometer, the LED, the capacitor and the P-MOSFET. I started with the obligatory reminders about electricity, breadboards and how to use a multimeter.

    After 2 hours, most of the circuits worked as expected ! Errors always happen (even I make them often) but thanks to a very progressive, careful and simple method, small errors are easily and quickly identified and solved. No magic smoke has been released, no tear has been shed!

    I am thankful to all the people at LOREM for their enthusiasm, patience, trust and curiosity. Some of the kids are pretty skilled (not just boys) and this is very encouraging. I'll return with this workshop and even more (wink wink) as soon as I can!

  • First layout

    Yann Guidon / YGDES04/13/2016 at 08:21 0 comments

    The schematic has just been entered into EAGLE!

    That circuit is really easy and quick to route. Here's the 2cm×6cm result with wide margins for newbies :

    I'll try to make 10 or 20 but the size does not let it fit in 5cm or 10cm square boards. I'll have to find a trick. Parts can be densely packed but that would not keep its beginner-fdriendliness.

  • Family Fun !

    Yann Guidon / YGDES03/02/2016 at 00:29 0 comments

    Nephew got introduced to MOSFETs today !

    One MOSFET didn't survive but "that's the price of education". And it's not as if I was about to run out of BS170 tomorrow...

    And today, an 11-years (and his younger sister) old learned about resistors, capacitors and transistors :-)

  • Locking to bi-alternance

    Yann Guidon / YGDES02/23/2016 at 09:16 0 comments

    I think I understand better what happens.

    The LEDs lock in either of 2 groups of opposite phases.

    Whenever I remove one that is alone in a group, some other will try to take its place/phase.

    It's more obvious when they are all started up at the same time: the LDR are in series with the charge capacitors' resistors. So in the dark, the oscillations don't start.

    The circuits need light to oscillate !

    The first LED that starts to emit light will trigger an avalanche and the others will turn on too, but with a little delay. There is already a phase shift and the first LED will oscillate thanks to the light of the others. And vice versa.

    Maybe I should add a 5M Ohms resistor across the LDR pins...

    but this will not solve the problem : there will still be 2 groups.

  • Coupled oscillations

    Yann Guidon / YGDES02/23/2016 at 05:48 0 comments

    I made a little test system for the 5 fireflies I just soldered. I made them run and I noticed a strange behaviour : they tend to oscillate by groups, so there IS coupling, however they usually make 2 alternating groups.

    I installed the circuits inside a cardboard box, with alu tape over them to increase reflection of their own light.

    The coupling is quite strong since a few cycles are enough to sync them... except that they tend to split into 2 groups (including one circuits that jumps from one group to another, maybe one of the parts is not the right value, or differently lit ?). Anyway, when they sometimes all turn on in sync, it's pretty powerful :-)

    Then it struck me: the light sensor is active during one part of the cycle only...

    I'll try to add another LDR in series with another 1M resistor, to cover another phase. I'll have to try different configurations to find the one that works best...

  • Oscillation coupling

    Yann Guidon / YGDES02/21/2016 at 18:31 0 comments

    My first test has not shown a significant period variation when the LDR is lit or shadowed, I wonder what is the best placement for the light-sensitive resistor. I'll have to build a few boards and test them...

    OK, let's do this :-)

    OK it seems I must engineer the system better. I made a 2nd circuit and they seem to naturally work at different frequencies. They appear to "read" each other when placed close but there is a weird 4:5 frequency ratio. I'm not sure if the feedback keeps the pulses in sync or prevents them, though I see they seem to lock for a cycle or two and then....

    I must analyse the phase behaviour. And/or design a phase detector, or something.

View all 11 project logs

Enjoy this project?



jawwadraza060 wrote 10/22/2016 at 10:20 point

I have made it but it's not switching from one LED to other LEDs. Kindly reply me ASAP 

  Are you sure? yes | no

Yann Guidon / YGDES wrote 10/22/2016 at 18:49 point


I'm sorry you encountered problems with this circuit. Fortunately, it is pretty easy to debug with a bit of luck and good methods :-) Tens of kids have made it work already and I've seen some of the possible errors.

* At east one LED is turned on so it's not a power supply problem.

* Did you forget the pull-up resistor in parallel of the LED ?

* Wiring mistake: it happens to everybody !

* Similar : if you used a PCB, check that there is no loose joint or broken trace.

* Bad transistor : it happened to me too ! Check that each transistor can switch the signal normally.

A good troubleshooting method is to remove the 1M resistors and inject a voltage instead. Test each stage. Ususally, I can spot a problem half-way through this procedure.

Good luck and please share your own experiences ! The comments are open to all feedback.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates