3×4 Membrane Matrix Keypad User’s guide
1. Overview
The 3×4 Matrix Keypad is a lightweight, flexible input device with 12 keys arranged in 3 columns and 4 rows. It’s widely used for numeric entry, password systems, and menu navigation.
- Keys:
0–9,*,# - Interface: 7-pin ribbon connector (4 rows + 3 columns)
- Typical use cases: Security panels, calculators, menu-driven projects, DIY controllers.
2. Pinout
The keypad has 7 pins that correspond to the rows and columns:
| Pin | Function | Notes |
|---|---|---|
| 1–4 | Row lines (R1–R4) | Activated when a button in that row is pressed |
| 5–7 | Column lines (C1–C3) | Used to detect which column the pressed button belongs to |
Pin order may vary by manufacturer. Use a multimeter to confirm continuity if needed.
3. How It Works
- Each key connects a row line to a column line when pressed.
- The microcontroller scans rows and columns to detect which key is pressed.
- Example: Pressing
5connects Row 2 to Column 2.
4. Wiring to Arduino UNO (Example)
Keypad Pin → Arduino Pin
R1 → D2
R2 → D3
R3 → D4
R4 → D5
C1 → D6
C2 → D7
C3 → D8
5. Arduino Code Example
#include <Keypad.h>
const byte ROWS = 4; // four rows
const byte COLS = 3; // three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {2, 3, 4, 5}; // connect to R1–R4
byte colPins[COLS] = {6, 7, 8}; // connect to C1–C3
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup() {
Serial.begin(9600);
}
void loop() {
char key = keypad.getKey();
if (key) {
Serial.println(key);
}
}
6. Applications
- Security systems: PIN entry for locks or alarms
- Menu navigation: Selecting options on LCD displays
- Calculators: Numeric input for math operations
- DIY controllers: Custom input devices for projects
7. Tips & Best Practices
- Use the Keypad library for easy scanning and debouncing.
- Keep ribbon cable connections secure to avoid false inputs.
- If using with ESP32/ESP8266, adjust pin assignments carefully (some pins are reserved).
- Mount the keypad on a panel or enclosure for durability.