Projects

Kids' Basics: Two LED Flasher

Transistor-based LED Flashing Circuit

Daniel Koch

Issue 55, February 2022

A simple circuit that demonstrates a very valuable electronic principle.

In most Kids’ Basics projects, we try to make sure that the circuit is either practical and functional in a real-world way, or artistic, creative, and decorative. However, there are some classic circuits around that nearly everyone involved in electronics, whether an engineer or hobbyist, has learned at some point. That’s the case with this circuit. It just flashes two LEDs, which we have done before with the Emergency Lights all the way back in Issue 19.

This time, we’re doing things differently. While we’ll throw a few ideas out there at the end, this circuit isn’t about serving a purpose. This is an opportunity to learn about some of the most useful and fundamental electronic concepts. Previously, we built this circuit with the ever-useful NE555 Integrated Circuit (IC). This time, however, we’re building it with two transistors. We hope this makes it a bit easier to follow along, because you can see each component involved, unlike the goings-on of the inside of an IC.

Despite being repeated often in beginner’s circuit series and tutorials, many explanations gloss over what is really going on with this circuit. You can find posts in online forums by people having built such a circuit and read the explanation that comes with that learning series, tutorial, and still not know how the circuit actually works and why. We’re going to do our best to explain this in the ‘How It Works’ section, but we can’t promise success for everyone in terms of ‘getting it’. Luckily, you can build the circuit and even take it as a design block, without really knowing how it works.

SOME HELPFUL HINTS

We encourage you to read all the way to the end of the article before you build. Not only will you then have a better feel for the overall picture as you build, but we sometimes discuss options or alternatives that you will need to have decided on. You will need some basic hand tools for most builds. Small long-nosed pliers and flush-cut side cutters meant for electronics are the main ones. Materials like tape or glue are mentioned in the steps, too. We always produce a tools materials list if you have to go shopping, but anything that is lying around in most homes is just stated in the steps.

As always with Kids' Basics, we avoid soldering to make the build more accessible to more people, but having an adult around can still be helpful. You won't need any particular skills besides being able to identify components at a basic level, and even then, we help as you go along. If, for example, you don't already know what a resistor is, you'll probably be able to work it out from the photos and description in each step.

We do provide a schematic or circuit diagram but this is just helpful if you already know how to read one. Don’t stress if you have never learned, but take the chance to compare the digital drawing of the breadboard layout (which we call a 'Fritzing' after the company that makes the software) to the schematic and see if you can work some things out. You can make this project from the Fritzing and photos alone. You might also like to check out our Breadboarding Basics from Issue 15.

The Build:

Parts Required:IDJaycarAltronicsPakronics
1 x Solderless Breadboard-PB8820P1002DF-FIT0096
1 x Packet Breadboard Wire Links-PB8850P1014ASS110990044
2 x 330Ω ResistorsR1, R4RR0560Z7546SS110990043
2 x 10kΩ ResistorsR2, R3RR0596R7582SS110990043
2 x 100µF CapacitorsC1, C2RE6130R5123DF-FIT0117
1 x Red LED*LED2ZD0120Z0701DF-FIT0242
1 x Blue LED*LED1ZD0185Z0869DF-FIT0242
2 x BC547 NPN TransistorsQ1, Q2ZT2152Z1040DF-FIT0322
1 x 9V Battery Snap-PH9232P0455DF-FIT0111
1 x 9V Battery-SB2423S4970BPAKR-A0113

Parts Required:

* Quantity used, item may only be available in packs

Step 1:

Place the breadboard in front of you with the outer red (+) rail furthest away from you, and the outer blue (-) rail closest to you. Add two wire links, one to join the two blue (-) rails and one to join the two red (+) rails.

Step 2:

Insert the blue LED into the board with its long anode lead (+) to the left and its shorter cathode lead (-) to the right. Leave one empty row between them. Add a 100µF capacitor with its positive leg meeting the LED cathode, and its negative leg (marked with a stripe) off to the right.

Step 3:

Install another 100µF capacitor, a couple of rows to the right of the first. This one is mirrored, with its negative striped leg facing left, and its positive leg facing right. Add the red LED, with its short cathode leg meeting the positive capacitor leg, and its longer anode leg off to the right. Again, there is one empty row between.

Step 4:

Add four resistors. The outer two are 330Ω (ORANGE ORANGE BLACK BLACK SPACE BROWN) and go between the upper red (+) rail and the anodes (long leg, +) of the LEDs. The inner two are 10kΩ (BROWN BLACK BLACK RED SPACE BROWN) and go between the upper red (+) rail and the negative striped side of the capacitors, Yes, you read that right! ››

Step 5:

Place four wire links to cross the middle of the board. Two go to the LED/capacitor lead junctions, while two more go to the capacitor/10kΩ resistor junctions. Count and check carefully that each lines up where it needs to go. It’s very easy to make a mistake here, and you may pick up an error in the previous steps, too. There should end up being two empty rows between each link.

Step 6:

Install two BC547 NPN bipolar transistors. The one on the left has the flat side facing you, and its left-hand leg in the same row as the outer left wire link. The other has its flat side facing away from you and has its right-hand leg in the same row as the outer right wire link. These often have straight legs close together, so make sure two don’t end up in the same row.

Step 7:

Add four wire links. One each goes to the inner leg of each transistor, to the lower blue (-) rail. The horizontal ones need absolute care. One goes from the base terminal (middle leg) of the left-hand transistor, to the inner right-hand wire link. The other goes from the base terminal of the right-hand transistor to the inner left-hand wire link. These are critical.

Step 8:

Insert the red wire for the 9V battery snap into the upper red (+) rail. Insert the black wire into the lower blue (-) rail. Keeping these apart helps avoid problems such as if one wire comes loose and touches the other. That happens far more easily if they are next to each other. They are unlikely to touch if they are further apart. Connect a 9V battery to the snap. You should see lights flashing. If you don’t, disconnect the battery and check your connections in reverse order.

HOW IT WORKS

Many descriptions of this circuit skirt around the real reason it works, and having tried to simplify it, we can understand why! Some of the best explanations redraw the circuit and reveal that it is nearly two of a certain type of amplifier, connected to each other so that one feeds the other. This explanation, however, is only useful if you already understand that type of amplifier.

Let’s get one thing out of the way first. When you build this circuit, one side always switches on first every time you apply power. If you build another copy of the circuit, one side will always turn on first but it may be the opposite side to the first copy. This is because of variations in each component. Particularly, the internal resistance of each capacitor, and the exact internal characteristics of each transistor.

More on what is what soon, but the upshot of it is that one side is not exactly the same as the other, even though they are built with the same value components, because none are precise. One side always reaches its trigger point slightly ahead of the other, and then the cycle proceeds as described. Because of this, we are going to describe the circuit as though the left-hand half turns on first, but yours may have the right-hand half turn on first.

One thing is very important to understand before we proceed, and this is the part that we find lacking in most descriptions. Most makers think of electrolytic capacitors as only being able to build a charge in one direction. In fact, they must be operated with a higher voltage on one side than the other due to the way they are made, but this circuit appears at first glance to bend those rules a bit.

Assuming the circuit is already running, with the left-hand turned on. Focusing on the green half of the schematic, transistor Q1 is conducting (which is why LED1 from the blue section is lit). In order for it to do this, it must have current flowing to its base. In an NPN transistor, current flows from the base, through the transistor and out through the emitter. When it does, a larger current can flow from the collector to the emitter.

This is how transistors are used as both switches and amplifiers. However, all semiconductors have a voltage drop across them and the base-emitter junction in the BC547 takes around 0.7V in order for current to flow. We have to explain some other things before we know where this current at 0.7V is coming from.

With Q2 off, current flows through R4 and LED2 to charge the positive side of C2. Generally not enough current flow to light the LED, but some high-efficiency types will actually show this. When a side turns off, the brightness drops but the LED does not extinguish. Instead, a limited brightness exists which quickly fades. This is the positive side of the capacitor charging through the LED and its resistor. This also means that the positive side of the capacitor only ever charges to the supply voltage minus the LED forward voltage drop.

Now we need to look at the blue section. The negative side of capacitor C1 is connected to the base of transistor Q2, and so is a 10kΩ resistor, R2, from the supply voltage. This resistor feeds a current to the negative side of the capacitor, which charges despite being reverse polarised. At some point, it reaches 0.7V.

Current now flows via the resistor R2 to the base of Q2, because the voltage has risen far enough. Now, Q2 turns on.

Now, LED2 lights, with current flowing via it and R4, to ground via the collector-emitter path of Q2. However, look at C2. It has been charging while Q2 was off, and is at the supply voltage minus the LED forward voltage drop. While Q1 was on, C2 was being charged on its positive side via LED2/R4, and on its negative side via R3. That means that the voltage across the capacitor is the charge on its positive side (around 6V) minus the charge on its negative side (0.7V). That’s around 5.3V. Now that Q2 is on, the positive side of C2 is suddenly grounded.

The quirky thing is, the capacitor retains its charge. Current cannot flow through it. However, now the voltage on the negative side is suddenly lower. It is now at -5.3V! This pulls the base of Q1 to -5.3V as well. This results in LED1 and R1 not conducting enough to light, but they do begin to charge the positive side of C1. While they do, R2 charges the negative side, and continues to charge it until the difference between the two sides of C1 has reached 0.7V. When it does, the base of Q2 which is connected to it, begins to conduct, triggering Q2 to conduct, and the cycle repeats.

It’s all a bit hard to follow in the text. We suggest printing the coloured circuit diagram and drawing on it or highlighting it as you read. Also, in the ‘Reading and Resources’ section, we found an excellent online simulator. We cannot actually tell from the website who has put all the work into this awesome piece of code, but we claim no credit for it!

WHERE TO NEXT

The main thing to do is to vary component values. Try using larger or smaller capacitors or resistors for R2 and R3, the 10kΩ resistors. Leave the 330Ω as they are, because those are just the current limiters for the LEDs.

One idea that is particularly helpful is to use 100kΩ resistors in place of the 10kΩ, and use a multimeter to probe around the circuit. Most multimeters that the maker can afford (and even some costing hundreds of dollars) take a moment to stabilise the reading, particularly if the probe contact isn’t perfect.

At the normal flash rate, you won’t properly see what’s going on. At the slow rate, you can see, for example, that the voltage at the collector when a transistor is off, is the supply voltage minus the forward voltage drop of the LED.

The other thing to do is find a practical use for the lights. Besides the emergency lights on a toy like in Issue 19, we propose they will make good level crossing lights on a toy railway. That could be wooden blocks, LEGO, plastic toy trains, or even a proper model railway. The photo here shows both LEDs lit in a model railway crossing sign. That’s a side-effect of shooting the lights with a long camera exposure to see them properly in the low light. Yours would only be on one at a time.