****NOTE: This is not a complete instructable for the time being. It goes through the construction of a keypad fully, however it does not yet fully explain or demonstrate the means to make it useful. This will change
Remove these ads by
Signing UpStep 1: Understanding the Keypad
A matrix is pretty much a grid like in battleship consisting of rows and columns. each button corresponds to a certain row and column. See the first picture to help illustrate this better. On a 9 button keypad you would use 3 rows and 3 columns. The first button would make a link between Row 1 and Column 1 (R1C1) just like in battleship. 2 would be R1C2, 3 R1C3, and lets say 8 would be R3C2... the rest are illustrated on the image.
The point of this is instead of having 9 different buttons to wire up, all you would need to do is wire up 3 columns and 3 rows for significantly less wires. The real benefits come when you begin adding buttons. adding another row and column (2 wires) would add 7 buttons... see where I'm going?






































Visit Our Store »
Go Pro Today »




it works very nicely. Thanks for the fun and interesting project. :)
thanks.
int beep = 13; //A buzzer is attatched to pin 13
const byte ROWS = 3; //four rows
const byte COLS = 3; //four columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
};
byte rowPins[ROWS] = {8, 7, 6}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {5 ,4, 3}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
pinMode(beep, OUTPUT);
}
void loop(){
char key = keypad.getKey();
if (key != NO_KEY){
Serial.println(key);
digitalWrite(beep, HIGH); // set the buzzer on
delay(100);
digitalWrite(beep, LOW); // set the buzzer off
}
}
It makes me feel like people are really benefiting from it when I get to see others examples of it
Only got one question: im making a multicolour led cube for my room and I was wondering if that keypad could be used to change the colour? for example: number 1 for red, number 2 for blue, etc.
Kudos to you Jorad! Great ideas!
love the idea, can't wait to see what it could be used for.
could you make a while typing keypad or rolled up piano keypad this way?
I had a very bad habit of taking things apart a while ago, thinking i could make them better. (Hmmm.... maybe i could combine my cell phone with my psp! oops....)
Now my keyboard is broken. :)
This project is very intresting as I am a car PC enthuisiast and have pretty much hand made all the electrical interfaces that went along with it. I could name about 100 applications for this when it comes to car PC's. I would like to use an old USB game pad witch I have already tapped the button hots and grounds to all the buttons with small stranded wire.
Lets name these first three A, B, and C. The second three are 1 2 and 3.
The combinations for the 9 numbers are A1, A2, A3, B1, B2, B3, C1, C2, and C3.
the arduino will recognize which Horizontal (A, B or C) input connects to which Vertical (1, 2, or 3) output.
so, assuming that the number 1 is A1, the number 3 is A3, the number 4 is B1 and so on, the combination 6, 7, and 2 would be B3, C1, and A2.
Get it now?
I did something like this many years ago when I was interested in building my own computer from scratch, the most dificult part in my eyes were the spacers, I used card with holes in it but the paper+foil would eventually sag. it looks like you used foam type spacers, I will have to try it myself.
I also considered making a trackpad type device (years before they were on laptops) by making very fine strips of foil going vertically on one side and horizontaly on the other, same principal as the keypad but it would have been a nightmare to read electronically and very unreliable.
Great project!
Nice work.
step 1: go here: http://tinyurl.com/lf2n2g
Essentially it's an open-source microcontroller with easy to learn code. You can interface with several peripherals such as your PC, sensors, LCDs, etc.
If you like doing stuff like this Arduino is your friend
A very cool project, I want to see the end result when its hooked up to the door.
Another idea I had was writing up some Processing code and getting it to open applications-- a sort of keyboard shortcut.