These keypad it is the same like computer keyboard, but rather the pressure pads that have only outline symbol printed on a flat, flexible surface. These membrane keyboard, which work by electrical contact between the key surface under layer circuit when key areas are press. See below the diagram of the membrane keyboard.
Membrane Keypad Schematic
Membrane Matrix Keypad Key Arrangement
1 2 3 A
4 5 6 B
7 8 9 C
* 0 # D
This keypad has 8 wires running from the bottom of the keypad, the wires connect in sequence from left to right and hook up to Arduino digital pin 2-9. You can get the Library from Arduino IDE, The following code below will allow you to test the keypad as each key is pressed, the corresponding character should appear on a separate line in IDE serial console.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
/* 14Core.com | Keypad Membrane Testing with Arduino */ #include <Keypad.h> // You need to include this library from your IDE const byte ROWS = 4; const byte COLS = 4; char keys[ROWS][COLS] = { {'1','2','3','A'}, // Row 1 {'4','5','6','B'}, // Row 2 {'7','8','9','C'}, // Row 3 {'*','0','#','D'} // Row 4 }; byte rowPins[ROWS] = {2,3,4,5}; // Connect to Pin Row pinouts byte colPins[COLS] = {6,7,8,9}; //connect to Pin Column pinouts Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); void setup(){ Serial.begin(9600); // Serial Console } void loop(){ char key = keypad.getKey(); if (key != NO_KEY){ Serial.println(key); // Display to Serial Console } } |