OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.ĭisclosure of Material Connection: is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, Site Copyright 2014-2020 Paul McWhorter, Send comments to SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. We will start simple so we can get an intuitive feel for how the LED works. Now lets play around with a program that will independently turn on the different colors. Arduino circuit to control the color of an RGB LED. The following schematic controls red from arduino pin 6, green from arduino pin 10 and blue from arduino pin 11. But first, lets go ahead and get our circuit set up. Basically by analogWrite-ing different values to the 3 different control pins, you can get any imaginable color. Also the exciting thing is that if you write voltages to multiple pins, you can get the in between blended colors. If we write a voltage to the blue pin, the LED will be blue. If we write a voltage to the red pin, the LED will be red. Once that is hooked up, we can control what color the LED is by writing voltages from the arduino to specific legs of the RGB LED. So each color control pin will connect to an arduino output pin through its own current limiting resistor. each color control pin will need its own current limiting resistor. For these new RGB LED’s how many current limiting resistors will we need? We will need three. Also, remember than you never connect an LED directly to a voltage source, you always use a series current limiting resistor (typically 330 ohms). To control this LED, how many control pins will you need to use on the arduino? That’s right. To control a normal LED, you needed to connect to one arduino output pin. Now, think about how you would connect the control pins. You can easily see that pin should be connected to your circuit ground. As you can see in the schematic, all three of the LED’s share a common ground pin. Now lets think about using this in a circuit. Also note in the drawing you can see that the length of the pins is your clue as to which pin controls red, which green and which blue. The Sparkfun Inventor Kit has the common cathode configuration, which is the type I prefer. I think these are much more confusing, but just mention them so that you know that this tutorial is for the common cathode type. There are also “Common Anode” LED’s which share a common high voltage pin, and then each color has its own ground. “Common Cathode” just means that the LED’s share the ground pin. This picture shows the four pins for a common cathode RGB LED. This schematic shows how to work with a common cathode RGB LED A schematic will probably help you understand how the component works and how you should hook up to it. You can control the color you get out of the LED based on the voltages you write to the different control pins. All three of the LED’s are connected to ground through the same pin. Then one lead controls the red LED, one lead controls the green LED, and one lead controls the blue LED. One lead, the long lead, is the common ground. Circuit to control RGB LED with an ArduinoĪn RGB LED is basically three LED’s in one. In today’s lesson we will learn how to control an RGB (Red, Green, Blue) LED with an arduino microcontroller! This will introduce us to a new circuit component, and will require us to learn some new programming skills. OK, we are ready to move forward and learn new circuit skills and new programming skills.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |