Smart Chess Board
An automated physical-to-digital chess system combining a 64-square magnetic sensor matrix, dual-processor hardware, board gestures, live online play, and Stockfish AI analysis.
Live Game Play & Sub-50ms Move Sync
Full over-the-board game showing physical piece tracking, mid-air capture handling, and real-time synchronization with the webapp.
Instant piece movement detection → Instant webapp board update, clock sync, and LED trajectory trail.
Lifting the King's Pawn, then the Queen's pawn starts AI analysis mode without touching a keyboard or screen. Other gestures exist to start features, no physical button on the board and 100% compatible without companion webapp
Edge LEDs continuously show time situation of both sides
Online chess forces players to stare at computer screens. Digitizing a physical board without bulky overhead cameras requires solving magnetic sensor baseline drift, tracking rapid piece movements during captures, and syncing clocks with minimal latency.
A dual-processor setup: an ESP32 microcontroller handles deterministic microsecond scanning across 64 Hall sensors and drives 152 LEDs, while a Raspberry Pi runs game state rules, Lichess connectivity, and Stockfish AI.
Physical piece movements also double as gestures to review games, restart matches, or train endgames directly on the wood.
Webapp & Analysis Interface
React 19 single-page application connected to the board via WebSockets
Interactive evaluation curve with clickable move nodes, move accuracy breakdown, and Stockfish Multi-PV candidate lines.
Live 64-square sensor voltage heatmap, per-square threshold calibration sliders (±3000), single-LED tests, and auto-zero calibration.
Blunder drills generated from past game mistakes, plus Grandmaster "Guess-the-Move" classic matches with physical LED hints.
Technical Specifications & Features
Overview of hardware scanning, LED drivers, online protocols, and automated tests
Board Gestures & Post-Game Analysis
Zero-Screen ControlTrigger software modes and review games through natural piece movements
No need to look at a monitor or touch a phone. When the board is set up, lifting the King's Pawn activates post-game Stockfish analysis, while corner pawns can trigger rematches or toggle LED night lighting.
- Setup Verification (
is_setup_ready): Gesture triggers only arm after all 32 pieces are verified in starting positions, avoiding accidental triggers during setup. - Alternative Line Exploration: During analysis, lifting pieces lets you explore "what-if" lines. The starting deviation square lights up in Purple; placing pieces back snaps the board back to the original game.
Magnetic Sensor Matrix & Capture Detection
Hardware & Firmware64-square magnetic Hall matrix with sub-50ms latency
64 miniature magnetic sensors beneath the wood detect piece lifts and placements in under 50ms. No cameras to align and no issues with hands blocking optical sensors during rapid moves.
- Analog Multiplexing: 64 linear Hall effect sensors scanned through 2× 16-channel
CD74HC4067multiplexers into the ESP32 12-bit ADC with automatic baseline drift compensation. - Mid-Air Capture Handling: During a capture, removing the victim piece leaves the square momentarily empty. The state engine buffers this intermediate state and confirms the move only when the capturing piece lands.
- Serial Framing: 921,600 baud serial connection with CRC-8 packet framing between the ESP32 coprocessor and the Raspberry Pi.
152-LED Matrix & Current Limiting
LED FeedbackMove feedback, perimeter win-chance eval bar, and power regulation
Each square contains 2 concealed addressable LEDs. Picking up a piece highlights valid destination squares, opponent moves trigger light trails, checks flash red, and edge LEDs show the live AI win probability.
- Layered Rendering: Base setup highlights → Move quality & eval bar → Transient move animations and check alarms.
- Move Quality Colors: Live classification — Green (Best), Cyan (Good), Amber (Inaccuracy), and Red (Blunder).
- Current Limiting: Firmware enforces a strict ≤220mA total current limit across both LED strips with a 256-entry gamma lookup table.
Lichess Online Play & Stockfish 17.1 AI
Online & AILichess Board API integration, Stockfish engine analysis, and custom blunder drills
Play live against online opponents on Lichess or challenge Stockfish AI locally. After games, the board generates custom blunder drills from your actual mistakes, and offers move-guessing practice for historical grandmaster games.
- NDJSON Streaming: Real-time HTTP/2 event streams synchronize game moves, resignations, and chess clocks without polling.
- Fair-Play Safeguard: Evaluation LEDs and hints are automatically disabled during rated online matches.
- Multi-PV Analysis: Computes the best line immediately for fast feedback, while multi-line candidate evaluations stream asynchronously in the background.
Automated Testing & Reliability (388 Tests)
Testing & QA100% passing test suite validating physical-digital edge cases
Automated tests cover edge cases like pawn promotions, castling sequences, disconnects, and packet loss, ensuring the physical and digital states stay synchronized.
- Chess Edge Cases: Underpromotions (Knight/Bishop/Rook), castling phases, en passant, and 50-move draw rules.
- Hardware Mocking: Pytest fixtures simulate serial packet drops, sensor jitter, and network reconnections without requiring physical hardware.
- State Reconciliation: React webapp reconciles board positions with server FEN updates using distance-aware animation timing.
Interested in discussing this project?
I would love to walk through the architecture, physical prototypes, or codebase in detail.