Introduction
The KY-011 Two Color LED module emits light in red and green colors. You also can modify the intensity of each color by using PWM.
This module is compatible to interfacing with popular electronic platforms like Arduino, ESP32, Raspberry Pi, and other microcontrollers. This module is equivalent to the KY-029 module.
Hardware Required
You will require the following Hardware Components for the Interfacing of the KY-011 Two Color LED module with arduino.
Components | # | Buy From Amazon |
---|---|---|
Arduino UNO | 1 | Buy Now |
KY-011 Two Color LED module | 1 | Buy Now |
Resistor 330Ω | 2 | Buy Now |
Jumper Wires | – | Buy Now |
Breadboard | 1 | Buy Now |
What is a KY-011 Two Color LED module?
A KY-011 Two Color LED module is a compact module that consists of two light-emitting diodes (LEDs), one red and one green, mounted on a single PCB (printed circuit board). It is a simple, low-cost, and ready-to-use solution for adding multi-color lighting to electronic projects.
![KY-011-Two-Color-Led-Module-with-arduino](http://arduinocircuit.com/wp-content/uploads/2023/02/KY-011-Two-Color-Led-Module-with-arduino.webp)
Specifications
This module contains a 0Ω resistor, a common cathode 3mm red and green LED, and 3 male header pins. Before the operating voltage is between 2.0v and 2.5v, you will have to use limiting resistors to preclude burnout when attaching to the Arduino.
Operating Voltage | 2.0v ~ 2.5v |
Working Current | 10mA |
Diameter | 3mm |
Package Type | Diffusion |
Color | Red + Green |
Beam Angle | 150 |
Wavelength | 571nm + 644nm |
Luminosity Intensity (MCD) | 20-40; 40-80 |
Pinout
![KY-011-Two-Color-Led-Module-Pinout](http://arduinocircuit.com/wp-content/uploads/2023/02/KY-011-Two-Color-Led-Module-Pinout-.webp)
Pin Configuration
Pin Name | Pin Type |
---|---|
R Pin | Red Pin |
G Pin | Green Pin |
– (GND) | Ground Pin |
Circuit Diagram
The following circuit shows you the connection of the KY-011 Two Color LED module with Arduino Please make the connection carefully
![KY-011-Two-Color-Led-Module-Interfacing-with-Arduino-circuit](http://arduinocircuit.com/wp-content/uploads/2023/02/KY-011-Two-Color-Led-Module-Interfacing-with-Arduino-1024x597.webp)
Circuit Connections
Place the module on BreadBoard and attach the green pin (G) of the module to Pin 10 of the Arduino, and connect the red pin (R) of the module to pin 11 of the arduino. Finally, connect the ground pin (Y) of the module to the GND of arduino.
We will use a pair of resistors between the module and the Arduino to preclude the burn of the LED.
Arduino | BreadBoard | Module |
---|---|---|
Pin 10 | Resistor 330Ω | G (Green) |
Pin 11 | Resistor 330Ω | R (Red) |
GND | – | G (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 slowly alternate between red and green colors.
int redpin = 11; // pin for red signal
int greenpin = 10; // pin for green signal
int val;
void setup() {
pinMode(redpin, OUTPUT);
pinMode(greenpin, OUTPUT);
}
void loop() {
for(val = 255; val > 0; val--) {
analogWrite(redpin, val); //dim red
analogWrite(greenpin, 255 - val); // brighten green
delay(15);
}
for(val = 0; val < 255; val++) {
analogWrite(redpin, val); //brighten red
analogWrite(greenpin, 255 - val); //dim green
delay(15);
}
}
Applications
- Status Indication: It can be used to indicate the status of a device or system by lighting up either the red or green LED. For example, the green LED can indicate that a device is powered on, while the red LED can indicate an error or fault condition.
- Visual Effects: The module can be used to create simple visual effects, such as a breathing effect, by gradually changing the brightness of the LED.
- Circuit Design: It can be used in circuit designs that require multiple color LEDs, but have limited space.
Downloads Files
- KY-011 Two-Color LED module Fritzing Part:
- Common cathode 3mm red and green LED Datasheet: