rushabhcodes/wireless-split-keyboard

Wireless Split Keyboard — custom routed nRF52840 split PCBs with a printable enclosure

Version
0.4.5
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone rushabhcodes/wireless-split-keyboard  # download the package files into ./wireless-split-keyboard
tsci add rushabhcodes/wireless-split-keyboard    # add it to your project as @tsci/rushabhcodes.wireless-split-keyboard

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

docs/design.md

# Design decisions and coordinate contracts

Mechanical reference: db-ok/SofleChocWireless at `aae7cc0ac5ca563dab8222320ae8749ed1911e56`, MIT. Its reversible PCB describes the right half. Left coordinates reflect X, with Y unchanged in tscircuit. The source coordinate conversion is `x = X - 153.7850905`, `y = 90.875 - Y`; left negates X. Millimeters throughout. Extents are 143.370181 × 111.75 mm per PCB. `TH3`–`TH7` include actual local drill offsets; footprint anchors are not substituted for hole centers.

SW25 occupies the encoder shaft location and is an alternative population. It is excluded. SW1–SW24 and SW26–SW30 give 29 mechanical keys. Encoder push occupies row 4, column 0, yielding 30 unique matrix cells per half and 60 diodes total.

Switch stem and keycap geometry is locked. Independent non-reversible Choc socket orientations may turn by 180° to put their asymmetric lands inward; this preserves the square switch/keycap center and axis but differs from an electrically reversible socket footprint. Verify the real switch/socket insertion orientation before release. Diode locations are editable TypeScript offsets, not copied reference copper.

All electronics are expressed as native TSX. Individual IC/connector imports contain their land patterns, not assembled boards. The QIAA footprint uses the manufacturer's physical terminal names mapped to 74 explicit land identifiers including EP; it is not a generic sequential QFN73. SWD remains directly accessible without a bootloader.

## Electrical baseline

- External 2.989 V from TPS63802, `0.5 × (1 + 453k/91k)`. MODE low enables PFM. 0.47 µH inductor and two 22 µF output capacitors are provisional until effective capacitance and layout are reviewed.
- BQ25185: 24 kΩ ILIM/VSET requests 100 mA input and 4.2 V charge regulation; 6.04 kΩ ISET gives about 49.7 mA charging. External 10 kΩ, B25/85=3435 K NTC is required at J_NTC. Charging is inhibited if the NTC is absent. The power switch controls only regulator EN, so USB charging can remain active while the main circuit is off.
- Candidate battery: Adafruit product 1578, protected 500 mAh, stated 29 × 36 × 4.75 mm, maximum stated charge rate 500 mA. It has no thermistor. This is a sizing candidate, not a confirmed local supply or final cell selection. Check JST polarity with the actual cable.
- Switched battery divider: P-channel high-side switch and N-channel gate driver; 1 MΩ/1 MΩ divider, 1 nF filtering. ZMK's 10 ms power-on wait is approximately 20 RC time constants. ADC acquisition is set to 40 µs. Actual leakage and ADC accuracy still require measurement.
- USB data merges D+/D− for both orientations. CC1 and CC2 have independent 5.1 kΩ pull-downs. TPD2EUSB30A protects data lines. Nordic VBUS uses its own 2.2 Ω series resistor and 4.7 µF decoupling; it is not VCC.
- Open-drain charge status pull-ups use the switched rail. No always-on indication LED is fitted.

## RF and stackup

Candidate: JLCPCB JLC04161H-3313, four layers, nominal 1.6 mm, 35 µm outer / 15.2 µm inner copper, 0.0994 mm outer prepreg, Er 4.1, core 1.265 mm / Er 4.6. These are published manufacturer parameters, not an order confirmation. For bottom-side RF, L3 must be a continuous ground reference below the RF feed; the brief's power-plane suggestion cannot interrupt that reference.

`outputs/calculations.json` includes a deliberately limited uncoated, zero-thickness microstrip estimate. It does **not** give the final masked RF width or a GCPW result. The solder mask, finite copper, etch geometry, ground gaps and actual stackup must be included by the fabricator/field solver before drawing a 50 Ω feed. Generic autorouting is excluded from RF and USB.

The Johanson 2450AT18A0100002E uses an all-layer 6.5 × 6.5 mm corner ground-clearance reservation. Only the antenna's required anchoring and feed lands are exempt. A distinct antenna tuning network is required in addition to the Nordic SoC output match. The two zero-ohm series slots and a DNP shunt capacitor form an antenna tuning tee; final values require measurement. VNA tuning with the finished enclosure, plate, display and battery is mandatory before performance claims.

Support-component anchors are transcribed from Nordic QIAA reference layout 1.3 configuration 5 production placement data (revision 15907, mil-to-mm conversion), reflected for bottom assembly. This is measurement data for individual parts. The source board is not imported. All 74 imported MCU terminal centers and the +90° package calibration pass the independent audit. Support anchors have small documented TypeScript offsets to clear the selected footprints; routing still requires verification against Nordic's layout PDF. Left electronics preserve physical package handedness; the MCU support cluster uses the same local frame. Antenna reservations differ internally (left x=47, right x=-61.5) while both external outlines stay locked.

## Mechanical status

The FPC/header location is retained as a reference anchor; the raw panel body and folded cable were not present in the original PCB CAD. The 14 × 32 mm vertical raw-glass allocation centered at |x|=53, y=29 is **provisional**, not an exact extracted panel position. FPC bend radius/contact side, panel retention, antenna-to-panel clearance, and z-height remain open.

The current enclosure is included in the default tscircuit assemblies as native JSCAD. Walls add 0.35 mm PCB clearance and 1.8 mm thickness outside the fixed outline. The 1.8 mm floor sits at Z −10.8…−9 mm, PCB at Z ±0.8 mm, and 1.2 mm key plate at Z 3.7…4.9 mm. Separate USB and power-switch pockets, a battery bay with retention-strap slots, and a raised raw-panel carrier are included. Five existing mounts use separate 2.9 mm spacers. See [enclosure dimensions and assembly](enclosure.md) and the current `outputs/enclosure` STLs. The older files in `outputs/mechanical` are historical fit-test references. Physical part measurements and print trials remain open.

## Imported component provenance

Seventeen JLCPCB component types are imported (16 currently selected) using `tsci import C<number> --lcsc`; 83 of the 136 component placements per half retain exact JLCPCB IDs in Circuit JSON. See `imports/README.md` and `imports/manifest.json`. The remaining PCB features and unsourced parts are distinguished in the draft inventory. The HF crystal is now Epson Q22FA12800025, 32 MHz, 8 pF; LF is Abracon ABS07-32.768KHZ-9-T, 9 pF. The encoder import required a documented manufacturer-drawing correction.

## Routed prototype stackup

The default entries include complete four-layer wire/via routing and two inner ground pours. The nRF52840 inner-row escapes use copper-filled and capped 0.15 mm laser holes with 0.35 mm capture pads, from bottom to inner2. This requires 1+2+1 HDI construction; a conventional through-hole-only four-layer board is incompatible. Through vias are 0.25/0.50 mm, with 0.30/0.60 mm thermal vias. All via-in-pad holes require filling and capping. Final dielectric thickness and the routed 0.20 mm RF feed impedance need fabricator approval.

The antenna reservation excludes copper on all layers except its two bottom lands and the bottom feed. Inner1/inner2 also have a dedicated clearance beneath the Nordic SoC output match. The adjacent inner2 reference region beneath the feed is reserved from signal routing. Independent copper reports cover the emitted native JSON, including pours, every wire and via span, and all functional pad connections.