Theme
๐Ÿ› ๏ธ DIY Electronics ยท Build Guide

Build Your Own
Macropad

Custom PCB ยท 6 Keys ยท 2 Knobs ยท RGB Lighting ยท 3D Printed Case

RP2040 Pico KiCad PCB QMK Firmware 3D Printed Case
Progress 0 / 0 tasks
0%
โ†“ SCROLL TO START
โฑ๏ธ Your Schedule
How many days do you have?
Drag the slider โ€” the entire guide reschedules instantly
15
Days Total
Quick Pick:
3 days (Sprint) 15 days (Default) 30 days (Relaxed)
๐ŸŽจ Design &
Planning
Days 1โ€“3
๐Ÿ”Œ PCB Layout
& Order
Days 4โ€“6
โณ Case Design
& Firmware Prep
Days 7โ€“9
๐Ÿ”ง Assembly
& Soldering
Days 10โ€“12
๐Ÿ’ป Firmware
& Final Assembly
Days 13โ€“15
โœ… Standard 15-day guide โ€” one comfortable session per day.

๐Ÿ“‹ Build Overview

โŒจ๏ธ
Keys
6 Keys
๐ŸŽ›๏ธ
Encoders
2 Knobs
๐ŸŒˆ
Lighting
Per-Key RGB
๐Ÿ—‚๏ธ
MCU
RP2040
๐Ÿ“ฆ
Case
3D Printed
โฑ๏ธ
Timeline
15 Days
๐Ÿ›’ Shopping List

What You'll Need

Component What to Buy Est. Cost Type
MicrocontrollerRaspberry Pi Pico (RP2040) โ†— Buy$4โ€“$8Must Have
Key Switches6ร— Gateron Yellow / Brown switches โ†— AliExpress$5โ€“$10Must Have
Keycaps6ร— MX-compatible keycaps โ†— KBDFans$5โ€“$15Must Have
RGB LEDs6ร— SK6812 MINI-E (south-facing) โ†— AliExpress$2โ€“$5Must Have
Rotary Encoders2ร— EC11 encoder with push-click โ†— AliExpress$2โ€“$4Must Have
Diodes10ร— 1N4148 SOD-123 SMD diodes$1โ€“$2Must Have
PCB Fabrication5 boards from JLCPCB โ†— JLCPCB or PCBWay โ†— PCBWay$5โ€“$12Must Have
Solder + IronPinecil or TS101 iron recommended โ†— Pinecil$20โ€“$35Must Have
USB-C Socket1ร— USB-C female SMD or THT connector$1โ€“$3Must Have
Reset Switch1ร— 6mm tactile push button (THT)$0.50Must Have
Encoder Knobs2ร— 6mm shaft metal/plastic knobs$2โ€“$6Nice to Have
3D Printed CasePLA/PETG filament or JLCPCB 3D print โ†— JLCPCB 3D$3โ€“$8Nice to Have
โš ๏ธ Order PCB on Day 3! JLCPCB fabrication + shipping = 7โ€“10 days. Everything else happens while you wait.
๐Ÿ”— Resources

Your Essential Links

๐Ÿ“… Build Plan

Your 15-Day Build Timeline

DAYS 1โ€“3 ๐ŸŽจ Design & Planning Phase 1
Day1SAME DAY โ–ฒ
Plan Your Layout
Sketch your key arrangement on paper before touching software. This 5-min step saves hours!
  • Sketch layout: 2ร—3 key grid + 2 knobs positioned above
  • Choose switch type: tactile Brown, linear Yellow/Red, or clicky Blue
  • Decide USB-C port placement (top edge recommended)
  • Download and install KiCad โ€” free PCB design software
Day2SAME DAY โ–ฒ
Learn KiCad Basics
Watch one good tutorial. Download the keyboard footprint libraries. Understand schematic vs PCB editor.
  • Watch 1 beginner KiCad keyboard PCB tutorial on YouTube
  • Download ai03's MX switch footprint library from GitHub
  • Download EC11 rotary encoder KiCad footprint
  • Understand schematic editor vs PCB layout editor difference
Day3SAME DAY โ–ฒ
Draw Your Schematic
Logical wiring diagram only โ€” not physical layout yet. Connect every component to the MCU.
  • Place all symbols: MCU, 6 switches, 6 diodes, 2 encoders, 6 RGB LEDs
  • Wire switch matrix: switch โ†’ diode (cathode toward column) โ†’ column pin
  • Wire RGB daisy chain: MCU GP โ†’ LED1 DIN โ†’ LED1 DOUT โ†’ LED2 DIN...
  • Wire encoder A, B, SW pins to free GPIO pins
  • Run ERC (Electrical Rules Check) โ€” fix every error before proceeding
DAYS 4โ€“6 ๐Ÿ”Œ PCB Layout & Order Phase 2
Day4SAME DAY โ–ฒ
Physical PCB Placement
Import footprints from schematic and place them physically on your board.
  • Open PCB editor โ†’ "Update PCB from Schematic" to import all footprints
  • Draw board outline on Edge.Cuts layer (~90mm ร— 72mm for this layout)
  • Place 6 MX switch footprints in 2ร—3 grid (19.05mm standard MX spacing)
  • Place 2 EC11 encoder footprints above the key grid
  • Place SK6812 LEDs under each switch (south-facing orientation)
  • Place MCU and USB-C socket โ€” USB-C must reach the board edge
Day5SAME DAY โ–ฒ
Route Traces & Ground Pour
Connect everything with copper traces. Add a ground pour for a cleaner, pro result.
  • Route switch matrix: columns on F.Cu, rows on B.Cu using vias to cross
  • Route RGB data chain between LEDs (short traces, same layer if possible)
  • Use 0.5mm traces for power (VCC/GND), 0.25mm for signal lines
  • Add GND copper pour on both layers (Edit โ†’ Fill All Zones)
  • Run DRC (Design Rules Check) โ€” zero errors before export!
Day6SAME DAY โ–ฒ
Export Gerbers & Order! ๐ŸŽ‰
Add silkscreen, export Gerbers, and place your order. Boards arrive in ~7 days!
  • Add silkscreen labels: SW1โ€“SW6, ENC1, ENC2, board name on F.Silkscreen layer
  • File โ†’ Plot โ†’ Select all layers โ†’ Click Plot (generates Gerber files)
  • Generate Drill Files in Excellon format into same folder
  • ZIP the Gerber folder โ†’ upload to JLCPCB โ†’ order 5 boards ($5โ€“10)
  • Order all components from AliExpress/LCSC while you're at it
๐Ÿ’ก Waiting for your PCB is totally normal Use the next phase to design your case and set up firmware โ€” don't sit idle!
DAYS 7โ€“9 โณ Case Design + Firmware Prep Phase 3
Day7SAME DAY โ–ฒ
Design Case Bottom Shell
Use Fusion 360 (free for personal use) or Tinkercad (browser, no install).
  • Create bottom plate matching PCB outline + 2mm border wall
  • Add 4 standoff posts at PCB corner mounting holes (M2, 5mm tall)
  • Build side walls 8โ€“10mm tall around the PCB
  • Cut USB-C slot in the appropriate side wall
Day8SAME DAY โ–ฒ
Design Switch Plate + Export STL
The plate is what you see on top. Switches snap into it. This is the visible face of your build!
  • Create flat plate matching PCB outline (~1.5mm thick)
  • Cut 14mm ร— 14mm openings at each MX switch position
  • Cut 7mm round holes for encoder shafts
  • Export both pieces as .STL and send to printer or JLCPCB 3D print
Day9SAME DAY โ–ฒ
Set Up QMK Environment
Install QMK and scaffold your firmware project while the PCB is in transit.
  • Install QMK MSYS (Windows) / Homebrew QMK (Mac) / apt QMK (Linux)
  • Run: qmk setup โ€” initializes your build environment
  • Run: qmk new-keyboard โ€” scaffolds a new keyboard project
  • Write down every GPIO pin assignment from your schematic (needed for config.h)
  • Browse QMK example keyboards in qmk_firmware/keyboards/ for inspiration
DAYS 10โ€“12 ๐Ÿ”ง Assembly & Soldering Phase 4
Day10SAME DAY โ–ฒ
PCB Arrives โ€” Inspect & Solder SMD
Your boards are here! Inspect carefully, then solder the smallest parts first.
  • Inspect all pads under good lighting โ€” check for shorts or bare copper
  • Apply flux to diode pads and solder all 1N4148 SOD-123 diodes
  • Solder SK6812 MINI-E LEDs โ€” fast confident strokes, they're heat-sensitive!
  • Solder 100nF decoupling caps near each LED (prevents flicker)
Day11SAME DAY โ–ฒ
Solder Switches, Encoders & MCU
The satisfying step โ€” your board really starts to look like a macropad!
  • Snap all 6 switches into the plate, set plate+switches onto PCB
  • Tack corner switches first to lock alignment, then solder all 12 pins
  • Solder both EC11 encoders โ€” 5 signal pins + 2 mounting legs each
  • Solder Raspberry Pi Pico via pin headers or direct mount
  • Solder the reset tactile button
  • Visual inspection: look for cold joints and solder bridges under good light
Day12SAME DAY โ–ฒ
First Power-On Test
Check for shorts with a multimeter first โ€” then plug it in and watch those LEDs glow!
  • Multimeter in continuity mode: confirm no short between VCC and GND pins
  • Plug into USB โ€” MCU should enumerate as USB device (check Device Manager)
  • Flash basic test firmware โ†’ verify all 6 LEDs light up in sequence
  • Reflow any cold joints: add flux, briefly reheat with iron tip
โš ๏ธ Soldering Order Matters! Always go smallest to tallest: SMD diodes โ†’ SK6812 LEDs โ†’ switches โ†’ encoders โ†’ MCU. Getting this wrong makes later components very hard to reach.
DAYS 13โ€“15 ๐Ÿ’ป Firmware & Final Assembly Phase 5
Day13SAME DAY โ–ฒ
Write Your QMK Firmware
Configure your keyboard brain โ€” pins, keys, RGB effects, and encoder actions.
  • Create keyboard dir: qmk_firmware/keyboards/mymacropad/
  • Edit config.h: MATRIX_ROW/COL_PINS, WS2812_DI_PIN, ENCODERS_PAD_A/B
  • Edit keymap.c: assign 6 keycodes (git commit, save, build, run, format, push)
  • Add encoder_update_user() callback: knob 1 = scroll, knob 2 = volume
  • Enable in rules.mk: RGB_MATRIX_ENABLE = yes, ENCODER_ENABLE = yes
  • Build: qmk compile -kb mymacropad -km default โ€” fix any errors
Day14SAME DAY โ–ฒ
Flash, Test & Remap
Flash firmware, test every single input, then dial in your perfect key layout.
  • Flash: qmk flash -kb mymacropad -km default (hold BOOT while connecting)
  • Open keyboardtester.com and press every key one-by-one
  • Test both encoder directions (CW and CCW) and their push buttons
  • Test RGB: cycle all effects with RGB_MOD key, check every LED
  • Open VIA or Vial and remap keys to your perfect programmer shortcuts
Day15SAME DAY โ–ฒ
Assemble Case & Celebrate! ๐ŸŽ‰
Final put-together. Your macropad is about to become a real desk companion.
  • Thread M2 screws through bottom case into PCB standoff posts
  • Seat the PCB + switch plate assembly into the bottom case
  • Press encoder knobs onto EC11 shafts (set screw or friction fit)
  • Press all 6 keycaps firmly onto switch stems
  • Final plug-in test โ€” all keys, knobs, RGB perfect? โœ…
  • ๐Ÿ“ธ Take photos and share on r/MechanicalKeyboards!
๐ŸŽ‰ You Did It! You've designed a PCB, soldered components, written firmware, and built a real working keyboard. That's proper embedded hardware engineering. Be proud!
๐Ÿ”Œ Deep Dive

PCB Design Explained

1
Switch Matrix โ€” Why diodes?
For 6 keys, use a 2ร—3 matrix โ€” 2 rows ร— 3 columns = 5 MCU pins instead of 6. Diodes prevent "ghosting" (phantom keypresses) when multiple keys are held. Rule: Row โ†’ switch โ†’ diode โ†’ Column. Diode cathode (stripe side) always points toward the column wire.
2
RGB LED Wiring (Addressable LEDs)
SK6812 and WS2812B LEDs need only one data wire from your MCU! They daisy-chain: MCU GPIO โ†’ LED1 DIN โ†’ LED1 DOUT โ†’ LED2 DIN โ†’.... Add a 300ฮฉ resistor on the MCU data line and a 100nF bypass cap between VCC and GND near each LED to prevent flickering.
3
EC11 Encoder Pinout
EC11 has 5 pins: A, B, C (GND), SW1, SW2. Connect A and B to MCU GPIOs (pull-ups enabled in firmware). Connect C to GND. SW1+SW2 are the push-click switch โ€” wire like a regular key switch. Enable ENCODER_ENABLE = yes in QMK rules.mk.
4
RP2040 Pin Recommendation
Suggested: GP0โ€“GP1 = matrix rows, GP2โ€“GP4 = matrix columns, GP5 = RGB data, GP6โ€“GP7 = encoder 1 (A, B), GP8โ€“GP9 = encoder 2 (A, B), GP10โ€“GP11 = encoder push buttons. Write this down โ€” it goes directly into config.h!
๐Ÿ’ป Code Reference

QMK Firmware Snippets

config.h โ€” Pin & Feature Configuration
// config.h #pragma once #include "config_common.h" // Matrix: 2 rows ร— 3 cols = 6 keys on 5 pins #define MATRIX_ROWS 2 #define MATRIX_COLS 3 #define MATRIX_ROW_PINS { GP0, GP1 } #define MATRIX_COL_PINS { GP2, GP3, GP4 } #define DIODE_DIRECTION COL2ROW // RGB LEDs #define WS2812_DI_PIN GP5 #define RGB_MATRIX_LED_COUNT 6 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // Rotary Encoders #define ENCODERS_PAD_A { GP6, GP8 } #define ENCODERS_PAD_B { GP7, GP9 } #define ENCODER_RESOLUTION 4
keymap.c โ€” Keys + Encoder Callbacks
// keymap.c #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( // Row 1: Format, Save, Toggle Sidebar LSFT(LALT(KC_F)), LCTL(KC_S), LCTL(KC_B), // Row 2: Build, Run, Custom macro (git push etc) LCTL(LSFT(KC_B)), KC_F5, KC_F13 ) }; // Encoder: Knob 1 = scroll, Knob 2 = volume bool encoder_update_user(uint8_t index, bool clockwise) { if (index == 0) { clockwise ? tap_code(KC_MS_WH_DOWN) : tap_code(KC_MS_WH_UP); } else { clockwise ? tap_code(KC_VOLU) : tap_code(KC_VOLD); } return false; }
๐ŸŽจ Enable VIA for Live Remapping Add VIA_ENABLE = yes to rules.mk. Then visit usevia.app โ€” remap keys in your browser with zero reflashing needed!
๐Ÿ“ฆ Case Options

Choose Your Case Style

๐Ÿ–จ๏ธ
3D Printed Sandwich
Two-piece: bottom shell + switch plate. 2โ€“4 hours to print in PLA or PETG. Most accessible option if you have a printer or a nearby makerspace.
โœ… Best for this Build
๐Ÿญ
JLCPCB 3D Print
Upload your STL with your PCB order. They print and ship together. Resin gives incredible detail. No printer needed at all.
๐Ÿ‘ No Printer Needed
โœจ
Acrylic Stack
Layered frosted acrylic panels with M2 standoffs. RGB glows through the sides beautifully. Export DXF from your KiCad board outline for laser cutting.
โœจ Stunning with RGB
โœ… Final Checklist

You're Done When All Green!

All 6 keys register correctly
Both encoders rotate and click
All 6 RGB LEDs light up
USB-C connects reliably
No PCB shorts (multimeter test)
Firmware flashes without errors
Keycaps pressed on firmly
Case assembled with all screws
Macros tested in real apps
Photos taken for Reddit! ๐Ÿ“ธ