Phone keypad a bit special

Hello !
I currently generates code. I retrieve a keyboard phone.
Here's how it seems to work (15 keys). I tested each key pin by pin:

If I press a key, I look on this array where is 2 "1".
Exemple :
I press "M" (bottom left), the circuit is closed between pin 1 and 2.

How can I use the Keypad library to run this keypad ?

Thanks for your help and sorry if I make mistake, my native language is French :wink:

Hello crocoscore, bonjour!

I’m not familiar with that keypad. The switch closure patterns seem odd and unexpected. What keypad are you using?

http://playground.arduino.cc/Main/KeypadTutorial

Pat.

I know this tutorial but my keybord looks differents. It don't run in rows and column (but perhaps I'm wrong about the operation of the keyboard used for explanation).

It not this phone keyboard but it looks like:

If you really need a photography of mine, I'll give you.

Redit :
I was wrong, it lacked a pin :

Now someone has an idea?

Up please !

That's what I do :

const byte ROWS = 5; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'3','2','1'},
{'6','5','4'},
{'9','8','7'},
{'#','0','*'},
{'B','R','W'}
};
byte rowPins[ROWS] = {0, 4, 6, 8, 9}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {11, 3, 5}; //connect to the column pinouts of the keypad

It works well for all the key exept for "8,0,R")

Here my keypad:

Where did you get pin 11 from for your rows/cols setup? I thought you had 10 pins in total. Also, why are your declaration backwards to your keys, and where is the M in your keymap?

I can see the pattern here and how to set this up I think, but I'm on my phone and will get back to my desk shortly and post again.

What are the actual keys on the bottom row?

Hold on, I'm, going mad. Let me work this out!

So, you're connecting to the Arduino pins D0, D3, D4, D5, D6, D8, D9, D11. That's going to use the serial ports RX on D0 so let's use pins from D2 to D9 for you so I can start afresh.

They have wired a 5 x 3 matrix but they've used 10 pins instead of only 8. The middle column has been split across 10, 7 and 3.

So, first join 10, 7 & 3 together on your keypad and we'll call the combined column 20 (10 + 7 + 3).

Now we have the following layout:-

9 -   1    2    3
8 -   4    5    6
6 -   7    8    9
4 -   *    0    #
1 -   M    R    B
      |    |    |
      2    20   5

Next wire up as follows:-

Keypad   >    Arduino
9        >    D2
8        >    D3
6        >    D4
4        >    D5
1        >    D6
2        >    D7
20       >    D8  + (Remember, 20 is keypad pins 10, 7 & 3 joined together to make a single column) 
5        >    D9

Then

const byte ROWS = 5; //five rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'},
  {'M','R','B'}
};
byte rowPins[ROWS] = {2, 3, 4, 5, 6}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {7, 8, 9}; //connect to the column pinouts of the keypad (20 is 3,7 & 10 joined together)

Let me know if that works.

The handy thing is, this is still 8 pins, so you could wire this to an 8 bit I/O expander such as PCF8574 if you wanted to convert over to Keypad_I2C to do it all on 2 Arduino pins.

crocoscore:
Now someone has an idea?

It's a 5x5 matrix keypad driven by two sets of five pins. One set is pins 1, 4, 6, 8, 9. The other set is pins 2, 3, 5, 7, 10. As you'll see, each button connects one pin from one set with one pin from the other set. Now that you know what pins are connected to which buttons, you can read it easily by sending a signal to each pin in one set, and seeing which pin in the other set receives the signal.

Yes, I suppose you can think of it as a 5 x 5, with some junctions without keys, but you'd need 10 pins to read that

If you join 10, 7, & 3 into a single column you can do it with 8 pins.

9  -   1   2   .   .   3
8  -   4   .   5   .   6
6  -   7   .   8   .   9
4  -   *   .   .   0   #
1  -   M   .   .   R   B
       |   |   |   |   |
       2   10  7   3   5

Thank you for your answers. Unfortunately I can programmed only during the weekend, so I'll keep this post neighbor. See you soon!

crocoscore:
Thank you for your answers. Unfortunately I can programmed only during the weekend, so I'll keep this post neighbor. See you soon!

Isn't it still the weekend? :wink:

Finally, I joined 3, 7 & 10 on one pin and it works (it is only after had the idea that I understood your post...) ! Thank you :slight_smile: