Hello everyone! I hope you all will be absolutely fine and having fun. Today, we are going to work on Arduino Keypad Interfacing. First of all, I would like to tell you a bit about the keypad. After getting the basic idea about the keypad, we will start our discussion about Arduino Keypad Interfacing.  You should also have a look at Interfacing of Keypad with PIC Microcontroller.

In this tutorial, I am going to use a 4×4 keypad. It has sixteen buttons having four alphabetic characters. Let's have a look at the Arduino Keypad Interfacing:

• The keypad consists of multiple buttons, arranged in the form of a matrix(rows & columns) and is used in embedded projects.
• They are cost-efficient and are easily available from online electronic stores.
• Keypads are normally available in a 3×3, 4×3 and 4×4 format.
• Keypad has several applications in real life based projects e.g. mobile phones, calculators, laptops, personal computers, television remote, toy remote, microwave oven, photocopy machine, bank’s ATM machine, tablets and a lot more.
• A simple 4x4 Keypad is shown in the figure given below:

• I am using a 4×4 keypad in this tutorial, it has total of eight (8) pins.
• All of these pins are provided in the table shown in the figure below:
• From the above table, we can see that keypad’s first four pins are associated with its four rows.
• The last four pins are assigned to the four columns of the keypad.
• 4×4 Keypad’s pins functions are listed in the table provided in the figure given below.

## Components Required for Arduino Keypad Interfacing

• Components required for this project are:
• Arduino UNO.
• Jumper Wires(Male to Female).

• The connections between the keypad and Arduino are provided in the figure given below:

### Circuit Diagram of Keypad Arduino Interfacing

• I have made a circuit diagram for keypad interfacing with Arduino.
• A complete labeled circuit diagram is given in the figure shown below:
• You can make a similar diagram and can easily test & verify your results on the serial monitor.

### Arduino Code

• You just need to copy this code into your Arduino software.
• After successfully uploading the code to your Arduino board you will be able to verify the results.
```#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[ROWS] = {9, 8, 7, 6}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {5, 4, 3, 2}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad

void setup(){
Serial.begin(9600);
}

void loop(){