m4 (2×2 Pad)

2×2 Pad 4 Keys Seeed XIAO BLE / RP2040 ZMK & QMK
All Keyboards

m4 — 2×2 LEGO Macropad

Status: Rev 1 & Rev 2 Tested 2×2 Ortho (4 Keys) Seeed XIAO nRF52840 BLE / RP2040 2× 74HC595 Shift Registers Rotary Encoder + OLED ZMK & QMK

M4 2x2 nRF52840 ZMK M4 2x2 RP2040 QMK M4 2x2 RP2040 ZMK

A compact 2×2 ortholinear macropad set in an 8×12 LEGO frame with an optional rotary encoder and I²C OLED display.

Built around the Seeed Studio XIAO RP2040 and Seeed Studio XIAO BLE nRF52840, the m4 served as the hardware and firmware proving ground for chaining two 74HC595 shift registers over SPI before scaling the design up to the 65-key m65 Rev 7.

Other boards in the Seeed XIAO family (SAMD21, XIAO BLE Sense, and ESP32C3) share the same footprint.

Status: All OK

* [x] Gerbers designed
* [x] Firmware (ZMK & QMK)
* [x] Breadboard tested
* [x] Gerbers printed
* [x] Board tested

Features

  • Layout: 2×2 ortholinear (4 keys, 5-pin PCB-mount MX switches)
  • Controller: Seeed Studio XIAO nRF52840 BLE (Rev 1) or XIAO RP2040 (Rev 2)
  • Matrix Expansion: 2× chained 74HC595 SMD shift registers
  • Peripherals: Optional EC11 rotary encoder and I²C OLED display
  • Firmware: ZMK (BLE & RP2040) and QMK (RP2040)

3D Render & PCBs

3D Render

M4 2x2 3D render

KiCad PCB (Front & Back)

M4 2x2 front PCB M4 2x2 back PCB

BOM

  • 1× Seeed Studio XIAO BLE nRF52840 or Seeed Studio XIAO RP2040
  • 2× 7-pin DIL/DIP female sockets + matching male headers
  • 2× 74HC595 surface-mount shift registers (SOIC-16)
  • 4× 1N4148 signal diodes (DO-35 through-hole or SOD-123 SMD)
  • 4× 5-pin Cherry MX–compatible switches
  • 1× EC11 rotary encoder (optional)
  • 1× I²C OLED display (optional)
  • LEGO 8×12 baseplate (or 2× 4×12 plates) and perimeter bricks/plates

Case & Assembly

  • LEGO Enclosure: Uses an 8×12 plate base (or two 4×12 plates). See the m65 Case section for stacking details.
  • Soldering & Build: Follow the step-by-step Assembly Guide.

Gerbers & KiCad

Firmware

Rev 1 — XIAO nRF52840 (ZMK)
Rev 2 — XIAO RP2040 (QMK & ZMK)

Compile QMK from source:

git clone --recurse-submodules -b mlego https://github.com/alinelena/qmk_firmware.git qmk-alin
cd qmk-alin
qmk compile -kb mlego/m4/rev2 -km default

Pinout Reference

  • Rows: 1 (D0), 4 (D3)
  • Columns:
    • C0: Shift Register 1 — QA
    • C1: Shift Register 2 — QA
  • 74HC595N Shift Registers:
    • Data (MOSI): 11 (D10)
    • Latch (RCLK): 8 (D7)
    • Clock (SRCLK): 9 (D8)
  • Encoder: Pad_A = 2 (D1), Pad_B = 3 (D2)
  • OLED (I²C): SDA = 5 (D4), SCL = 6 (D5)

Additional Photos

M4 2x2 bare M4 2x2 switches M4 2x2 with DSA keycaps

m4 (2×2 Pad)

Quick Specs

  • Layout: 2×2 Pad
  • Keys: 4
  • MCU: Seeed XIAO BLE / RP2040
  • Firmware: ZMK & QMK

Ultra-compact 4-key macropad and wireless testbed for prototyping shift-register matrix scanning and BLE firmware.