The MiRage Keyboard by Zack Freedman Is a DIY 3-in-1 Contraption with Several Interesting Functions
The MiRage can be used as a normal keyboard, split in half for more natural hand layouts, or used only with its right half as a stream deck
Idea for the MiRage
Over the past several years, mechanical keyboards have ballooned in popularity due to their stiff, "clacky" feel and for the myriad of ways they can be customized. Additionally, many companies have cropped up for the express purpose of selling custom, high-end boards, although they tend to be very expensive. YouTuber Zack Freedman also wanted to make his own DIY keyboard that would not only be cheaper, but have the ability to take the form of three total layouts. The first layout is essentially a normal 60% keyboard (a keyboard without the number pad and arrow/page keys). From here, it can be split into two halves for a more ergonomic layout. And finally, the third form is using only the right half as a livestreaming control pad.
Gathering the necessary hardware
To make this project, Freedman needed components that were simultaneously cheap, easy-to-use, and at a high enough quality compared to other normal mechanical keyboards. For a microcontroller, he settled on the Xiao RP2040 module from Seeed Studio due to its low profile, USB-C port, and simply programming methods because of its CircuitPython integration, which allows for new programs to be dragged and dropped onto the device when it's attached to a host PC. As for the switches themselves, Freedman opted for Kailh Choc switches because of their lower price and profile, unlike the more common ones from Cherry.
To sense when a key is pressed, each switch is connected to an IO multiplexer. This method was chosen over the traditional matrix scanning and diode solution to reduce complexity and component count. Finally, three 128x64 OLED modules were added, along with a pair of momentary pushbutton switches, to add user-programmable buttons that can be set to run programs or switch scenes whilst livestreaming.
The PCB
The PCB for this project understandably took a while to produce because of all the required components and strict layout. The circuit board was also designed to snap in half with the use of "mouse bites" which are little perforated tabs that allow the board to snap cleanly into smaller pieces. This technique also lets the board get tested as a single unit, further reducing complexity. Each half comes with a 3.5mm jack that carries power and I2C data between the two halves in the event they are separated, as only the right half contains the control circuitry.
Squashing a few bugs
Even though Freedman's first prototype turned out quite well, there were still a few problems with the design. First, the I/O expander circuit's VSS and VDD pins were swapped, meaning that power was being provided to the ground rail and ground was connected to the voltage rail. This forced Freedman to scrape away the incorrect traces and add jumper wires between the correct pins. Two smaller errors included not pulling up the reset lines and placing screws under the bottom row of keys that prevented them from being pressed down all the way.
Uploading some firmware
The firmware for the keyboard was written in CircuitPython to make it easier to program and parse the keybinding files. At a basic level, the keyboard will read keymap files and associate certain keypresses with either a symbol or a macro that expands to a series of other keypresses/functions. You can look at Freedman's code more closely here in the MiRage's GitHub repository.
Fabricating a keyboard body
With the electronics mostly completed, it was then time to build the keyboard's chassis. Designed in Fusion 360, the base is made from a pair of 3D-printed PLA shells that had a series of brass inserts added to make assembly and disassembly more durable compared to plastic alone. The right side also has three special cutouts for adding the OLED buttons.
How did it turn out?
In its current state, the keyboard is slightly buggy and slow, although the potential for expansion is great. Freedman plans on making a second board revision soon to fix these problems and perhaps add even more features. You can watch his build/demonstration video here on YouTube.