User Manual
28
Lesson 2 RGB LED Module
Introduction
RGB LED modules can emit various colors of light. Three LEDs of red, green, and blue are
packaged into a transparent or semitransparent plastic shell with four pins led out. The three
primary colors of red, green, and blue can be mixed and compose all kinds of colors by
brightness, so you can make an RGB LED emit colorful light by controlling the circuit.
Components
- 1 * Raspberry Pi
- 1 * Breadboard
- 4 * Jumper wires (Male to Male, 2 red and 2 black)
- 1 * Network cable (or USB wireless network adapter)
- 1 * RGB LED module
- 1 * 4-Pin anti-reverse cable
Experimental Principle
In this experiment, we will use PWM technology to control the brightness of RGB.
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means.
Digital control is used to create a square wave, a signal switched between on and off. This
on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing
the portion of the time the signal spends on versus the time that the signal spends off. The
duration of "on time" is called the pulse width. To get varying analog values, you change, or
modulate, that pulse width. If you repeat this on-off pattern fast enough with an LED for
example, the result is as if the signal is a steady voltage between 0 and 5v controlling the
brightness of the LED.










