The code for this project can be downloaded from my GitHub page here.
See also the post using this keypad as an electronic lock here.
I saw these membrane keyboards on sale on eBay for around £1, for example this one here. They are only a milimetre or so thick and although they will not be much use for a calculator they could be used for a keypad entry system.
I have already produced a sketch to read a 4×4 matrix keyboard and decided to modify that to read this four column by five rows keyboard. I made a few changes and the code returns a numeric code from 0 to 19 that represents each key in addition it returns a string with the name of the non numeric keys and finally an integer representing the numeric keys.
The sketch scans the rows checking each column to determine which, if any, key has been pressed. To use the sketch open it in the Arduino IDE and you will find a blank section in the centre, add your code here. If no key has been pressed then the variable keyString will be an empty string and the integer keyValue will greater than 20. The keypad is scanned continuously, but it does not take long and it’s unlikely that you would use the keypad in a situation that takes too much time to respond to key presses. The connection diagram is shown below and an example of this key pad being used for data entry in a two lock electronic lock can be found here.
Unlike keyboards made using individual keys this keyboard does not seem to need any key debounce code. Connection information is provided in the sketch.