![]() You must add a resistors to each pins RGB in order to limit the current flow through it. So in order to do that I have used digital pins 1,2 and 3 of Arduino. As explained in the above section for a Common Anode LED current from Common pin should be sinked to the pins of Arduino via R, B and G pins. Note: we’ll be using a common anode LED for this project, but if you already have a common cathode LED it’s fine to use that just watch out for the differences noted in the circuit wiring and code. I have used common Anode RGB LED to illustrate in this tutorial. However in Common Anode configuration Common pin is to source the voltage and desired color can be lighten up by sinking the current through pins of Arduino or any other controller. In Common Cathode configuration RGB pins are used to source the voltage from Arduino and common pin is meant to sink the current, resulting in lighting up the desired color. Common Anode (+) This type of LED has four pins. Unlike the 7 segment display there are Common Anode and Common cathode LED’s as shown in the above figure. There are two type of RGB LEDs you will encounter and they are wired very differently. Altogether this LED will have 4 pins in total as shown above. This is nothing but LED’s of three colors Red, Blue and Green combined together in a single package with a pin dedicated to each color and one pin as common. I got the idea of writing a tutorial on interfacing RGB led with Arduino to help those who are not aware of interfacing and programming them. I am always fond of building projects and playing with LED’s because of their vibrant colors and unending possibilities. The RGB LED we are using is a common anode LED. The pinout of the common anode RGB LED is shown below. For the common anode RBG LED, one pin is power (pin 2) and the other 3 pins are the cathodes of the red, green, and blue LED. In order to create ground for the leds I connected 3 rectifier diodes to R-, G- and B. ![]() Using 3 pnp transistors it inverts the R-, G- and B- to R+, G+ and B+. ![]() After a few tests I came up with the circuit below. ![]() LED’s we can never get enough out of this thing. How do RGB LEDs work 10pcs 10mm 4pins Full-color Rgb Led Common Anode / Cathode Transparent / Fog F10mm Tri-color Light Emitting Diode Red Green Blue - Diodes. 3 220 resistors 3 toggle switches The RGB LED is a 4-pin LED. Now that I have run out of common anode RGB leds I tried to come up with a solution to somehow connect common ground to common anode. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |