Back to Portfolio Robin De Lissnyder
EMBEDDED HARDWARE • PYTHON & REACT • CHESS AI

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.

ESP32 C++ Coprocessor Raspberry Pi / FastAPI React 19 & TypeScript Real-Time WebSockets Stockfish 17.1 AI 388 / 388 Automated Tests
Video Demonstrations 10-Min Live Match

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.

Select a Video
Physical Board (ESP32 + 64 Hall MUX)
Webapp Analysis (React 19 + Stockfish 17.1)
1
Piece Tracking

Instant piece movement detection → Instant webapp board update, clock sync, and LED trajectory trail.

2
Board Gestures

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

3
Perimeter Eval Bar

Edge LEDs continuously show time situation of both sides

The Problem

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.

The Solution

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

React 19 • TypeScript • Tailwind
Webapp Stockfish Analysis Panel
Stockfish 17.1 Multi-PV
Stockfish Analysis Panel Live Eval

Interactive evaluation curve with clickable move nodes, move accuracy breakdown, and Stockfish Multi-PV candidate lines.

Eval Curve Accuracy Stats
Sensor Calibration Matrix
8x8 ADC Heatmap
Sensor Calibration Matrix 12-Bit ADC

Live 64-square sensor voltage heatmap, per-square threshold calibration sliders (±3000), single-LED tests, and auto-zero calibration.

64-Hall MUX Auto-Zero
Puzzles & Practice Panel
Training & Classics
Puzzles & Practice Tactical Drills

Blunder drills generated from past game mistakes, plus Grandmaster "Guess-the-Move" classic matches with physical LED hints.

Mistake Replay LED Hints

Technical Specifications & Features

Overview of hardware scanning, LED drivers, online protocols, and automated tests

5 Core Subsystems
01

Board Gestures & Post-Game Analysis

Zero-Screen Control

Trigger software modes and review games through natural piece movements

State Machine Piece Gestures

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.

Implementation Details
  • 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.
02

Magnetic Sensor Matrix & Capture Detection

Hardware & Firmware

64-square magnetic Hall matrix with sub-50ms latency

ESP32 C++ CD74HC4067 MUX CRC-8 Serial

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.

Implementation Details
  • Analog Multiplexing: 64 linear Hall effect sensors scanned through 2× 16-channel CD74HC4067 multiplexers 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.
03

152-LED Matrix & Current Limiting

LED Feedback

Move feedback, perimeter win-chance eval bar, and power regulation

WS2812B Serpentine 3-Layer Engine ≤ 220mA Limit

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.

Implementation Details
  • 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.
04

Lichess Online Play & Stockfish 17.1 AI

Online & AI

Lichess Board API integration, Stockfish engine analysis, and custom blunder drills

Lichess API Stockfish 17.1 HTTP/2 NDJSON

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.

Implementation Details
  • 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.
05

Automated Testing & Reliability (388 Tests)

Testing & QA

100% passing test suite validating physical-digital edge cases

388 Tests Passing Mock Hardware Pytest

Automated tests cover edge cases like pawn promotions, castling sequences, disconnects, and packet loss, ensuring the physical and digital states stay synchronized.

Test Coverage Details
  • 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.