KY-009 RGB Color LED module with Arduino

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 UNO1Buy Link
KY-009 RGB Color LED module1Buy Link
Resistor 110Ω2Buy Link
Resistor 180Ω1Buy Link
Jumper WiresBuy Link
Breadboard1Buy 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.

KY-009-RGB-Color-LED-SMD-Module-Datasheet

Specifications

This module contains 4 male header pins and a 5050 SMD LED. use with specifying resistors to stop LED burnout.

Operating Voltage5V max
Red 1.8V ~2.4V
Green 2.8V ~ 3.6V
Blue 2.8V ~ 3.6V
Forward Current20mA ~ 30mA
Operating Temperature-25°C to 85°C [-13°F ~ 185°F]
Board Dimensions18.5mm x 15mm [0.728in x 0.591in]

Pinout

KY-009-RGB-Color-LED-SMD-Module-Pinout

Pin Configuration

Pin NamePin Description
RRed Light Pin
GGreen Light Pin
BBlue Light Pin
(-) GNDGround 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

KY-009-RGB-Color-LED-SMD-Module-Interfacing-with-Arduino

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

ArduinoBreadboardModule
Pin 9180Ω resistorG
Pin 10110Ω resistorB
Pin 11110Ω resistorR
(-)GNDGND

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:

  1. DIY electronics projects
  2. Arduino and Raspberry Pi projects
  3. Hobby and educational projects
  4. Lighting and decoration projects
  5. Mood lighting and ambiance creation
  6. 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

  1. KY-003 Hall Magnetic Sensor module Arduino Circuit
  2. LED Blink and Flash with Arduino
  3. KY-004 Key Switch Module Arduino Circuit

Leave a Comment


error: