salian
Disciple
Like most power users, I use many keyboard shortcuts across various apps to improve productivity. Beyond a point remembering shortcuts gets difficult, especially on new software and when moving across Mac and Windows, so I wanted to try out a macropad.
This seems like a good beginner project; these days with 3D printing, laser cutting and PCB fabrication being easily available online or at many local places you just need to design something in software and finally integrate all of it together using basic soldering and some screws.
How many keys?
Regular macropads on the market have between 4 to 16 keys, but I was sure I wanted the number of available physical keys to be on the higher side, let's say around 20, while still keeping things much more compact than a full keyboard. The incremental cost for adding keys to a design is low, and I'm hoping the final cost for this project will be under 1500 INR. If so, on a per-key basis, this might be one of the least expensive macropads in the world.
Which microcontroller?
I had a Raspberry Pi Pico and a Seeeduino XIAO in my parts bin, so I decided to build a design based on either one of those. The Seeeduino XIAO is smaller and has modern USB-C, while the Pico is larger, has more pins, has the older micro-usb connector, but is almost 30% cheaper. I want to avoid SMD soldering, so I'm not considering a bare microcontroller.
The circuit design
Generally a keyboard has many more keys than the number of pins its microcontroller has. So instead of assigning one microcontroller pin for one key switch, the switches on a keyboard are laid out in a matrix layout, using one-way diodes such that for any m x n keyboard you only need m + n pins on the controller (plus ground). For a 20-key macropad in a 5 column - 4 row layout then I would need only 9 GPIO pins and one ground pin. Also I'd need 20 of the one-way diodes, one for each switch.
But the Raspberry Pi Pico actually has 26 GPIO (General Purpose Input-Output) pins available, which means for a 20-key macropad I don't even need to use a matrix layout. This simplifies the circuit and removes the need for one-way diodes; I can just dedicate one GPIO pin to each key, and still have a few GPIO pins left over for other uses.
So I fired up Eagle and started laying out a 20-key macropad schematic. This is the basic tutorial I followed as it's my first time using Eagle.
Because we avoided a matrix layout, this circuit is fairly simple. Even tried to put in GPIO outputs for a piezo buzzer and IIC output for an LCD display there. Not sure what or if I will end up doing anything with those at the moment, but that's a software decision for later and it doesn't add anything to the PCB cost to have those outputs.
Dedicated keys deserve dedicated keycaps
I'm designing this for 12mm tactile switches rather than MX-style switches, primarily to keep things low-cost. Those tactile switches are not the first thing that comes to mind when one says mechanical but these are really affordable, tactile and mechanical switches, and this macropad is not something intended for touch-typing on at furious speeds.
Another major reason for selecting these is that their "flat-with-a-hole" keycaps should be much easier to customize and print on a resin 3D printer as compared to the usual MX-compatible keycaps.
I also designed a resin-printable flat-top profile based on DSA dimensions (so, DFA profile?) MX keycap, with a view to using conventional Cherry MX clone switches. Looking at the STL though it feels it would be quite the effort to support, finish and replicate for 20+ keys.
I could probably figure out a way to print just the legends and design some silicone casting mold with a removable top to make life easier if I chose to go this route. But those 12 mm tactile switches with their flat keycaps look simpler to customize.
Hopefully in the next update, PCB design and fabrication.
This seems like a good beginner project; these days with 3D printing, laser cutting and PCB fabrication being easily available online or at many local places you just need to design something in software and finally integrate all of it together using basic soldering and some screws.
How many keys?
Regular macropads on the market have between 4 to 16 keys, but I was sure I wanted the number of available physical keys to be on the higher side, let's say around 20, while still keeping things much more compact than a full keyboard. The incremental cost for adding keys to a design is low, and I'm hoping the final cost for this project will be under 1500 INR. If so, on a per-key basis, this might be one of the least expensive macropads in the world.
Which microcontroller?
I had a Raspberry Pi Pico and a Seeeduino XIAO in my parts bin, so I decided to build a design based on either one of those. The Seeeduino XIAO is smaller and has modern USB-C, while the Pico is larger, has more pins, has the older micro-usb connector, but is almost 30% cheaper. I want to avoid SMD soldering, so I'm not considering a bare microcontroller.
The circuit design
Generally a keyboard has many more keys than the number of pins its microcontroller has. So instead of assigning one microcontroller pin for one key switch, the switches on a keyboard are laid out in a matrix layout, using one-way diodes such that for any m x n keyboard you only need m + n pins on the controller (plus ground). For a 20-key macropad in a 5 column - 4 row layout then I would need only 9 GPIO pins and one ground pin. Also I'd need 20 of the one-way diodes, one for each switch.
But the Raspberry Pi Pico actually has 26 GPIO (General Purpose Input-Output) pins available, which means for a 20-key macropad I don't even need to use a matrix layout. This simplifies the circuit and removes the need for one-way diodes; I can just dedicate one GPIO pin to each key, and still have a few GPIO pins left over for other uses.
So I fired up Eagle and started laying out a 20-key macropad schematic. This is the basic tutorial I followed as it's my first time using Eagle.
Because we avoided a matrix layout, this circuit is fairly simple. Even tried to put in GPIO outputs for a piezo buzzer and IIC output for an LCD display there. Not sure what or if I will end up doing anything with those at the moment, but that's a software decision for later and it doesn't add anything to the PCB cost to have those outputs.
Dedicated keys deserve dedicated keycaps
I'm designing this for 12mm tactile switches rather than MX-style switches, primarily to keep things low-cost. Those tactile switches are not the first thing that comes to mind when one says mechanical but these are really affordable, tactile and mechanical switches, and this macropad is not something intended for touch-typing on at furious speeds.
Another major reason for selecting these is that their "flat-with-a-hole" keycaps should be much easier to customize and print on a resin 3D printer as compared to the usual MX-compatible keycaps.
I also designed a resin-printable flat-top profile based on DSA dimensions (so, DFA profile?) MX keycap, with a view to using conventional Cherry MX clone switches. Looking at the STL though it feels it would be quite the effort to support, finish and replicate for 20+ keys.
I could probably figure out a way to print just the legends and design some silicone casting mold with a removable top to make life easier if I chose to go this route. But those 12 mm tactile switches with their flat keycaps look simpler to customize.
Hopefully in the next update, PCB design and fabrication.