This project demonstrates interfacing a 4x3 matrix keypad with a PIC16F877A microcontroller and displaying pressed keys on a 16x2 LCD.
- Keypad rows connected to RB4-RB7
- Keypad columns connected to RB0-RB2
- LCD data connected to PORTC
- LCD control pins connected to RD0-RD2
When a key is pressed, the corresponding character appears on the LCD.
- PIC16F877A Microcontroller
- 16x2 LCD Display
- 4x3 Matrix Keypad
- Resistors (for pull-up/pull-down if required)
- Breadboard / Proteus simulation board
- Connecting wires
- MPLAB X IDE
- XC8 Compiler
- Proteus 8 Professional (for simulation)
🧩 Proteus Circuit Setup
Controller: PIC16F877A
Oscillator: 20 MHz Crystal (pins 13 & 14)
LCD: Data → PORTC, RS→RD0, RW→RD1, EN→RD2
Keypad: Rows → RB4-RB7, Columns → RB0-RB2
Power: +5V to VDD, GND to VSS
Open Proteus_Design.pdsprj in Proteus 8.
Load the compiled .hex file from MPLAB X.
Run simulation — press keys on the keypad and see them displayed on the LCD.
📸 Output
LCD displays the corresponding pressed key:
KEYPAD: <pressed_key>
🧰 Future Expansion Ideas
Implement password entry or access control.
Combine with buzzer/relay for alarms.
Scroll multiple characters or messages on LCD.