Keypad

In this project, you'll learn how to connect and use a 4x3 keypad.

Parts needed: Arduino      4x3 keypad      Breadboard     
The 4x3 keypad is simply a group of 12 switches configured as 4 rows and 3 columns. The internal connections of these 12 switches is shown on the right.

There are seven (7) connections, starting with pin 1 on the left side.
keypad internal connections
1 Making the connections

The 4x3 keypad requires seven (7) connections. Make the following 7 connections.

Arduino pins Keypad pins Description
8 1 Row 1
7 2 Row 2
6 3 Row 3
5 4 Row 4
4 5 Column 1
3 6 Column 2
2 7 Column 3





keypad connections
2 Download the Keypad library.
3 Install the Keypad library by selecting Sketch from the Arduino IDE menu
  • then select Import Library or Include Library
  • then select Add Library or Add .ZIP Library
Locate and select the Keypad.zip file that you just downloaded in step 2. It should be in the Download folder.

Click the Open button.

(Refer to this document for more information on how to install a library if you run into problems.)
4 Create a new program by selecting File from the menu
  • then select Examples
  • then select Keypad
  • then select KeypadExample
5 Upload and run the program.
6 Open up the Serial Monitor.
7 Press any key on the keypad and you should see the key that you pressed printed on the monitor.