4x3 matrix keypad sometimes just get stuck and wont work for a while

i am having a really hard time looking for the culprit, i am using this 4x3 keypad matrix along with the keypad library at first it works all great but sometimes it will get stuck even the example

/* @file CustomKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates changing the keypad size and key values.
|| #
*/
#include <Keypad.h>
char hexaKeys[4][3] = {
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
  {'*', '0', '#'}
};

byte rowPins[4] = {11, 10, 9, 7}; //connect to the row pinouts of the keypad
byte colPins[3] = {6, 5, 4}; //connect to the column pinouts of the keypad


Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, 4, 3);
void setup(){
  Serial.begin(9600);
}
  
void loop(){
  char customKey = customKeypad.getKey();
  
  if (customKey){
    Serial.println(customKey);
  }
}

doesnt work anymore, serial monitor will just out one asterisk and thats it i, have to wait for awhile be it come back okay, i doubled checked almost everything continuity checks out on all connection solder are also good.

Any have experienced this in the past and is willing to share how you overcomed it?. I would rather have a few unregistered clicks than making it not work for a period of time.

I tried to manually create my own code buy serial always spits out '1' and the code does hase a half second delay, I alsor treied changing the keypad and the microcontroller both show the same symptoms

You should also post how you have connected the arduino to the keypad. A photo of the setup may be good enough if you can get it focused and the wiring is clear.

marco_c:
You should also post how you have connected the arduino to the keypad. A photo of the setup may be good enough if you can get it focused and the wiring is clear.

the connection is just a direct connection between the pins, Arduino pin -> perfboard wires -> male headers -> jumper cables -> Keypad.

the connection not seem to be the culprit because trying it on another arduino( uno this time) with a different keypad,and wires. im ang still getting the same effect. It could be that i got really unlucky with the batch of keypads i have. But when it does work it works really cleanly up until the next power down.

or maybe interferences in the lines since it is a direct connection? do you have a recommendation for the configuration of the pull up/down ?

Still, something is not working. So if we assume the library and example code is ok (as everyone else uses it); the keypad is probably ok (does swapping keypads does change the situation?), the the wires are probably ok (have you measured the that they are not broken?) then the only thing that remains is incorrect wiring, a damaged Arduino MCU or a bad breadboard (if you are using one).

As we don't know any of the last three it is hard to give you any help.

marco_c:
Still, something is not working. So if we assume the library and example code is ok (as everyone else uses it); the keypad is probably ok (does swapping keypads does change the situation?), the the wires are probably ok (have you measured the that they are not broken?) then the only thing that remains is incorrect wiring, a damaged Arduino MCU or a bad breadboard (if you are using one).

As we don't know any of the last three it is hard to give you any help.

No unfortunately changing the keypad, does not fix the problem, no breadboard i soldered them on a perf-board, doing continuity test show everythin is okay, i even measured the resistance of the connection from the mCU pin to the the keypad pins, although that does prove that it might be shorted to something else ( will do some more continuity. It is hard for me to believe that it is caused by incorrect wiring because, it did work smoothly not just as consistent.

EDIT: alright it would seem that i have 2 busted mCU i tried it on an unused original from arduino board it did seem to work. The next thing that probobly is my solder, oh my this will be hard since they are just direct connections