In this project we are going to interface 5 RGB (Red Green Blue) LEDs to Arduino Uno. These LEDs are connected in parallel for reducing PIN usage of Uno.
The RGB LED will have four pins as shown in figure.
PIN1: Color 1 negative terminal or color 1 positive terminal
PIN2: Common positive for all three colors or common negative for all three colors
PIN3: Color 2 negative terminal or color 2 positive terminal
PIN4: Color 3 negative terminal or color 3 positive terminal
So there are two types of RGB LEDs, one is common cathode type (common negative) and other is common anode type (common positive) type. In CC (Common Cathode or Common Negative), there will be three positive terminals each terminal representing a color and one negative terminal representing all three colors. The internal circuit of a CC RGB LED can be represented as below.
If we want RED to be on in above, we need to power the RED LED pin and ground the common negative. The same goes for all the LEDs. In CA (Common Anode or Common Positive), there will be three negative terminals each terminal representing a color and one positive terminal representing all three colors. The internal circuit of a CA RGB LED can be represented as shown in figure..
If we want RED to be on in above, we need to ground the RED LED pin and power the common positive. The same goes for all the LEDs.
In our circuit we are going to use CA (Common Anode or Common Positive) type. For connecting 5 RGB LEDs to Arduino we need 5×4= 20 PINS usually, by we are going to reduce this PIN usage to 8 by connecting RGB LEDs in parallel and by using a technique called multiplexing.
Components
Hardware: UNO, power supply (5v), 1KΩ resistor (3 pieces), RGB (Red Green Blue) LED (5 pieces)
Software: Atmel studio 6.2 or Aurdino nightly.
Read More: RGB LED with Arduino