Budget Macropad

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.

1667202015875.png


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.
1667204717921.png

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.

3d4d372e-cd77-40f5-8160-f8cbbb9bfa98.jpeg
9b3b0ec3-f4cc-45d0-a93d-ff13bdceb58f.jpeg
4122195e-0e46-4784-ad7a-e6db1e88b01b.jpeg


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.

1667213588939.png
 
I placed the order at JLCPCB.com, which is a budget PCB fabrication service in Shenzen. They have a minimum order quantity of five units.

Waiting for the PCBs

Meanwhile I used Autodesk Fusion 360 to mock up how the assembled PCB might look, and to explore some case ideas.

Blown.jpg
blown-2.png


3D Rendering of Assembled PCB
79237415-54bc-4548-9ed5-9c969365129b.PNG


Case_2022-Nov-28_07-21-04AM-000_CustomizedView23905310754.png
Case_2022-Nov-28_07-22-24AM-000_CustomizedView4208423262.png


Case_2022-Nov-28_06-10-12AM-000_CustomizedView33526596074.png
Case_2022-Nov-28_06-07-22AM-000_CustomizedView13833990601.png


This is a case designed for FDM printing with PLA, however it does not show-off the underlighting capability of this macropad.

Designing a Case for Underlighting

I had designed in a single RGB LED on the underside of the board, intended as a sort of dim under-light. Not being confident enough about voltage requirements for multiple RBG lights and wanting to wrap up the PCB layout soon without breadboarding it, I just placed a single W2812B "neopixel" LED in the centre of the board. To show off the underlight the case would need to have a transparent underside, which is not feasible with FDM 3D printing. One way would be to pressure-cast clear resin in a silicone mold, but that's a lot of money and effort for a one-off case. So it would have to be acrylic or SLA (resin 3D printed). Resin printing a large hollow structural case would come with its own challenges, and I'm not too keen on the acrylic sandwich design for keyboard cases.

PCB Assembly

I received the prototype PCBs via IndiaPost around 20 days later, albeit with some extra delay and 10% Duty + 28% IGST charges courtesy the Customs department. JLCPCB did a great job with the fabrication.

PCB.jpg


Started off assembly with the tiny SMD RGB LED. Lots of flux really helps with tiny SMD components. After soldering it on and testing it with a Pico, I covered it in globs of clear two-part epoxy to ensure the mechanical strength of the joint. I did the same around the Pico's Micro-USB port. This should help prevent it from breaking off if extra force is applied while inserting the keyboard cable.

smd.jpeg
pico-usb-epoxy.jpg


Assembling the switches was a bit tedious and repetitive. I can only imagine how it must feel to solder 104 key switches on full-sized keyboards!
Sorry for the 'video' quality; had to convert it to tiny GIFs to meet forum restrictions. Remember to heat the switch leg and not the solder.


assemble-switch-resized.gif
solder-switch-resized.gif


The PCB after assembly with tactile switches and caps - does it look similar to the mockup?


assembled-1.jpg
assembled-2.jpg


Hopefully in the next update, case assembly and firmware programming in circuitpython.
 
Last edited:
Back
Top