per-square piece sensing for any chessboard 64 bytes, every 20 ms
A 20 mm board with one omnipolar Hall switch goes under every square and a magnet goes in every piece. The nodes are soldered into a single chain; an ESP32 clocks the whole board out and streams each move to your computer as a JSON line.
What a byte says
Every node answers with one byte: bit 7 is the sensor, the first bit the 74HC165 shifts out, and the other seven inputs are tied to ground. The switch is omnipolar, so a magnet glued in either way reads the same.
On v1 an occupied square and a dead node are the same byte. v2 ties D0 to 3V3 instead of ground, so a live node always returns a bit a dead one cannot fake.
- 1
- 0
- 0
- 0
- 0
- 0
- 0
- 0
0x80 — empty
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 0
0x00 — occupied
- 0
- 0
- 0
- 0
- 0
- 0
- 0
- 1
0x01 — occupied, node alive
The chain
Adjacent pad rows are wired 1:1 with plain AWG 24–26 wire. No connectors, no matrix, nothing to work loose — the whole board is one shift register 64 bytes long.
- clock
- 1 MHz SPI
- frame
- 64 bytes in ~0.5 ms
- scan
- 50 Hz, timestamped debounce
- topology
- serpentine, soldered hops
- mandatory
- 100 Ω in series on CLK and LOAD, at the ESP32 end
The node
The Hall switch sits at the exact center of the board, so the sensitive spot lands under the middle of the square at any pitch. A thick board costs field strength, not alignment.
| DRV5032FA | omnipolar Hall switch, board center |
|---|---|
| 74HC165 | 8-bit shift register, one per node |
| 8 × 3 mm | NdFeB magnet in each piece base |
| WS2812B | optional per-square LED, v2 only |
Two revisions
A chain is one revision end to end, and a single firmware flag says which. v1 is what exists in hardware; v2 is the smaller board, with the LED rail and the marker bit.
node v124 × 24 mm
component side
solder side
node v220 × 20 mm
component side
solder side
node v1
- pitch
- 24 × 24 mm
- conductors
- 5 per hop
- LED
- none
- marker bit
- none
- 8 × 8 cost
- ~$23 parts + ~$5 wire
150 boards manufactured; 32 assembled and reading correctly.
node v2
- pitch
- 20 × 20 mm
- conductors
- 7 per hop
- LED
- optional WS2812B
- marker bit
- yes
- 8 × 8 cost
- ~$28 incl. LEDs
Designed and verified; never fabricated.
Open on v2, none of it a board change: a hardware cutoff for the LED rail (64 LEDs at full white is 19.2 W into a closed cavity), 5 V injected per rank, and magnetic margin below about 40 mm square pitch. Build a pilot panel before a full run.
How it is checked
Everything regenerates from one Makefile: the PCBs come out of parametric KiCad generators, DRC and ERC run on the output, and the schematic netlist is matched against the board pad for pad.
The chain was simulated in ngspice across all 64 nodes before anyone soldered one. Fifty unit tests and a full simulated game run the real move-detection logic with no hardware attached.
/dev/ttyUSB0 115200
{"t":1021.480,"ev":"frame","nodes":64,"occ":32}
{"t":1023.660,"ev":"lift","sq":"e2"}
{"t":1024.120,"ev":"move","from":"e2","to":"e4","san":"e4"}
{"t":1026.900,"ev":"move","from":"e7","to":"e5","san":"e5"}
{"t":1027.400,"ev":"dead","node":42,"sq":"c6"}