Min menu

Pages

project 25 : 7 Segment Display Interface

 

Arduino 7 Segment Display Interface

In this project, we will learn about 7 Segment Displays and see how the Arduino 7 Segment Display Interface works. 7 Segment Display or Seven Segment Display is one of the simplest display devices that can be connected to Arduino or any microcontroller.
There are several display devices like alphanumeric LCD, graphical LCD, touchscreen etc. a simple 7 segment display is sufficient for many applications.
Devices like washing machines, microwave ovens, etc. still use 7 segment displays for displaying information like quantity and time. The main reason for this is their simple interface and low cost.
If your project involves displaying just numbers, then a 7 Segment Display is your safe bet instead of the expensive 16×2 LCD DisplaY

Components Required
  • Arduino UNO
  • 7 Segment Display
  • 7 x 220Ω Resistors (1/4 Watt)
  • Breadboard
  • Power Supply
  • Connecting Wires
Code
//e = 2;
//d = 3;
//c = 4;
//g = 5;
//f = 6;
//a = 7;
//b = 8;
int num[10][7]={ {0,0,0,1,0,0,0},
{1,1,0,1,1,1,0},
{0,0,1,0,1,0,0},
{1,0,0,0,1,0,0},
{1,1,0,0,0,1,0},
{1,0,0,0,0,0,1},
{0,0,0,0,0,1,1},
{1,1,0,1,1,0,0},
{0,0,0,0,0,0,0},
{1,0,0,0,0,0,0}
};
void setup()
{
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
digitalWrite(9,HIGH);
}
void loop()
{
for(int i=0;i<10;i++)
{
for(int j=0;j<7;j++)
{
digitalWrite(j+2,num[i][j]);
}
delay(1000);
}
}
reaction: