Breadboard wiring

Breadboard wiring: build a three-LED sequence

Place three LEDs, three resistors and one shared ground rail on a breadboard, then wire them to separate Arduino outputs.

22 November 20264 min read
Breadboard wiring: build a three-LED sequence — Arduino and breadboard circuit diagram
Breadboard layout, components and jumper connections for this circuit.

Bu projeyi gerçekten kurmak istersen parçaları hobidevre.com'dan temin edebilirsin →

Build it for real

To build this project for real, get the parts from hobidevre.com → hobidevre.com →

More build guides: hobidevre.com/blog

Create a free account — save your progress and get more circuits →

Save your progress

What it does

Three LEDs - red, green and yellow - are connected to three separate digital output pins. Each LED has its own 220 ohm series resistor between the output pin and the anode, and all cathodes share a common ground rail. The sketch sets the pins HIGH one after another with a short delay in between, so the LEDs light and go off in sequence. The shared ground gives every branch the same reference point, and a separate resistor per branch keeps the current of one LED from affecting the others.

Parts you need

Use the following parts to build this circuit:

  • Arduino Uno × 1 — Controls three outputs independently.
  • 220 Ω resistor × 3 — One current limiter for each LED.
  • Red LED × 1 — First indicator in the sequence.
  • Green LED × 1 — Second indicator in the sequence.
  • Yellow LED × 1 — Third indicator in the sequence.
  • Ground connection × 1 — Common return path for all three LEDs.

Build it step by step

  1. Place the board and arrange the three LEDs in a vertical row.Keeping the colour order the same as in the sketch makes debugging easier.
  2. Add a 220 Ω 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 to the constants defined in the sketch.
  4. Connect the cathodes of all three LEDs to a shared ground rail.One GND connection closes the circuit for every LED.
  5. Connect the ground rail to the GND pin of the board.Without a common reference the outputs are not stable.
  6. Upload the sketch; the LEDs light in red, green, yellow order.Change the delay to adjust the speed of the sequence.

How it works

Every output pin can be set HIGH or LOW independently. When a pin is set HIGH, about 5 V reaches the LED anode; because the cathode is tied to ground, the LED conducts in the forward direction and the 220 ohm resistor limits the current. When the pin is set LOW, both ends of the LED sit at the same potential and current stops. The sketch sets the three pins HIGH in turn with short delays to create a timed sequence. The shared ground ties all three branches to the same 0 V reference, and the per-branch resistor means one LED cannot change the current of another.

What you learn

  • Manage more than one output pin independently.
  • Explain the logic of a common-cathode connection.
  • Build a timed sequence with a loop and a delay.
  • Recognise that every LED needs its own series resistor.

Tips

  • If two LEDs light together, check whether two pins are left HIGH in the sketch.
  • If one LED stays dark, check its polarity and resistor one branch at a time.
  • If the sequence is too fast, increase the delay value.

Try it yourself

  • Confirm that the LEDs light in the stated order.
  • Change the delay and observe how the speed of the sequence changes.
  • Rearrange the pin list in the sketch to reverse the order.

Expected result: The red, green and yellow LEDs light and go off one after another.

Get the parts

If you want to build this project in real life, you can get the parts from hobidevre.com.

Frequently asked questions

What is this circuit for?

Three LEDs - red, green and yellow - are connected to three separate digital output pins. Each LED has its own 220 ohm series resistor between the output pin and the anode, and all cathodes share a common ground rail. The sketch sets the pins HIGH one after another with a short delay in between, so the LEDs light and go off in sequence. The shared ground gives every branch the same reference point, and a separate resistor per branch keeps the current of one LED from affecting the others.

How does it work?

Every output pin can be set HIGH or LOW independently. When a pin is set HIGH, about 5 V reaches the LED anode; because the cathode is tied to ground, the LED conducts in the forward direction and the 220 ohm resistor limits the current. When the pin is set LOW, both ends of the LED sit at the same potential and current stops. The sketch sets the three pins HIGH in turn with short delays to create a timed sequence. The shared ground ties all three branches to the same 0 V reference, and the per-branch resistor means one LED cannot change the current of another.

What should I see at the end?

The red, green and yellow LEDs light and go off one after another.

Related reading

Try the circuit in the browser

Open the same layout in the simulator, inspect the connections and follow the steps.