DIY Mechanical Macro Keypad ― Ocreeb
by salimbenbouz in Circuits > Electronics
40836 Views, 364 Favorites, 0 Comments
DIY Mechanical Macro Keypad ― Ocreeb
Ocreeb is a 12 key macro keypad with 2 rotary encoders, custom keycaps and under-glow RGB. The board is running KMK firmware on the Adafruit KB2040.
Supplies
Parts
- Ocreeb custom PCB. PCB Way
- KB 2040 board. Digikey ― Adafruit
- 12 × Diodes (SOD-123) Digikey
- 12 × Cherry MX style switches. Digikey ― Adafruit
- 12 × DSA style keycaps. Digikey ― Adafruit
- 2 × Encoders (PEC11R). Digikey ― Adafruit
- 4 × Neopixel 5050 (SK6812 or WS2812 _ 5mm × 5mm) Digikey ― Adafruit
- 4 × 0.1 µF Capacitors 0603 (1608 Metric). Digikey
- 1 × Level shifter SOT-23-5. Digikey
- 1 × 10 kOhms Resistor 0805 (2012 Metric). Digikey
- 6 × Screws (M2 × 4.5mm)
- 4 × Rubber Bumper Feet. Adafruit
Tools
- Soldering Iron
- Solder
- Flux
- 3D printer
- Screw driver
Watch the Build Video
An overview on the entire build from the design to the final assembly.
3D Printing
The 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
Soldering Components
I 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.
Firmware
Follow 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.
Assembly
I 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.
Done
As 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.