4x4 Matrix Keypad
16-Button Membrane Keypad with Row/Column Scanning
Wiring 16 individual buttons to a microcontroller the naive way would need 16 separate input pins plus pull-down resistors for each - a matrix keypad avoids that entirely by arranging its 16 buttons in a 4x4 grid where each button sits at the intersection of one row wire and one column wire, needing only 8 total pins (4 rows plus 4 columns) no matter how many buttons are in the grid. Your microcontroller scans the keypad by driving one row LOW at a time while reading all four column pins - when a button is pressed, it briefly connects its row to its column, so if a specific column reads LOW while a specific row is being driven LOW, your code knows exactly which of the 16 buttons was pressed from that unique row/column combination. This scanning happens fast enough, many times per second, that key presses feel instantaneous even though the microcontroller is really checking one row at a time in rapid succession rather than reading all 16 buttons simultaneously.
Key features
Efficient Pin Usage
Reads 16 buttons using only 8 microcontroller pins.
Row/Column Scanning
A well-understood, widely-documented matrix scanning technique.
Membrane Construction
Thin, flexible, and low-cost compared to individual mechanical buttons.
Standard 0-9/A-D/*/# Layout
Familiar telephone/calculator-style button arrangement.
No External Components Needed
Works directly with a microcontroller's internal pull-ups.
Compact, Flat Form Factor
Easy to mount on an enclosure face or panel.


