How to Make Blinking LED Circuit – Easy Tutorial

Blinking LED circuit is a simple circuit which is made for flashing LED lights in a specific pattern like the digital screen to make an image or text.

It also is made with a random blinking pattern for Christmas decoration lamps. Its main purpose is to make some LEDs blinking.

Four Methods to Make Blinking LED Circuit

LED stands for Light Emitting Diode. It is one-of-many diode types in power electronics. It can act as a diode to hold current from flowing in the opposite direction and allows current flowing from the desired direction.

There are several ways for flashing LED circuits such as using a simple relay, Schmitt Trigger Inverter, various logic gates, microcontroller, transistor, or even a transistor combined with a microcontroller.

For this time, we will focus on the most common and most effective methods for LED blinking circuits, including relay, transistor, microcontroller, and a microcontroller with a transistor.

Unlike common diodes, LED emits light when forward current is passing through until the forward current stops flowing. LED has minimum current to be operated depending on its size, and it also has current threshold before it breaks when the forward current is too high.

How to Make Blinking LED Circuit with Relay

Relay is a basic electromagnetic device mainly used for automatic switching. The relay can turn on or off large currents with only small current.

Its primary parts are the electromagnetic part (the wire coil as a temporary magnet) and contact which looks like a lever with spring to pull it back.

The simplest explanation is, when the coil is energized by a small portion of current, it acts like a magnet and pulls the contact to it.

When the coil is not energized anymore, the magnetic force disappears and the spring pulls back the contact.

The use of a simple relay can be seen below where we use a relay, a resistor, a dc source battery, and a LED. This relay will be able to answer us how to make LED blink.

How to make blinking LED circuit 1

The circuit above is the initial condition where the coil has not been energized by the battery.

How to make blinking LED circuit 2

The circuit above is the condition where the coil has been energized and pulling the contact then delivers the current to a single LED.

After the contact moves the current to the LED, the coil does not get energized and the circuit’s condition is coming back to initial condition and the cycle keeps looping shown below.

How to make blinking LED circuit 3

If the LED transition is too fast, you can use a time delay consisting of a resistor and a capacitor to delay the transition with a charging capacitor principle as shown below.

How to make blinking LED circuit 4

Using a relay is the most simple blinking led circuit.

How to Make Blinking LED Circuit with Transistor

We can utilize a transistor as a switch when we operate it on its active and cut-off region. This time we will use an NPN transistor to make LED flashing in sequence. Before we move on to the example, make sure you already understand how transistors work.

For the simplest example, let us see below where we use a single resistor, a LED, a resistor, and a dc voltage source to make a single blinking LED circuit.

How to make blinking LED circuit 5

When the current is flowing to the base terminal of the transistor, current from the collector side will flow to the emitter side and light the LED.

The base current needs to be higher than its minimum requirement, and the voltage will drop by approximately 0.7 V across the LED. The LED will emit its light as drawn below.

How to make blinking LED circuit 6

Now let us try to use two LED flashes in sequence using two capacitors and two LEDs below..

How to make blinking LED circuit 7

The circuit below shows us the first part of the cycle. At first, the transistor Q1 (the left side transistor) will run first and light the LED1 with full current supplied by a voltage source.

The current will flow through LED1, resistor R1 (most left resistor), and collector-emitter terminal of transistor Q1.

How to make blinking LED circuit 8

The next part is shown below, there will be flowing current through LED2, resistor R4 (top right resistor), and charge the capacitor C2 (right side capacitor) until full.

This occurs at a time slightly after the first LED flashed.

How to make blinking LED circuit 9

For some quiet time, the base-emitter voltage VBE will be lower than 0.7 V, as a result, LED1 goes out after the Q1 turns off.

The next part is Q2 starts turning ON and the LED2 becomes brighter below.

How to make blinking LED circuit 10

Like LED1 cycle, at the same time LED2 grows brighter, C1 will be charged until full until Q2 turns off and LED2 goes out when VBE is lower than 0.7 V.

How to make blinking LED circuit 11

And the cycle repeats from above.

We can observe the full cycle below.

How to make blinking LED circuit 12

How to Make Blinking LED Circuit with Microcontroller

The microcontroller may be the easiest and most effective way to make LED blinker circuits. It provides some unique patterns you can imagine along with controlling its switching blinking pattern interval time.

For this time, we will use the basic ATMEGA8535 to blink 8 LEDs in some pattern with the easiest method.

Below, we provide an example with a simple ATMEGA8535 with 8 LEDs along with their resistors.

We will understand how to make LED lights flash in sequence.

How to make blinking LED circuit 13

From the most right to most left, we give the LEDs name D0 to D7 respectively. We will use PORT.A as output to deliver voltage at 5 V to the desired LEDs to make them flash.

In order to control the LED, we will need a basic idea about the binary number for programming.

PORT.A has 8 ports as output, so the biner code will be :

PORT.A = 0bxxxxxxxx;

where the x can be changed to 0 or 1.

Changing x to 1 results in the connected LED flashing.
Changing x to 0 results in the connected LED going out.

In order to track which ports we need to program, let us see below.

How to make blinking LED circuit 14

We realize that PORTA.0 (PA0) is connected with LED1 (D0), PORTA.1 (PA1) is connected with LED2(D1), and so on.

The binary code PORTA = 0bxxxxxxxx represents ports A7, A6, …. and A0 respectively.

Assume we want to light LED D0 which connected to A0 then we make a program line such as :

PORTA=0b00000001;

where we turn off D1 up to D7 and only turn on D0.

If we want to make LED flashing in an on-off pattern below,

How to make blinking LED circuit 15

we write the binary code

PORTA=0b01010101;

In an opposite pattern below,

How to make blinking LED circuit 16

we can rewrite the code becomes :

PORTA=0b10101010;

For the last example, let us combine those two patterns into 1 continuous pattern below.

How to make blinking LED circuit 17

And the code will be :

while(1){
PORTA=0b01010101;
delay_ms(100);
PORTA=0b10101010;
delay_ms(100);}

where we add ‘delay_ms(100)’ as pattern switching interval time 100 millisecond. We also use ‘while(1)’ for loop commands.

How to Make Blinking LED Circuit with Microcontroller and Transistor

Sometimes we use this method for a special case such as a bigger LED which requires bigger current.

As we know already, most microcontrollers only provide 5 V output voltage.

In order to flash a bigger LED, we need bigger output voltage. In this case, we can use a NPN transistor connected with an external voltage source and LED as shown in below,

How to make blinking LED circuit 18

The program sequence will be the same as the previous example of a microcontroller, we only need to add a transistor and external voltage source.

6 thoughts on “How to Make Blinking LED Circuit – Easy Tutorial”

  1. Wow you did amazing explaining how LEDs work and even broke it all into technical terms with the schematics and everything. I don’t know anything at all about how LEDs work and how to get them to blink. I wish I could understand all the technical stuff but I know alot of people appreciate you breaking it all down. Thank you so much. Merry Xmas Everyone..🎄🎁

    Reply
  2. Hi, I dont really know anything about microcontrollers but I understand the logic behind the PORTA Output and the associated biner code. However that’s where it stops. Obviously power needs to run through this chip in order for it to work, and obviously the code needs to be put into the chip or be able to communicate with the chip or however it works. So I’m just wondering, practically, how would one set this up?

    Thanks, Nick.

    Reply
    • Hello Nick,

      For my experience, I used CVAVR to make and compile the program. For downloading the program into the microcontroller, we can use ProgISP. Arduino also do this job very well and it is simpler to download the program to the microcontroller.

      Reply

Leave a Comment

x