Arduino RGB LED Module

5,546

10

1

About: Student, currently studying programming. Interested in Arduino, Raspberry Pi and Electronics in general.

Today, you will learn how to use an RGB LED module which can be used as multiple LEDs at once. I got mine from Kuman, as included in their Arduino UNO Kit, which was provided for this tutorial at no cost.


Step 1: Parts Needed

You will need the following parts:

  • A breadboard
  • An Arduino board
  • USB Cable
  • 4 Jumper Wires
  • The RGB LED module

Allchips is an electronics components online service platform, you can buy all the components from them.

Step 2: Connecting the Module

Plug in the module in your breadboard, I'm using a mini one. We need to connect 4 pins - one for common ground (GND) and one for each of the 3 basic colors - red, green, blue.

GND of the module goes to GND of the Arduino. The following 3 pins are as follows:

Red (R) -> Pin 8

Green (G) -> Pin 10

Blue (B) -> Pin 12

* You can change the pin numbers in the code that I've provided below

Step 3: Uploading the Code

Connect the board to your PC using the USB cable. The code that I've written changes every color's value (from 0 to 255) so the 3 colors are random, making up the one that is visible random as well. Feel free to change the different values in the code so you can get fixed colors. By default, the color is being changed every 500 ms (1/2 second), you can change that as well

Code

Step 4: Video Showcase

Share

    Recommendations

    • Warm and Fuzzy Contest

      Warm and Fuzzy Contest
    • Toys Contest

      Toys Contest
    • Cardboard Challenge

      Cardboard Challenge

    Discussions

    0
    None
    LiepājasA

    3 months ago on Step 4

    Great. One can also do this project without any wires by plugging RGB module in pins 8,9,10 and 11. Set 8 as ground by writing digitalWrite(8,LOW)