Go Down

Topic: How to read keypresses from a keyboard number pad (Read 430 times) previous topic - next topic

domiflichi

Nov 23, 2018, 06:35 pm Last Edit: Nov 23, 2018, 06:38 pm by domiflichi
Hello,


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.

larryd

#1
Nov 23, 2018, 07:15 pm Last Edit: Nov 23, 2018, 07:21 pm by larryd
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.
http://www.dipmicro.com/store/RGB-LEDCTL-RM44   

http://forum.arduino.cc/index.php?topic=289446.0   





https://forum.arduino.cc/index.php?topic=317625.0   




No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

domiflichi

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.

larryd

#3
Nov 23, 2018, 08:26 pm Last Edit: Nov 23, 2018, 08:34 pm by larryd
What kind of connector is on your keypad cable?

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




No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

domiflichi

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...

Delta_G

#5
Nov 23, 2018, 09:17 pm Last Edit: Nov 23, 2018, 09:17 pm by Delta_G
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. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

larryd

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

domiflichi

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

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



??

leongjerland

#8
Nov 24, 2018, 02:11 am Last Edit: Nov 24, 2018, 02:11 am by leongjerland
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.
Code: [Select]

#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()
{
  Serial.begin(9600);
}

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

wvmarle

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.

Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

domiflichi

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.

BabyGeezer

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 ?
Attach your images to be viewed directly - THIS WAY;
https://forum.arduino.cc/index.php?topic=519037.0

Go Up