This part has a page of its own, with a note on using it and a circuit to try: the part page.
4x4 membrane keypad
The 4x4 membrane keypad, the sticky-backed one on a ribbon: sixteen keys, eight pins, and no chip at all.
Peel off the backing and inside are four printed rows and four printed columns; under each key a carbon pad shorts the row it is on to the column it is in. That is the whole part, and it is the reason a sketch has to scan it.
C1 C2 C3 C4
R1 1 2 3 A
R2 4 5 6 B
R3 7 8 9 C
R4 * 0 # D
Pins
| Pin | What it does |
|---|---|
R1–R4 |
Rows. |
C1–C4 |
Columns. |
Properties
None.
While it runs
Click a key to hold it down.
What the model gets right
A closed key is a real low-resistance contact passing whatever is on either side in either direction. The model does nothing to stop a row driven high while another key shorts it to a driven low, because a real keypad does nothing to stop that either. Ghosting is modeled too: three keys held in a rectangle make the fourth corner read as pressed, because current has a way around through the three that are closed, exactly what a real matrix keypad with no diodes does, and the reason a keypad sketch normally reads one key at a time.
What it does not model
No diodes on the keys. Some keypads add one per key to prevent ghosting, but the cheap membrane kind does not, and neither does this part.
No contact bounce. A real membrane key's carbon pad chatters for a millisecond or two and a scanning sketch has to settle for it; here a key closes exactly once. That is a deliberate omission, not an oversight (the bounce lesson belongs to the pushbutton), but it means a keypad sketch that would need debouncing on the bench runs clean here. There is no contact resistance drift, no row or column capacitance and no settle time after a row is driven, so a scan can be as fast as the firmware likes.
Common mistakes
Driving a row high instead of low while scanning. With two keys held in the same column, that puts a driven high and a driven low directly across one another, which is the classic way to let the smoke out of a real board, and the model does nothing to protect against it here either.
See it in action
Keypad lock scans this part row by row to check a code. Open it at /templates.