(click to embiggen)
After a couple false-starts I've gotten a pretty cheap, fairly easy DIY membrane keypad developed. It's not as nice as a commercially made one, but it's cheaper and you can include any sort of graphics or buttons you could want encoded any way you want. Here I've created a simple 4x4 keypad with numbers and a few interface buttons that would be useful for a generic LCD-based textual user interface. The keys are simply encoded as a 4x4 matrix, so it requires 8 I/O lines (or as few as 5 if you multiplex them). The more keys you have, the greater the advantage of multiplexing.
There is really no tactile feedback to this keypad, so immediate UI feedback (onscreen or maybe a quick beep) would be a huge help in a real application.
- Base layer: acetate sheet cut to shape, aluminum tape applied to top side to form column traces.
- Interstitial layer: acetate sheet with voids cut to the shape and size of each button
- Top layer: acetate sheet cut to shape, aluminum tape applied to bottom side (so the two foil layers face one another) to form row traces.
- Face art: so you can see what the buttons are!
The aluminum tape is basically aluminum foil with an adhesive backing, used to seal ductwork.
I drew all of the layers out in AutoCAD (a PCB layout program would probably do well at this, too, but I'm faster with ACAD) and then printed them on the appropriate materials (the three acetate layers on acetate, and the front art and a copy of each contact layer on plain paper). I'll share the files when I get to work since they're on my work laptop.
I used two different methods to get the foil tape onto the contact layers in the right spots:
- Stick the paper copy of the contact layer onto the tape (Scotch restickable glue sticks work great).
- Using the printed lines on the paper, carefully cut out each contact area from the tape (cutting directly through the paper).
- Peel the foil tape from the backing and, using the printed lines on the acetate, carefully stick the tape pieces down in the appropriate places.
- Remove paper layer.
The drawback to this method is that it's tricky to get a large, oddly-shaped bit of very sticky tape down in the right spot, so some sections might land a bit off.
- Cover the acetate layer with a single, contiguous piece of foil tape.
- Stick the paper copy down on top of the tape (again, restickable glue stick is great).
- Use the printed lines as a guide to cut through the tape, but NOT through the acetate.
- Very carefully peel the tape up where it is unwanted, leaving only the contact trace areas on the acetate.
- Remove remaining paper.
The drawback here is that you must control the cut depth very carefully to avoid cutting into the acetate. I cut too deep in a few spots and had to lay some packing tape on the back of the sheet to reinforce the cuts. On the other hand, though, the placement and spacing of all of the contact layers will be much more precise than with the first method
-You could easily replace the bottom acetate+foil layer with an etched PCB, which has the advantage of providing a rigid structure as well.
-it may be possible to adhere a contiguous piece of tape to the acetate substrate, apply a resist, and etch it just like a PCB. Not sure if the acetate would survive, nor if the tape-acetate bond would stand up to the removal of the resist.
-I tried drawing the traces using a CircuitWriter pen, but found that the contact resistance was in the MOhms, so went to this method. Turns out, though, that once stuff has dried for a while the contact resistance gets down near <1Ohm. So this method might be more viable than I first thought.
The interstitial layer just has a bunch of holes cut to allow the two foil layers to come together for each button.
Once the layers are made, they just get stacked on top of one another. I used a couple clamps to hold the corners to a piece of plexiglas for testing, and then used some black masking tape around the edges once it was working. This leaves a bit of play in the layers that allows the middle to bubble up a bit which affects useablity--but not a huge issue for a keypad this small. For a larger keypad, the layers should all get glued together and the kaypad should be adhered to a rigid surface.
I recorded a video with a short demo program. There's no debouncing yet, just a 100ms delay between scans, hence the multiple keypresses. I'm working on extending my input library to support matrices, will post about that when there's progress.