In the fast-growing world of electronics and automation, interfacing Arduino with a 16×2 LCD and a 4×4 matrix keypad offers endless possibilities for student projects, engineering applications, and final year projects (FYPs). Whether you're a DIY enthusiast, a university student from anywhere in Pakistan, or an automation hobbyist, this hands-on guide is your complete roadmap to mastering these components.
We'll walk you through wiring, pinouts, code examples, setup tips, and even real-world project ideas. Plus, we'll highlight where to buy components at affordable prices — like Hall Road, Lahore and QKZee Technologies.
Arduino's flexibility and low cost make it the ideal platform for students and professionals alike. Combining it with a 16×2 LCD and a 4×4 matrix keypad creates the foundation for projects like:
These components are budget-friendly, widely available, and beginner-friendly, especially when sourced from Lahore's tech hub at Hall Road or stores like QKZee Technologies.

A 16×2 LCD displays 16 characters per line across 2 rows. It's ideal for:
You can get the regular model or an I2C version, which makes wiring significantly easier with only 4 connections. The I2C version has a small backpack board on the back of the LCD (built around a PCF8574 I/O expander chip) that converts the LCD's parallel interface to I2C — so instead of 6 data pins plus power, you need only VCC, GND, SDA and SCL.

This keypad has 16 push buttons (4 rows x 4 columns) and is widely used for:

Everything you need can be found at QKZee Technologies or Hall Road, Lahore. Here's your component checklist:
| Component | Purpose | Price / link |
|---|---|---|
| Arduino Uno/Nano | Main controller | Arduino UNO R3 DIP — Rs 1,200 |
| 16×2 LCD Display (with I2C) | Display output | Rs 660 |
| 4×4 Matrix Keypad | Input | Available on order — message us on WhatsApp |
| Jumper wires | Connections | Rs 180 |
| Breadboard | Prototyping | MB102 — Rs 250 |
| 9V battery or USB cable | Power (the UNO comes with a USB cable) | 9V battery with clip — Rs 120 |
| I2C module (standalone) | For a non-I2C LCD | Available on order — message us on WhatsApp |
Without I2C:
With I2C:
| LCD Pin | Arduino |
|---|---|
| VCC | 5V |
| GND | GND |
| SDA | A4 |
| SCL | A5 |
Connect keypad to digital pins 2–9 on Arduino. You can change this in code based on availability. In the code below, rows use pins 2, 3, 4, 5 and columns use pins 6, 7, 8, 9.

Install via Library Manager in Arduino IDE.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {2,3,4,5};
byte colPins[COLS] = {6,7,8,9};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup(){
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("Press a Key:");
}
void loop(){
char key = keypad.getKey();
if (key){
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Key Pressed:");
lcd.setCursor(0,1);
lcd.print(key);
}
}
For a complete temperature display project that uses this same LCD, see our LM35 temperature sensor guide — it shows the LCD displaying live temperature readings.
Pakistani universities emphasize hands-on work. A working keypad + LCD setup is a powerful asset for:
For more FYP ideas that use this setup, see our top 10 final year project ideas.
You don't have to go solo! Get components, mentorship, and even full project help from QKZee Technologies (also has a YouTube channel for science & automation project guides).
Mastering the integration of Arduino with a 16×2 LCD and a 4×4 Matrix Keypad is a game-changing skill for anyone interested in automation, electronics, or engineering projects. Whether you're working on a science fair demo or a university-level final year project, this setup provides a rock-solid foundation.
So get your tools, grab your components from Hall Road, Lahore, and start building with support from QKZee Technologies.
The Arduino UNO R3 DIP (Rs 1,200), 16×2 LCD with I2C (Rs 660), jumper wires (Rs 180), MB102 breadboard (Rs 250) and 9V battery with clip (Rs 120) are available at QKZEE Technologies, Shop 20, 1st Floor, Al-Khalil Center, Hall Road, Lahore, and online at qkzeetech.com with delivery all over Pakistan — see the links above. The 4×4 matrix keypad and a standalone I2C module are available on order — message us on WhatsApp and we will arrange them for you.
If the LCD shows nothing, or the keypad does not respond, message us — tell us whether the LCD backlight is on, what I2C address you are using (0x27 or 0x3F), and which pins the keypad rows and columns are on, and we will help you find the fault.
Chat on WhatsApp Watch on YouTube
Why does the LCD show nothing at all?
Check the contrast potentiometer on the I2C backpack first — a blank LCD is usually a contrast problem, not a wiring problem. Then check the I2C address: it is 0x27 on most modules but 0x3F on some. Run an I2C scanner sketch to find yours.
Why does the LCD show black boxes on the first row?
That means the LCD is powered but not initialized — check the SDA/SCL wiring (SDA to A4, SCL to A5 on the UNO) and that the LiquidCrystal_I2C library is installed.
Why does the keypad not respond?
Double-check the pin assignments: rows on pins 2, 3, 4, 5 and columns on pins 6, 7, 8, 9 in the code must match the actual wiring. Also check the keypad connector is firmly seated — a loose ribbon cable is the most common cause.
Why does the LCD show the wrong key?
The keymap in the code must match your keypad's layout. If pressing "1" shows "4", your row and column pins are swapped — swap the rowPins and colPins arrays in the code.
Can I use the LCD without the I2C module?
Yes — wire RS, E, D4–D7 to digital pins and use the LiquidCrystal library instead of LiquidCrystal_I2C. But the I2C version is much easier (4 wires instead of 12) and leaves more pins free for the keypad.
Can I build a password lock with this setup?
Yes — that is the most popular FYP using these two components. Store the correct PIN in the code, compare each keypress against it, and drive a relay or a servo when the PIN matches. Our relay module guide shows the output side.
An Arduino, a 16×2 LCD and a 4×4 keypad are the input and output of almost every student project: the keypad takes the user's input, the LCD shows the result. Remember the three things that trip everyone up — the LCD contrast potentiometer, the I2C address (0x27 or 0x3F), and the keypad row/column pin order. That is the whole project, and it works.