How to read keypresses from a keyboard number pad


What I'm looking to do, is take the following cheap keyboard number pad:

and 'intercept' the key presses. Basically, I want to hook up the buttons to an Arduino, and read the keypresses from the Arduino. Not necessarily every single one, mainly the 1-9 and the '-' and '+' buttons.

I was wondering if someone could point me in the right direction on how to read the buttons. There seems to be only 12 lines/connections coming from the membrane, but there's actually 19 buttons on the keypad.

Ideally I'd like to do away with the existing circuit board entirely, and put a tiny Arduino in it's place.

If it matters/helps, what I'm trying to do is make this number pad be a little portable 'hotkey' keyboard. For instance, I'd like to make it so that every time you press the '1' on the keypad, it sends [Ctrl + Shift + a] to the computer. I know I'm limited to the kinds of Arduinos that can act as a keyboard, and that's fine.

I know you can do this kind of stuff in software, but as I hinted in the previous paragraph, I want it to be 'hardcoded' into the keypad so that it doesn't require extra software/configuration on every computer I hook it up to. This would make it easily portable.

Hopefully that all makes sense and I'm not in over my head here.

Your keypad appears to have serial output.

IMO, get a simple matrix keypad rather than this one.

An IR remote keypad might be the way to go.

Thanks for the info!

The problem is that those buttons in the pictures of those other keypads look small and hard to push...I'm worried that may not work as I'm using my keypad for trying to day trade. The buttons on my keypad are nice and big like keys on a keyboard and are easy to press. I could see myself making all kinds of mistakes on those other keypads' little buttons.

You mentioned that it looks like my keypad is using serial output...I assume that makes things difficult?
(Just a reminder though - I don't want to use the existing circuitry of the keypad - I'd like to bypass it and solder on my own wires from the wiring connector to an Arduino (and I guess cut all the traces on the existing circuit board that are going to the black epoxy blob). So I'm not sure if that makes a difference or not. You probably got that the first time though.

What kind of connector is on your keypad cable?

Is that a double sided connector for the flex circuit plug?

I don’t know…I don’t really know connector types/names or anything. I did disconnect it though, and I discovered that the flex circuit/membrane is actually 2 layers folded, with a piece of thin, clear plastic separating the 2…here’s a photo:

I feel like I might be going down into a rabbit hole…

In the picture in the OP there is a wire coming out of the top of the keypad. What connector is on the other end of that wire...

If it is a PS2 keypad then there is a library to read from it.

I asked about the connector but . . . .

@Delta_G - it's a USB plug (it's just a generic USB keypad)

@larryd - I'm not really sure...looks like 1 sided?


If you follow the traces from the membrane connector, you see 6 lines connected to one layer, organized as columns, and 6 to the other, organized as rows.

So basically this is a 6x6 matrix keypad (with 17 missing keys).

I would connect them to 12 pins on the Arduino. Then I would write a sketch, using the Keypad library, to identify the keys.

This code was used for testing a 3x3 matrix, and can easily be modified for 6x6.

#include <Keypad.h>

const byte ROWS = 3;
const byte COLS = 3;

byte keys[9] = {1, 2, 3,
                4, 5, 6,
                7, 8, 9

byte rowPins[ROWS] = {2, 3, 4};
byte colPins[COLS] = {5, 6, 7};

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup()

void loop()
  byte key = kpd.getKey();
  if (key)
    if (kpd.getState() == PRESSED) {
      Serial.print("Key: ");

It looks like the PCB has exposed copper pads in each trace just next to the connector. Maybe you can solder wires onto those pads, the cut off the left-hand side of the PCB to get rid of the built-in logic. Soldering to the thin plastic film will be a problem.

The layout indeed looks like a matrix type keypad. 6x6 matrix is probably correct. Some traces are a bit odd, you'll have to do some experimenting with the Keypad library to properly match keys with location.

I should've posted this right when you guys replied. Thanks a bunch for the replies. I've got some things to try now thanks to you guys.

I'll update back later after my testing...not sure when I'll be able to...hopefully closer to the end of the year.

not meaning to hijack this thread, and perhaps it might even clarify more theory about using this device.

what is the conversion process that changes the matrix pulses(?) into serial data ?

is there something like a shift register chip (parallel input, serial output) under that black blob ?