FIGURE 6. Unusual non-numeric shapes can be created by
activating selected segments of a seven-segment LED display.
Use this system to display numbers (of course) or codes.
reversing the voltage to the LED. You can also produce
a yellowish-orange by quickly alternating the voltage
• Tri-color LEDs are functionally identical to bi-color
LEDs, except that they have separate connections for
the red and green diode.
• Multi-color LEDs contain red, green, and blue
LED elements. You control which color to show by
individually applying current to separate terminals on
Figure 3 shows how to connect a bi-color LED to
two Arduino pins. To turn the LED off, put both pins
LOW. To turn on one color or the other, put one of the
pins HIGH. Refer to Table 2.
As an example, the following code for the Arduino
toggles between the two colors of a bi-color LED:
to green to orange. Refer to Table 3.
Finally, multi- or RGB-color LEDs have a red, green, and
blue diode. These three primary colors can be displayed
independently, or in different combinations to produce
many other colors. You use these the same as with a
tri-color LED, except that you need a third I/O pin to
control the additional color.
Figure 5 shows the connection scheme for a
multi-color LED, plus a testing rig so you can experiment
with how they work. Solder a current-limiting resistor
For the mixed color effect,
simply toggle between the two
colors more quickly. Try reducing
the delay from 1,000
milliseconds (one second) to
10 milliseconds (1/100th of a
SERVO 03.2013 39
FIGURE 7. Connection diagram for a CD4511 (binary coded decimal)
to seven-segment driver. Numbers appear in the display based
on the binary coded values on the A to D input pins.