Arduino

Types of Arduino keypads

Keypads are composed of buttons just like the buttons which are present on mobile phones and calculators. These keypads can be interfaced with any board of Arduino to get the input. There are different types of keypads whose working principle is the same but the dimensions are different.

In this write-up, different types of keypads and also the working of keypads are being explained.

What is a keypad

The keypad is an input device that is a combination of different buttons on a circuit membrane and these sets of buttons are in the shape of a matrix. This matrix is composed of rows and columns used to take input from the users for different purposes like to take passwords for the security applications.

This matrix-based keypad replaces the usage of buttons which reduces the number of connections. For example, you need to connect 9 buttons to take the inputs, you are supposed to provide ground and power connections to each button. These buttons will need a minimum of 16 connections which can be reduced to eight connections by using a 3×3 keypad.

These keypads can be interfaced with Arduino to get inputs from the users for projects like calculator, security identification, and displaying some text on the LCD.

What are the types of keypad

The keypads are of various types which differentiates in the number of rows and columns, remaining the working and construction of all the keypads are the same. Some of them are:

  • 3×4 keypad
  • 4×4 keypad
  • 4×5 keypad
  • 1×4 keypad

3×4 Keypad

In this keypad, there are four rows and three columns which implies it has a total of seven output pins. It can be used on security lockers where only a numeric keypad is needed.

4×4 Keypad

In this keypad, there are four rows and four columns which implies it has a total of eight output pins. It can be used on telephone dialers.

4×5 Keypad

In this keypad, there are five rows and four columns which implies it has a total of nine output pins. It can be used on telephone dialers or for security applications.

1×4 Keypad

In this keypad, there are four rows and one column which implies it has a total of five output pins. These types of keypads can be used where fewer keys are required.

The most used keypads are 3×4 and 4×4, moreover, the working principle of all the types of keypads is the same.

What is the working of a keypad

These keypads contain a different number of rows and columns, let us consider the 4×4 keypad. This keypad has four columns as well as four rows. The keypad looks like this:

These sixteen buttons are attached to this thin membrane of some material. All these buttons are connected with each other and they can be visualized from its back by removing the sheet. In the above figure, we can see that all the buttons are connected with each other in a specific pattern.

In the above figure of the 4×4 keypad, we can see that it has a total of 8 pins, 4 pins are for four rows, and the remaining 4 pins are for the 4 columns. One terminal of each button is short with each other and is connected to one output pin of the keypad. Similarly, the other terminal of each button is connected to the next button of its column and is connected to the output pin of the keypad column.

This circuit is demonstrated in the figure below:

In the sketch of coding, all the rows of the 4×4 keypad matrix are set LOW and all the buttons are set HIGH. When the button is pressed, the row remains its state whereas the column changes its state from HIGH to LOW. The keypad scans every button and when it reads the LOW states of both column and row of any button, it reads the input from that button as the button is pressed.

For example, in the above figure, button five is pressed, its column and row both have LOW values, so the keypad will understand it in the pressed position.

This will be understand more clearly from the animation shown below:

Conclusion

The keypad is one of the input devices which contains a set of buttons to take different inputs from the users. The keypads are commonly used in the calculators, mobiles, and many other electronic devices to take the inputs. In this write-up, different types of keypad are discussed with the working of the 4×4 keypad.

About the author

Hammad Zahid

I'm an Engineering graduate and my passion for IT has brought me to Linux. Now here I'm learning and sharing my knowledge with the world.