15
Lesson 2 RGB LED
Introduction
There are two kinds of packages for RGB LED (as shown below) in this kit. One is Surface
Mount Device (SMD) type, and the other is Dual In-line Package (DIP) type.
Components
-
1 * SunFounder Uno board
- 1 * USB data cable
- 1 * RGB LED module
- Several jumper wires
Experimental Principle
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, red, green, and blue, can be mixed into various kinds of color by brightness,
so you can make an RGB LED emit colorful light by controlling the circuit.
In this experiment, we will also use PWM technology to control the brightness of RGB.
Before we talk about PWM, let’s take a look at the applications of PWM first. PWM has been
successfully applied in motor speed regulation, steering angle control, light intensity control
and signal output. For example, when PWM is applied to a horn, it will make sounds. After we
know about its special functions, let’s find out what PWM really is.
Pulse Width Modulation commonly refers to PWM. Pulse Width Modulation (PWM) is a digital
coding method for analog signal levels. Since a computer cannot output an analog voltage
but digital voltage value 0V or 5V, we modulate the duty cycle of square waves to encode
a specific level of analog signal by using a high-resolution counter. PWM signals are
essentially digital signals, for the full amplitude DC power supply is either 5V (ON) or 0V (OFF)
SunFounder