Controlling membrane keypad with a CD4021 shifter

Hi, I just bought my first arduino yesterday and managed to set up LCD on it, but now I am out of pins to connect my 4x4 matrix keypad. After doing some search, I decided to try Arduino ShiftIn example. I produced the exact circuitry using a CD4021B 8 bit shifter (without VCC and GND as matrix keypad does not require them). However, when I check out the results all I am seeing is 11111111, pressing buttons does not change this output. I am new to electronics, I come from a software development background. Can anyone guide me to right direction on how to make my matrix keypad work with shift in method?

PS: My keypad:

Show us a schematic how you wired things up.
Show us your sketch.

I am using 8x10kOhm resistors with CD4021B shifter. Keypad only has data out pins. No VCC or GND required. But I connected GND as shown in the example on ardouino's official tutorial.

Do you have a link to the keypad.
Also a picture of the keypad might be of some use.

This is the keypad:

This is a 4X4 keypad which has to be read by placing a High on a given row then reading the 4 columns to see if a switch is being pressed. Then the next Row ....

So I guess, it wont be able to achieve this with a shifter because I won't be able to set specific row high? I need to use an IO extender?

If you have the pins you can use your Arduino

You need no IO extender. You have to change your circuit a little. The three gates in up part is not necessary, but when you connect it to interrupt, you got event (any_key_pressed) :wink:


...And what about dealing with 5 x 4 ??