Most chess apps keep you on a screen. The team at How To Electronics has built an AI chess coach that lets you play on an ordinary wooden board with physical pieces. An overhead ESP32-S3 camera watches the board, the system works out what you moved, plays back using the Stockfish engine and tells you, out loud, where your move went wrong.
The hardware
The build uses a Freenove ESP32-S3 N16R8 camera board (16 MB flash, 8 MB PSRAM) with an OV2640 camera that captures 1600 x 1200 images. It plugs into the team's own H2E Core carrier board, which adds an INMP441 I2S microphone, a MAX98357A I2S amplifier and speaker, an MCP23017 GPIO expander, an MCP73831 battery charger and a TPS61023 boost converter for the 5 V rail. The camera sits on a mount above a standard chessboard. The video covers the schematic, PCB design and SMD assembly as well as the software.
How it works
The ESP32-S3 firmware, written in ESP-IDF, handles the camera, the microphone, the speaker and a single button. The heavy lifting runs on a Python FastAPI backend:
- Seeing the move. After you move, the ESP32-S3 captures the board and the backend uses OpenAI vision to work out the new position. The Python-Chess library then checks the move against the rules.
- Playing back. Stockfish picks the reply at one of four levels: Beginner, Easy, Medium or Hard.
- Coaching. GPT-4o Mini writes the feedback, OpenAI speech recognition handles voice commands such as picking your colour and level, and text-to-speech reads it back through the speaker. The coach points out mistakes, suggests better moves and can let you take back a serious blunder.
A web dashboard shows the live game and the captured board images, and games can be saved and resumed.
Our take
The clever split here is that the microcontroller does what it is good at, capturing images and audio and driving a speaker, while the backend does vision, rules and chess strength. That keeps the device cheap and simple, and Stockfish ensures the moves are strong even though the language model only explains them. The trade-off is that it needs a network connection and an OpenAI account; a fully offline version would need a local board-recognition model. All PCB files, Gerbers, ESP32-S3 firmware and Python code are published with the written tutorial.
Image credit: How To Electronics (video thumbnail), cropped and resized.
About the author: Aswinth Raj is an electronics engineer and the editor of CircuitDigest, where he has published more than 150 hands-on projects and tutorials across Arduino, PIC, ESP32, Raspberry Pi and EV battery systems. He selects the stories on this page for what engineers and makers can actually learn or build from. Connect on LinkedIn
Add a comment
No account needed. Your comment appears once a moderator has reviewed it.