members
Basics: Project 075h RGB LED
of Acoptex.com in UNO
Basics: Project 075h
Project name: RGB LED
Tags: Arduino Uno, RGB LED
Attachments: sketch
In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):
1.Arduino Uno R3 (you can also use the other version of Arduino)
2. Arduino IDE ( you can download it from here )
4.Jumper cables F-M
5. Resistor 3 pcs (220 Ohm each)
6. RGB LED 1 pc
7. Breadboard 1 pc
General
We will learn how to connect RGB LED to Arduino board and use it.
Understanding the RGB LED
What are LEDs?
LEDs are light emitting diodes. These are electronic components that convert electrical energy directly to light through the movement of electrons within the material of the diode. LEDs are important because due to their efficiency and low energy, they are beginning to replace most conventional light sources.
What does RGB LED mean?
RGB LED is a combination of 3 LEDs (red, blue and green LEDs) in just one package. RGB LED products combine these three colors to produce over 16 million hues of light. Note that not all colors are possible. Some colors are “outside” the triangle formed by the RGB LEDs. Also, pigment colors such as brown or pink are difficult, or impossible, to achieve.
There are common anode RGB LEDs and common cathode RGB LEDs. See the Common cathode (-) below:
See the coomon anode (+) below:
As you can see, the 3 LEDs can share the cathode or the anode. This results in an RGB LED that has 4 pins, one for each LED, and one common cathode or one common anode. The common anode RGB LED is the most popular type.
How to create different colors?
You can create one of those three colors – red, green or blue – by activating just one LED.
For example, if you want to produce red, you activate the red LED and turn off the other two.
To produce other colors, you can combine the three colors in different intensities. To generate different colors you can use PWM to adjust the brightness of each LED.
As the LEDs are very close to each other, we can only see the final colors result rather than the three colors individually. To have an idea on how to combine the colors, take a look at the following chart. This is the simplest color mixing chart, there are more complex color charts on the web.
Signals and connections of the
RGB LEDs have 4 pins which can be distinguished by their length. The longest one is the ground (-) or voltage (+) depending if it is a common cathode or common anode LED, respectively.
The operating voltage of the LED is 1.8V and the operating current is 10mA-20mA. The Arduino Uno board can supply 5V or 3.3V power. We will use 5V for this project, so the minimum resistance of the current limiting resistor should be (5 V to 1.8 V)/20 = 160 Om. The 220 Om is suitable and you can also choose other resistors that meet the condition. The larger the resistance is, the dimmer the LED will get.
Wiring
The following picture shows the needed connections with the Arduino Uno
We are using the common anode RGB LED here.
Step by Step instruction
- Do wiring.
- Open Arduino IDE.
- Plug your Adruino Uno board into your PC and select the correct board and com port
- Open, verify and upload the sketch to your Adruino Uno.
- Open up serial monitor and set your baud to 9600 baud.
- The RGB LED will appear red, green, and blue first, then red, orange, yellow, green, blue, indigo, and purple.
Summary
We learnt how to connect RGB LED to Arduino board and use it.
Libraries:
- No libraries required
Sketch:
- See attachment on the begining of this project
Other projects of Acoptex.com










jobs.viewed