

Numpad
Hand-wired 17-key USB numpad on Pi Pico W. CircuitPython, diode matrix, event-driven scanning.
- Size
- 83 × 127 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 120
- Nets
- 96
- Pads
- 505
- Tracks, vias
- 1,167, 134
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 2 Jul 2026
- Updated
- 10 Sep 2026
Overview
Numpad is an open-source printed circuit board by blafr103, from the blafr103/pico-numpad repository on GitHub, published under the MIT licence. It is a 2-layer board of 83 × 127 mm with 120 parts on 96 nets, routed with 1,167 tracks and 134 vias.
It is built around the RP2040, 74AHCT1G125SE and W25Q128JVSIQ, with the USBLC6-2SC6, 1N4148W and BSS138 among its other parts. Its parts include 36 capacitors, 35 diodes, 11 resistors, 5 ICs and 3 connectors. It belongs with the lEDs and displays boards and the RP2040 boards of this library.
Main components
6RP2040
LQFN-56(7x7)12bit 133MHz 30 LQFN-56(7x7) Microcontrollers (MCU/MPU/SOC) ROHSRaspberry PiMicrocontrollers (MCU/MPU/SOC)74AHCT1G125SE
SOT-353-40℃~+125℃ 1 1 4.5V~5.5V 4.7ns@5V,50pF 40uA 74AHCT 8mA 8mA Schmitt trigger Tri-State Unidirectional SOT-353 Buffers, Drivers, Receivers, Transceivers ROHSDiodes IncorporatedBuffers, Drivers, Receivers, TransceiversW25Q128JVSIQ
SOIC-8-208mil-40℃~+85℃ 100,000 cycles 120ms@(32KB) 128Mbit 133MHz 1uA 2.7V~3.6V 20 Years 3ms Power-on reset、Hardware write protection、Software write protection、Write enable latch、Absolute write protection SPI SOIC-8-208mil NOR FLASH ROHSWinbondNOR FLASHUSBLC6-2SC6
SOT-23-60.35pF、0.8pF 100nA 150W@8/20us 15V 2 5V 6A@8/20us 6V ESD SOT-23-6 ESD and Surge Protection (TVS/ESD) ROHSUMWESD And Surge Protection (TVS/ESD)1N4148W
SOD-123150mA 1A 1V@50mA 1uA@75V 400mW 4ns 75V Independent SOD-123 Switching Diodes ROHSSTMicroelectronicsSwitching DiodesBSS138
SOT-23-55℃~+150℃ 1 N-channel 1.1Ω@10V、1.2Ω@4.5V 1.2V 1.7nC@10V 17.5pF 340mA 350mW 50V 6.5pF N-Channel SOT-23 MOSFETs ROHShongjiachengMOSFETs
README
README.mdpico-numpad
Custom-built 17-key USB HID numpad powered by a Raspberry Pi Pico W, featuring a hand-wired switch matrix, 16×2 LCD interface, host-integrated PC monitoring, weather display, and onboard calculator.
The enclosure, electronics, and firmware were designed specifically for
this project using CircuitPython with event-driven matrix scanning via
keypad.KeyMatrix.
This README documents the hand-wired prototype. A custom two-layer PCB
successor built around a bare RP2040 is documented in
hardware/.
Features
- USB HID numeric keypad
- Event-driven matrix scanning (
keypad.KeyMatrix) - 16x2 LCD with switchable views:
- Clock + weather (current conditions and local time for one of four preset Canadian locations; date + time synced from the host)
- PC stats, 4 cycling pages: overview (CPU/GPU utilization, temperature, package power), memory (RAM utilization, DIMM temperatures, VRAM), clocks (P/E-core max, GPU, TjMax distance), and voltages
- Calculator (+ - * / with standard precedence; expression on row 0, result on Enter; keys are captured while active and send nothing to the PC)
- Lifetime keypress statistics
- NumLock doubles as a momentary Fn key:
- Fn+0: Clock view; pressed again while on it, cycles the weather location
- Fn+1: PC stats view; pressed again while on it, cycles the stat pages
- Fn+2: Calculator view; pressed again while on it, clears
- Fn+3: Statistics view
- Fn+'+': Increase keypad LED brightness
- Fn+'-': Decrease keypad LED brightness
- Persistent settings (lifetime key counter and LED brightness) are stored in the
CircuitPython filesystem (
/count.txton internal flash). - Automatic LCD backlight/LED timeout after 300 seconds of inactivity
- Optional Python companion application providing local time, weather (Environment Canada API), and PC hardware monitoring.
![]() Finished Device |
![]() Hand-Wired Matrix |
Physical Construction
This prototype is entirely hand-built rather than assembled on a PCB. The
hand-wired construction allowed the electrical design, firmware, and enclosure
to be developed and validated before committing to a dedicated PCB. That board
now exists as rev A and is documented in hardware/.
Enclosure
- Designed from scratch in Autodesk Fusion 360
- 3D printed on a Bambu Lab X1 Carbon using PETG for the structural components and translucent polycarbonate (PC) for the light-diffusing enclosure
- Two-piece printed enclosure with integrated LCD mount and switch plate
- Translucent white PC diffuses the per-key LEDs
Switches & Keycaps
- Switches: Gateron KS-9 G Pro Black linear switches
- Keycaps: Ranked POM Jelly Premium Translucent keycaps
Key Matrix
The keypad is wired as a 5×4 switch matrix with one diode per key to eliminate ghosting.
Color coding throughout the wiring:
| Color | Function |
|---|---|
| Red | Matrix columns |
| Yellow | Matrix rows |
| Orange | LED power distribution |
| Black | LED ground |
Each switch includes a 1N4148 diode (anode toward the row, cathode toward
the column), matching the firmware configuration
(columns_to_anodes=False). The matrix layout and diode orientation were
verified using the included tools/matrix_map_test.py and
tools/diode_test.py utilities.
Note that the rev A PCB in hardware/ uses the opposite
orientation (cathode to row).
Lighting
- One discrete white LED beneath each key
- LEDs share a common PWM-controlled supply, with each LED using its own 100 Ω current-limiting resistor
- Brightness is adjustable in 12.5% increments using Fn + '+' and Fn + '-'
- The selected brightness is persisted across power cycles
- LEDs turn off together with the LCD backlight after the inactivity timeout and are restored automatically on activity
Electronics
- Raspberry Pi Pico W mounted internally
- HD44780-compatible 16×2 LCD with PCF8574 I²C backpack
Hardware
- Raspberry Pi Pico W (RP2040), CircuitPython 9.2.1
- 16×2 HD44780-compatible LCD with PCF8574 I²C backpack (0x27)
- 17 Gateron KS-9 G Pro Black switches
- Ranked POM Jelly translucent keycaps
- 17 white discrete LEDs
- Rows: GP2–GP6
- Columns: GP12–GP15
- Key LEDs (PWM): GP11
- I²C: SDA GP0 · SCL GP1
Install
- Flash CircuitPython 9.x to the Pico.
- Copy
code.py,boot.py, andlib/to the CIRCUITPY drive, then power cycle (boot.pychanges only apply at power-up).- On first boot, the firmware creates
/count.txtto store persistent settings (currently the lifetime keypress count and LED brightness).
- On first boot, the firmware creates
- Install
adafruit_hidfrom the CircuitPython 9.x library bundle intolib/. - Optional, for the clock, weather, and PC stats:
pip install pyserial requests env_canadaon the PC and runpython host/companion.py. The pad is fully functional without it; the clock shows UNKNOWN, weather shows "no weather", and PC stats show "no data" until first contact.- The Pico exposes two serial ports; the script auto-detects the data port, or set PORT in the script manually.
- PC stats additionally require LibreHardwareMonitor running as administrator with its web server enabled (Options - Remote Web Server - Run). Time and weather work without it.
- Weather locations are configured in companion.py as label + coordinates + IANA timezone.
- For hands-off startup on Windows (Task Scheduler setup, logging, troubleshooting), see host/README.md.
Design
Matrix scanning and debouncing run in C in the background
(keypad.KeyMatrix, 10 ms interval); the main loop only consumes
queued edge events, so a busy loop delays input rather than dropping
it. HID output uses press()/release() on edges so the host sees
real held keys and handles auto-repeat. A hand-written equivalent of
the scanner (polling, per-key debounce state machine) is kept in
reference/ with a comparison of the two approaches.
columns_to_anodes=False is required for this board's diode
orientation; the default silently reads all keys as dead.
boot.py remounts the filesystem to allow the firmware to save the
persistent key counter. Holding NumLock while connecting the Pico
starts a development mode that leaves the drive writable from the host
and disables persistence.
The LCD is driven with no sleep() in the main loop: dirty-flag
rendering (I²C writes only on state change), fixed-width line
overwrites instead of clear(), and edge-triggered backlight
control. A full LCD line write costs ~50 ms over I²C, so
unconditional redraws would starve input latency.
The LCD is organized as switchable views (splash on boot, clock, PC stats, calculator, statistics). Holding NumLock acts as a momentary Fn key: tapping a digit while held switches views without typing it. A plain NumLock tap is deferred until release so tap and hold can be distinguished without affecting normal typing. Each view owns its input: most pass keys through to the PC as normal typing, while the calculator captures digits and operators entirely (including suppressing their release events), so nothing leaks to the host while it is active.
The calculator stores the expression as typed (row 0, scrolling
left past 16 characters) and evaluates on Enter with standard
precedence: tokens are reduced in two passes, folding * and /
left-to-right first, then summing the remaining +/- terms.
Divide-by-zero shows Error, cleared by the next digit. After a
result, a digit starts a fresh expression and an operator continues
from the result. Results too wide for the row use scientific
notation. Leaving the view clears it.
Time, weather, and PC stats come from an optional host script
(host/companion.py, setup and operation in
host/README.md) over a second USB CDC serial port
enabled in boot.py. The protocol is newline-terminated ASCII key:value lines;
the Pico is a pure listener and the host broadcasts unsolicited (time
on connect and every 30 s, stats every 2 s, weather every 10 min).
The clock free-runs on the crystal between syncs and re-anchors on
every message, bounding drift to one broadcast interval. The RP2040
has no battery-backed RTC, so time is lost at power-off and shows
UNKNOWN until the first sync.
Weather comes from Environment Canada via the env_canada package
(nearest site to each configured coordinate). The clock view shows
one location's conditions on row 0 and its local date/time on row 1;
the host sends each location's UTC-offset delta computed fresh with
zoneinfo, so DST is handled entirely host-side. Weather older than
30 minutes displays as stale (LABEL --); PC stats older than 15
seconds display as "no data".
PC stat rows are composed entirely on the host: companion.py reads
LibreHardwareMonitor's JSON endpoint, selects sensors by hardware
prefix and display name (numeric sensor indices shift between LHM
versions), and sends each page row as a finished 16-character line.
The Pico renders these verbatim, apart from substituting * with
the LCD's degree symbol, so adding or reworking a stat page is a
host-only change. Missing sensors render as --; the sensor names
target this machine's hardware and need adjusting for others.
Persistent settings (currently the lifetime keypress count and LED brightness)
are stored in /count.txt. To minimize flash wear, writes are batched
(100 keypresses by default) and also occur immediately after brightness
changes and when the device transitions to the idle state.
The firmware is organized into independent subsystems for input handling, LCD rendering, view management, HID output, persistent settings, and host communication.
Future Improvements
- User-configurable key mapping and macros
- More robust persistent configuration storage
The custom PCB, integrated USB-C, and per-key RGB lighting items previously
listed here are addressed by the rev A board in hardware/.
Tools
tools/matrix_map_test.pyprints (row, col) per keypress; used to build/verify the keymaptools/diode_test.pyis a bidirectional scan; verifies diode presence and orientation per key
Run either by copying to CIRCUITPY as code.py (back up first) and
watching the serial console. Run in dev mode (NumLock at plug-in)
so the drive is writable.
Credits
LCD driver (lib/lcd.py, lib/i2c_pcf8574_interface.py):
dwhall/circuitpython_lcd,
original license headers retained.
Parts
120| Qty | Value | Footprint | References |
|---|---|---|---|
| 27 | 100n | Capacitor_SMD:C_0603_1608Metric | C10, C12, C13, C14, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28 +11 |
| 18 | 1N4148W | Diode_SMD:D_SOD-123 | D1, D2, D3, D4, D5, D6, D7, D10, D11, D12, D13, D14, D15, D16, D17, D18 +2 |
| 17 | MX_SK6812MINI-E | PCM_marbastlib-mx:LED_MX_6028R | LED1, LED2, LED3, LED4, LED5, LED6, LED7, LED8, LED10, LED11, LED12, LED13, LED14, LED15, LED16, LED17 +1 |
| 3 | 1u | Capacitor_SMD:C_0603_1608Metric | C3, C5, C11 |
| 2 | 10k | Resistor_SMD:R_0603_1608Metric | R3, R4 |
| 2 | 10u | Capacitor_SMD:C_0805_2012Metric | C1, C2 |
| 2 | 1k | Resistor_SMD:R_0603_1608Metric | R5, R8 |
| 2 | 22u | Capacitor_SMD:C_0805_2012Metric | C35, C36 |
| 2 | 27 | Resistor_SMD:R_0603_1608Metric | R6, R7 |
| 2 | 27p | Capacitor_SMD:C_0603_1608Metric | C15, C16 |
| 2 | 4k7 | Resistor_SMD:R_0603_1608Metric | R10, R11 |
| 2 | 5k1 | Resistor_SMD:R_0603_1608Metric | R1, R2 |
| 2 | BSS138 | Package_TO_SOT_SMD:SOT-23 | Q1, Q2 |
| 1 | 0 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX15 |
| 1 | 1 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX12 |
| 1 | 12MHz | Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mm | Y1 |
| 1 | 2 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX13 |
| 1 | 3 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX14 |
| 1 | 4 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX9 |
| 1 | 470 | Resistor_SMD:R_0603_1608Metric | R9 |
| 1 | 5 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX10 |
| 1 | 6 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX11 |
| 1 | 7 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX5 |
| 1 | 74AHCT1G125 | Package_TO_SOT_SMD:SOT-23-5 | U5 |
| 1 | 8 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX6 |
| 1 | 9 | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX7 |
| 1 | BOOTSEL | Button_Switch_SMD:SW_SPST_PTS645Sx43SMTR92 | SW1 |
| 1 | Conn_01x03 | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J2 |
| 1 | Conn_01x04 | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J3 |
| 1 | DIV | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX2 |
| 1 | ENTER | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX17 |
| 1 | MIN | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX4 |
| 1 | MULT | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX3 |
| 1 | NCP1117-3.3_SOT223 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U1 |
| 1 | NUM | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX1 |
| 1 | PERIOD | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX16 |
| 1 | PLUS | PCM_marbastlib-mx:SW_MX_HS_CPG151101S11_1u | MX8 |
| 1 | RESET | Button_Switch_SMD:SW_SPST_PTS645Sx43SMTR92 | SW2 |
| 1 | RP2040 | Package_DFN_QFN:QFN-56-1EP_7x7mm_P0.4mm_EP3.2x3.2mm | U3 |
| 1 | RotaryEncoder_Switch | Rotary_Encoder:RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm | SW3 |
| 1 | USBLC6-2SC6 | Package_TO_SOT_SMD:SOT-23-6 | U2 |
| 1 | USB_C_Receptacle_USB2.0_16P | Connector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12 | J1 |
| 1 | W25Q128JVS | Package_SO:SOIC-8_5.3x5.3mm_P1.27mm | U4 |
The 113 most common of 120 parts.
Similar boards
- 2 layers446.9 × 141.7 mm

- 2 layers347.9 × 119.3 mm

- 2 layers308.8 × 99.3 mm

- 4 layers50 × 50 mm

FlightController Drone
damnitzhemanth-oss/Flight_Controller
Custom STM based flightcontroller designed from scratch.
157 parts - 4 layers100 × 142.5 mm

Keeb4x4
TheRealBluesun/keeb4x4
4x4 macropad: STM32G431, per-key RGB, ScreenKey display keycaps, encoder. KiCad + Rust/Embassy firmware, USB bootloader, host CLI, printable base.
127 partsCERN-OHL-P-2.0 - 2 layers248.6 × 81.9 mm

Alpha curISO
calvin-mcd/alpha-curISO
The Alpha CurISO is a community pcb for the Curio. It supports two different Alpha Staggers and Ortho Layouts. This is a collaboration between jadethemaid, airuei, galvy0 and calvin.
241 parts2 - 4 layers70 × 68 mm

Sssata fluxpad Fluxpad
punkfab/pcb-corpus
235 real KiCad boards from open-source hardware repositories, prepared as a placement and routing benchmark
78 parts1 - 4 layers95 × 95 mm

AgentDeck
Brillar0101/agentdeck
RP2040 macropad for supervising AI coding agents: 13 hot-swap keys with per-key RGB status, encoder, joystick, 4-layer PCB, CircuitPython firmware, printable enclosure
101 partsMIT
Questions
How big is the Numpad PCB?
It measures 83 × 127 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Numpad use?
120 parts, built around the RP2040, 74AHCT1G125SE, W25Q128JVSIQ and USBLC6-2SC6. 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 Numpad KiCad files?
From the blafr103/pico-numpad repository on GitHub, at the commit this page was made from: the board is hardware/numpad/numpad.kicad_pcb and its schematic hardware/numpad/01_power_usb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Numpad design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

