Introduction: (Programmable) Mechanical Keypad
I wanteed to make a keyboard for macro keys, since windows allows for multiple keyboard inputs, i figured i would make an additional keypad to use besides of my regular keyboard.
The intention was to make it programmable and working on windows bu due to time conscerns i wasn't able to implemetn that just yet.
The keyboard itself is controlled by an arduino uno, and so it requires additional listeners to control keyboard strokes on any pc.
The housing of the unit is consists of a laser-cut 3mm plywood housing and the keycaps are 3d-printed out of abs plastic.
Step 1: Making the Casing
I started by making the casing. I chose 3mm plywood as my materia of choice to make the casing out of.
This decision was made when i ordered my switches which are cherry MX blacks.
The casing itself had to have a few requirements:
- It should have 12 holes to preceisely presure fit my switches
- It should have a hole for the usb port of the arduino
- It sould be easy to reach the interns for easy maintenance
The lines on the model are 0.01mm and in full red so the laser cutter can cut it out.
So i made the following model to print out on a laser cutter
Step 2: Making the Keycaps
I have used a existing file from Thingiverse to make the keycaps.
The keycaps were printed on an UP! 3d printer ant the material i chose to print with was PLA.
I used the settings in the photo above this text so you can take a look at that.
I chose these settings after fiddeling around a bit with the printer and encountered some issues when using uther settings, so these wer the best in my opinion on the UP! 3d printer, but ofcourse on other printers, things might get different.
Step 3: Soldering the Internals
Once i was done with the printing of the keycaps and th cutting of the casing, it was time to solder everything together. I started by cutting a length of wire to each pole of the switch.
At this point i had 24 loose wires of which i solderd 1 pole of a switch to a male header to put in the arduino,
I needed to seperate a header because the gap between my two digital pin segments on my arduino was too large to fit the header in one peice.
On the other pole of the arduino i made a small board with pull up resistorsso there wer no floating voltages.
The scheme shown above is a representatation of the connection of one switch.
Step 4: Assembling the Casing
The assembly of the casing is pretty much straight-forward, The laser-cut sides inter-lock with eachother in a way that they are sturdy from themselfs. I used a tiny bit of wood glue to glue the sides and top in place.
The bottom of the unit is locked in with eight M3 screws so the internals are reachable if i wanted to.
On the bottom of the casing i glued an hinge peice with a small peice of wood that which I quickly had laser-cut. Th is so the entire unit can be angled a bit to make it:
- More stabile
- An higher angle
For the rest it was just a job of putting the keykaps on top and inserting the arduino before i screwed in the bottom and fired up the arduino program to write some quick and dirty test code.
Step 5: Arduino Coding
Although my plan was to make this a real keyboard, it stayed as a over-complicated button array for the arduino.
In the arduino program itself there is not much to see, just some serial monitor printlines which will print a letter in the serial monitor so i can see if all the connections were working fine.
Due to time-constraints it stayed that way. Possibly i will update this project in the future to make this a real programmable keyboard, but for the time being that's is all there is to it.
Underneath you can find the arduino source code which I used to test all the switches.