- 7 Segment display
The 7-segment display is one of the most common and effective types of display in embedded systems. Only 8 LEDs are contained within this display. As indicated in the diagram above, these 8 LEDs are divided into segments that are labeled a,b,c,d,e,f,g, DP. One end of each of these 8 segment LEDs' pins has been pulled out of the module, as seen above, and the other ends have been joined and pulled out as the Common pin. So, to make an LED in a specific segment glow, we just need to power the common pin as well as the segment pin.
Choosing a 7-Segment Display
There are numerous alternatives for a 7-segment display, as detailed in the Features section. There are many different sizes and colors to choose from. The 14.20mm with red color display is the default and most usually used / available one, as shown in the video above. Other color displays might be used if you want to make your project stand out. Also, keep in mind that the quantity of current required by the display will vary depending on its size and color. Because it consumes less current than other colors, the red one is generally used.
7 Segment Display Pin Configuration
|Pin Number||Pin Name||Description|
|1||e||Controls the left bottom LED of the 7-segment display|
|2||d||Controls the bottom-most LED of the 7-segment display|
|3||Com||Connected to Ground/Vcc based on the type of display|
|4||c||Controls the right bottom LED of the 7-segment display|
|5||DP||Controls the decimal point LED of the 7-segment display|
|6||b||Controls the top right LED of the 7-segment display|
|7||a||Controls the topmost LED of the 7-segment display|
|8||Com||Connected to Ground/Vcc based on the type of display|
|9||f||Controls the top left LED of the 7-segment display|
|10||g||Controls the middle LED of the 7-segment display|
Common Cathode (CC) 7 Segment Display
The common cathode display is commonly called CC display. In this type, the common pin on the 7-segment display is connected to all the eight Cathode pins of the LEDs. So, in order to make this type of seven-segment display work, we should connect the Com pin to the Ground pin and power the other pins with Vcc (+5V typically).
Common Anode (CA) 7 Segment Display
The common anode display is commonly called CA display. In this type, the common pin on the 7-segment display is connected to all the eight Anode pins of the LEDs. So, In order to make this type of seven-segment display work, we should connect the Com pin to the Vcc (+5V typically) and ground the required segment pin to turn it on.
How to use a 7-Segment display
One important advantage of a 7-segment display is that it is very easy to use. Unlike other display modules, a 7-segment display can be made to work even without a Microcontroller or a Microprocessor.
This is possible because of the readily available 7-segment counter ICs like IC CD4026. This IC can be used in combination with the display for projects which have very simple circuits. The IC can drive one 7-segment display module and the number that is being displayed can also be incremented or decremented.
But, most commonly a seven-segment display is used along with an MCU/MPU in that case, the eight segment pins will be connected to the I/O pins of the Microcontroller and the com pin will be connected to the ground of Vcc depending upon its type (CC/CA). Then these IO pins can be toggled in a particular sequence to display the desired numbers. This particular sequence is explained in the table below. For displaying each number in the seven-segment display its respective sequence is given in the table. If we want to display the number “0”, then we need to glow all the LEDs except LED which belongs to line “g” (see 7 segment pin diagrams above, so we need a bit pattern 11000000. Similarly, to display “1” we need to glow LEDs associated with b and c, so the bit pattern for this would be 11111001.
|Digit to Display||h g f e d c b a||Hex code|
|0||1 1 0 0 0 0 0 0||C0|
|1||1 1 1 1 1 0 0 1||F9|
|2||1 0 1 0 0 1 0 0||A4|
|3||1 0 1 1 0 0 0 0||B0|
|4||1 0 0 1 1 0 0 1||99|
|5||1 0 0 1 0 0 1 0||92|
|6||1 0 0 0 0 0 1 0||82|
|7||1 1 1 1 1 0 0 0||F8|
|8||1 0 0 0 0 0 0 0||80|
|9||1 0 0 1 0 0 0 0||90|
- Used in applications where font size is required to be bigger