2023 Autonomous Systems & AI

Automatic Chess Playing Robot

An autonomous system designed for a single player to compete against a Chess AI. The AI's pieces move automatically using a hidden electromagnet system, while the player's moves are detected by hall-effect sensors embedded under each square.

Playing Area

20"×20"

Tournament-standard size chessboard

Chess Engine

Stockfish 14.1

Advanced chess AI with robust decision-making

Sensors

64

Hall-effect sensors (one under each square)

The Challenge

Creating an autonomous chess-playing system presented several key challenges:

  • Developing a mechanism to move chess pieces without human intervention
  • Designing a reliable system to detect player moves
  • Integrating a chess AI with physical movement systems
  • Building a robust physical structure to house all components
  • Creating a seamless user experience that preserves the feel of real-life chess
First Chess Robot Drawing

First Chess Robot Drawing

The Solution

We developed an integrated system featuring:

  • A two-axis gantry system with an electromagnet to move the AI's pieces
  • An 8×8 hall-effect sensor matrix to detect player moves
  • Integration with the Stockfish 14.1 chess engine via UCI
  • Custom 3D-printed components for precise fit and rapid iteration
  • A robust software architecture to coordinate all systems
Gantry System Assembly

Two-Axis Gantry System Assembly

The mechanical subsystem was designed to move pieces across the board with precision and reliability:

  • Two NEMA 17 stepper motors controlling an electromagnet through a two-axis gantry system
  • M8 "fast threaded" rods connected to steppers via couplings for precise movement
  • Custom-designed and 3D-printed mounts for steppers, rods, electromagnets, and bearings
  • Unthreaded rods added for additional stability during movement
  • 20"×20" playing field matching American tournament standard dimensions

Technical Implementation

The system architecture consists of three main components working together:

Software: Python controls game flow using the Python Chess Library, handling move validation and AI integration. The Chess Drive Class translates chess moves to motor commands, while the MoveSensor class interprets player actions from the hall-effect sensor data.

Electrical: An 8×8 Hall Effect Sensor Matrix uses two CD4051BE multiplexer/decoders to read sensor values, while the electromagnet is controlled via a 2N3904 NPN switching transistor. Two NEMA 17 Stepper motors connected to A4988 drivers control the gantry movement.

Chess System Logic

System Logic

Development Process

The project was developed over three main sprints:

Sprint 1: Concept development, initial testing with a DC motor and temporary electromagnet, and exploration of LED matrix technology.

Sprint 2: First draft of the box design, iteration on 3D-printed mounts, and transition from a 2×2 test matrix to PCB design for the full 8×8 sensor matrix.

Sprint 3: Final assembly of the gantry system, completion of the hall effect sensor matrix, and integration of all subsystems. This sprint included significant troubleshooting of motor control issues and optimization of movement parameters.

Hall Effect Matrix Schematic

Hall Effect Sensor Matrix Schematic

Key Subsystems

Mechanical System

  • Two-axis gantry with NEMA 17 stepper motors
  • Custom 3D-printed mounts for all components
  • Electromagnet mount with dual-rod stabilization
  • Linear bearings for smooth movement across axes
  • Ball bearings to minimize rotational friction

Detection System

  • A3144 Hall effect sensors to detect magnets in chess pieces
  • CD4051BE multiplexer/decoder system for efficient sensor reading
  • MoveSensor class to interpret pickup and placement actions
  • Special handling for piece captures and moves
  • Position determination through matrix scanning

Control System

  • Python Chess Library for game state management
  • Stockfish 14.1 chess engine for AI decisions
  • Serial communication between Python and Arduino
  • CNC shield with A4988 stepper drivers
  • Transistor-controlled electromagnet activation

Challenges Overcome

  • Stepper motor acceleration optimization
  • Splitting large components for manufacturing constraints
  • Interdisciplinary troubleshooting across subsystems
  • PCB design issues and alternatives for sensor layout
  • Limited budget and timeline constraints