PinLab › Components › Membrane keypad 4×4
123A456B789C*0#D R1–R4C1–C4

Membrane keypad 4×4

16 keys, 8 wires

A thin keypad with digits and letters. Used for codes (electronic lock), entering numbers and menus.

Open the course →

How it works

16 keys would need 16 pins, but the keypad is a matrix: 4 rows and 4 columns. The program puts one row LOW, reads the 4 columns (with pull-ups), and if one is LOW it knows which key is pressed. Then the same for the next row, very fast. That way 8 pins read 16 keys. The Keypad library does the scanning.

Pins and wiring

PinWhat it isWhere it connects / why
R1 – R4Rows (pins 1–4)→ 4 GPIO (outputs).
C1 – C4Columns (pins 5–8)→ 4 GPIO with pull-up (inputs).

Specifications

Keys16 (0–9, A–D, *, #)
Wires8
Voltageup to 24 V, usually 3.3 V logic
Lifetime~1 million presses

Tips and typical mistakes