Controlling a 7-Segment LED Display
In this project, you'll learn how to connect and control a 7-segment LED display to show the numbers from 0 to 9.
Parts needed:
| ||||||||||||||||||||||||||||||||||||||||||||||
A 7-segment LED display is a display with seven individual LEDs built inside one package.
The seven LEDs form a figure 8 and are given the alphabetical names from a to g. There is an eighth LED for the decimal point. With this configuration, decimal digits can be formed by turning on the individual LEDs.
| ||||||||||||||||||||||||||||||||||||||||||||||
Since each LED requires a positive and a negative connection, a total of 16 connections for the eight LEDs (seven forming the figure 8 plus the decimal point) would be required.
In order to reduce the number of connections needed, either the positive or the negative ends for all of the LEDs are connected in common. If all the negative ends are connected together, it is referred to as common cathode, and if all the positive ends are connected together, it is referred to as common anode. Using a common cathode or common anode, only 9 connections are needed instead of the original 16 to control the 7-segment display. |
Common Cathode Common Anode | |||||||||||||||||||||||||||||||||||||||||||||
1 | Making the connections
Different 7-segment displays have different pin connections. Choose the one that matches your 7-segment display. Common Cathode with pins on the sides Make the following 9 connections:
| |||||||||||||||||||||||||||||||||||||||||||||
2 | Create a new Bare Minimum program by selecting File from the menu
For a Common Cathode display, a HIGH signal turns on the LED, and a LOW signal turns off the LED. | |||||||||||||||||||||||||||||||||||||||||||||
3 | Upload and run the program. You should see the digit 1. | |||||||||||||||||||||||||||||||||||||||||||||