This is an old revision of the document!
The Interactive Electronic Chessboard is a project that aims to enhance the chess-playing experience by providing real-time visual feedback through individually addressable RGB LEDs placed under each of the 64 squares. Pieces are detected using a matrix of reed switches and neodymium magnets embedded in the base of each piece.
When a player picks up a piece, the board highlights all legal moves in green, the selected square in yellow, and any check situation in red. Invalid moves trigger a short red flash. The board state is transmitted in real time to a laptop via UART, where a Python script displays the game.
Purpose: To create an interactive and educational chess experience that helps players — especially beginners — understand legal moves intuitively through direct visual feedback on the board.
GitHub Repository: To be announced
The system is split into two main subsystems:
To be posted.
| No | Component | Role |
|---|---|---|
| 1 | ESP32-WROOM-32D DevKit 38P | Main microcontroller, 240MHz dual-core |
| 2 | WS2812B LED strip 60LED/m IP30, 2×1m | 64 individually addressable RGB LEDs |
| 3 | Reed switch N/O 2×14mm, 100 pcs | Piece presence detection on each square |
| 4 | Neodymium magnet N52 disc 5×2mm, 50 pcs | Embedded in piece bases |
| 5 | 5V 3A DC power supply | Powers the LED strip |
| 6 | 330Ω resistor 1/4W | DATA line protection for WS2812B |
| 7 | 10kΩ resistors 1/4W, 8 pcs | Pull-up on column lines (GPIO34/35 mandatory external) |
| 8 | Electrolytic capacitor 1000µF 6.3V | Inrush current protection for LED strip |
| 9 | Ceramic capacitors 100nF, 3 pcs | Decoupling on ESP32 power supply |
| 10 | Dupont wires 30cm (M-M, M-F, F-F) | Component interconnections |
| 11 | Chess set with pieces | Game pieces (magnets embedded in bases) |
| GPIO | Function | Direction |
|---|---|---|
| GPIO4 | WS2812B DATA (through 330Ω) | OUTPUT |
| GPIO2 | Row R1 | OUTPUT |
| GPIO0 | Row R2 | OUTPUT |
| GPIO18 | Row R3 | OUTPUT |
| GPIO19 | Row R4 | OUTPUT |
| GPIO27 | Row R5 | OUTPUT |
| GPIO14 | Row R6 | OUTPUT |
| GPIO12 | Row R7 | OUTPUT |
| GPIO13 | Row R8 | OUTPUT |
| GPIO32 | Column A | INPUT + internal pull-up |
| GPIO33 | Column B | INPUT + internal pull-up |
| GPIO34 | Column C | INPUT + external 10kΩ pull-up (input-only pin) |
| GPIO35 | Column D | INPUT + external 10kΩ pull-up (input-only pin) |
| GPIO15 | Column E | INPUT + internal pull-up |
| GPIO16 | Column F | INPUT + internal pull-up |
| GPIO17 | Column G | INPUT + internal pull-up |
| GPIO5 | Column H | INPUT + internal pull-up |
Schematic to be added
Matrix scanning: The ESP32 drives each of the 8 row pins LOW sequentially (~100Hz scan rate) and reads the 8 column pins. The result is a 64-bit board occupancy map stored as uint8_t board_state[8].
Board state representation: uint8_t board[64] — lower 3 bits = piece type (0=empty, 1=pawn, 2=rook, 3=knight, 4=bishop, 5=queen, 6=king), bit 3 = color (0=white, 1=black).
Chess logic: Legal move generation for all piece types. On piece lift, computes all valid destination squares. Detects check and checkmate conditions.
LED control: On every state change, computes the color map for all 64 LEDs and pushes it via FastLED. Colors: green = valid move, yellow = selected piece, red = check/invalid move, off = empty square.
UART output: On every confirmed move, sends board state in simplified FEN notation at 115200 baud.
void loop() { scan_matrix(board_state); // read all 64 reed switches if (board_state != prev_state) { compute_delta(prev_state, board_state); if (piece_lifted) { legal_moves = get_legal_moves(from_square); set_leds_green(legal_moves); set_led_yellow(from_square); } if (piece_placed) { if (is_valid_move(from_square, to_square)) { update_board(from_square, to_square); switch_turn(); send_uart_fen(); if (king_in_check()) set_led_red(king_square); } else { flash_red(to_square); // invalid move feedback } } FastLED.show(); prev_state = board_state; } }
The project successfully demonstrates the integration of multiple ESP32 peripherals — GPIO matrix scanning, RMT hardware for WS2812B, and UART — into a functional hardware product. The RGB LED visual feedback proved intuitive for indicating legal moves, and the reed switch matrix provided reliable piece detection without complex analog circuitry.
To be posted.
Author: Alexandru-Constantin Strugariu
Group: 333CD
Lab Assistant: Jan Alexandru Văduva