Pages: [1]   Go Down
Author Topic: Shift register keypad  (Read 803 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
Karma: 0
Posts: 270
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In order to save precious input pins, I first tried to use an analog input to read keypad values. It didn't lead to good results, as I point out in this thread

My next attempt was to use a shift register. The shift register I use is CD4021B.

I ripped the keypad from an old ericsson diavox phone I found from the attic. In addition to row/column pins of the standard matrix keypads, it has two other pins. I don't know what the pin no. 9 is for, but the pin no. 8 is very useful. If I connect pin 8 to +5V, the corresponding row and column pins goes high when a key is pressed. There is no need to pull rows high/low one by one and scan the column pins as the standard approach goes. To be honest, I can't figure out how to read the keypad with a shift register without the extra pin. The shift register is parallel in, AFAIK it provides no means to put pins high/low that is needed in the standard approach. Please let me know if you know how it can be done with a shift register using the row/column pins only.

I made a little adapter board where the shift register sits on. The resistors are pull-downs for the shift register's input pins.

I removed the cable from the keypad and replaced it with a male header. It matches the adapter's female header. The wires from the adapter  goes to Arduino's three digital pins, +5V and GND.

I also wrote a modified version of Mark Stanley's and Alexander Brevig's Keypad library I has the same interface and event model as the Keypad library, only the constructor is different.

« Last Edit: November 18, 2009, 01:06:12 pm by pekkaa » Logged

Pages: [1]   Go Up
Jump to: