Unreliable Keypad input

Hi All,

I've tried searching in the forum for this, but couldn't quite find an answer for my issue.

I'm using the 12 Button keypad from sparkfun (http://www.sparkfun.com/products/8653) and have no problem wiring it up or reading the key presses from it using the example at http://www.instructables.com/id/Using-the-sparkfun-12-Button-keypad-with-the-ardu/, I've soldered pins into the through-hole mountings and connected it up using a breadboard for testing.

I am monitoring the keypresses using the serial monitor in the Arduino IDE.

When pressing buttons on the keypad, 1,2,4,5,7,8 and 0 all operate perfectly and give consistent readings.

  • for some reason gives a #? When I press 3,6,9 or #, I get readings for multiple button presses, e.g. pressing 3 will give a reading for 1 and 3 in quick succession, or sometimes 2,1,3 or any other mix. Similarly when I press 6, I get readings for 4 and 5 also.

I thought I may have crossed two pins with solder, but I reflowed the solder joints and everything looks fine. I also double-checked which pins I put resistors on (I'm using 5.6k resistors) in accordance with the pins in the instructable, I also tried no resistors and with resistors on every pin, the behaviour was still the same.

Does anyone have any suggestions as to what might be the issue here? Am I doing something incorrectly or is there a fault with my keypad?

Any help appreciated. Thanks

The Keypad library enables the internal pull-up resistors on the four ROW inputs so the external pull-up resistors should not be necessary. The three COLUMN outputs are kept HIGH by default. To read the keyboard it pulls each COLUMN pin LOW in turn and looks for a LOW on each of the four ROW inputs. If it finds a LOW it means that there is a button connecting the COLUMN to the ROW.

There should probably be some ~100 Ohm resistors between the COLUMN pins and the Arduino outputs because if two buttons in the same ROW are pressed a HIGH output will be shorted to a LOW output. With 100 Ohms on each pin the resulting current would be limited to 25 mA (5v across 200 Ohms).

The multiple key detects would indicate that the third COLUMN is shorted to Ground or possibly just not properly connected to the output pin. When reading the third column the column pin would be briefly pulled LOW wand the four rows checked. If that line is shorted to Ground then it would pul the corresponding ROW LOW even when the output pin for that column is HIGH.

I think its a quality control issue. I used to use these in little electronic props that I make for people. I have purchased around 5 of these since August, and every one had this problem. Since I have used these keypads in around 20 different props with no problems prior to this (and I have made no hardware or software changes since then), I assume it is an issue with the keypads themselves.

I'm in work at the moment so can't check but I'm fairly confident this is the answer:

My biggest mistake was involving pin 13, which has an LED on it on the Duemilinove and thus leaked to ground which resulted in oscilating readings.

  • From the comments on the product page on sparkfun.com

I opened up my arduino sketch and checked;

byte colPins[COLS] = {A1, A3, 13};

Column 3 is connected to pin 13... I'm gonna put good money that's the cause, will find out over the weekend.

Thank you both for your replies.