RGB LED (Common Cathode - Clear) (Pack of 10)
RGB LED (Common Cathode - Clear) (Pack of 10)
The RGB LED (Common Cathode - Clear) is a type of light-emitting diode (LED) that emits a combination of red, green, and blue light to produce a wide range of colors. This component is commonly used in various Internet of Things (IoT) projects, robotics, and electronic devices that require colorful visual indicators or displays.
The RGB LED (Common Cathode - Clear) is a multi-color LED that can produce up to 16,777,216 different colors by varying the intensity of the red, green, and blue light. The LED has four pins | one common cathode (negative leg) and three anodes (positive legs) for the red, green, and blue light sources. By applying different voltage levels to the anodes, the LED can produce a wide range of colors, from pure red, green, and blue to various shades of yellow, orange, purple, and white. |
1.8-2.2V (typical) for each color
20mA (maximum) for each color
200-300mcd (typical) for each color
620-630nm (red), 520-530nm (green), 460-470nm (blue)
120 (typical)
-25C to +85C
-40C to +100C
The RGB LED (Common Cathode - Clear) is suitable for a wide range of applications, including |
IoT projects requiring colorful visual indicators or displays
Robotics and robotic vision systems
Electronic signage and lighting
Gaming consoles and peripherals
Automotive and aerospace applications
Medical devices and equipment
Component Documentation: RGB LED (Common Cathode - Clear) (Pack of 10)
Overview
The RGB LED (Common Cathode - Clear) is a high-intensity, three-color LED that combines red, green, and blue light sources in a single package. This LED has a common cathode connection, meaning all three color channels share a common negative leg. The clear lens allows for a wider viewing angle and higher light output. This pack includes 10 pieces of RGB LEDs.
Technical Specifications
Color: Red, Green, and Blue
Wavelength:
+ Red: 620-630 nm
+ Green: 520-530 nm
+ Blue: 460-470 nm
Luminous Intensity: 1000-2000 mcd (millicandela)
Forward Voltage: 2.0-2.5 V (Red), 3.0-3.5 V (Green), 3.0-3.5 V (Blue)
Reverse Voltage: 5 V
Current: 20 mA (maximum)
Package: 5-pin, Common Cathode
Operating Temperature: -25C to +85C
Pinout
Pin 1: Red Anode
Pin 2: Green Anode
Pin 3: Blue Anode
Pin 4: No Connection
Pin 5: Common Cathode
Code Examples
### Example 1: Basic RGB LED Control with Arduino
This example demonstrates how to control the RGB LED using an Arduino board. It sets the LED to display a bright red color.
```arduino
const int redPin = 9; // Pin 1 of the RGB LED
const int greenPin = 10; // Pin 2 of the RGB LED
const int bluePin = 11; // Pin 3 of the RGB LED
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
// Set the LED to bright red
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, LOW);
digitalWrite(bluePin, LOW);
delay(1000); // Wait for 1 second
}
```
### Example 2: Fading RGB LED with Raspberry Pi (Python)
This example demonstrates how to fade the RGB LED using a Raspberry Pi and Python. It gradually changes the LED's color from blue to red.
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO pins
GPIO.setmode(GPIO.BCM)
red_pin = 17
green_pin = 23
blue_pin = 24
GPIO.setup(red_pin, GPIO.OUT)
GPIO.setup(green_pin, GPIO.OUT)
GPIO.setup(blue_pin, GPIO.OUT)
# Define a function to set the LED color
def set_color(red, green, blue):
GPIO.output(red_pin, GPIO.HIGH if red else GPIO.LOW)
GPIO.output(green_pin, GPIO.HIGH if green else GPIO.LOW)
GPIO.output(blue_pin, GPIO.HIGH if blue else GPIO.LOW)
try:
while True:
# Fade from blue to red
for i in range(100):
set_color(i % 2, 0, (100 - i) % 2)
time.sleep(0.01)
except KeyboardInterrupt:
GPIO.cleanup()
```
### Example 3: RGB LED Color Cycling with ESP32 (MicroPython)
This example demonstrates how to cycle through different colors using an ESP32 board and MicroPython.
```python
import machine
import utime
# Set up GPIO pins
red_pin = machine.Pin(18, machine.Pin.OUT)
green_pin = machine.Pin(19, machine.Pin.OUT)
blue_pin = machine.Pin(20, machine.Pin.OUT)
# Define a function to set the LED color
def set_color(red, green, blue):
red_pin.value(red)
green_pin.value(green)
blue_pin.value(blue)
while True:
# Cycle through colors
set_color(1, 0, 0) # Red
utime.sleep(0.5)
set_color(0, 1, 0) # Green
utime.sleep(0.5)
set_color(0, 0, 1) # Blue
utime.sleep(0.5)
set_color(1, 1, 0) # Yellow
utime.sleep(0.5)
set_color(1, 0, 1) # Magenta
utime.sleep(0.5)
set_color(0, 1, 1) # Cyan
utime.sleep(0.5)
```
Remember to adjust the pin connections and voltage levels according to your specific board and setup.