Skip to the content
2 layers100 × 80 mmX240 pico rev b, the printed circuit board in 3D

X240 pico rev b

nikolareljin/x240-kbd3

ThinkPad X240 keyboard and ClickPad USB HID controller using Raspberry Pi Pico RP2040, QMK firmware, and OpenSCAD enclosure files.

Size
100 × 80 mm
Copper layers
2
Thickness
1.6 mm
Parts
42
Nets
110
Pads
338
Tracks, vias
1,665, 174
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
7 Apr 2026
Updated
28 Oct 2026

Overview

X240 pico rev b is an open-source printed circuit board by nikolareljin, from the nikolareljin/x240-kbd repository on GitHub. It is a 2-layer board of 100 × 80 mm with 42 parts on 110 nets, routed with 1,665 tracks and 174 vias.

It is built around the 74HC165D. Its parts include 9 resistors, 8 connectors, 5 capacitors, 4 ICs and 1 transistor. It belongs with the keyboards and input boards and the RP2040 boards of this library.

Main components

1

README

README.md

x240-kbd

A standalone USB keyboard with touchpad and TrackPoint, built from a ThinkPad X240 keyboard assembly (FRU 0C44020) and its Synaptics ClickPad, driven by a Raspberry Pi Pico (RP2040) running QMK.

Works on any OS without drivers — it enumerates as a standard USB HID composite device (keyboard + mouse + media keys).

Standalone X240 Keyboard

Project status: design, not yet built. The matrix pinout is unverified until the probing step runs on real hardware, and the TrackPoint route (via the ClickPad's PS/2 pass-through) is the expected architecture, confirmed by the same step. Everything else here is designed to survive either answer. Track progress in the issues — nine milestones from documentation to release.


Features

  • Full 84-key ThinkPad X240 layout (QWERTY, US)
  • Synaptics ClickPad — cursor, left/right click zones
  • TrackPoint — via the ClickPad's pass-through port, decoded in firmware
  • FN layer with the ThinkPad media/system keys; FN Lock (FN + Esc)
  • Keyboard backlight, 5 levels (backlit keyboard variants; no breathing — software PWM)
  • Power button with a 500 ms long-press guard → OS power/sleep
  • Touchpad indicator LED
  • N-Key Rollover
  • Micro-USB; documented USB-C upgrade
  • Two enclosure routes: 3D-printed (split case) or hand-made with no printer
  • Two electronics revisions: Rev A perfboard and Rev B KiCad PCB, same firmware

Hardware at a glance

ComponentDetail
ControllerRaspberry Pi Pico, RP2040, 26 GPIO
KeyboardX240 0C44020, 40-pin 0.5 mm FPC; matrix size measured by probing
Sense expansion3 × 74HC165 shift registers — 24 sense lines on 3 GPIO
Touchpad + TrackPointSynaptics ClickPad, PS/2 on GP21/GP22 (RP2040 PIO driver)
BacklightLED strip via 2N7002/BS170 MOSFET on GP26
Power buttonGP27, active LOW
USBMicro-USB; USB-C via the Pico's TP1/TP2/TP3 pads
EnclosurePrinted split case, or the original X240 base cover, laser-cut plates, a Hammond console or wood

Signal flow

Why a shift register: the closest documented ThinkPad keyboard of this era needs 26 matrix lines — every GPIO the Pico has. docs/hardware/gpio-budget.md.

Cost

BuildAll-in (USD, Aug 2026)
Rev A + your own printer$90–130
Rev A + reused X240 base cover, no printer$110–150
Rev B PCBadd $25–35

The donor keyboard and palmrest are most of it. Full tiers and part links: docs/hardware/bom-and-cost.md.


Repository structure

text
x240-kbd/
├── firmware/qmk/keyboards/x240_pico/   QMK keyboard definition (corrected in milestone M4)
├── hardware/pinout/                     FPC pin maps — filled by probing
├── hardware/wiring/                     GPIO table (the single authoritative copy) and schematics
├── hardware/pcb/                        Rev B KiCad project (milestone M7)
├── tools/matrix_probe/                  CircuitPython matrix discovery
├── tools/ps2_sniffer/                   CircuitPython PS/2 + Synaptics sniffer
├── cad/                                 OpenSCAD: split case and small printed parts
└── docs/                                The documentation site (GitHub Pages from /docs)
    ├── hardware/                        components, BOM & cost, GPIO budget, sense chain, TrackPoint, backlight, PCB
    ├── firmware/                        architecture, QMK configuration, pointing stack
    ├── enclosure/                       printed, hand-made, integration, durability, presentation
    ├── references.md · glossary.md
    └── images/

Quick start

Everything runs through one entry point, ./dev (verbs from the workspace-wide script-helpers template; toolchains in Docker, so the host needs only docker, git and python3):

bash
./dev install            # submodules, docker images, a shallow qmk_firmware checkout
./dev build [firmware|docs|tools|cad|pcb|all]
./dev test               # host pytest for the tools, link check, shellcheck
./dev preflight          # everything CI runs: test + build all
./dev deploy             # copy the UF2 to the Pico's RPI-RP2 drive  (alias: ./flash)
./dev deploy matrix_probe   # copy a probing tool to CIRCUITPY        (alias: ./probe <tool>)
./dev devices            # RPI-RP2 / CIRCUITPY mounts and serial ports
./dev logs               # qmk console — the firmware's debug output

Shims ./build, ./test, ./flash, ./probe, ./site wrap the same verbs. Artifacts land in out/. The Docker images and the qmk_firmware commit are pinned by digest in scripts/toolchain.env (scripts/pull_toolchain.sh pulls, saves or refreshes them), so today's build can be repeated later. CI (.github/workflows/ci.yml, via ci-helpers) runs ./dev test and ./dev build all on every push and PR.

  1. Read the component reference and buy parts — docs/hardware/components.md, docs/hardware/bom-and-cost.md.
  2. Probe the FPC pinouts — mandatory first step. Flash CircuitPython, ./probe matrix_probe, then ./probe ps2_sniffer, following hardware/pinout/probing_procedure.md. Do not wire the Pico to anything before this is done.
  3. Build the Rev A adapter — ASSEMBLY.md Phase 2, using hardware/wiring/wiring_diagram.md.
  4. Build and flash firmware — ./dev build then ./dev deploy (hold BOOTSEL while plugging in). Without ./dev: copy firmware/qmk/keyboards/x240_pico into a QMK checkout and qmk compile -kb x240_pico -km default. The firmware builds (custom 74HC165 matrix, PIO PS/2 host, Synaptics + TrackPoint decoding); the key map is a placeholder until probing (#38). docs/firmware/qmk-configuration.md.
  5. Choose an enclosure — printed: docs/enclosure/printed.md; no printer: docs/enclosure/handmade.md.
  6. Close it up — docs/enclosure/presentation.md has the assembly order.

FN key map

FN +ActionFN +Action
F1MuteF9Settings
F2Volume downF10Bluetooth
F3Volume upF11Backlight step
F4Mic mute (F20)F12Print Screen
F5Brightness downPgUp / PgDnHome / End
F6Brightness upLeft / RightPrevious / next track
F7External displayEscFN Lock
F8Wireless toggle

USB-C upgrade (optional)

Wire a USB-C female breakout (one with 5.1 kΩ CC pull-downs) to the pads on the Pico's underside:

Pico padSignalBreakout
TP1GNDGND
TP2USB D−D−
TP3USB D+D+
VBUS (pin 40)5 VVBUS

Set usb_c = true in cad/bottom_case.scad for the USB-C cutout. No firmware change.

USB-C breakout to Pico test pads

The illustration docs/images/usb_c_wiring.png is decorative; its pad labels predate this table and are not the wiring reference. Source: Pico datasheet, test points.

Alternatively use a Pimoroni Pico LiPo (USB-C native, same pinout).


Flashing

  • First flash: hold BOOTSEL while plugging in → RPI-RP2 drive → drag the .uf2.
  • After that: ./dev deploy, or hold the top-left key (Esc) while plugging in (Bootmagic).
  • Recommended: wire a tactile switch to the Pico's RUN pad, reachable through the case, so BOOTSEL + reset works without opening anything.

Documentation

The site is built from docs/ (GitHub Pages, milestone M1). Start at docs/README.md. Builder guides: ASSEMBLY.md, PLAN.md. Changes: CHANGELOG.md.

References

Annotated list in docs/references.md. The projects this one stands on: delingren/thinkpad_keyboards, hamishcoleman/thinkpad-usbkb, thedalles77/USB_Laptop_Keyboard_Controller.

Repository

nikolareljin/x240-kbd · GPL-2.0, matching QMK.

Clone traffic

Clone traffic

Updated daily. Total and unique cloners over the last 14 days.

Parts

42
QtyValueFootprintReferences
610kR_Array_Convex_4x0603RN1, RN2, RN3, RN4, RN5, RN6
4MountingHole_2.2mm_M2H1, H2, H3, H4
4100nC_0603_1608MetricC1, C2, C3, C4
3MountingHole_2.7mm_M2.5H5, H6, H7
3100RR_0603_1608MetricR7, R8, R9
374HC165TSSOP-16_4.4x5mm_P0.65mmU2, U3, U4
24.7kR_0603_1608MetricR1, R2
2DNP 4.7kR_0603_1608MetricR3, R4
1100kR_0603_1608MetricR6
110kR_0603_1608MetricR5
110uC_0805_2012MetricC5
12N7002SOT-23Q1
1BL supply 3V3/VBUSSolderJumper-3_P1.3mm_Open_RoundedPad1.0x1.5mmJP1
1FH12-12S ClickPad FPCHirose_FH12-12S-0.5SH_1x12-1MP_P0.50mm_HorizontalJ2
1FH12-40S keyboard FPCHirose_FH12-40S-0.5SH_1x40-1MP_P0.50mm_HorizontalJ1
1J_KB FPC lines 1-40PinHeader_2x20_P2.54mm_VerticalJ3
1J_LED 3V3/GP28R/GNDPinHeader_1x03_P2.54mm_VerticalJ8
1J_MAT drive/sense/auxPinHeader_2x17_P2.54mm_VerticalJ4
1J_PS2 bus/auxPinHeader_1x08_P2.54mm_VerticalJ6
1J_TP ClickPad lines 1-12PinHeader_1x12_P2.54mm_VerticalJ5
1J_USBC TP1/TP2/TP3/VBUSPinHeader_1x04_P2.54mm_VerticalJ7
1RESETSW_PUSH_6mmSW1
1Raspberry_Pi_PicoRaspberryPi_Pico_Common_THTU1

Similar boards

  • 2 layers181 × 97 mmOpenDeck r3.1.2, the printed circuit board in 3D

    OpenDeck r3.1.2

    shanteacontrols/OpenDeck

    A platform for building interactive control and sensing devices using MIDI and OSC built with Zephyr RTOS.

    262 parts960Apache-2.0
  • 2 layers245.1 × 160 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-64x4-Home-Computer

    My DIY TTL home computer with VGA and PS/2 and 4x the processing power of a Commodore C64 or Apple II.

    139 parts326
  • 2 layers191.8 × 121.3 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-UART-Computer-1-2

    Legacy: Version 1 and 2 of my TTL-only CPU featuring UART I/O, an expansion port, 512KB SSD at up to 10MHz clock speed

    109 parts184
  • 2 layers135.9 × 87 mmPfm3 ctrl, the printed circuit board in 3D

    Pfm3 ctrl

    Ixox/preenfm3

    Official repo of the preenfm3 FM synth

    65 parts127
  • 2 layers171.5 × 106.7 mmSequencer, the printed circuit board in 3D

    Sequencer

    westlicht/performer-hardware

    PER|FORMER Eurorack Sequencer - Hardware Design Files

    435 parts110
  • 2 layers306.1 × 130.2 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-64-Home-Computer

    Legacy: Full TTL-only home computer with VGA and PS/2 and twice the processing power of a Commodore 64

    132 parts94
  • 2 layers215.9 × 20.3 mmKeybed, the printed circuit board in 3D

    Keybed

    friggeri/keyboard

    28 parts69
  • 2 layers300 × 105 mmTR-808-Clone, the printed circuit board in 3D

    TR-808-Clone

    minisystem/880

    A Euroack drum machine

    1,078 parts67

Questions

How big is the X240 pico rev b PCB?

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

What parts does the X240 pico rev b use?

42 parts, built around the 74HC165D. 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 X240 pico rev b KiCad files?

From the nikolareljin/x240-kbd repository on GitHub, at the commit this page was made from: the board is hardware/pcb/x240_pico_rev_b.kicad_pcb and its schematic hardware/pcb/x240_pico_rev_b.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the X240 pico rev b design in my own project?

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