I was gifted a productivity console for my birthday and it inspired me to make my own macro keypad with some special features. It was my first custom PCB experience and I really enjoyed the entire process.
Step 1: Watch the Build VideoStep 2: 3D PrintingThe bottom plate is printed in transparent PETG to refract the under-glow RGB and give the macropad a floating look. I used matte black PLA for the remaining enclosure and 2 knobs.
You can get the STLs from Thingiverse or from the project repo on Github.
Step 3: Soldering ComponentsI started with the bottom side of the PCB. Soldering the diodes, Neopixels, capacitors, level shifter, resistor and of course the KB2040.
The smaller components can seem very intimidating at first. Use flux on the pads to tack them in place first before adding a tiny bit of solder. I found that it works great this way.
Lastly add both encoders to the board from the other side and solder them.
DO NOT solder the switches during this step.
Step 4: FirmwareFollow this guide from Adafruit to install CircuitPython first.
Once the board mounts again, we can drag the content of the Firmware folder to it.
⚠️ Comment out everything in the boot.py file temporary while testing the board to not lock your self out.
# import supervisor
# import board
# import storage
# import usb_cdc
# from digitalio import DigitalInOut, Direction, Pull
# supervisor.set_next_stack_limit(4096 + 4096)
# row = DigitalInOut(board.D7)
# col = DigitalInOut(board.D6)
# row.direction = Direction.INPUT
# col.direction = Direction.OUTPUT
# row.pull = Pull.DOWN
# col.value = True
# if not row.value:
# storage.disable_usb_drive()
# usb_cdc.disable()
If everything worked out the 4 Neopixels will light up after you restart the board.
The macros, key map and layers are all defined in code.py you can customize to your needs. Here is all the references and key codes in this documentation KMK docs.
I used a pair of tweezers to trigger the keys from the pads while testing.
Once we're happy with macros we can remove the comments from the boot file to hide the CircuitPython drive.
To mount it and access the code again, we keep the top right key (the lock key in my map) pressed during boot.
Step 5: AssemblyI started by placing the switches in the plate in the right orientation. They will snap in place pretty snuggly.
We can now solder them from the other side and secure the PCB with the 6 x M2 screws.
Add the bottom plate, knobs (after the bottom plate) and key caps.
Add the Rubber Bumper Feet to the bottom.
⚠️ Keep the bottom plate in place while pressing the encoder switches or placing the knobs on the shafts.
Since the board is screwed to the top part you can easily snap the screw posts when actuating the encoder switches without any support.
Step 6: DoneAs a finishing touch I did the keycaps legends in Dye-sub, checkout the video for more details. You might not want to commit to permanent legends if you're planning on changing the macros frequently.
Feel free to ask any questions. I will do my best to reply.
Comments