Help needed with interfacing a keypad

I want to make a device with the UNO which can take in values input from a number pad and start a timer based on the input value. I want this device to be able to work independently from the computer, which means I can’t use the serial monitor to input the values. I’m thinking buying an individual keypad and then connect it the board physically and then do some programming so that the board can understand what has been input from the number pad. I don’t know if this is feasible for UNO and if it is feasible, how exactly do I go about doing it? Thanks!

How to go about depends entirely on what type of keypad you get. Usually this shouldn't pose much problems, except for the case where you get and USB-keypad. Many tutorials about how to interface keypads exists, you just need to find one matching your keypad and your requirements of free ports on the Arduino.


Most EE students will have an encounter with this keypad or something similar. There's code on the sparkfun site too. Plenty of tutorials are available.

The keypad from sparkfun looks good. In case you want to develop your own keypad, you can use the 9 buttons(build them using silicon diodes) with a multiplexer, give the output to the microprocessor and then let the code take control.

If you weren’t planning to buy a board, I think considering this option would be a good learning experience and a cheap option as well.

Thanks for the great inputs everyone!

The instructions on SparkFun looks pretty good and I will look deeper into that. Korman: What kind of keypad would you recommend since you said the USB-keypad is not very good for the project?

How about the Sparkfun keypad?


well, it only has 12 buttons. I need at least 10 digit buttons from 0 to 9, an "enter" button, a "clear" button and a "." button. The user should be able to input multiple digits and decimal numbers. I can find a lot of these kind of keypad on amazon but most of them use USB ports. That's why I'm confused...

You can find 4 x 4 keypads quite readily. Looks like the 4 x 3 that sparkun carries. I got one locally in Boston area for ~$6. Or you get a 20 button keypad for $1 from Last I recall, if you search for switches and scroll halfway down the page you will come across them. I bought 6, planning to upgrade my 16 button remote control keypad to 20 at some point. Sizewise it should mount nicely on top of one of the Really Useful Boxes that Staples, OfficeMax carry. Yeah, still works:

Lingalin, update your profile with geographic area for better source suggestions.

I wrote a tutorial on interfacing with keypads using an Arduino:

Maybe that will help…

The keypad.h library also works well, can be expanded to use as many pins as you have free. I used it for a 4x4 keypad. Added diodes to allow the an interrupt to be created to wake from power down sleep mode as well for a remote control.