Skip to the content
2 layers50.5 × 74.3 mmStm32 macro keyboard, the printed circuit board in 3D

Stm32 macro keyboard

mirmisbahali/macro_keyboard

A custom 6-key macro keyboard built from scratch custom written bare-metal STM32 firmware, hand-drawn schematics, and a PCB designed in KiCAD. No Arduino. No HAL. Just registers, datasheets, and stubbornness.

Size
50.5 × 74.3 mm
Copper layers
2
Thickness
1.6 mm
Parts
44
Nets
56
Pads
174
Tracks, vias
0, 0
Routed
Not yet
KiCad
KiCad 10.0 (file 20260206)
Created
18 Apr 2026
Updated
16 Jul 2026

Overview

Stm32 macro keyboard is an open-source printed circuit board by mirmisbahali, from the mirmisbahali/macro_keyboard repository on GitHub. It is a 2-layer board of 50.5 × 74.3 mm with 44 parts on 56 nets.

It is built around the STM32F103C8T6, AMS1117-3.3 and 1N4148W. Its parts include 13 capacitors, 7 diodes, 7 switches, 5 resistors and 4 connectors. It belongs with the keyboards and input boards and the STM32 boards of this library.

Main components

3

README

README.md

STM32 Macro Keyboard

A custom 6-key macro keyboard built from scratch custom written bare-metal STM32 firmware, hand-drawn schematics, and a PCB designed in KiCAD. No Arduino. No HAL. Just registers, datasheets, and stubbornness.

Status: Hardware design in progress


PCB

PCB layout and routing in progress.

Schematic

Wiring is completed — schematic still needs to be made neat and tidy.


Why

I am learning to design STM32-based hardware - from choosing a microcontroller and designing the PCB, to writing drivers from scratch in register-level C.

Hardware

ItemDetail
MCUSTM32F072CBTx — Cortex-M0, 48 MHz, 128 KB flash, LQFP-48
Key matrix6 switches with diode-per-key (1N4148W)
Power3.3 V core, ferrite bead on analog rail (VDDA), decoupling on all supply pins
ProgrammingUSB DFU via BOOT0 SPDT switch — no debug probe needed
EDA toolKiCAD 10.0

Requirements

Requirements follow the systems engineering convention: shall = mandatory, should = desired.

SYS — System

IDRequirement
SYS-01The device shall enumerate as a USB HID keyboard on any host OS without requiring driver installation.
SYS-02The device shall be powered entirely from the USB bus (5 V, ≤ 100 mA).
SYS-03The device shall support a minimum of 6 independently programmable macro keys.
SYS-04The device firmware shall be updatable via USB without a hardware debug probe.
SYS-05All firmware shall be written in register-level C with no vendor HAL or Arduino abstractions.

HW — Hardware

IDRequirement
HW-01The MCU core supply (VDD) shall be 3.3 V ± 5%.
HW-02Each VDD, VDDA, VBAT, and VSSIO2 supply pin shall have a dedicated decoupling capacitor placed within 2 mm of the pin.
HW-03VDDA shall be filtered from VDD using a ferrite bead to reduce digital noise on the analog supply.
HW-04Each key switch shall have a dedicated series diode to prevent ghosting in the key matrix.
HW-05The BOOT0 pin shall be switchable between VDD and GND via an SPDT switch to allow toggling between DFU programming mode and normal run mode.
HW-06The PCB shall pass KiCAD DRC with zero errors before submission for fabrication.

FW — Firmware

IDRequirement
FW-01The firmware shall configure the system clock to 48 MHz using the internal PLL before any peripheral initialisation.
FW-02The key scan loop shall debounce each key with a settling time of ≤ 5 ms.
FW-03The firmware shall report a key press to the USB host within 10 ms of a physical key actuation.
FW-04Macro key mappings shall be stored in non-volatile flash and survive a power cycle.
FW-05The firmware shall implement the USB HID boot-protocol keyboard descriptor to ensure compatibility with BIOS/UEFI environments.

VER — Verification

IDRequirementMethod
VER-01All supply rails measure within tolerance at board bring-up.Test — multimeter
VER-02Device enumerates as HID keyboard on Windows, macOS, and Linux.Test — plug in, check device manager
VER-03Every key registers a unique, correct HID keycode.Test — key tester utility
VER-04Firmware can be flashed via DFU using only the BOOT0 switch and a USB cable.Demonstration
VER-05Key mappings persist across power cycles.Test — assign macro, power cycle, verify
VER-06PCB DRC passes with zero errors.Analysis — KiCAD DRC report

Roadmap

Electronics

  • MCU symbol + footprint
  • Decoupling capacitors (VBAT, VDD, VDDA, VSSIO2)
  • BOOT0 SPDT switch for programming / run mode toggle
  • USB data lines + ESD protection
  • USB power input + 3.3 V regulator
  • Key switch matrix (complete all 6 keys)
  • PCB layout and routing
  • DRC pass → Gerber export → fabrication

Firmware

  • Bare-metal project setup (linker script, startup file)
  • System clock → 48 MHz via PLL
  • GPIO driver — key matrix scan
  • USB HID descriptor (boot-protocol keyboard)
  • Key debounce
  • Macro layer + flash storage for mappings

Parts

44
QtyValueFootprintReferences
61N4148WDiode_SMD:D_SOD-123D1, D2, D3, D4, D5, D6
6~ScottoKeebs_MX:MX_PCB_2.50uS1, S2, S3, S4, S5, S6
5100nCapacitor_SMD:C_0402_1005MetricC4, C5, C6, C7, C11
41k5Resistor_SMD:R_0402_1005MetricR1, R3, R4, R5
4MountingHoleMountingHole:MountingHole_2.2mm_M2H1, H2, H3, H4
3Conn_01x04_PinConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2, J3, J4
210pCapacitor_SMD:C_0402_1005MetricC12, C13
21uCapacitor_SMD:C_0402_1005MetricC9, C10
222uCapacitor_SMD:C_0805_2012MetricC1, C2
110kResistor_SMD:R_0402_1005MetricR2
110nCapacitor_SMD:C_0402_1005MetricC8
110uCapacitor_SMD:C_0603_1608MetricC3
1120RInductor_SMD:L_0603_1608MetricFB1
116MHzCrystal:Crystal_SMD_3225-4Pin_3.2x2.5mmY1
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U2
1REDLED_SMD:LED_0603_1608MetricD7
1STM32F103C8T6Package_QFP:LQFP-48_7x7mm_P0.5mmU1
1SW_SPDTButton_Switch_SMD:SW_SPDT_PCM12SW1
1USB_B_MicroConnector_USB:USB_Micro-B_Wuerth_629105150521J1

Similar boards

  • 2 layers110.5 × 75.5 mmGameboy, the printed circuit board in 3D

    Gameboy

    TalhaHossainKhan/Handheld-Game-Console

    Designed a Handheld Game Console PCB in KiCad around an STM32F103.

    57 parts
  • 2 layers188.5 × 167.3 mmPanel2, the printed circuit board in 3D

    Panel2

    sean618/MakerTiles

    Modular STM32 electronic-tile system: hardware, firmware, the MicroBus + Field Protocol stack, and a Python daemon.

    585 partsMIT
  • 4 layers92.5 × 70 mmClock, the printed circuit board in 3D

    Clock

    stevel1212-droid/stm32-rtc-climate-controller

    Kicad project of an STM32-based board climate controller utilizing an RTC module for time-scheduled environmental reading of temperature/humidity with SHT30 sensor and optional small relay for control.

    69 partsMIT
  • 2 layers68 × 40 mmStm32-io extend, the printed circuit board in 3D

    Stm32-io extend

    hardenedlinux/cheap-pcb

    Cheap PCB: Better understanding the current status of hardware supply chain

    44 parts170CC0-1.0
  • 2 layers99.1 × 58.4 mmHEAT, the printed circuit board in 3D

    HEAT

    milar111/HEAT

    An open-source STM32 SMD assembly station for precision soldering. Uses a custom Smart Pulse & Coast algorithm to drive 400W mains heaters via SSR. Features OLED UI, NTC feedback, and safety cooling.

    57 parts9
  • 2 layers71.3 × 25.4 mmUSB DALI, the printed circuit board in 3D

    USB DALI

    even-notodd/USB-DALI

    USB-DALI interface converter

    43 parts4
  • 2 layers78 × 60 mmDC Motor Controller, the printed circuit board in 3D

    DC Motor Controller

    minhle4397/Line-Follower-Robot-v2

    Improved Hardware and Firmware for Line Follower Robot

    53 parts3
  • 4 layers36 × 36 mmTrackMAG, the printed circuit board in 3D

    TrackMAG

    mupfdev/TrackMAG

    An open hardware development board primarily intended for the development of accessible input devices.

    58 parts3

Questions

How big is the Stm32 macro keyboard PCB?

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

What parts does the Stm32 macro keyboard use?

44 parts, built around the STM32F103C8T6, AMS1117-3.3 and 1N4148W. 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 Stm32 macro keyboard KiCad files?

From the mirmisbahali/macro_keyboard repository on GitHub, at the commit this page was made from: the board is Electronics/stm32_macro_keyboard/stm32_macro_keyboard.kicad_pcb and its schematic Electronics/stm32_macro_keyboard/stm32_macro_keyboard.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Stm32 macro keyboard design in my own project?

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