6-key USB Keypad
We calculate the final price from your selected file. You review and accept it before payment.
Saved on this device.
A 2×3 USB keypad for typing characters not typically found on keyboards
- Rating
- 0 / 5
- Likes
- 11
- Downloads
- 45
- Makes
- 0
- Views
- 488
- Reviews
- 0
Updated at source:
Model information
- Source
- Printables
- Category
- Computers
- License
- Creative Commons — Attribution
I've been developing OpenSCAD code to generate functional parametric keyboards and keypads. This is the first practical application to come out of that.
Here's what it looks like in action. It's attached to a Lenovo laptop and I'm typing in a LibreOffice document.
Non-printed Parts
The non-printed parts for this are:
- an Adafruit Trinket M0 microcontroller
- six tactile switches (6mm wide × 5mm high, with 3mm leads, Adafruit 367 or equivalent)
The switches sit in recesses within the base, with their leads sticking out the bottom. The microcontroller rests on 4 pegs inside the box. You'll also need some hookup wire to connect the two.
Printing
Everything can be printed in PLA at 0.2mm layer height. The key markings are recessed by 0.4mm, so doing a filament change at 0.4mm and 0.6mm will give the keys contrasting text.
Wiring the Switches
The switches have 4 leads, 2 each for each side of the connection. When placed in the base, the left and right sides of the switch should represent either side of the connection.
Wire one side of each of the 3 left switches together. Do the same for the right switches. These will be your 2 column wires. Connect these to pins A3 and A4 on the Trinket.
Wire the other side of the switches in side-by-side pairs. These will be your 3 row wires. Connect these to pins A0, A1 and A2 of the Trinket.
For example, I've got the left column connected to A4, the right column to A3, and the top, middle and bottom rows to A1, A2 and A0 respectively. It doesn't really matter what order you put them in, as long as the Arduino code matches the connections (lines 39,40 of the .ino file)
Programming
The code supplied here emulates a USB keyboard and generates Alt sequences for typing special characters. NOTE: This only works for Windows machines. The key sequences for Linux, Chromebook and Mac machines are completely different.
Also, the Alt sequences tend to work better if numlock is on. I've updated the code to toggle numlock if the bottom 2 keys are pressed at the same time. This can come in handy if you're hooked up to a laptop that doesn't have a numlock key.
Lines 30-35 define the Alt sequence for each key. When a key is pressed, the microcontroller sends out an Alt key down, followed by 3 or 4 keystrokes on the numpad, followed by an Alt key up. Some Alt sequences require only 3 numpad keystrokes; an X for the fourth key can be used as a do-nothing placeholder.
The Arduino IDE should handle the code with too much trouble. You'll probably need to have it download a bunch of libraries and board profiles, though.
With a few changes to the Arduino code, it can be repurposed to work with non-Windows machines, or for use as a macro pad.
Assembly
There are no fasteners involved. Everything is friction-fit. If the keys feel a bit loose, you can add a drop of glue to hold them onto the spring layer.
Once the base and Trinket are wired up, push them into the bottom of the box, with the Trinket sitting on the 4 pegs. It's a bit fiddly to get the Trinket in place, especially once it's wired up.
Attach the keys to the spring layer, then push that onto the base.
Push the cover on top of the spring layer.
Usage
It should just work. After it's been programmed, the keypad should be usable by any Windows PC.