This is more of a story of what I did, rather than a full on how-to. Mistakes were made, tears were shed, but I got a very useful keypad out of the ordeal and I hope that this information might be useful to someone else.
Just as a disclaimer: The multimedia key functionality of the Teensy doesn't work in Windows for some reason. All of the rest of it does, just not the multimedia keys...
Step 1: Materials List
- Altoids Mints tin
- Adafruit Perma-Proto Quarter-sized PCB
- A Rotary Encoder
- Tactile Buttons
- Teensy 2.0
- A couple of 10K Ohm resistors
- USB cable
- Some wire
- Two M3 screws (8mm)
- Soldering Iron
- 3D Printer (Not completely necessary... I just happened to have one)
- A hand drill
- Flush Wire cutters
- Misc clamps (I used a few large binder clips, also)
Step 2: Design
Step 3: I Like Pressing Buttons.
These round tactile buttons that i ordered from Adafruit are nice, but they have a pretty big footprint. The Adafruit Perma-Proto board has a nice small footprint, but it's designed for stacking things only in one direction. I wanted to stack these buttons both ways, so I had to get a little creative and cut a few traces along the back of the board.
I'm sure there is a more elegant way of doing this, but this is what I had available to me.
Step 4: Paneling
Conversely, you could also just drill holes through the tin itself, which is what I originally tried to do, but the drill mangled the thin metal pretty harshly. I need to learn a finer touch...
I used some epoxy to attach the panel to the tin after cutting out a large enough hole to accommodate the buttons.
Attached are the SCAD files if you would like to print them.
Step 5: Insulation
Step 6: Support Group...
Again, you don't need a 3D printer for this, but man, does it make it convenient... somewhat...
I printed out two of these support "beams" (included in panel.zip in step 4) with a screw hole large enough for a couple of M3 screws.
The bowing effect is due to the print peeling off of the print bed, something that I need to work on, but does not affect this build as there is still no side-to-side flex of the PCB because the screws have such a firm hold.
With these supports made, I epoxy'd them into place on the underside of the lid, and used the same high tech clamping method as earlier. I failed to grab a picture of this step...
Step 7: Putting It All Together...
Also, it's time for a hole to be drilled for the rotary encoder to be placed into the lid of the tin (again, I forgot to snap a picture of it), you can see it vaguely here.
Step 8: USB Cord
Step 9: Wiring Continued...
Wire up all of the buttons. There are two more than were in the prototype (sixth pushbutton, and the pushbutton on the rotary encoder). I left pins 7 and 8 (D2 and D3 on the teensy) open in case I wanted another rotary encoder on a future version, and rotary encoders require a hardware interrupt pin (or that's what they tell me, I believe them. Why would they lie?), and wire the other two buttons up to pins 9 and 10 (C6 and C7 on the teensy).
Step 10: Code the Thing!
You can make the Teensy type out just about anything from a single press of a button. Also, this does not work on Windows, for whatever reason. I'm using Linux, and from what I understand it should also work on Macs, but I have not tested this case. I haven't found a whole lot on how to get it to work on Windows, but I'm not terribly worried about it, as I don't use it for anything but games, and have headphones for that. If anybody has any ideas, I would love to hear them.
Feedback is appreciated.