3X4 and 4X4 Keyboard Pinout Diagram, Interfacing with Arduino
When we are going to build our electronic projects with an Arduino, sometimes we need keypads to operate the system. These small devices are used to input numbers or commands and they come in various sizes like 3x4 and 4x4 matrices. So, in this article, first, we will see see the pinout diagrams of both of these 3x4 and 4x4 keypads and then will see the connection diagram for interfacing with Arduino.
A matrix keyboard works by arranging keys in a grid of rows and columns. The keypads in these keyboards are arranged in a matrix form which means the keys are organized in rows and columns. When we press a key, it connects a specific row and column which creates a circuit that the microcontroller (like an Arduino) can detect. Instead of having a separate wire for each key, the matrix setup allows us to use fewer wires for the keyboard interfacing. The microcontroller scans the rows and columns one by one to check which key is pressed by looking for changes in the connections.
Pinout Diagram
Here, you can see the pinout diagram of both 3X4 and 4X4 Keyboards.
3x4 Keypad
A 3x4 keypad has 3 rows and 4 columns, so it has a total of 12 keys. The keypad has 7 pins for interfacing with external devices. First, 4 pins are for the rows(Row 1, Row 2, Row 3, Row 4) and next 3 pins are for the columns(Column 1, Column 2, Column 3).
4x4 Keypad
A 4x4 keypad has 4 rows and 4 columns, so it has a total of 16 keys. The keypad has 8 pinsfor interfacing with external devices. First, 4 pins are for the rows(Row 1, Row 2, Row 3, Row 4) and next 4 pins are for the columns(Column 1, Column 2, Column 3, Column 4).
When a key in the keyboard is pressed, it make connection between a specific row and column which creates a path for the current. The microcontroller (e.g., Arduino) scans the keypad by setting each row to a HIGH state and check the columns for any LOW state. If a key is pressed the corresponding row and column are connected so the microcontroller can detect which key was pressed. The microcontroller reads the rows and columns in a sequence which helps it to identify the exact key by knowing which row and column are connected.
3X4 Keyboard Interfacing with Arduino
Here, you can see the connection diagram for 3X4 Keyboard Interfacing with Arduino.
Connection Procedure
Connect 4 Row Pins of the keyboard to any 4 digital pins on the Arduino (e.g., pins 6, 7, 8, 9).
Connect 3 Column Pins of the keyboard to any 3 digital pins on the Arduino (e.g., pins 3, 4, 5).
4X4 Keyboard Interfacing with Arduino
Here, you can see the connection diagram for 4X4 Keyboard Interfacing with Arduino.
Connection Procedure
Connect 4 Row Pins of the keyboard to any 4 digital pins on the Arduino (e.g., pins 6, 7, 8, 9).
Connect 4 Column Pins of the keyboard to any 4 digital pins on the Arduino (e.g., pins 2, 3, 4, 5).
Read Also:
- Current Sensor INA219 Pinout Diagram and Connection with Arduino
- Motor Driver L293D and L298N Connection with Arduino and Motors
- NEO-6M GPS with Arduino, ESP32, Raspberry Pi – Pinout Diagram and Wiring Guide
- Bluetooth Module HC05 and HM10 Pinout, Wiring Diagram with Arduino
- 16×2 LCD Display 1602 Pinout Diagram and Connection


