# Simple LED Flasher

The electronics student or hobbyist’s always likes to make various circuits for their home or school and especially ones that flashes a few lights.

There are many circuits and kits on the market that can flash any number of LED’s or lights periodically, randomly or sequentially but one very versatile IC that can be used to produce a simple LED flasher circuit is called a binary ripple counter.

Ripple counters as we discussed in the Counter tutorial, are basically toggle flip-flops that can be used as frequency dividers to divide the reference clock input by a set amount to give a new, lower frequency and which we can use as part of our simple LED flasher design.

These types of counters are asynchronous in nature because not all the flip-flops change or “toggle” together with the application of an external clock pulse. Usually the toggling occurs on the negative edge of the clock pulse.

The toggle or “T-type” flip-flop is the basic building block of all counters with asynchronous counters are commonly referred to as “ripple counters” because the input clock pulse appears to “ripple” through the counter as the clock input for one stage is generated from the output of the previous stage. The result is a ripple effect as each stage changes in sequence and we can put this to good effect as a simple LED flasher circuit.

Ripple counters are constructed from a number of divide-by-2, T-type flip-flops cascaded together to form a single divide-by-N frequency divider, where N is equal to the counters bit-count. Commonly available binary ripple counter IC’s include the 74LS93 4-bit (÷16), the CMOS 4024 7-bit (÷128), the CMOS 4040 12-bit (÷4096) or the larger CMOS 4060 14-bit (÷16,384) counter.

Then their output count, (Qn) would be defined as the “N-th” stage of the counter. So for example, output Q6 is 26 = 64 (1/64 of the clock frequency) and Q12 is 212 = 4096 (1/4096 of the clock frequency) and so on.

As we have seen, there are many binary counters available that can flash any number of lights periodically, randomly or sequentially but one very versatile IC that the hobbyist or student can use to produce a simple LED flasher for use in a variety of different lighting displays is the CMOS CD4040B 12-bit Binary Counter.

The CD4040B is a fast switching 12-bit binary ripple counter complete with twelve fully decoded outputs (making a total of 12 individual LED sequence’s). These twelve outputs switch sequentially on the arrival of each negative-going edge of the clock pulse producing a binary output sequence as shown in the timing diagram.

The outputs of the 4040 switch between a logic “1” or “HIGH” and a logic “0” or “LOW” on each count so it can produce a moving sequence, chaser or random effect, making the 4040 ideal as a simple LED flasher or lighting display for a lights project.

As the 4040 is a 12-bit ripple counter, each one of the twelve outputs will toggle HIGH or LOW in a binary sequence from 0 to 4096 (212), and this is shown in the following timing diagram.

### 4040 Ripple Counter Timing Diagram

But before we can use the 4040B ripple counter as part of our simple LED flasher circuit, we need to produce a timing signal. There are many different ways of producing a timing or clock signal, the list is endless. But one very simple and effective way of producing a square wave timing signal with the minimum of components is by using a dedicated timing IC such as the NE555 Astable Timer.

The timing period T, depends upon the chosen input clock frequency, were T = 1/ƒ. So for example if we choose the 4040 12-bit (÷4096) counter as part of our simple LED flasher circuit, and we want our longest timing period on the 12th-bit to be 4 seconds (2 seconds ON and 2 seconds OFF) or 0.25Hz, then our input clock frequency on pin 10 of the 4040 counter would need to be about 1kHz, (0.25 x 4096) as shown.

### Simple LED Flasher Circuit

By connecting the LED’s to different outputs they will flash one at a time but at different rates to each other (each output half the frequency of the previous one) and will not be all “ON” or all “OFF” together making it ideal for our simple LED flasher circuit.

By using divide-by-2 frequency divider/counters, with multiple LED’s connected to their outputs, it is possible to produce a twinkling star or flashing lights effect or any LED flashing lights display of your choice depending upon which ripple output you connect the LEDs to and how you physically arrange them.

## Ripple Counter Output

The counters outputs Q1 to Q12 have the ability to either “Sink” or “Source” a load current of up to a maximum of about 15mA, which is sufficient to directly drive the LEDs. The ability of the 4040 counter to both “Sink” (absorb) and “Source” (supply) current means that the LEDs can be connected between the output terminal of the counter and the supply to sink the load current or between the output terminal and ground to source the load current. For example.

### Sinking and Sourcing the Outputs

In the first circuit above, the LED is connected between the positive supply rail ( +Vcc ) and the output, in this case Q8. This means that the current will “Sink” (absorb) or flow into the 4040 counters output terminal and the LED will be “ON” when the output is “LOW”.

The second circuit above shows that the LED is connected between the output, Q8 and ground ( 0v ). This means that the current will “Source” (supply) or flow out of the 4040 counters output terminal and the LED will be “ON” when the output is “HIGH”.

The ability of the ripple counter to both sink and source its output load current means that both LED’s can be connected to one output terminal increasing the number of LED’s we can use within our simple LED flasher circuit. However, only one LED will be switched “ON” at any one time depending whether the output state is “HIGH” or “LOW”.

The circuit to the left shows an example of this. The two LED’s will be alternatively switched “ON” and “OFF” depending upon the output creating an alternating flashing action. Series resistors can be used if needed to limit the LED current to below 15mA.

We said earlier that the maximum output current to either sink or source the load current via the output pins is about 15mA and this value is more than enough to drive or switch the LEDs or small lamps, etc. But what if we wanted to switch or control higher power devices such as motors, electromagnets or relays instead of this simple LED flasher. Then we would need to use Transistors in order to provide a sufficiently high enough current to drive the load.

### Ripple Counter Transistor Driver

The transistor in the two examples above, can be replaced with a Power MOSFET device or Darlington transistors if the load current is high. When using an inductive load such as a motor, relay or electromagnet, it is advisable to connect a “freewheeling diode” directly across the load terminals to absorb any back emf voltages generated by the inductive device when it changes state.

It is also possible to add more LED’s to the output but remember that generally each LED requires about 15 to 20mA at 1.2V to fully illuminate so keep this in mind when connecting the circuit to a battery or power supply. One advantage of the 4040 IC, is that it self limits its maximum input/output current so the LED’s can be connected directly without the need for any current limiting resistors.

We have seen that we can create a very simple LED flasher circuit just by using a few commonly available components, a NE555 Timer to create the timing clock signal and a CMOS 4040 12-bit Asynchronous Ripple Counter to interface with the LEDs. The simplest LED flasher circuit can be built using just single bit T-type flip-flops if required because the toggle feature is naturally suited for the implementation of the counting operation.

Multi-bit ripple counters can be cascaded together to produce larger bit ripple dividers (or counters) of your choice or decoded to reset after a particular binary count. The 4060B is a 14-bit binary ripple counter which has its own built in oscillator circuit, so by just adding a timing capacitor and two resistors a very simple LED flasher circuit can be constructed without the need for an additional NE555 timing circuit.