How to Use an RGB LED Module With Arduino
Perhaps one of the most common modules in an Arduino starter kit, the RGB LED lets you create all sorts of colors with just four pins from the Arduino. This tutorial demonstrates two ways to use this module, so read on to learn how well it works!
What Is an RGB LED Module?
An RGB LED module uses a special kind of LED light that can emit three colors: red, green, and blue. However, you can make any color you could possibly think of by changing which one is turned on and mixing up each one’s brightness.
There are two ways to go about lighting an RGB LED module on any Arduino board. The usual method is to use the Arduino’s analog pins to send PWM signals to the module. This lets you mix each color, giving you full control over the RGB LED.
Meanwhile, the other (digital) option is to use pins 11, 12, 13, and GND by attaching the module to the Arduino as you would with a shield. This saves space by not requiring jumper wires for every pin, but it does exchange fine control over the LED’s hue and brightness. Furthermore, the setup only works if the module has pins that fit properly on the Arduino board, such as the HW-479 that we’re using in this guide.
How RGB LEDs Work
At this point, you may be wondering how a single RGB LED module emits three colors. You may be surprised to learn that an RGB LED is not really just one fancy LED but three smaller LEDs encased in a larger LED. These mini LEDs share the same grounding pin, which should be the longest of the four pins in an RGB LED.
If you have a bare RGB LED instead of a module in a breakout board, you can make something akin to a module by attaching resistors on each of the color pins. The resistance value varies per manufacturer, but 220Ω per leg is a safe bet.
Read More: How to Use an RGB LED Module With Arduino – Make Tech Easier