DIY Mechanical Macro Keypad ― Ocreeb

by salimbenbouz in Circuits > Electronics

35979 Views, 350 Favorites, 0 Comments

DIY Mechanical Macro Keypad ― Ocreeb

DIY Macro Keypad Build from Scratch with PCB and Custom Keycaps

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

Sequence 01.gif
001_parts_002.gif

Parts

Tools

  • Soldering Iron
  • Solder
  • Flux
  • 3D printer
  • Screw driver

Watch the Build Video

DIY Macro Keypad Build from Scratch with PCB and Custom Keycaps

An overview on the entire build from the design to the final assembly.

3D Printing

002_3d_printing.gif
002_3d_printing_002.gif

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

003_soldering.gif
003_soldering_002.gif

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

004_firmware_002.gif
004_firmware.gif

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

005_assembly.gif
005_assembly_002.gif
005_assembly_003.gif
005_assembly_004.gif
005_assembly_005.gif

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

reveal_001.gif
Artboard 1.png

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.