Rgb Led Module

10.00 EGP

  • RGB LED is a light emitting diode that displays just about any color by manipulating the intensities of either the Red, the Green or the Blue LED.

Out of stock

SKU: CM-22540 Categories: , Tags: ,

Description

Rgb Led Module

  • RGB stands for Red, Green and Blue and these are the primary colors.
  • RGB LED is a light emitting diode that displays just about any color by manipulating the intensities of either the Red, the Green or the Blue LED.
  • It can produce a variety of different colors instead of seeing the individual color as the LEDs are very closed-packed inside.

Rgb Led Module
Rgb Led Module
  • An RGB LED is composed of 3 LEDs that are connected to either a common cathode or common anode Arduino.
 common cathode or common anode Arduino

Common Cathode vs Common Anode RGB Arduino

  • For a common cathode, all 3 LEDs are integrated to a single pin which is a negative connection and in order to control the colors, you will need to provide a DC voltage supply or a HIGH signal.
  • In a Common Anode, again all 3 LEDs are connected to a pin but this time it is a positive connection.
  • And this is why an RGB LED has 4 pins, one for each LED and one for the common cathode or common anode. See the diagram below.
Diagram of the difference of Common Cathode and Anode

Try these other LED module projects.

Simple Arduino RGB Circuit Diagram 

  • Here is a simple project of interfacing an RGB LED module to an Arduino UNO.
  • First we need to connect the wires to integrate the RGB LED module to the Arduino board and it is best that we use the same color combination of wires (red, green, blue and black) to avoid confusion.
  • Place the RGB LED module on your breadboard and connect the wires according to color (but you can use any color you want). Connect the black wire to the cathode or anode pin of the module. Now, place the other end of the wire to the Arduino Pin slots.
  • Red wire     = 7 pin
  • Green wire  = 6 pin
  • Blue wire    = 5 pin
  • Black wire   = Ground
RGB LED module interfaced to an Arduino UNO

Specification:

  • Material: FR4
  • Length: 25mm
  • Width: 11mm
  • Height: 16mm
  • Weight: 1.59g
  • Operating Voltage: 5v DC

Code Setup

Setting up the global variables

int redPin     = 7;
int greenPin = 6;
int bluePin    = 5;

Here, we will do the void setup and we will have 3 output for this project

void setup() {
 pinMode(redPin, OUTPUT);
 pinMode(greenPin, OUTPUT);
 pinMode(bluePin, OUTPUT);
}

For the loop section, this function is for the RGB color transition and will change every second. We will make use of the setColor() function to set the redValue to 255 and 0 for the others and so on and so forth. We will also use different argument values to get different colors like white and purple.

void loop() {
 setColor(255, 0, 0);  // Red Color
 delay(1000);
 setColor(0, 255, 0);  // Green Color
 delay(1000);
 setColor(0, 0, 255);  // Blue Color
 delay(1000);
 setColor(255, 255, 255);  // White Color
 delay(1000);
 setColor(170, 0, 255);  // Purple Color
 delay(1000);
}

In this last section of the Code, the redValue, greenValue and blueValue are arguments that will indicate the intensity of the brightness of the LED’s.

void setColor(int redValue, int greenValue, int blueValue) {
 analogWrite(redPin, redValue);
 analogWrite(greenPin, greenValue);
 analogWrite(bluePin, blueValue);
}

Full Code:

int redPin= 7;
int greenPin = 6;
int bluePin = 5;
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
setColor(255, 0, 0); // Red Color
delay(1000);
setColor(0, 255, 0); // Green Color
delay(1000);
setColor(0, 0, 255); // Blue Color
delay(1000);
setColor(255, 255, 255); // White Color
delay(1000);
setColor(170, 0, 255); // Purple Color
delay(1000);
}
void setColor(int redValue, int greenValue, int blueValue) {
analogWrite(redPin, redValue);
analogWrite(greenPin, greenValue);
analogWrite(bluePin, blueValue);
}

Common usage of a RGB LED module

  • Can be made into Indoor and outdoor lighting
  • Used in mobile phones 
  • LCD
  • Can be integrated to Automotive lights
How to make white with RGB LED?

  • In order for your RGB LED module to produce a white color, you need to set the maximum brightness of the 3 LED of your project. In this article, we have set the argument values to 255 for for each LED to achieve the white color.

Package Included:

  • 1 X Rgb Led Module

Additional information

Weight 0.00195 kg
Dimensions 2.5 × 1.1 × 1.6 cm

Reviews

There are no reviews yet.

Be the first to review “Rgb Led Module”

Your email address will not be published. Required fields are marked *