Create Own Membrane Matrix Keypad (and Hooking It Up to the Arduino)

135,311

183

93

So you want to create your own membrane keypad? Why? well making your own keypad can be useful for many reasons. It's cheap and easy to do, it can be placed in situations where it may be vandalized or stolen without much frustration, It can be fully customized to display whatever you like, and you can make as large a keypad as you like with as many inputs as you can handle. I created my keypad to go on the exterior of my door in residence to act as a keypad entry in much the same way as colin353 did here www.instructables.com/id/An-Electronic-Door-Opener/. I however have some more tricks up my sleeve for this coming up in a later Instructable.

****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

Step 1: Understanding the Keypad

   The first thing I want you to understand is how this keypad works. I know what you're thinking... Matrix keypad?... "I'm not going to have to take any blue pills to get this to work am I?". No its not that matrix.. The best way to think about a matrix style keypad is to think about battleship.

   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?


Step 2: Collecting the Materials.

The really cool thing about this instructable is you probably already have all the things you need to build this in your house! Yes when I say that this is a simple, cheap, effective way of making a keypad I mean that it is simple and cheap. For this instructable you will need:

Aluminum Foil (tin foil... some sort of foil) *foil tape works well also
Some sort of paper or flat material (what you choose here will effect the durability. I'm using a dry erase pad for my fridge)
glue (unless you're using foil tape)
and a spacer of some sort (a few layers of paper with holes cut in them may work I'm using double sided sticky foam pads)

Laminator (COMPLETELY OPTIONAL)

Step 3: Decision Time

The first step to putting your keypad together is deciding what you want it to look like/how many buttons do you want on it. For this instructable I will be using a 3X3 setup with the numbers from 1 to 9 on it. Once you have decided what it will look like draw it out and decide where you want all the wires to go. I want a lead off from my keypad so it will go around my door so see image 2 for what mine should look like. Make a mock up on your computer using whatever software you like (paint, photoshop, illustrator...) and proceed to the next step.

Step 4: Mapping Out Your Cheap "Circuit"

What we are going to be doing is gluing on foil to make a flexible, cheap, however effective circuit board. What we need to do now is on our computer mock up we need to make how our columns and rows are going to be set-up. If you are using Photoshop make 2 new layers, one called rows the other columns. if you're just using paint make a copy of the file called rows and another columns.

On these new layers we will put large black lines where we want our "Circuits" to go. See image 2 for rows and image 3 columns if you are confused. Image 4 shows what both layers turned on looks like. Starting to look familiar?
Now you need to flip one of your images vertically... or is it horizontally... see image 5 you'll get what I mean.

Go ahead and print these out for the next step.

Step 5: Faux Circuit Making Time!

Here is the fun part... well in my opinion the whole thing is fun but whatever...
Now that you have your printed out templates you can start making your circuit. Now is the time to glue down your foil where ever your rows and columns are supposed to go. Look at figure 2 for both of my circuits, yours should look somewhat like this. Also, notice how my leads go away from the keypad in an organized way to facilitate easy hook-up? Just like I planned!

*NOTE* At this point its a good idea to re-make your front design to include labels for the hookup at the end of the leads with the labels
R1
R2
R3
C3
C2
C1

This is just going to make it easier for you.

Step 6: Putting It All Together.

In the next step we will be putting it all together. Take your spacers and apply them to one side of your keypad. come to think of it you could technically use silicone (the type used for caulking) as a really decent spacer... I may try this in the future actually.... hmm..

Anyways back on topic. To apply these spacers we need to make sure that there is a hole in the center of them so that the rows and columns can contact one another when they are depressed (not sad... pressed down). I kinda just tiled everything but you could use a hole punch or something to get better results. The spacers are also there to make sure other parts of our circuit do not touch each-other incidentally.

Take a look at image 1 to see all the spacers applied appropriately. Once your spacers have been applied (you may need to glue whatever you are using) you may put the other side of your keypad on top of this one (image 2). Luckily you made sure that everything was mapped out properly on your template on the computer... you did make a template didn't you?

Image 3 is the pieced together keypad.

*****OPTIONAL STEP*****
To help my keypad enjoy a long healthy life I laminated mine. It helps provide some structural support for the paper... constant pressing can and will create depressions (again not sad) in the paper that sooner or later will cause your keypad to become ineffectively pressing that button constantly.

Image 4 would show my beautiful laminated Matrix style keypad however the laminator ate my piece of art.

Step 7: Arduino Anyone?!

Time to hook up your keypad to the Arduino for the first time... exciting no?

Well Exciting as it may be it'll have to wait for now! The Laminator lovingly ate my keypad so until I can find the time to make another one then it'll have to wait. I WILL be coming back so do not to worry this step will come. Perhaps in the near future I will explain how to set it all up and not exactly show it off. For now here is the arduino code I was using with my prototypes for those of you who know where to go from here good luck. For the others sit tight.

***NOTE*** you will have to install the keypad library from arduino.cc




Share

Recommendations

  • First Time Author

    First Time Author
  • PCB Contest

    PCB Contest
  • Make it Glow Contest 2018

    Make it Glow Contest 2018

93 Discussions

0
None
Pokaloka

2 years ago

we can add some antistatic foam in some holes to have variable resistance contacts

1 reply
0
None
AlderinPokaloka

Reply 2 years ago

Unfortunately, that wouldn't work in a matrix-style sensing arrangement. A large part of the matrix pattern depends on a very binary state of the switches. If there were to be a resistance behind each button, power would flow from any column, through the buttons on the row, through the rows to the other columns, and you end up with one big switch.

In order for variable resistance switches to work, you'd have to have clever use of diodes and/or additional resistors to block selection power and classify each button into a different, detectable resistance range... and equally clever software to figure out just what which level signal on this line actually means.

Not impossible, but not as easy as antistatic foam.

0
None
RossL14

2 years ago

Aww what an adorable laminator. I hope it has a little smiley face on it :) I am hoping to make a proper flexible membrane matrix for a project, with about 75 buttons. Will there be enough inputs on the arduino? I know there is a component that multiplies the available in/outs.

0
None
Pokaloka

2 years ago

and making 4 matrixes on 4 cd 4060 (oscillator inside) outputs and connect them to 4 cd4069 amp stages and then inside 4 cd4069 drum generators and you (I suppose) get a 4 analog sound polyrythm drum sequencer/ looper :)

0
None
Pokaloka

2 years ago

thanks a lot :)

0
None
ly333

8 years ago on Introduction

Ok I finished mine I used tape and hot glue to connect leads to a cable I found I hope it works...This is what i looks like...Also how do I connect it to my arduino?

DSC01021.JPG
4 replies
0
None
ly333ly333

Reply 8 years ago on Introduction

The leads and everything is exactly the same as the one from the top to bottom. cables goes from top to bottom in order.

0
None
TheBestJohnly333

Reply 8 years ago on Introduction

 That is awesome my friend! well stick the columns into pins 3, 4, and 5, and the rows into pins 6, 7, and 8. Also if you have a buzzer stick it into pin 13 and ground. then load up the code included here and open up serial monitor in at 9600 baud. Press a button and you should see it pop up on the monitor! 

Note: Make sure you have installed the keypad library from arduino.cc Make a video if you have the time. I'd love to see it!

0
None
NavedA2TheBestJohn

Reply 3 years ago

Great Idea but still confusing how to keep spacer between two sheets.

0
None

Take a look at the pde file. It's pretty straightforward. You plug in the wires into digital ins and run the code. I unfortunately destroyed this project in a laminator and was unable to take pictures of that process

0
None
jvan lierde

5 years ago on Introduction

Hye, I've changed the 9 and 7 into a '#' and a "*". Now it looked like it did run right for about a minute and then he just started ignoring the password en took the '#' as enter without reading the password! I guess I changed something the wrong way. I'll keep trying. :)

0
None
jvan lierde

5 years ago on Introduction

Hye, I made this membrane. Now I'm trying to hook it up with a servo what i've got is this:
#include
#include
#include



Servo myservo;
Password password = Password( "123" );

const byte ROWS = 3; // Four rows
const byte COLS = 3; // columns
// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'}
};
// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = { 5, 4, 3};// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
byte colPins[COLS] = { 8, 7, 6 };


// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
myservo.attach(9); //servo on digital pin 9
Serial.begin(9600);
keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}

void loop(){
keypad.getKey();
}

//take care of some special events
void keypadEvent(KeypadEvent eKey){
switch (keypad.getState()){
case PRESSED:
Serial.print("Pressed: ");
Serial.println(eKey);
switch (eKey){
case '#': checkPassword(); break;
case '*': password.reset(); break;
default: password.append(eKey);
}
}
}

void checkPassword(){
if (password.evaluate()){
Serial.println("Success");
//Add code to run if it works
myservo.write(160); //160deg
digitalWrite(11, HIGH);
delay(500);
digitalWrite(11, LOW);
}else{
Serial.println("Wrong");
//add code to run if it did not work
myservo.write(10); //10 deg
digitalWrite(12, HIGH);
delay(500);
digitalWrite(12, LOW);
}

}


Now the problem is it won't react to the key "123". I did try some things out like changing the "#" for check password into a number like 9 or something. Then the servo moves every time number 9 is pushed but still does not react to "123". What am I doing wrong? Can you help me out? Greets

4 replies
0
None

Looks like you are doing that... do several printIns at different points in your code to help narrow down where it's breaking

0
None

Oh i see whats wrong... you have no # key here... case '#': checkPassword(); is never called because there is none set up... set up a push button or something for a pound key