7 Segment
7 Segment
Display
Here is where your presentation begins
CONTENTS
2
INTRODUCTION
3
HOW ITS WORK ?
5
● Each of the seven LEDs in the display is given a positional segment,
with one of its connection pins being brought straight out of the
rectangular plastic package.
● These individual LED pins are labelled from a through to g representing each
LED. The other LED pins are connected and wired to form a common pin.
● To turn a particular display part on and off, you set the appropriate pin
HIGH or LOW, just like a regular LED.
So that some segments will be light and others will be dark, allowing
the desired character pattern of the number to be generated on
display.
● This allows us to display each of the ten decimal digits 0
through to 9 on the same 7-segment display.
6
TYPES OF
7SEGMENT
Seven Segment displays are Common Cathode
(CC) and Common Anode (CA).
Comman Cathode
The Internal structure of both types is nearly the
same. The difference is the polarity of the LEDs
and the common terminal. As their name
suggests, the common cathode has all the
cathodes of the LEDs in a 7-segment connected,
and the common anode has all the anodes of the
LEDs in a 7-segment connected.In the common
cathode display, all the cathode connections of
the LED segments are connected to ‘logic 0' /
GND. The individual segments are then
illuminated by applying a HIGH /' logic 1' signal to
the individual Anode terminals (a-g).
Comman Anode
To Display Numbers
between 0 to 9.
Component Required
Resistor 330
Ohm-8 Nos*
1 2 3 4
*It can also be done with one single 1k OHM resistance at a common pin
attached to the ground rather than using eight separate resistances.
7 SEGMENT PIN
CODING
14
// DECLARING THE OUTPUT PINS
void setup()
{
pinMode(a,OUTPUT);
pinMode(b,OUTPUT);
pinMode(c,OUTPUT);
pinMode(d,OUTPUT);
pinMode(e,OUTPUT);
pinMode(f,OUTPUT);
pinMode(g,OUTPUT);
}
15
// TO DISPLAY NUMBER 9
void loop()
{
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
digitalWrite(e,LOW);
digitalWrite(f,HIGH);
digitalWrite(g,HIGH);
16
// TO DISPLAY NUMBER 8
digitalWrite (a,HIGH);
digitalWrite (b,HIGH);
digitalWrite (c,HIGH);
digitalWrite (d,HIGH);
digitalWrite (e,HIGH);
digitalWrite (f,HIGH);
digitalWrite (g,HIGH);
17