Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Seven segment displays are important display units in Electronics and widely used to

display numbers from 0 to 9. It can also display some character alphabets like A, B, C, H, F,
E etc. It just consists of 8 LEDs, each LED used to illuminate one segment of unit and the
8thLED used to illuminate DOT in 7 segment display. We can refer each segment as a LINE,
as we can see there are 7 lines in the unit, which are used to display a number/character.
We can refer each line/segment "a,b,c,d,e,f,g" and for dot character we will use "h". There
are 10 pins, in which 8 pins are used to refer a,b,c,d,e,f,g and h/dp, the two middle pins are
common anode/cathode of all he LEDs. These common anode/cathode are internally
shorted so we need to connect only one COM pin.
There are two types of 7 segment displays: Common Anode and Common Cathode:
Common Anode: In this all the Negative terminals (cathode) of all the 8 LEDs are
connected together as shown in below figure, named as COM. And all the positive
terminals are left alone.
Common Cathode: In this all the positive terminals (Anodes) of all the 8 LEDs are
connected together, named as COM. And all the negative thermals are left alone.

Here, common cathode 7 segment is used to display the digits. In this circuit, pins a to
h of the 7 segment are connected to the PORT 2 of the microcontroller and com pin is
connected to the ground through the 330 ohm resistor. This resistor is used to drop the
voltage. Since we are using common cathode 7 segment we need to send LOGIC 1 to
the segments to glow. Here dot is used for indicating the decimal point. Here all the
cathodes of LEDs are connected to the Gnd pin. The operating voltage of this LEDs is
2 to 3V but from controller we will get 5V so to drop the remaining voltage we have to
connect a to g pins to the controller through the resistor.
Now suppose we want to display 0, then we need to glow all the LEDs except LED which
belongs to line g, so pins 2.0 to 2.6 should be at 1 and pin 2.7 and 2.8 should be at 0. So

the LEDs connected to pins 2.6 to 2.0 (f,e,d,c,b,a) will be ON and LEDs connected to 2.8
and 2.7 (h and g) will be OFF, that will create a 0 in 7 segment. So we need bit pattern
00111111, and the HEX code for binary 00111111 is 3f. Similarly we can calculate for all
the digits. Here we should note that we are keeping dot/h always OFF, so we need to give
LOGIC 0 to it every time. A table has been given below for all the numbers while using
Common Cathode 7 segment.

You might also like