Introduction
The KY-009 RGB Color LED module emits rays of colors by a mixture of red, green, and blue light. Each color is modified by operating Pulse Width Modulation (PWM).
This module is capable of interfacing with popular electronic platforms like Arduino, ESP32, Raspberry Pi, and other microcontrollers. that will turn on the RGB Led light on adjusted colors.
Hardware Required
You will require the following Hardware Components for the Interfacing of the KY-009 RGB Color LED module with arduino.
Components | # | Buy From Amazon |
---|---|---|
Arduino UNO | 1 | Buy Link |
KY-009 RGB Color LED module | 1 | Buy Link |
Resistor 110Ω | 2 | Buy Link |
Resistor 180Ω | 1 | Buy Link |
Jumper Wires | – | Buy Link |
Breadboard | 1 | Buy Link |
What is a KY-009 RGB Color LED module?
The KY-009 RGB Color LED module is a simple and low-cost module that consists of an RGB LED, which can produce various colors by mixing red, green, and blue light. The module can be connected to an Arduino board or other microcontroller to control the color and brightness of the LED. The unique article identifier refers to a specific instance of the KY-009 RGB Color LED module, which can be used to distinguish it from other similar modules.
Specifications
This module contains 4 male header pins and a 5050 SMD LED. use with specifying resistors to stop LED burnout.
Operating Voltage | 5V max Red 1.8V ~2.4V Green 2.8V ~ 3.6V Blue 2.8V ~ 3.6V |
Forward Current | 20mA ~ 30mA |
Operating Temperature | -25°C to 85°C [-13°F ~ 185°F] |
Board Dimensions | 18.5mm x 15mm [0.728in x 0.591in] |
Pinout
Pin Configuration
Pin Name | Pin Description |
---|---|
R | Red Light Pin |
G | Green Light Pin |
B | Blue Light Pin |
(-) GND | Ground Pin |
Circuit Diagram
The following circuit shows you the connection of the KY-009 RGB Color LED module with Arduino Please make the connection carefully
Circuit Connections
Place the module on the Breadboard and connect the green pin (G) of the module connected to 9 pin of Arduino, and blue pin (B) of the module is connected to pin 10 and red pin of module is connected to pin 11 of the arduino and finally the ground pin (-) of the module is connected to GND pin of arduino respectively
Arduino | Breadboard | Module |
---|---|---|
Pin 9 | 180Ω resistor | G |
Pin 10 | 110Ω resistor | B |
Pin 11 | 110Ω resistor | R |
(-)GND | GND |
Installing Arduino IDE Software
First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow
Code
The following Arduino code will process through different colors by modifying the PWM value on each of the Red, Green, and Blue primary colors.
int redpin = 11; //select the pin for the red LED
int bluepin =10; // select the pin for the blue LED
int greenpin = 9;// select the pin for the green LED
int val;
void setup() {
pinMode(redpin, OUTPUT);
pinMode(bluepin, OUTPUT);
pinMode(greenpin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
for(val = 255; val > 0; val--)
{
analogWrite(redpin, val); //set PWM value for red
analogWrite(bluepin, 255 - val); //set PWM value for blue
analogWrite(greenpin, 128 - val); //set PWM value for green
Serial.println(val); //print current value
delay(1);
}
for(val = 0; val < 255; val++)
{
analogWrite(redpin, val);
analogWrite(bluepin, 255 - val);
analogWrite(greenpin, 128 - val);
Serial.println(val);
delay(1);
}
}
Applications
The KY-009 RGB Color LED module is commonly used in a variety of electronic applications, such as:
- DIY electronics projects
- Arduino and Raspberry Pi projects
- Hobby and educational projects
- Lighting and decoration projects
- Mood lighting and ambiance creation
- Product prototyping and testing.
These modules can be controlled using microcontrollers or other control devices, allowing users to program and control the color and brightness of the LED.
See Also