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)


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

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.

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

<p>we can add some antistatic foam in some holes to have variable resistance contacts </p>
<p>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.</p><p>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.</p><p>Not impossible, but not as easy as antistatic foam.</p>
<p>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. </p>
<p>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 :)</p>
<p>I made a magnetic patchbay :<br><br><a href="https://www.instructables.com/id/Magnetic-Patchbay-for-Modular-Synth-or-Anything-El/" rel="nofollow">https://www.instructables.com/id/Magnetic-Patchbay-...</a><br>and now, gonna make your switch matrix for my synths :) </p>
<p><strong>thanks a lot :)</strong></p>
<p>thank you bro, I made it thanks to you</p>
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?
The leads and everything is exactly the same as the one from the top to bottom. cables goes from top to bottom in order.
&nbsp;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!&nbsp;<br /> <br /> 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!<br />
<p>Great Idea but still confusing how to keep spacer between two sheets.</p>
So I labelled it from top to bottom X1-3 Y1-3
<p>And then?</p>
<p>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 </p>
If you want an alphabetical keyboard for Arduino check out this DIY Keyboard from LucidTronix:&nbsp;<a href="http://lucidtronix.com/tutorials/44" rel="nofollow">http://lucidtronix.com/tutorials/44</a>
Hye, I've changed the 9 and 7 into a '#' and a &quot;*&quot;. 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. :)
Hye, I made this membrane. Now I'm trying to hook it up with a servo what i've got is this: <br> #include <br> #include <br> #include <br> <br> <br> <br> Servo myservo; <br> Password password = Password( &quot;123&quot; ); <br> <br> const byte ROWS = 3; // Four rows <br> const byte COLS = 3; // columns <br> // Define the Keymap <br> char keys[ROWS][COLS] = { <br> {'1','2','3'}, <br> {'4','5','6'}, <br> {'7','8','9'} <br> }; <br> // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins. <br> byte rowPins[ROWS] = { 5, 4, 3};// Connect keypad COL0, COL1 and COL2 to these Arduino pins. <br> byte colPins[COLS] = { 8, 7, 6 }; <br> <br> <br> // Create the Keypad <br> Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); <br> <br> void setup(){ <br> myservo.attach(9); //servo on digital pin 9 <br> Serial.begin(9600); <br> keypad.addEventListener(keypadEvent); //add an event listener for this keypad <br> } <br> <br> void loop(){ <br> keypad.getKey(); <br> } <br> <br> //take care of some special events <br> void keypadEvent(KeypadEvent eKey){ <br> switch (keypad.getState()){ <br> case PRESSED: <br> Serial.print(&quot;Pressed: &quot;); <br> Serial.println(eKey); <br> switch (eKey){ <br> case '#': checkPassword(); break; <br> case '*': password.reset(); break; <br> default: password.append(eKey); <br> } <br> } <br> } <br> <br> void checkPassword(){ <br> if (password.evaluate()){ <br> Serial.println(&quot;Success&quot;); <br> //Add code to run if it works <br> myservo.write(160); //160deg <br> digitalWrite(11, HIGH); <br> delay(500); <br> digitalWrite(11, LOW); <br> }else{ <br> Serial.println(&quot;Wrong&quot;); <br> //add code to run if it did not work <br> myservo.write(10); //10 deg <br> digitalWrite(12, HIGH); <br> delay(500); <br> digitalWrite(12, LOW); <br> } <br> <br> } <br> <br> <br>Now the problem is it won't react to the key &quot;123&quot;. I did try some things out like changing the &quot;#&quot; 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 &quot;123&quot;. What am I doing wrong? Can you help me out? Greets
The includes are: Keypad, password and servo
best bet, Serial.println(key); and make sure the numbers are the ones you're pressing first.
Looks like you are doing that... do several printIns at different points in your code to help narrow down where it's breaking
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
I combined this instructable with Arduino 3 wire Matrix Keypad : https://www.instructables.com/id/Arduino-3-wire-Matrix-Keypad/<br>it works very nicely. Thanks for the fun and interesting project. :)
That's an awesome Idea! I'd love to see pictures if you have the time!
Does anyone have a copy of the code for the arduino? Can't get it from here it just saves a blank file.<br><br>thanks.
#include <br><br>int beep = 13; //A buzzer is attatched to pin 13<br><br>const byte ROWS = 3; //four rows<br>const byte COLS = 3; //four columns<br>char keys[ROWS][COLS] = {<br> {'1','2','3'},<br> {'4','5','6'},<br> {'7','8','9'},<br>};<br><br><br>byte rowPins[ROWS] = {8, 7, 6}; //connect to the row pinouts of the keypad<br>byte colPins[COLS] = {5 ,4, 3}; //connect to the column pinouts of the keypad<br><br>Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );<br><br>void setup(){<br> Serial.begin(9600);<br> pinMode(beep, OUTPUT); <br>}<br><br>void loop(){<br> char key = keypad.getKey();<br> if (key != NO_KEY){<br> Serial.println(key);<br> digitalWrite(beep, HIGH); // set the buzzer on<br> delay(100);<br> digitalWrite(beep, LOW); // set the buzzer off <br> <br> }<br><br>}
Thank you very much I got the sample working.
Great! post up a picture I'd love to see it! <br><br>It makes me feel like people are really benefiting from it when I get to see others examples of it
the include is &lt; keypad.h &gt;
If possible, this method could be used to make a modded cell phone part?
any progress on hooking up the arduino? im stuck at that step
Sorry for the wait. I just Graduated so I'll have some time shortly to finish this up. to give you the gist of it is to take the code at the bottom and hook up the rows to pins 3, 4, and 5 and the columns up to 6, 7, and 8 and run the code. Make sure you have downloaded the keypad library from arduino and have it installed. if the numbers show up but aren't the right ones try moving those connections around.
Wonderful! <br /> 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.<br />
defiantly! That's actually the first thing I did with this thing. Control the colors of an RGB&nbsp;LED that I had obtained... be sure to ask for some samples from a company called lumex... they'll send you some awesome samples of RGB leds that are wickedly bright.<br />
Why would you post an incomplete Instructable - not cool.<br /> <div id="refHTML">&nbsp;</div>
He did say in the intro that it would be a &quot;work in progress&quot;, meaning that it will be added to as he has time and/or new steps completed.<br /> <br /> <br /> Kudos to you Jorad! Great ideas!<br />
Thanks Charlie! Also Nixoid, I decided to post this after having it half written for a month. I finished what information I had however my original keypad was eaten so I could not take pictures of the final step of hooking it up. In my defense all the information needed to do this is in the instructable. I included all the code you need and if you read the comments you'll find that someone has already built the entire keypad and gotten it working. Also I am active on instructables, if you want to build it and have any questions, I am here. <br />
Eaten? The original keypad was eaten?&nbsp;&nbsp; Great article.&nbsp; Looking forward to reading more.
&nbsp;Eaten by the laminator lol it was a mess and I wish I had pictures
laminators love to eat anything thats not really flat. perhaps putting the pads on after laminating? I'm a complete nubie to all this make your own electronics stuff, could you explain some basics in this wonderful instructable or point out some links?<br /> <br /> love the idea, can't wait to see what it could be used for.<br /> <br /> could you make a while typing keypad or rolled up piano keypad this way?<br />
You most likely could. Look up the arduino if you want a good introduction into microcontroller programming and whatnot. it's really easy to pick up and run with and there are thousands of tutorials for it out there.<br />
there is already a roll-up-piano keyboard. I have one, but sadly i took it apart.<br /> <br /> 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!&nbsp;oops....)<br /> <br /> Now my keyboard is broken. :)<br />
Jarad,&nbsp; hope you plan to complete this ible.&nbsp; I am intrigued.&nbsp; I&nbsp;would like to understand how to use the keypad when complete.&nbsp; I'm assuming it interfaces with arduino.&nbsp; I&nbsp;have no clue what arduino is or how to use it, but am guessing that I will know when you complete the projects. thanks in advance, look forward to it<span class="stepTitle">.</span>
&nbsp;I sure do just really busy lately. While you are waiting make sure to look up Arduino tutorials ;)
Dumb question,&nbsp; but how are you identifying the buttons on the Arduino.&nbsp; The reason I am asking because my limited electronics knowledge tells me you should have a unique hot and a common ground&nbsp;for each button.&nbsp; I did not see this.&nbsp; Could you explain alittle.<br /> <br /> This project is very intresting as I&nbsp;am a car PC enthuisiast and have pretty much hand made all the electrical interfaces that went along with it.&nbsp; I could name about 100 applications for this when it comes to car PC's.&nbsp; I would like to use an old USB game pad witch I have already tapped the button hots and grounds&nbsp;to all the buttons with small stranded wire.
the answer to your first question is that (obviously) Aluminum foil is an electric conductor. There are 6 pieces of foil, 3 for the horizontal and 3 for the vertical. <br /> <br /> Lets name these first three A, B, and C. The second three are 1 2 and 3.<br /> <br /> The combinations for the 9 numbers are A1, A2, A3, B1, B2, B3, C1, C2, and C3.<br /> <br /> the arduino will recognize which Horizontal (A, B or C) input connects to which Vertical (1, 2, or 3)&nbsp;output.<br /> <br /> 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.<br /> <br /> Get it now?<br />
WOW! ever since i was little i always wanted one of these bad boys.. i didn't know it was that easy!! Thanks man! 5 stars!<br />
Excellent instructable.<br /> 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.<br /> <br /> 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.<br />
I would suggest laminating the front cover (one side) before assembling the keypad entirely. &nbsp;Or get some wide clear packaging tape and laminate it yourself with tape.
I haven't experimented much with all these different methods. I had thought of that and I figured that I was just using it for my dorm door, which means drunk freshmen ripping everything they see down in the hall so I didn't want to put too much time into it in case it was destroyed. Thats why I love instructables though. You can make it that way and post your results for others to see how it went.<br />
How are you identifying each button press.&nbsp; Are you measuring resistance.&nbsp; The reason I ask is not every button has it's own seperate contact.&nbsp; The ground I imagine would not matter.&nbsp; The reason I am asking is instead of using an Arduino I want to actually interface it to an old USB game pad wich I have already tapped the ground and button leads with small wire.&nbsp; <br /> <br /> Great project!

About This Instructable




More by TheBestJohn:Create own Membrane Matrix Keypad (and hooking it up to the Arduino) 
Add instructable to: