Arduino Circuits

Multiple LED Sequence

Create a simple light sequence by lighting three different-coloured LEDs in turn from separate output pins.

November 22, 20264 min read
Multiple LED Sequence — Arduino circuit built on a breadboard, showing components and connections
Multiple LED Sequence circuit breadboard layout, components and jumper connections.

Interactive circuit guide

Run the simulation, follow the build steps one by one and try it in our real app.

Real screenshot of our circuit simulator Stopped
Open in our app →

Step-by-step build

What is it for?

In this circuit, three LEDs (red, green and yellow) are connected to three separate digital output pins. The anode leg of each LED goes to an output pin through its own 220-ohm series resistor, and the cathodes go to common ground. The code sets the output pins HIGH in a certain order, waits briefly and then sets them LOW. The LEDs therefore light up and go out one by one, creating a visual sequence. Using a common ground lets multiple outputs share the same reference point. This project teaches managing multiple outputs, using loops and controlling each pin independently; the same approach can later be used for traffic lights and indicator panels.

Parts list

The following components are used to build this project:

  • Arduino Uno — Controls the three outputs independently.
  • 220Ω Resistor — One separate current limiter for each LED (×3).
  • Red LED — The first indicator in the sequence.
  • Green LED — The second indicator in the sequence.
  • Yellow LED — The third indicator in the sequence.
  • Ground — Common return path for the three LEDs.

Step-by-step build

  1. Place the board and arrange the three LEDs in a vertical row.Keeping the colour order the same as in the code makes the work easier.
  2. Add a 220-ohm resistor to the anode of each LED.Keep the resistors to the left of the LEDs.
  3. Connect the free ends of the resistors to three separate output pins.Match the pin numbers with the constants defined in the code.
  4. Connect the cathodes of the three LEDs to the common ground rail.A single GND connection closes all the LEDs.
  5. Connect the ground rail to the board's GND pin.Without a common reference the outputs are not stable.
  6. Upload the code; the LEDs light up in the order red, green, yellow.Adjust the delay to set the speed of the sequence.

How it works

Each output pin can be set independently to HIGH or LOW. When a pin is set HIGH, about 5 volts reaches the LED's anode; since the cathode is connected to ground, the LED conducts in the forward direction and current flows limited by the 220-ohm resistor. When the pin is set LOW, both ends of the LED reach the same potential and current stops. The code sets the three pins HIGH in turn with short delays between them, creating a timed sequence. Using a common ground ties all three branches to the same 0-volt reference; having a separate resistor for each branch prevents one LED's current from affecting the others.

The three LEDs are arranged vertically in the upper rows; each LED is preceded by its own 220-ohm resistor. The cathodes meet on the common ground rail on the right, which connects to the board's GND pin. Each anode is fed from a separate digital output pin.

What you will learn

  • Manages more than one output pin independently.
  • Explains the logic of a common-cathode connection.
  • Creates a timed sequence using loops and delays.
  • Knows that each LED needs its own series resistor.

Tips

  • If two LEDs light up at the same time, two pins may have been left HIGH in the code.
  • If an LED never lights up, check the polarity and resistor connection one by one.
  • If the sequence is too fast, increase the delay.

Try it yourself

  • Verify that the LEDs light up in the stated order.
  • Observe the sequence speed by changing the delay.
  • Rearrange the pin list in the code to reverse the sequence.

Getting the parts

Frequently asked questions

What does this circuit do?

Create a simple light sequence by lighting three different-coloured LEDs in turn from separate output pins.

How does the circuit work?

Each output pin can be set independently to HIGH or LOW. When a pin is set HIGH, about 5 volts reaches the LED's anode; since the cathode is connected to ground, the LED conducts in the forward direction and current flows limited by the 220-ohm resistor. When the pin is set LOW, both ends of the LED reach the same potential and current stops. The code sets the three pins HIGH in turn with short delays between them, creating a timed sequence. Using a common ground ties all three branches to the same 0-volt reference; having a separate resistor for each branch prevents one LED's current from affecting the others.

What is the expected result?

The red, green and yellow LEDs light up and go out in sequence.

You may also like

Try the circuit in the simulator

Open the diagram in your browser, inspect the connections and follow the steps.