If you've found this project, you've most likely used an LED before. LEDs are a great feature to many projects, especially for indication lights. They can be used to signify whether or not a project is powered, to notify you of which "mode" you are in, or simply just for their cool looks. But what if you have the need for multiple LEDs but no room in your project? An RGB LED is a great choice!
RGB simply stands for "red, green, blue." So an RGB LED is an LED consisting, really, of three separate LEDs in a single package: red, green, and blue. These colors can be mixed together in various ways to create many shades of color. Maybe red is "startup," yellow is "ready," and green is the "operating" identifier for your project. Of course, you can just use them for flashy effects and attention, too!
The RGB Triangle.
In the everyday world, red, green, and blue are primary colors used in an additive color model, meaning they can be added together in various ways to create up to 16 million shades of color. Of course, not all colors can be created—some exist outside of the "RGB Triangle." When these three color LEDs are put together in the same package, the same laws apply.
These three colors can be controlled individually, which is why you'll notice on an RGB LED there are 4 leads—a common cathode and three individual anodes, or a common anode and three individual cathodes. Applying various voltages to each lead will create many different shades. This means you will need three output pins on your microcontroller to control a single RGB LED.
With the help of Cypress' PSoC 6 BLE kit, we can conveniently control the color of it's an on-board RGB LED without having to tediously change many lines of code. When you open the RGB section of the app, you'll notice its own RGB color blob. Simply move your finger across it and you'll see the colors change in real time! It's just like being back in kindergarten!
Red and green make yellow. Red and blue make pink, and so on and so forth. But who needs just one?! These little guys are sold by the meter on an adhesive strip which already includes necessary resistors and capacitors. All you need is a few beefy transistors and a 12 V power supply and you're good to go! Don't be afraid to get crazy, if you've "blinked" or "faded" LEDs before you can do the same with an entire strip.
Remember to always look for libraries and example code when you get stuck! Thanks for checking this out!
PSoC 6 RGB.
Give this project a try for yourself! Get the BOM.
Other MIT-i Innovations:
- The Cat-Apult! (an Arduino-controlled servo for makers)
- The Launchpad-Based Laser Tripwire Alarm! (a launchpad security system)
- The Arduino UNIVERSAL Remote Control! (an IR receiver for your entire house)
- The Crop Duster Buster! (a clap-controlled odor-management system)
- The Traffic Light Controller! (an Arduino delay statement lesson)
- The Dancing Ghostbusters Toaster! (a lesson on solenoids and inductive loads)
- The Raspberry Pi Object Detection Cat Toy! (a lesson on the RPi GPIO)
- The Zambroombi! (an object-avoidance robot)
- The Holiday Season Analog Alarm! (a gift-defending system)
- The Santa Cam! (a holiday motion-activated camera)
- The IoT Beaglebone Beagle Treat Dispenser-Feeder! (a poor excuse for automation)
- The Punxsutawney 5000! (an interesting way to avoid the cold)
- The BIG Arduino Piano! (a PWM musical instrument)
- The Trinamic Stepper Motor Drivers! (a stepper motor lesson)
- The Debra 2: An Analog Device's Soil Moisture Sensor (a live moisture sensor)
- Maxim Integrated's Sound Activated Rave Goggles (a musical Neopixel application)
- Fruit Drums (a Circuit Playground adventure in music)
- F.U.N. with B.L.E. (STMicro's Newest BLE Device)
- Arduino Multitasking (a lesson on millis() )