Skip to the content
PCBKitNew board
2 layers100 × 100 mmKSP MacroPad, the printed circuit board in 3D

KSP MacroPad repo for the HackClub stardance project

Size
100 × 100 mm
Copper layers
2
Thickness
1.6 mm
Parts
71
Nets
61
Pads
251
Tracks, vias
712, 43
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
24 Jun 2026
Updated
29 Sep 2026

Overview

KSP MacroPad is an open-source printed circuit board by MintyTheCoder, from the MintyTheCoder/KSP-MacroPad repository on GitHub. It is a 2-layer board of 100 × 100 mm with 71 parts on 61 nets, routed with 712 tracks and 43 vias.

It is built around the SK6812MINI-E. Its parts include 36 diodes, 17 switches, 9 resistors, 1 capacitor and 1 IC. It belongs with the keyboards and input boards of this library.

Main components

1

README

README.md

KSP MacroPad

A custom macropad built for Kerbal Space Program, made for Hack Club's Stardance Challenge.

16 macro keys and 2 rotary encoders on a custom PCB, driven by a Seeed XIAO RP2040. The keys don't send keystrokes. They trigger full flight procedures (launch, gravity turn, circularize, rendezvous, suicide burn, an interplanetary autopilot) that a companion KSP mod runs inside the game. The mod talks to the pad over USB serial, and sends state back for per-key RGB LEDs, underglow, and a 128x32 OLED.

The key matrix is read through a resistor ladder on 4 ADC pins instead of 8 GPIO pins, which is what makes everything fit on the XIAO's 11 pins.

Assembled macropad

Hardware

  • Seeed XIAO RP2040
  • 16 MX switches in a 4x4 grid (20 mm pitch), read as an analog matrix on A0 to A3
  • 2 EC11 rotary encoders (left on D10/D9, right on D7/D8)
  • 20 SK6812 MINI-E RGB LEDs on D6: 16 per-key backlights and 4 underglow
  • 0.91" SSD1306 128x32 OLED over I2C (SDA D4, SCL D5)
  • 100 x 100 mm 2-layer PCB
  • 3D-printed case tilted 7°, with the plate held on by magnets
SchematicPCB routing
PCB frontPCB back

How the analog matrix works

A normal 4x4 matrix needs 8 pins, and after the encoders, OLED and LEDs there were only 4 left. So each pin carries two lines:

  • A2 and A3 each drive two column lines, one straight and one through a 10k resistor.
  • A0 and A1 each read two row lines, one straight and one through a 16k resistor, into a 10k pulldown.

The firmware drives one column pin high at a time and reads both row pins. A pressed key puts one of four voltages on its row pin depending on which resistors are in its path:

Column pathRow pathRow pin voltage
10k16k0.70 to 0.82 V
direct16k0.98 to 1.13 V
10kdirect1.28 to 1.45 V
directdirect2.62 to 2.85 V

Those ranges cover 1% resistors across the full 1N4148 diode drop range, and every band has at least 0.15 V of margin to the next, so all 16 keys decode reliably.

Case

Case

Exploded view

  • The board and plate are rotated 7° as one rigid unit on a wedge floor. The bottom stays flat on the desk.
  • The plate sits at the MX standard 5.0 mm above the PCB, with 14 mm switch cutouts.
  • The encoders come through round holes in raised collars, and the OLED window matches the screen glass.
  • The PCB mounts on 3 standoffs with M3 heat-set inserts. The standoffs are perpendicular to the board, with relief notches where parts on the back of the board sit close.
  • The plate is held on by 3 pairs of 4 mm magnets, so there are no screws on top.
  • The USB-C opening is sized for the plug body and lines up with the tilted connector.
  • Underglow notches wrap each corner so the LED light reaches the desk.
  • Overall size: 110.4 x 109.8 x 34.2 mm.

The case is fully parametric in CAD/ksp_macropad_case.scad, and it was checked for interference against the real board's STEP model.

Key Layout

IDMacroIDMacro
0x00Launch sequence0x08Docking prep
0x01Auto gravity turn0x09Landing prep
0x02Circularize0x0ASuicide burn arm (hold 1 s)
0x03Time warp to next event0x0BPrecision input toggle (encoder mode 2)
0x04Intercept0x0CTransmit science
0x05Orbit sync0x0DResource monitor
0x06Rendezvous prep0x0EAuxiliary toggle (encoder mode 3)
0x07Deorbit burn0x0FAutopilot

Macros that fly the vessel queue up: press CIRCULARIZE while AUTO GRAVITY TURN is still flying and it starts as soon as the turn finishes. The OLED shows the active macro and what's queued next.

Encoder modes

ModeLeft encoderRight encoder
1: NormalThrottleTime warp
2: PrecisionTarget throttle %Target heading
3: AuxiliaryCamera zoomRCS thrust limit %

The KSP Mod

The mod (mod/KSPMacropad) is a C# plugin for KSP 1.12. It:

  • finds the pad automatically by listening for its hello packet on every COM port, and reconnects if it's unplugged
  • runs all the macros, including a Lambert-solver transfer planner for AUTOPILOT and a closed-loop suicide burn
  • drives every key LED and the underglow from live game state (resources, comms, upcoming maneuver nodes, time warp)
  • detects MechJeb, Principia, FAR and Kerbalism, and disables the macros that would conflict with them

To install it, build the project in Visual Studio (.NET Framework 4.8) and copy KSPMacropad.dll into GameData/KSPMacropad/Plugins/. Optional settings go in KSPMacropad.cfg next to the DLL:

text
port = COM5
allow_with_mechjeb = true

Serial Protocol

The firmware turns on a second USB CDC data port (in boot.py) alongside the REPL console.

Pad to mod (6 bytes): [0x44, type, id, data_hi, data_lo, 0x77]

  • type 0x01: key press, id = key ID
  • type 0x02: encoder turn, id = (mode << 4) | encoder (1 = left, 2 = right), data = signed 16-bit detent steps
  • type 0x03: hello, sent every second so the mod can find the right port
  • type 0x04: resync, asks the mod to resend every LED state after a lost connection

Mod to pad (5 bytes): [0x77, id, state, data, 0x44]

  • 0x00 to 0x0F: key LED state
  • 0x10 to 0x13: underglow state
  • 0x14: heartbeat (the pad shows NO CONN after 3 s without one)
  • 0x15: live throttle %
  • 0x16: live warp rate, as data x 10^(state & 0x0F), with bit 7 of state set for physics warp
  • 0x17 to 0x19: active macro, next queued macro, queue length

LED state values are defined in led_states.py (firmware) and LEDStates.cs (mod), and the two have to stay in sync.

Flashing the Firmware

  1. Install CircuitPython on the XIAO RP2040.
  2. Copy these libraries from the Adafruit CircuitPython bundle into CIRCUITPY/lib/:
    • neopixel
    • adafruit_display_text
    • adafruit_displayio_ssd1306
  3. Copy boot.py, code.py and led_states.py from Firmware/ to the root of CIRCUITPY.
  4. Power-cycle the board (not just a soft reload) so boot.py can turn on the USB data port.

Bill of Materials

QtyPartReferenceNotes
1Seeed XIAO RP2040U1
16MX switchesSW1 to SW16
16DSA 1U keycaps
161N4148 diodes, through-holeD1 to D16
20SK6812 MINI-E RGB LEDsLED1 to LED20reverse mount
2EC11 rotary encoders, 20 mm shaftENCDR_LEFT1, ENCDR_RIGHT1
10.91" 128x32 SSD1306 OLED, I2CS1pinout GND, VCC, SCL, SDA
1100 µF electrolytic capacitorC1LED supply
210k resistor, 1%R2, R4matrix columns
216k resistor, 1%R5, R7matrix rows
410k resistorR9 to R12ADC pulldowns
1300 Ω resistorR13LED data line
3M3 x 16 mm screwsPCB to case
3M3 x 5 x 4 mm heat-set inserts
64 x 1 mm disc magnetsplate retention, glued in pairs
1PCBproduction/gerbers.zip
1Case bottom, 3D printedproduction/case_bottom.stl
1Top plate, 3D printedproduction/case_top_plate.stl

Repository Layout

  • CAD/: OpenSCAD case source, case STEP files, and the full assembled STEP
  • PCB/: KiCad 10 project, board STEP, and footprint/3D model libraries
  • Firmware/: CircuitPython firmware
  • mod/: KSP C# plugin
  • production/: gerbers, printable case STLs, and the firmware files
  • images/: renders and screenshots

Tools

  • KiCad 10
  • OpenSCAD
  • CircuitPython
  • Visual Studio
  • Kerbal Space Program

Parts

71
QtyValueFootprintReferences
20SK6812MINI-Emade-for-macro:SK6812MINI-E_fixedLED1, LED2, LED3, LED4, LED5, LED10, LED11, LED12, LED13, LED14, LED15, LED16, LED17, LED18, LED19, LED20 +4
16DDiode_THT:D_DO-35_SOD27_P7.62mm_HorizontalD1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15, D16
16SW_Pushai03-2725 MX_V2 main MX_Solderable:MX-Solderable-1USW1, SW2, SW3, SW4, SW5, SW6, SW7, SW8, SW9, SW10, SW11, SW12, SW13, SW14, SW15, SW16
610kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2, R4, R9, R10, R11, R12
3MountingHole_3.2mm_M3MountingHole:MountingHole_3.2mm_M3SCRW1, SCRW2, SCRW3
216kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR5, R7
2NetTie_2NetTie:NetTie-2_SMD_Pad0.5mmNT1, NT2
2RotaryEncoder_SwitchRotary_Encoder_hp:RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mmENCDR_LEFT1, ENCDR_RIGHT1
1100Capacitor_THT:CP_Radial_D6.3mm_P2.50mmC1
1300Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR13
1MOUDLE-SEEEDUINO-XIAOSeeed-Studio-XIAO-series:XIAO-Generic-Hybrid-14P-2.54-21X17.8MMU1
1~made-for-macro:SSD1306-0.91-OLED-4pin-128x32S1

Questions

How big is the KSP MacroPad PCB?

It measures 100 × 100 mm and has 2 copper layers, 1.6 mm thick.

What parts does the KSP MacroPad use?

71 parts, built around the SK6812MINI-E. 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.

Where can I download the KSP MacroPad KiCad files?

From the MintyTheCoder/KSP-MacroPad repository on GitHub, at the commit this page was made from: the board is design/KSPMacroPad/KSPMacroPad.kicad_pcb and its schematic PCB/KSPMacroPad.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the KSP MacroPad design in my own project?

Its repository states no licence, so its author keeps all rights: ask MintyTheCoder before reusing the design.

Similar boards

  • 4 layers234 × 84 mmMain panel, the printed circuit board in 3D

    Main panel

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    234 parts3kApache-2.0
  • 4 layers180.8 × 300.3 mmDilemma, the printed circuit board in 3D

    Dilemma

    Bastardkb/Dilemma

    The Dilemma is a vertical stagger low-profile keyboard with mods.

    383 parts590
  • 4 layers48 × 32 mmFlatSat, the printed circuit board in 3D

    FlatSat

    Pwnsat/FlatSat

    Flatsat v1.0 is a hardware based platform for aerospace cybersecurity research

    106 parts575GPL-2.0
  • 2 layersDemo, the printed circuit board in 3D

    Demo

    adamws/kicad-kbplacer

    KiCad plugin for automatic keyboard's key placement and routing

    48 parts547GPL-3.0
  • 2 layers97 × 78.5 mmDumbpad, the printed circuit board in 3D

    Dumbpad

    imchipwood/dumbpad

    Simple 4x4 numpad with rotary encoder. Powered by QMK via ATmega32u4 Pro Micro

    62 parts517GPL-2.0
  • 4 layers82.5 × 39.4 mmV4head, the printed circuit board in 3D

    V4head

    makerforgetech/modular-biped

    An open source framework for creating a bipedal modular companion robot.

    26 parts493GPL-3.0
  • 2 layers115.7 × 95.7 mmFifi split keeb, the printed circuit board in 3D

    Fifi split keeb

    raychengy/fifi_split_keeb

    Fifi Keyboard 🐶 ⌨️

    66 parts334
  • 4 layers70 × 54 mmPicoLab, the printed circuit board in 3D

    PicoLab

    CoretechR/PicoLab

    Web-GUI Embedded Multitool

    285 parts327GPL-3.0