KEYPAD 4x4

 KEYPAD 4x4 

                  Keypad is used as an input device to read the key pressed by the user and to process it.The 4x4 keypad consists of 4 rows and 4 columns. Switches are placed between the rows and columns.A key press establishes a connection between the corresponding row and column, between which the switch is placed.
We can interface the keypad with arduino and can get the output of the key we pressed through serial monitor.


Application:

  • It is used in communication devices.
  • It is used in security devices for entering the PIN.
  • It also used in vending machines, sale payment devices, time clocks, calculators etc,.

Sample Project Using Arduino:

                                In this going to get the output of the keys pressed in the keypad through the serial monitor in arduino.

 Materials required:

  • Keypad 4x4
  • Arduino UNO
  • Jumper wires

Circuit:

Code:

#include <Keypad.h>

const byte ROWS = 4; /* four rows */

const byte COLS = 4; /* four columns */

/* define the symbols on the buttons of the keypads */

char hexaKeys[ROWS][COLS] = {

  {'1','2','3','A'},

  {'4','5','6','B'},

  {'7','8','9','C'},

  {'*','0','#','D'}

};

byte rowPins[ROWS] = {10, 11, 12, 13}; /* connect to the row pinouts of the keypad */

byte colPins[COLS] = {6, 7, 8, 9}; /* connect to the column pinouts of the keypad */

 

/* initialize an instance of class NewKeypad */

Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

 

void setup(){

Serial.begin(9600);

}

 

void loop(){

  char customKey = customKeypad.getKey();

 

  if (customKey){

Serial.println(customKey);

  }

}


Comments

Popular posts from this blog

Voice Record & Playback Module

GSM Sim800L

GPS