Circuit With RGB LED

by tejbho305 in Circuits > Arduino

59 Views, 0 Favorites, 0 Comments

Circuit With RGB LED

IMG_2571.jpg

In this tutorial you will learn to make a RGB LED light up any color you want.

Supplies

IMG_2569.jpg
  1. Elegoo Uno R3 Microcontroller board
  2. Breadboard
  3. RGB LED
  4. Three 330 ohm resistors
  5. USB cable

Attach the LED and Resistors

IMG_2570.jpg

Attach the three resistors above the RGB LED as shown. Do not attach a resistor above the longest end of the LED because we will connect that to ground in the next step.

Connect the Wires

how-an-rgb-led-works.jpg
IMG_2571.jpg

To see which end of the LED corresponds to which color, see the above image. Then connect wires going from the top of each resistor to the input pins on the microcontroller board. I color coded my wires in the photo. Finally, connect one wire going from the longest end of the LED to GND.

Write the Code

download.jpg

You will need to download Arduino IDE for this step: https://www.arduino.cc/en/software

You can find my code here: https://github.com/tejbho/ArduinoProjects/blob/main/RGBlight/RGBlight.ino

Test the Circuit

RGB LED

The program will ask you which color you want the LED. In the video I change the LED to a variety of colors. See if you can make your own!