Professional Documents
Culture Documents
AIM:
To display the characters and numbers in the seven segment display using Arduino UNO controller.
Software required:
Arduino IDE
Proteous
PROCEDURE:
Arduino IDE
Step1:Open the Arduino IDE
Step2: Go to file and select new file option
Step3:Type the program
Step4:Go to file and select save option to save the program
Step5:Go to sketch and select verify or compile options
Step6:If no error Hex file will be generated in the temporary folder
Proteus
Step7:Open the Proteus software
Step8:Go to file select new design and click ok button
Step9:Select component mode and click pick devices from the library
Step10:Type the component name in the keyword to select the components and click ok button
Step11:Design the circuit as per the diagram
Step12:Double click the Arduino controller and upload the hex file generated by Arduino IDE
Step13:Click start button and check the output
THEORY:
https://github.com/Jeganvjk/Interfacing-Seven-Segment-Display 1/7
6/12/23, 12:40 AM Jeganvjk/Interfacing-Seven-Segment-Display
Study the internal circuitry of a seven-segment display, as shown in the picture above carefully.
You’ll notice the carefully laid out LEDs. Notice how in both the configurations, one off the two
ends of the LEDs is connected to a common line. This common line is either GND (left) or VCC
(right). Let’s talk about that a bit. Your 7-segment display is possibly one of two types: Common
cathode,Common anode
https://github.com/Jeganvjk/Interfacing-Seven-Segment-Display 2/7
6/12/23, 12:40 AM Jeganvjk/Interfacing-Seven-Segment-Display
https://github.com/Jeganvjk/Interfacing-Seven-Segment-Display 3/7
6/12/23, 12:40 AM Jeganvjk/Interfacing-Seven-Segment-Display
https://github.com/Jeganvjk/Interfacing-Seven-Segment-Display 4/7
6/12/23, 12:40 AM Jeganvjk/Interfacing-Seven-Segment-Display
PROGRAM:
int cnt=0;
int incPrev, decPrev;
void setup()
{
pinMode(0, INPUT);
pinMode(3, INPUT);
pinMode(5, INPUT);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
}
void loop()
{
int inc = digitalRead(3);
int dec = digitalRead(5);
int res = digitalRead(0);
{
switch (cnt)
{
case 0://when count value is zero show”0” on disp
digitalWrite(13, HIGH);
digitalWrite(12, HIGH);
digitalWrite(11, HIGH);
digitalWrite(10, HIGH);
digitalWrite(9, HIGH);
digitalWrite(8, HIGH);
digitalWrite(7, LOW);
digitalWrite(6, LOW);
break;
case 1:// when count value is 1 show”1” on disp
digitalWrite(13, LOW);
digitalWrite(12, HIGH);
digitalWrite(11, HIGH);
digitalWrite(10, LOW);
digitalWrite(9, LOW);
digitalWrite(8, LOW);
digitalWrite(7, LOW);
digitalWrite(6, LOW);
break;
case 2:// when count value is 2 show”2” on disp
digitalWrite(13, HIGH);
digitalWrite(12, HIGH);
https://github.com/Jeganvjk/Interfacing-Seven-Segment-Display 5/7
6/12/23, 12:40 AM Jeganvjk/Interfacing-Seven-Segment-Display
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
digitalWrite(9, HIGH);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
digitalWrite(6, LOW);
break;
case 3:// when count value is 3 show”3” on disp
digitalWrite(13, HIGH);
digitalWrite(12, HIGH);
digitalWrite(11, HIGH);
digitalWrite(10, HIGH);
digitalWrite(9, LOW);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
digitalWrite(6, LOW);
break;
case 4:// when count value is 4 show”4” on disp
digitalWrite(13, LOW);
digitalWrite(12, HIGH);
digitalWrite(11, HIGH);
digitalWrite(10, LOW);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
digitalWrite(7, HIGH);
digitalWrite(6, LOW);
break;
}
}
if((inc == HIGH)&& (cnt < 3))
{
delay(1000);
cnt++;
switch (cnt);
}
if((dec == HIGH) && (cnt > 0))
{
delay(1000);
cnt--;
switch (cnt);
}
if ((res == HIGH)&& (cnt > 0))
{
delay(1000);
cnt=0;
switch (cnt);
}
}
https://github.com/Jeganvjk/Interfacing-Seven-Segment-Display 6/7
6/12/23, 12:40 AM Jeganvjk/Interfacing-Seven-Segment-Display
CIRCUIT DIAGRAM:
OUTPUT:
RESULT:
Thus the characters and numbers are displayed in the seven segment display using Arduino UNO
controller
https://github.com/Jeganvjk/Interfacing-Seven-Segment-Display 7/7