Need help with 4x4 Keypad Matrix

I got this keypad http://www.elesof.com/electronics/product/4x4_matrix_keypad

Pressing any button in Row1 is not being detected.
While pressing any button in other 3 rows is being detected as the first number in that row.
i.e the detection i am getting is like -


4 4 4 4
7 7 7 7


About the connections - I connected the 8 pins R1-R4 and C1-C4 to 8 digital pins of Arduino Uno and edited the example called hellokeypad accordingly , but I am getting very weird results. I have left the Vcc pin open and not used any resistors in connections because I read somewhere that external resistors are not required with the Keypad library.

I am very new to electronics so please pardon if I am committing a very big mistake. Any possible diagnosis or Any fixes to the issue would be really appreciated.

Akash

Can you show us how it is wired to the arduino?

Are you using the Keypad.h library? Makes it very easy to use a 4x4 keypad.

HazardsMind:
Can you show us how it is wired to the arduino?


Its just connectors from each pin of keypad to digital pins of arduino

CrossRoads:
Are you using the Keypad.h library? Makes it very easy to use a 4x4 keypad.

Yes, I am, I don't feel there is any problem in the coding part.

Would you guys have also wired it this way only? IF anything different then please let me know, I m struggling hard to find a solution

Hard to say without code & without schematic of the board. You mention resistors & Vcc, neither of which are normally used, so that may be hosing things.
You could try swapping the pins used for Rs & Cs.

CrossRoads:
Hard to say without code & without schematic of the board. You mention resistors & Vcc, neither of which are normally used, so that may be hosing things.
You could try swapping the pins used for Rs & Cs.

Thanks for that. I swapped the pins for rows and columns as well as rows and columns in my code. Now 3 rows work perfectly while 1 refuses to work. It is like if i rotate the keypad 90 degrees, then it works like a 4x3 keypad with rows being rows and columns being columns, which is confusing me. I dont have a schematic or datasheet available but from the back side of the keypad with a multimeter I indeed verified that the row pins were connected to the rows only. I m clueless about what is happening

Post your code, the problem may lie there.

akashrupela:
I dont have a schematic or datasheet available but from the back side of the keypad with a multimeter I indeed verified that the row pins were connected to the rows only. I m clueless about what is happening

As a sanity check, I suggest that you disconnect the keypad and do a continuity test between the row and column pins to confirm that pressing a button connects the relevant row and column pin, and the others all remain isolated. It may be that the relationship between physical buttons and row/column pins is non-obvious, and you need to understand that relationship completely in order to diagnose the problem.

HazardsMind:
Post your code, the problem may lie there.

/* @file HelloKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates the simplest use of the matrix Keypad library.
|| #
*/
#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] = {
  {'1','4','7','*'},
  {'2','5','8','0'},
  {'3','6','9','#'},
  {'A','B','C','D'}
};
byte colPins[4] = {9, 8, 7, 6}; //These pin numbers are actually row pin numbers
byte rowPins[4] = {5, 4, 3, 2}; //These are actually column pin numbers but its the only way it works

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

void setup(){
  Serial.begin(9600);
}
  
void loop(){
  char key = keypad.getKey();
  
  if (key){
    Serial.println(key);
  }
}

This gives output


4 5 6 B
7 8 9 C

  • 0 # D

Also, i checked the connections, they look good. I am also guessing the problem maybe lies somewhere in the code

That suggests a wiring issue then.
I have used same with 4x4 keypad in this remote without problems:

CrossRoads, What does that keypad do or control?

Press a key, creates an interrupt to wake the processors, it reads the keypad using keypad.h library, a character is sent out via 433 MHz module using virtualwire library, and processor goes back into power down sleep mode.
Missing from the picture is MAX1811 chip on DIP adapter to control charging of the LIPO battery under the board.

The schematic.

I count only eight wires to the keypad in your picture.

You must connect the common wire to the resistor SIP on the keypad to something - I do not know (because I do not know the keypad library) to exactly what, but I strongly suspect it should go to Vcc, and then you may need to swap the rows and columns back again to make it work.