Abrish Fatimaaah
Published

RGB LED Blinking with Arduino UNO

A simple Arduino UNO project demonstrating how to control and blink an RGB LED using basic electronics and programming.

BeginnerFull instructions provided1 hour40
RGB LED Blinking with Arduino UNO

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
×1
Male/Male Jumper Wires
×1
Arduino UNO
Arduino UNO
×1
RGB Diffused Common Anode
RGB Diffused Common Anode
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Wire Cutter / Stripper, 5.25 " Overall Length
Wire Cutter / Stripper, 5.25 " Overall Length

Story

Read more

Custom parts and enclosures

result

## Result

The RGB LED successfully blinked in different colors according to the Arduino program. This confirmed that the RGB channels were connected and controlled correctly.

Schematics

circuit diagram

## Circuit Diagram

The circuit diagram below shows how the **RGB LED, resistors, breadboard, and Arduino UNO** are connected. Use it as a reference to recreate the circuit and ensure the connections are made correctly.

Code

code

C/C++
The Arduino code used to control the RGB LED is provided below. It controls each RGB channel individually and uses timed delays to create the blinking color sequence.

You can copy the code into the Arduino IDE and upload it to your Arduino UNO to recreate the project.
// RGB LED Blinking with Arduino UNO

int redPin = 11;
int greenPin = 10;
int bluePin = 9;

void setup() {
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

void loop() {

  // Red
  digitalWrite(redPin, HIGH);
  digitalWrite(greenPin, LOW);
  digitalWrite(bluePin, LOW);
  delay(1000);

  // Green
  digitalWrite(redPin, LOW);
  digitalWrite(greenPin, HIGH);
  digitalWrite(bluePin, LOW);
  delay(1000);

  // Blue
  digitalWrite(redPin, LOW);
  digitalWrite(greenPin, LOW);
  digitalWrite(bluePin, HIGH);
  delay(1000);

  // Yellow
  digitalWrite(redPin, HIGH);
  digitalWrite(greenPin, HIGH);
  digitalWrite(bluePin, LOW);
  delay(1000);

  // Purple
  digitalWrite(redPin, HIGH);
  digitalWrite(greenPin, LOW);
  digitalWrite(bluePin, HIGH);
  delay(1000);

  // Cyan
  digitalWrite(redPin, LOW);
  digitalWrite(greenPin, HIGH);
  digitalWrite(bluePin, HIGH);
  delay(1000);

  // Turn OFF
  digitalWrite(redPin, LOW);
  digitalWrite(greenPin, LOW);
  digitalWrite(bluePin, LOW);
  delay(1000);
}

Credits

ABRISH FATIMA

Comments