What is MagiChess?

MagiChess is a computer operated chess robot that allows users to play a game of physical chess against a remote opponent. MagiChess closes the gap between physical and digital chess. To do this, we plan to create a chess board that allows users to play with an AI or a remote human opponent.

Interfacing with LiChess Server and User

To communicate, process information, control movements and accept user input, an internet connected Raspberry Pi is used. A Raspberry Pi is a credit-card sized computer that includes onboard WiFi capabilities and General Purpose Input/Output (GPIO) pins for interfacing with external systems. WiFi is used to enable the Pi’s internet connectivity and communication with Lichess.com, an open source online chess server. The Pi’s GPIO pins allow MagiChess to transmit movements and magnetic sensor commands to its XY-Gantry subsystem. MagiChess comes equipped with a touch display and speakers for user interfacing. The screen displays current game information, notifications, and accepts user input for game and system settings.


Chess piece with embedded magnet and RFID Tag inside.


Making Movements: The Chess Piece

Each chess piece is fitted with a magnet to aid moving. When placed on the chess board, the magnet will trigger the sensors used to monitor moves made by the user. The magnet is also used in moving chess pieces with an electromagnet under the chessboard.





Gantry Photo



Making Movements: The Gantry

The XY-Gantry located underneath the MagiChess board is responsible for piece movement. An electromagnet is attached to the head of the mechanical gantry. When turned on, it attracts a magnet embedded in a chess piece. The gantry will then move with the target piece in a desired path. Two stepper motors and drivers, an electromagnet, an RFID reader and a Microcontroller work together to control movements of the XY-Gantry.






Gantry Photo



Making Movements: Path Planning Algorithm

To avoid piece collisions and reduce move time, MagiChess implements a custom path planning algorithm. When a remote player executes a move, the algorithm determines a near optimal, collision free path between a target piece’s start and end location. The path planning process is executed by MagiChess’s Raspberry Pi. Solution paths are then transmitted to the XY-Gantry system’s microcontroller via the UART communication protocol.






Graphic explaining Path Planning



Sensing Movements: The Hall Sensor Array

Moving chess pieces autonomously is a challenging feat. To mitigate errors and enforce fault-tolerance, MagiChess is able to monitor the physical state of the board and detect a user’s move. MagiChess implements a Hall Sensor Array consisting of 64 magnetic hall sensors located under each cell to detect the presence of a chess piece. A microcontroller multiplexes 8 sensors at a time to scan for changes made on the chess board.

Flowcharts

Hardware + Software Diagram

Hardware and Software flow diagram