Keypad Interfacing with seven segment display through 8051 microcontroller
- This project corporates the simple interfacing between the popular 4 x 4 keypad matrix with a single seven segment display in order to manually input numbers or ASCII characters on the seven segment display.
- Here the idea is to display any letter on the 7 segment display according to the keypad pressed.
- In this way we can manually display string of characters or numbers.
Which is the idea after all.
- The keypad matrix is used for interfacing with the seven segment .
- It is 3 x 3 matrix keypad with each key having a specific value as designed by the programmer.
- Alternatively a keypad predefined with symbols can also be interfaced with the seven segment display through 8051 microcontroller board.
sbit R0= P1^0;
sbit R1= P1^1;
sbit R2= P1^2;
sbit R3= P1^3;
sbit C0= P1^4;
sbit C1= P1^5;
sbit C2= P1^6;
void seg(unsigned int);
if (C1 ==0)
if(C2 == 0)
if(C0== 0 )
R1 = 0;
R1 = 0;
R2 = 0;
R2 = 0;
R2 = 0;
R3 = 0;
void seg (unsigned int ch)
P2 = ch;
Proteus simulation program:
- Here there are three seven segment displays interfaced with the hex keypad through 8051.
- By using proteus simulation diagram we can pre predict whether the circuit is working or not.
- When different keypads are switched the corresponding number is displayed(0- 9 range).
- Initially the microchip is placed onto the ACP slot after dumping the code in it.
- A 9V power supply is used to power up the circuit on desire.
- Then the 9th pin of the microcontroller is connected to the 5V supply before powerup of the circuit.
- After powering on the circuit the reset pin is connected to ground.
- Whereas the four rows (R0 – R3) are connected to corresponding pins of Port 1 of ATS9852 microcontroller chip as well as the three columns (C0 – C2).
- Secondly the channel port, in this case is the Port 2 of the microcontroller.
- The port 2 is interfaced with the 8 segments(a-g and h for decimal) of single seven segment display component.
- Finally the common pins of the seven segment can be either shorted and given a separate 5v connection or just one common pin can be connected to ground if reset pin is given to 5V pin on the board.
Click here to see the video.