KY-016 RGB Full color LED module

Description

KY-016 Arduino full color 5mm RGB LED, different colors can be obtained by mixing the three primary colors.

Specifications

This module consists of a 5mm RGB LED and three 150Ω limiting resistors to prevent burnout. Adjusting the PWM signal on each color pin will result on different colors.

Operating Voltage5V
LED drive modeCommon cathode driver
LED diameter5 mm

KY-016 Connection Diagram

Connect the red pin (R) on the KY-016 to pin 11 on the Arduino. Blue (B) to pin 10, green (G) to pin 9 and ground (-) to GND. Notice that you do not need to use limiting resistors since they are already included on the board.

KY-016Arduino
RPin 11
BPin 10
GPin 9
-GND
KY-016 Arduino connection diagram click to enlarge

KY-016 Example Code

The following Arduino sketch will gradually increase/decrease the PWM values on the red, green and blue pins causing the LED to cycle through various 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(11, val);
    analogWrite(10, 255 - val);
    analogWrite(9, 128 - val);

    Serial.println(val, DEC);
    delay(5); 
  }
  for(val = 0; val < 255; val++)
  {
    analogWrite(11, val);
    analogWrite(10, 255 - val);
    analogWrite(9, 128 - val);
    
    Serial.println(val, DEC);
    delay(5); 
  }
}

2
Leave a Reply

avatar
1 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
ArduinoModulesZachary H. Recent comment authors
Zachary H.
Zachary H.

You found that RBG module on Frizting?? Where is it? I can’t find it and I need it in my schematics.