Smart Chess Board

ROSPythonComputer VisionRaspberry PiSolidWorks3D Printing
Smart Chess Board

Project Overview

I'm building an autonomous chess board that physically moves pieces to play against a human opponent. no screens, no manual input, just a traditional chess experience where the computer moves its own pieces. This ongoing project combines computer vision, robotics control, embedded systems, and mechanical design into one integrated system.

The board uses a Raspberry Pi for processing, an overhead camera for board state detection, a Python chess engine for move calculation, and a custom CoreXY gantry system with a servo-actuated magnet to physically move pieces from beneath the board. A traditional chess clock provides timing and serves as the trigger mechanism. when the human player hits their side of the clock, it signals the system to capture the board state, calculate its move, and execute.

Project Status: Currently in active development (2 semesters in progress). Hardware assembly is largely complete, with motors operational. Software integration and computer vision pipeline are the next major milestones.

Chess Board Hardware Current hardware assembly with CoreXY gantry and electronics


Design Goals

This isn't just about moving chess pieces, it's about creating an authentic chess-playing experience against a computer opponent that feels like playing against another person. The board maintains the tactile, focused nature of traditional chess while incorporating autonomous capabilities.

Core Requirements:

  1. Seamless gameplay: Human moves piece → hits clock → computer moves piece
  2. Reliable piece detection: Track all 32 pieces across 64 squares in real-time
  3. Precise motion: Move pieces accurately without collisions or drops
  4. Standard chess interface: Regular pieces, standard board, traditional clock

System Architecture

Hardware Components

Mechanical System:

Electronics:

Board Construction:

CAD Model SolidWorks assembly showing complete mechanical design


Mechanical Design & Manufacturing

CoreXY Gantry System

I selected a CoreXY configuration because both motors remain stationary (mounted to the frame), reducing moving mass compared to traditional Cartesian systems. This allows for:

Gantry System CoreXY belt routing with stationary motors

Custom 3D Printed Components

This is my first major SolidWorks project, and I've designed every custom component from scratch:

Key Parts Designed:

Design Challenges:

Material Choices:

3D Printed Parts Sample of custom 3D printed brackets and mounts

Learning SolidWorks

This project forced me to learn advanced CAD modeling:

Creating a high-fidelity model that I could actually build from was a major milestone. The CAD model serves as the single source of truth for all dimensions, hole placements, and assembly procedures.


Computer Vision Pipeline (Planned)

The vision system is the brain of the operation, but it's still in the design phase. Here's the planned approach:

1. Camera Calibration

2. Board Detection

3. Piece Detection

4. State Tracking (Key Innovation)

Instead of trying to identify piece types visually (computationally expensive and unreliable), the system:

  1. Knows the starting position (standard chess setup)
  2. Tracks which blobs move between frames (before/after player move)
  3. Uses chess engine to validate that the detected move is legal
  4. Updates internal board state accordingly

Pseudocode:

def detect_board_state(current_frame, previous_frame): # Find all piece blobs in both frames current_blobs = find_blobs(current_frame) previous_blobs = find_blobs(previous_frame) # Identify which blob moved moved_blob = find_difference(current_blobs, previous_blobs) # Determine from_square and to_square from_square = blob_to_square(moved_blob.old_position) to_square = blob_to_square(moved_blob.new_position) # Validate move is legal for piece at from_square if chess_engine.is_legal(from_square, to_square): update_board_state(from_square, to_square) else: request_player_retry() # Invalid move detected

This approach is much more robust than trying to do shape-based piece recognition, which fails under varying lighting and viewing angles.


Motion Control System

Current Status

The gantry is mechanically complete and motors are functional. I can send commands to move the X and Y axes. However, the integrated control system (path planning, collision avoidance, coordinated motion) is still being developed.

Planned Motion Planning

Path Planning Algorithm:

def plan_move(from_square, to_square, board_state): """ Plan collision-free path from source to destination """ # Check if direct path is clear if is_path_clear(from_square, to_square, board_state): return [from_square, to_square] # If destination occupied (capture), remove captured piece first if board_state[to_square] is not None: captured_path = move_to_graveyard(to_square) main_path = [from_square, to_square] return captured_path + main_path # Otherwise, plan around obstacles (A* pathfinding) return find_obstacle_free_path(from_square, to_square, board_state)

Motion Execution:

Servo-Actuated Magnet

The end effector uses a servo motor that rotates 90° to bring a magnet close to the underside of the board:

This simple mechanism is more reliable than an electromagnet (no current control needed) and easier to mount on a moving gantry.


ROS Integration (In Development)

The software will be structured as modular ROS nodes:

Planned Node Architecture:

/camera_node → Publishes board state (FEN strings) /engine_node → Subscribes to board state, computes moves /motion_node → Subscribes to move commands, controls gantry /clock_node → Detects clock hits, triggers turn changes

Benefits of ROS:

I'm still learning ROS as part of this project, so the node structure may evolve as I understand best practices better.


Game Clock Integration

The chess clock serves a dual purpose:

  1. Timing: Tracks how much time each player has remaining (standard chess timer)
  2. Turn trigger: When the human hits their side of the clock, it sends a signal to the Raspberry Pi GPIO, indicating "my turn is complete, your turn now"

This creates a natural interaction. Players use the clock exactly as they would in a normal chess game, and it seamlessly triggers the computer's response.

Workflow:

  1. Human makes move on board
  2. Human hits chess clock
  3. GPIO interrupt triggers on Raspberry Pi
  4. Camera captures image
  5. Vision system detects move
  6. Chess engine calculates response
  7. Gantry executes computer's move
  8. Clock switches back to human's time

Digital Twin (Early Stage)

I've created a preliminary NVIDIA Isaac Sim model of the chess board to:

Current Status: Basic model exists but needs refinement. The digital twin will become more valuable once the vision and control systems are operational, allowing full simulation-to-reality validation.

Isaac Sim Model Early-stage Isaac Sim digital twin (being refined)


Technical Challenges

1. First-Time SolidWorks User

This project was my introduction to professional CAD software. Challenges included:

Impact: Gained proficiency in a critical engineering tool. The final CAD model is detailed enough to manufacture from without additional drawings.

2. 3D Printing Tolerances

Achieving smooth motion in the gantry required learning how to design for FDM printing:

Solution: Design with adjustability in mind. Slots instead of holes, tensioners with range, multiple test prints to dial in fits.

3. Electronics Integration (Ongoing)

Current Challenge: Wiring all components cleanly and reliably. I'm using off-the-shelf boards (no custom PCB), so cable management and connector reliability are critical.

Approach:

4. Computer Vision (Upcoming)

Anticipated Challenges:

Planned Solutions:


Current Status

✅ Completed

🔨 In Progress

📅 Coming Next (Priority Order)

  1. Get gantry moving smoothly: Write ROS nodes for coordinated X-Y motion
  2. Test magnet pickup: Verify servo-magnet system reliably grabs/releases pieces
  3. Implement vision pipeline: Get basic piece detection working
  4. Integrate chess engine: Connect Python chess library to board state
  5. Full system test: Complete human-vs-computer game

What I'm Learning

This project is teaching me system integration at a level I haven't experienced before:

Mechanical Engineering:

Software Engineering:

Electrical Engineering:

Project Management:

Most Important Lesson: Integration is harder than implementation. Each subsystem works in isolation, but making them work together reliably requires careful interface design, robust error handling, and extensive testing.


Future Enhancements

Once the core system is operational, potential additions include:

Software Features:

Hardware Improvements:


Technologies Used

Mechanical Design: SolidWorks (first major project)
Manufacturing: FDM 3D Printing (PLA), Laser Cutting (Acrylic, Wood)
Electronics: Raspberry Pi 4, NEMA 17 Stepper Motors, Servo Motor
Software: Python, ROS (Noetic), OpenCV (planned), Python Chess Engine
Development Tools: VS Code, Docker, Git
Simulation: NVIDIA Isaac Sim (early-stage digital twin)


This project is ongoing and represents my most ambitious engineering effort to date. I am integrating mechanical, electrical, and software systems into one cohesive product. Follow the GitHub repository for updates as development continues.