Close
0%
0%

Mat@ir

A spherical chessboard where a robotic arm plays moves from an online game.

Public Chat
Similar projects worth following
0 followers

The goal of this project is to create a spherical chessboard where moves are played by a small robotic arm moving along a circular track.

The robotic arm will execute the moves made by players in an online chess game.

Our broader vision is to build multiple chessboards across different campuses of our school, allowing players to compete remotely. Each robotic arm will replicate the moves made by players in real-time on their respective boards.

  • 1 × ESP32-DevKitC-32E
  • 128 × Magnets
  • 3 × NEMA17 Stepper Motors
  • 1 × Nextion 3.5 inch display DISCOVERY SERIES
  • 3 × DRV8825 stepper motor driver

View all 12 components

  • Building the Backbone: Our Server & Network Infrastructure

    Nasser02/26/2025 at 02:23 0 comments

    Since the goal of the project is to allow people from different parts of the country to play against each other on their devices and on separate spherical chessboards, we needed to design a server-client infrastructure where the server relays requests between clients—the clients being both the game and the ESP32 microcontroller.

    After analyzing how all the components (game, server, ESP32) should interact, we created a diagram to illustrate how communication will take place.

    Our system is built around a server-client architecture using WebSockets for real-time communication. It consists of three main components:

    1. Game Clients (Web-based Chess Game) – Players interact with the game through their web browsers, sending move requests and receiving game updates from the server. Spectators can also connect to watch ongoing games.

    2. Server (Python WebSocket Backend) – The central hub that manages all game sessions, player connections, and communication between devices. It validates moves, relays commands, and synchronizes game states.

    3. ESP32 (Robotic Chessboard Controller) – The ESP32 microcontroller controls the robotic arm and executes chess moves on the physical spherical chessboard based on commands from the server.

    How It Works

    • Player Connection: Players authenticate using an ORB code, which links them to a specific chessboard. If an ORB is already in a game, they continue; otherwise, a new game is created.

    • Spectator Mode: Users can join as spectators by selecting an active game from the server's game list. The server continuously sends game state updates.

    • Move Execution:

      1. A player makes a move in the web game.
      2. The game client sends the move request to the server.
      3. The server validates the move and checks if the robotic chessboard is ready.
      4. If valid, the move is sent to both the opponent and the ESP32, which executes it on the physical board.
    • Game Synchronization: Any change in the game state is immediately broadcasted to all relevant clients.

    • Error Handling & Timeout: If an ORB disconnects or a player loses connection, the server resets the ORB and updates the game state accordingly.

    • Game Termination: Players can close a game, which triggers a reset command for the ORB and disconnects all clients.

    After implementing this Infrastructure (4000+ lines of code), we had a fully functional online game, with data being sent between the game, server, and ESP32 in real time.

    Code of the game can be found here : Github link

    Code of the server can be found here : Github link

    Code of the esp32 can be found here : Github link

  • Developing the Chess game

    Nasser02/26/2025 at 02:22 0 comments

    For our project, since we are playing on a spherical chessboard, the rules of chess are not the same as in classical chess. A variant of chess will be played. Given the spherical nature of the board, we had the choice between two variants: 
    Spherical chess (link), which fully utilizes the unique properties of the chessboard.

    Cylinder chess (link), which is typically played on a cylindrical board but can also be adapted to a spherical one.

    After researching both variants, we decided to settle on cylinder chess for two main reasons. First, it is much less confusing and easier for players to understand. Second, since we will be coding our chess game from scratch, implementing cylinder chess is significantly simpler. It is essentially standard chess but without the horizontal "walls," allowing pieces to wrap around the board horizontally.

    As mentioned, we will be developing the game from scratch for two reasons:

    1. We couldn't find any good open-source examples that fit our needs.
    2. Since the game must be playable online, designing the code from the ground up will allow us to easily integrate the networking functionality later.

    The game will be developed using GameMaker Studio, as we are already very comfortable with the software. It also provides solid networking capabilities and supports HTML export, which is essential for making the game playable in a web browser.

    Making the game was pretty straightforward; it was essentially like coding a normal chess game, except that whenever a position exceeded the chessboard limits, it would wrap around to the other side. In GameMaker, we implemented it like this:

    And as a said the rest was just coding a normal chess game, this was the final result :

    (Chess Set - Pixel Art)

    The next step was to implement networking into the game.

  • The goals of the project

    Nasser02/26/2025 at 02:22 0 comments

    The goal of this project is to create a spherical chessboard where moves are played by a small robotic arm moving along a circular track.

    The robotic arm will execute the moves made by players in an online chess game.

    Here is a rough draft of our vision for the final product :

    Our broader vision is to build multiple chessboards across different campuses of our school, allowing players to compete remotely. Each robotic arm will replicate the moves made by players in real-time on their respective boards.

    Our main inspiration is the OrbChess by NKD Puzzle: OrbChess – NKD Puzzle.

    We will first focus on the software aspects of the project—the chess game, game server, networking, etc.—before moving on to the hardware.

    For the implementation:

    • We'll use an ESP32 DevKit (full pinout) as the brain of the chessboard.
    • GameMaker Studio will be used to develop the chess game.
    • The game server will be built with Python using WebSockets for real-time communication.

    This project is ambitious as it covers IoT, mechanical design, game development, and networking.

View all 3 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates