RGB LED MODULE

Description

  • Common cathode RGB LED
  • Series current limiting resistors on the board, ready to use
  • Male pin header simplifies connections
  • VCC input voltage 5V
  • Easy to use and set up

5 volts RGB LED breakout board with current limiting resistors and male pins for fast and easy use. Use colors to signal a state or to make your project stand out.

Supply voltage +5 VDC
Maximum current 60 mA
Operating temperature -25 to 85 ℃
Luminosity (RGB) 800, 4000, 900 mcd
Wavelength (RGB) 623, 517.5, 466 nm

Easy to connect, with only four cables. You can pin the module on the breadboard and use the male to male jumper cables, or use the male to female jumper cables to connect the module directly to the Arduino-compatible board.

Connect the – pin to the GND pin on your Arduino-compatible board. For our example, connect B (blue anode) to digital 9, G (green anode) to digital 10 and R (red anode) to digital 11 on your Arduino-compatible board.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*Rewieved by Dr. Mangus for MangoLabs
   Example by jamesotron*/
 
 
const int redPin = 11;
const int greenPin = 10;
const int bluePin = 9;
 
void setup() {
  // Start off with the LED off.
  setColourRgb(0,0,0);
}
 
void loop() {
  unsigned int rgbColour[3];
 
  // Start off with red.
  rgbColour[0] = 255;
  rgbColour[1] = 0;
  rgbColour[2] = 0; 
 
  // Choose the colours to increment and decrement.
  for (int decColour = 0; decColour < 3; decColour += 1) {
    int incColour = decColour == 2 ? 0 : decColour + 1;
 
    // cross-fade the two colours.
    for(int i = 0; i < 255; i += 1) {
      rgbColour[decColour] -= 1;
      rgbColour[incColour] += 1;
       
      setColourRgb(rgbColour[0], rgbColour[1], rgbColour[2]);
      delay(5);
    }
  }
}
 
void setColourRgb(unsigned int red, unsigned int green, unsigned int blue) {
  analogWrite(redPin, red);
  analogWrite(greenPin, green);
  analogWrite(bluePin, blue);
 }
  1. In this example we are connecting:
    Arduino   RGB LED
    D11    —    R
    D10    —   G
    D9     —    B
    GND —    –
  2. Download and install the Arduino environment from here or use the web editor.
  3. Download the sketch here and open or open the Arduino environment and copy the code into a blank sketch.
  4. Connect your board to your computer with the included usb cable.
  5. Select your board in Tools/Board/Arduino Uno.
  6. Select your port in Tools/Port/COM#(Arduino Uno), this will change slightly depending on your operating system.
  7. Upload pressing the arrow in the circle on the upper left.
  8. You should see the RGB LED changing colors.
    That’s it!