
Encoder
byrantech/laptop
anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

A custom MIDI keypad PCB that combines hardware design and music technology. Featuring mechanical switches, sliders, rotary encoders, NeoPixels, and capacitive touch to create a personalized MIDI controller for interactive music production.
KeySync is an open-source printed circuit board by ZaraeQurashi, from the ZaraeQurashi/KeySync repository on GitHub. It is a 2-layer board of 106 × 121.5 mm with 7 parts on 16 nets, routed with 58 tracks and 0 vias.
Its parts include 3 switches, 1 IC and 1 connector. It belongs with the audio and music boards and the ESP32 boards of this library.
A custom-built MIDI controller inspired by Undertale, featuring seven heart-shaped capacitive touch keys, two mechanical pushbuttons, and a rotary encoder.
KeySync combines custom PCB design, programming, and game inspired aesthetics to create a unique musical device. The heart-shaped touch pads are inspired by the 7 SOULS from the game UNDERTALE, giving the controller a recognizable design while serving as its main musical input.
KeySync started as an idea for a custom MIDI controller that would combine my interests in electronics, programming, and video games. Instead of using a standard keyboard layout, I wanted to design something with a distinct appearance that reflected the games that inspired it.
The project involved designing the circuit in KiCad, arranging components on a custom PCB, creating heart-shaped copper electrodes for the touch keys, routing the board, developing the firmware, and documenting the parts required to build it.
One of the main goals was to make the controller visually interesting while still keeping the controls practical. The seven touch keys provide the main musical input, the mechanical pushbuttons add two extra notes, and the rotary encoder provides a convenient way to control system volume.
| Category | Details |
|---|---|
| Project name | KeySync |
| Project type | Custom MIDI controller |
| Microcontroller | Seeed Studio XIAO ESP32-S3 |
| PCB design software | KiCad |
| Firmware language | Python |
| Firmware environment | CircuitPython |
| Keyboard framework | KMK |
| Main inputs | 7 capacitive touch pads |
| Additional inputs | 2 mechanical pushbuttons |
| Encoder | 1 rotary encoder |
| Design inspiration | UNDERTALE |
KeySync is built around the Seeed Studio XIAO ESP32-S3 microcontroller. The board acts as the controller for the inputs and runs the firmware that determines how the device responds to them.
The hardware consists of three main input groups.
The seven heart-shaped electrodes are the main controls on KeySync. They are designed to detect touch and correspond to individual notes in a C-major scale.
Unlike a mechanical switch, a capacitive touch key doesn't require a physical contact to close a circuit. Instead, the sensing system detects a change in capacitance when a finger approaches or touches the electrode.
KeySync also includes two low-profile mechanical pushbuttons. These provide additional physical inputs that can be used alongside the touch keys.
The firmware assigns each button a separate drum note, allowing them to trigger additional sounds or percussion samples in compatible MIDI software. The buttons use GPIO inputs configured with pull-ups, with the inputs changing state when the buttons connect their respective pins to ground.
The rotary encoder provides a control that can be turned in either direction. In the current firmware configuration, it is intended to adjust the computer's system volume.
The PCB was designed in KiCad. After completing the schematic, I moved on to arranging the components, creating the board outline, designing the custom heart-shaped electrodes, and routing the electrical connections.
The schematic defined the electrical connections between the microcontroller and the various inputs. Once the schematic was ready, I transferred the components into the PCB layout and began arranging them to fit the board.
During this stage, I encountered footprint sizing issues and had to adjust an oversized footprint to fit the available space. I also revised some schematic connections and custom footprint pad numbers to make sure the PCB layout matched the intended electrical connections.
This reinforced the importance of checking the physical dimensions of components and the electrical mapping of their pads.
After settling on the component placement, I routed the PCB using both copper layers.
Using both layers helped organize the traces and make better use of the available board space.
The firmware is configured to map the seven touch keys to a C-major scale, the two mechanical buttons to drum notes, and the rotary encoder to system volume control.
| Touch key | MIDI note number | Intended note |
|---|---|---|
| Heart 1 | 60 | C4 |
| Heart 2 | 62 | D4 |
| Heart 3 | 64 | E4 |
| Heart 4 | 65 | F4 |
| Heart 5 | 67 | G4 |
| Heart 6 | 69 | A4 |
| Heart 7 | 71 | B4 |
| Button | MIDI note number | Intended use |
|---|---|---|
| Button 1 | 36 | Drum/percussion trigger |
| Button 2 | 38 | Drum/percussion trigger |
| Control | Function |
|---|---|
| Rotary encoder | Increase or decrease computer system volume |
| Communication method | Media-key commands in the current firmware design |
The firmware is written in Python using CircuitPython and KMK. It handles input scanning, maps the controls to their intended functions, and provides the logic needed for the controller to respond to touches, button presses, and encoder movements.
The code is organized around several main responsibilities:
Touch sensing: Reads the state of the seven capacitive touch inputs and detects changes between touched and untouched states.
Button scanning: Reads the two mechanical pushbuttons and determines when they are pressed or released.
Key mapping: Associates each touch key and pushbutton with its assigned MIDI note.
Encoder controls: Reads the rotary encoder and triggers the appropriate system volume command.
The following GPIO assignments are from the current firmware configuration.
| Control | GPIO pin |
|---|---|
| Capacitive touch key 1 | GPIO3 |
| Capacitive touch key 2 | GPIO4 |
| Capacitive touch key 3 | GPIO5 |
| Capacitive touch key 4 | GPIO6 |
| Capacitive touch key 5 | GPIO7 |
| Capacitive touch key 6 | GPIO8 |
| Capacitive touch key 7 | GPIO9 |
| Mechanical pushbutton 1 | GPIO43 |
| Mechanical pushbutton 2 | GPIO44 |
| Rotary encoder signal A | GPIO1 |
| Rotary encoder signal B | GPIO2 |
The seven touch keys are intended to send MIDI note events corresponding to the C-major scale. Touching a key triggers a Note On event, while releasing it triggers a matching Note Off event.
The two mechanical pushbuttons are assigned to notes 36 and 38 for percussion.
Developing KeySync involved more than creating a circuit board. Some of the most important work happened while adapting the firmware and making sure the software matched the hardware.
Creating the PCB required me to design custom heart-shaped electrodes, fit the components within the board outline, fix an oversized footprint, and revise pad numbers and connections. Routing the switches and touch keys across two copper layers also required careful planning.
These challenges taught me to check both the physical and electrical sides of a design. A footprint can look correct on screen but still be unsuitable for the actual component, and an attractive layout is not useful if the pads do not connect to the intended signals.
I initially explored an Arduino-based firmware approach and encountered compatibility problems involving USB MIDI classes, MIDI event types, and capacitive touch functions. I eventually moved to CircuitPython and KMK, which meant adapting the implementation instead of simply transferring the earlier code.
This taught me that code written for one development environment does not automatically work in another. Microcontroller features, library APIs, and USB support can differ significantly between boards and programming environments.
KeySync brought together my interests in electronics, programming and gaming into one custom MIDI controller inspired by UNDERTALE. From designing the PCB and seven heart-shaped capacitive touch keys in KiCad to developing the CircuitPython/KMK firmware, creating the BOM, and documenting everything on GitHub, I gained hands-on experience with both hardware and software. Although troubleshooting firmware compatibility was challenging, it taught me to approach problems systematically and consider how every part of a project works together. Overall, KeySync helped me better understand the process of turning an idea into a custom electronic device.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | LOGO | LOGO | G***, G*** |
| 2 | SW_Push | Hackclub Footprints:Kailh Choc Low-Profile Switches | SW1, SW2 |
| 1 | Conn_01x07 | Zarae's Library:Capacitative Keys Heart | J1 |
| 1 | RotaryEncoder_Switch_MP | Rotary_Encoder:RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm | SW3 |
| 1 | XIAO-ESP32-S3 | Hackclub Footprints:XIAO ESP32-S3 | U1 |
It measures 106 × 121.5 mm and has 2 copper layers, 1.6 mm thick.
7 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the ZaraeQurashi/KeySync repository on GitHub, at the commit this page was made from: the board is PCB/Keysync.kicad_pcb and its schematic PCB/Keysync.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask ZaraeQurashi before reusing the design.

byrantech/laptop
anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.



AxxAxx/AxxSolder
STM32 Based soldering station for JBC cartridges, 9-24 VDC and USB-PD power


jamro/tiny-engineer
A small desktop robot that brings an AI coding assistant to life, physically acting out when it reads files, thinks, writes code, and finishes work.

hoglet67/RGBtoHDMI
Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI
