Learn using RGB 3 Color LED Module KY-016 in Arduino. RGB LED module is capable of producing lights of different colors using a single LED. We can generate light of any color code through this module. In this, we will generate lights of all colors. We are using Arduino Uno and RGB 3 Color LED Module KY-016 for this. So, let’s start.
First, let’s start with the basics of the RGB LED module.
Operating Voltage: 5V
LED drive mode: Common cathode driver
LED diameter: 5mm
Step 1: Required Components
RGB LED Module x 1
Breadboard x 1
Arduino Uno Board x 1
Jumper Wires
Step 2: Circuit Time
Make the circuit as per the given diagram. Connect red LED pin to pin 7 of Arduino. Then, connect the green LED pin to pin 9 of Arduino. Now, connect the blue LED pin to 8 of Arduino. Connect (-) pin of the module to the GND pin of Arduino. The RGB LED module will not require any limiting resistors.
Step 3: Code Time
This is code for the RGB LED module in Arduino. Firstly, we declare pins for red, green and blue pins. Then, set the declared pins in output mode. We use the ‘for’ loop to generate light of all the color codes. The first loop generates color in decreasing order, whereas the second loop generates color in increasing order. You can use the serial monitor to determine the light of which color code is generated.
Step 4: Upload the code to Arduino
Upload the above-given code to the Arduino Uno Board after the components are set as per the Circuit Diagram. Now you can see RGB lights of different colors generating subsequently.
Learn more information about uploading code to Arduino Uno.