AED 14.95
Description
The Keypad 4x4 Matrix 16 Button Keyboard Module is a compact and versatile input device that features a 4x4 matrix of buttons, providing 16 individual keys in total. The module comes with a standard 2.54mm pin header and an 8-pin connector, making it easy to connect to an Arduino or other microcontroller board.
Package Includes:
- 1 x Keypad 4x4 Matrix 16 Button Keyboard Module
Features:
- Matrix Keypad: The module has a universal 4x4 matrix keypad with 16 buttons.
- Easy to Use: The module features a header on the upper part of the board that allows you to quickly and easily hook up the Keypad to an Arduino Board or any other MCU.
- Pin Header Pitch: The module has a standard pin header pitch of 2.54mm.
- Connector: The module comes with an 8-pin connector for easy wiring.
- Insulation: The insulation resistance of the module is 100MΩ 100V.
- Maximum I/U: The module can handle a maximum current of 100mA and a maximum voltage of 35V.
- Contact Bouncing: The contact bouncing time of the module is 5ms.
- Durability: The module has long durability and can withstand up to 1 million presses.
- Compact Size: The module has a compact size of 43mm x 39mm, making it suitable for various applications.
Description:
The Keypad 4x4 Matrix 16 Button Keyboard Module is a simple and cost-effective input device that allows users to input data through a 4x4 matrix keypad. This module can be easily interfaced with an Arduino board or any other microcontroller unit through an 8-pin header, which is located on the upper part of the board. This module features 16 tactile push buttons arranged in a 4x4 matrix, allowing for a total of 16 different button combinations. The pin header pitch of the module is 2.54, which is a standard pitch used for prototyping and breadboard applications. The keypad module has a maximum insulation resistance of 100MΩ at 100V and a maximum I/U rating of 100mA and 35V. The contact bouncing time is around 5ms, which is a standard value for most tactile switches. The module is rated for the durability of up to 1 million presses, making it suitable for a wide range of applications. With its compact size of 43mm x 39mm, this module is easy to integrate into a wide range of projects, including security systems, access control, home automation, and industrial control systems. It is a popular input device due to its ease of use, low cost, and versatility.
Principle of Work:
- The 4x4 matrix keypad module works by using a set of 16 buttons arranged in a 4x4 grid. Each button has a unique connection between its row and column, and when pressed, a connection is made between the corresponding row and column pins. The module has 8 pins: four pins for the row connections and four pins for the column connections.
- To use the module with an Arduino, the row pins are connected to digital input pins on the Arduino, and the column pins are connected to digital output pins. The module's output pins are connected to the Arduino's digital input pins. The Arduino then scans each row, checking to see if any buttons in that row have been pressed. If a button is pressed, the Arduino reads the corresponding column pin to determine which button was pressed.
Pinout of the Module:
Applications:
- Security systems: The keypad can be used as a means of access control by requiring users to enter a code to gain entry.
- Industrial automation: The keypad can be used to enter data or control various industrial machines.
- Consumer electronics: The keypad can be used in remote controls, gaming devices, and other consumer electronics products.
- Educational projects: The keypad can be used in educational projects to teach programming, electronics, and interfacing with microcontrollers.
- Robotics: The keypad can be used to control robots and other automated systems.
Circuit:
- Keypad row 1 pin is connected to Arduino digital pin 10
- Keypad row 2 pin is connected to Arduino digital pin 11
- Keypad row 3 pin is connected to Arduino digital pin 12
- Keypad row 4 pin is connected to Arduino digital pin 13
- Keypad column 1 pin is connected to Arduino digital pin 6
- Keypad column 2 pin is connected to Arduino digital pin 7
- Keypad column 3 pin is connected to Arduino digital pin 8
- Keypad column 4 pin is connected to Arduino digital pin 9
Library:
To install the Keypad library for Arduino, follow these steps:
- Open the Arduino IDE software on your computer.
- Select "Sketch" from the menu, then "Include Library", and then "Manage Libraries...".
- In the Library Manager, search for "Keypad" and select the Keypad library from the search results.
- Click on the "Install" button to install the Keypad library.
- Wait for the installation process to complete.
- Once installed, you can include the Keypad library in your Arduino code by selecting "Sketch" from the menu, then "Include Library", and then selecting "Keypad" from the list of installed libraries.
Note: Make sure that you have an internet connection during the installation process. The installation process may take some time depending on the speed of your internet connection.
Code:
This example code initializes a 4x4 keypad with symbols on the buttons defined as '0' to '9' and 'A' to 'F'. The code then waits for a key press and when a key is pressed, it prints the corresponding value to the serial monitor at a baud rate of 9600.
#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] = { {'0','1','2','3'}, {'4','5','6','7'}, {'8','9','A','B'}, {'C','D','E','F'} }; 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 Keypad */ Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); void setup(){ Serial.begin(9600); } void loop(){ // check for key press char customKey = customKeypad.getKey(); // if a key is pressed, print the key value to the serial monitor if (customKey != NO_KEY){ Serial.println(customKey); } }
-
First, the Keypad library is included, and constants for the number of rows and columns on the keypad are defined. Then a 2D array of characters is defined, which represents the symbols on the buttons of the keypad.
-
Next, two arrays of bytes are defined to represent the row and column pins of the keypad, respectively. These arrays are used to initialize a Keypad object called
customKeypad
, which represents the physical keypad connected to the Arduino. -
In the
setup()
function, the code initializes serial communication with a baud rate of 9600, which allows us to print values to the serial monitor in the Arduino IDE. -
In the
loop()
function, the code checks if any key on the keypad has been pressed by calling thegetKey()
method of thecustomKeypad
object. If a key has been pressed, its value is stored in thecustomKey
variable. IfcustomKey
is not equal toNO_KEY
(a constant defined in the Keypad library to represent no key being pressed), the value ofcustomKey
is printed to the serial monitor using theprintln()
function.
Technical Details:
- pin header pitch: 2.54
- 8-pin connector
- Insulation 100MΩ 100V
- Maximum I, U 100mA, 35V
- Contact bouncing 5ms
- The durability: 1 million presses
- Dimensions 43mm x 39mm
Resources:
Comparisons:
-
Both membrane and PCB 4x4 keypad modules have their advantages and disadvantages.
-
Membrane 4x4 keypads are less expensive and lighter in weight compared to PCB 4x4 keypad modules. They are also easier to integrate into projects, as they usually have an adhesive backing that can be attached to a surface. However, they may be less durable over time and may wear out faster due to their membrane construction.
-
PCB 4x4 keypad modules are more robust and durable because of their solid construction. They may also offer more tactile feedback and a better typing experience compared to membrane keypads. However, they are more expensive and may require additional assembly and wiring to integrate into a project.
-
Ultimately, the choice between membrane and PCB 4x4 keypads will depend on the specific needs and requirements of your project. If cost and ease of integration are your primary concerns, a membrane keypad may be the better choice. If durability and a more tactile typing experience are important, a PCB keypad module may be the better option.