Skip to the content
2 layers220 × 70 mmAutonomous chess playing machine, the printed circuit board in 3D

Autonomous chess playing machine

rtweera/autochess

Fully autonomous chess playing machine with a physical chess board, allowing a human player to compete as if playing against another human, with an ELO rating of 2000.

Size
220 × 70 mm
Copper layers
2
Thickness
1.6 mm
Parts
21
Nets
74
Pads
214
Tracks, vias
485, 28
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
31 Aug 2024
Updated
3 Apr 2026

Overview

Autonomous chess playing machine is an open-source printed circuit board by rtweera, from the rtweera/autochess repository on GitHub. It is a 2-layer board of 220 × 70 mm with 21 parts on 74 nets, routed with 485 tracks and 28 vias.

It is built around the CD74HC4067M. Its parts include 9 connectors, 4 capacitors and 4 ICs.

Main components

1

README

README.md

AutoChess

An autonomous chess board project that combines:

  • Mechanical piece movement (XY stepper gantry + electromagnet)
  • Board state sensing (reed switches via multiplexers)
  • On-board chess engine (MicroMax-based logic)
  • Dual-microcontroller control flow (Arduino Mega + ESP-based board)

AutoChess banner


Overview

This repository contains firmware, PCB design files, and project assets for a physical chess board that:

  1. Detects the human player’s move from sensors,
  2. Validates and evaluates the move with an embedded chess engine,
  3. Computes the AI response,
  4. Physically moves pieces on the board.

The project appears structured for Human vs Computer (HvsC) gameplay with game-state handling (stalemate, invalid move, wins, punishment flow).


Repository Structure

text
autochess/
├── node_game &mega_game_algo/
│   ├── mega_game_algo/
│   │   ├── mega_game_algo.ino
│   │   └── global.h
│   └── node_game_algo/
│       └── node_game_algo.ino
├── Mux_codes/
│   └── module_testing/
│       └── module_testing.ino
├── pcb/
│   ├── autonomous chess playing machine/
│   └── libraries/
├── pcb_to_entc/
│   ├── acpm-arduino_motor_part/
│   ├── acpm-mux_part/
│   └── pre_final_to_entc/
├── EXMO/
│   └── main_banner.png
├── Datasheets/
├── AI Group 10 - Project Report.pdf
└── Autunomous Chess Board.pptx

System Architecture

1) Arduino Mega firmware (mega_game_algo.ino)

  • Handles the main game loop/state machine
  • Reads board sensors through multiplexers
  • Controls:
    • Stepper motors (X/Y movement)
    • Electromagnet pickup/drop
    • LCD display
    • Buttons and limit switches
  • Sends player move to AI controller and receives AI result/move through Serial2

2) ESP/Node firmware (node_game_algo.ino)

  • Runs a MicroMax-style chess engine
  • Validates incoming human move
  • Computes the computer move
  • Returns:
    • status codes (stalemate/invalid/win/etc.), or
    • a 4-char move coordinate (e.g. e2e4)

3) Sensor subsystem

  • Reed switch matrix read through mux lines (s0..s3) and mux inputs (m0..m3)
  • Board occupancy stored in arr[8][8] and compared against backups to detect move origin/destination

4) Motion subsystem

  • Two stepper channels (white/black motor pins in code naming)
  • Calibrates against limit switches
  • Supports:
    • straight moves
    • diagonal moves
    • knight movement path handling
    • castling handling
    • capture handling with resting zones

Communication Protocol (Mega ↔ Node)

Mega → Node

  • Sends player move as 4 ASCII chars + newline
  • Example: e2e4\n
  • Special restart signal: R

Node → Mega

  • Returns either a move (a1b2 format) or status code.
  • Mega checks first character:
    • S → stalemate
    • N → no valid move
    • P → player wins
    • C → computer wins
    • I → punishment
    • otherwise parse as move string

Firmware Entry Points

  • Mega setup/loop:
    • /home/runner/work/autochess/autochess/node_game &mega_game_algo/mega_game_algo/mega_game_algo.ino
  • Node setup/loop:
    • /home/runner/work/autochess/autochess/node_game &mega_game_algo/node_game_algo/node_game_algo.ino
  • Shared globals/constants:
    • /home/runner/work/autochess/autochess/node_game &mega_game_algo/mega_game_algo/global.h
  • Multiplexer test sketch:
    • /home/runner/work/autochess/autochess/Mux_codes/module_testing/module_testing.ino

Hardware Pin Mapping (from firmware)

Mega-side key pins

  • Multiplexer select: s0=24, s1=26, s2=28, s3=30
  • Multiplexer read inputs: m0=36, m1=38, m2=40, m3=42
  • Motors:
    • black step/dir: 29 / 27
    • white step/dir: 47 / 45
  • Electromagnet: 53
  • Buttons: white 12, black 11
  • Limit switches: white 23, black 25
  • Reset pin to AI board: 50

Node-side key pins

  • Serial + engine logic only in provided sketch (no board actuator pins)

Confirm physical wiring against PCB schematics before powering hardware.


Game Flow (HvsC)

  1. System starts and displays startup screen.
  2. Calibration homes trolley and moves to start position.
  3. White (human) move is detected from reed sensor changes.
  4. On white button press, move is sent to AI controller.
  5. AI responds with status or computer move.
  6. If move provided, Mega performs physical black/computer movement.
  7. Repeat until game-over state.

PCB and Manufacturing Files

Primary PCB resources are under:

  • /home/runner/work/autochess/autochess/pcb/
  • /home/runner/work/autochess/autochess/pcb_to_entc/

Includes:

  • .kicad_sch, .kicad_pcb, .kicad_pro design files
  • gerbers/ output folders
  • related custom libraries for DRV8825 modules
  • printable board PDFs in pcb_to_entc/pre_final_to_entc/

How to Build / Flash Firmware

No automated build scripts are included in this repository. Use the Arduino toolchain.

Suggested process

  1. Open .ino files in Arduino IDE / Arduino CLI.
  2. Select the correct board/port for each firmware target:
    • Mega sketch: mega_game_algo.ino
    • Node/ESP sketch: node_game_algo.ino
  3. Install required libraries (as referenced in source), including:
    • LiquidCrystal_I2C
    • standard Arduino core libraries
  4. Compile and upload each sketch to its target board.
  5. Open Serial Monitor(s) at 9600 baud for diagnostics.

Testing and Validation

Available in-repo validation artifact

  • Mux_codes/module_testing/module_testing.ino for basic mux signal testing.

Manual validation checklist

  • Calibration reaches and respects both limit switches.
  • Sensor scan detects a single move correctly (from/to squares).
  • Serial protocol roundtrip works between boards.
  • Electromagnet toggles reliably during pickup/drop.
  • Piece movement logic works for:
    • straight, diagonal, knight, castling, captures.

Known Notes / Limitations

  • Repository currently has no CI, unit tests, or automated lint/build pipeline.
  • Some directories include desktop.ini files from Windows environments.
  • File and folder naming is historical and includes spaces/special characters.

Documentation Assets

  • Project report: AI Group 10 - Project Report.pdf
  • Presentation: Autunomous Chess Board.pptx (filename in repository; title intent: "Autonomous Chess Board")

These likely contain additional mechanical/electrical background and design rationale.


Contributing

If you plan to contribute:

  1. Keep firmware changes separated by module (Mega vs Node).
  2. Document pin changes and protocol changes in this README.
  3. Validate hardware safety (limit switches, motor directions, current limits) before long runs.

License

No top-level project license file is currently present in this repository. Some bundled PCB library components include their own license files under pcb/libraries/.../License.txt.

Parts

21
QtyValueFootprintReferences
40.1uFCapacitor_THT:C_Rect_L4.6mm_W3.0mm_P2.50mm_MKS02_FKP02C1, C2, C3, C4
4CD74HC4067Package_DIP:DIP-24_W15.24mm_Socket_LongPadsU1, U2, U3, U4
1Circuit_ConnectorConnector_JST:JST_XH_B10B-XH-A_1x10_P2.50mm_VerticalJ1
1Line_1Connector_JST:JST_XH_B11B-XH-A_1x11_P2.50mm_VerticalJ2
1Line_2Connector_JST:JST_XH_B11B-XH-A_1x11_P2.50mm_VerticalJ3
1Line_3Connector_JST:JST_XH_B11B-XH-A_1x11_P2.50mm_VerticalJ4
1Line_4Connector_JST:JST_XH_B11B-XH-A_1x11_P2.50mm_VerticalJ5
1Line_5Connector_JST:JST_XH_B11B-XH-A_1x11_P2.50mm_VerticalJ6
1Line_6Connector_JST:JST_XH_B11B-XH-A_1x11_P2.50mm_VerticalJ7
1Line_7Connector_JST:JST_XH_B11B-XH-A_1x11_P2.50mm_VerticalJ8
1Line_8Connector_JST:JST_XH_B11B-XH-A_1x11_P2.50mm_VerticalJ9

The 17 most common of 21 parts.

More from rtweera/autochess

3
  • 2 layers220 × 70 mmAcpm arduino motor part, the printed circuit board in 3D

    Acpm arduino motor part

    rtweera/autochess

    Fully autonomous chess playing machine with a physical chess board, allowing a human player to compete as if playing against another human, with an ELO rating of 2000.

    34 parts
  • 2 layers220 × 70 mmAcpm arduino motor part, the printed circuit board in 3D

    Acpm arduino motor part

    rtweera/autochess

    Fully autonomous chess playing machine with a physical chess board, allowing a human player to compete as if playing against another human, with an ELO rating of 2000.

    34 parts
  • 2 layers220 × 70 mmAutonomous chess playing machine, the printed circuit board in 3D

    Autonomous chess playing machine

    rtweera/autochess

    Fully autonomous chess playing machine with a physical chess board, allowing a human player to compete as if playing against another human, with an ELO rating of 2000.

    21 parts

Similar boards

  • 2 layers312 × 140 mmTsynth2 Rev1.3, the printed circuit board in 3D

    Tsynth2 Rev1.3

    Electrotechnique/TSynth-Teensy4.1

    TSynth for Teensy 4.1

    108 parts182
  • 2 layers422.4 × 118.2 mmMidiMood (tht), the printed circuit board in 3D

    MidiMood (tht)

    silveirago/MidiMood

    This repository contains the code for a custom MIDI controller project called MidiMood, built using an ATmega32U4 microcontroller (or similar).

    53 parts82
  • 2 layers248.9 × 120.7 mm16nx, the printed circuit board in 3D

    16nx

    16n-faderbank/16nx

    16nx is a controller for musical instruments. Sixteen faders,MIDI over USB and jack, CV out, and I2C out. Based around RP2040.

    171 parts76
  • 4 layers100 × 100 mmOPDM, the printed circuit board in 3D

    OPDM

    brenonsantos/OpenPDM

    OpenPDM is an open-source programable Power Distribution Module for your car

    156 parts75MIT
  • 2 layers215.9 × 101.6 mmIps20, the printed circuit board in 3D

    Ips20

    gzweigle/open-hybrid-piano

    Building a hybrid MIDI digital piano

    135 parts61GPL-3.0
  • 2 layers152.4 × 95.3 mmControl board, the printed circuit board in 3D

    Control board

    carsonrobles/fpga-guitar-pedal

    FPGA based guitar effect station.

    51 parts36
  • 2 layers100 × 100 mmEavesdrum module, the printed circuit board in 3D

    Eavesdrum module

    tobigun/EavesDrum

    EavesDrum is an e-drum trigger module project, designed for musicians and makers. It allows you to connect drum pads or piezo triggers and converts their signals into MIDI events.

    103 parts25GPL-3.0
  • 4 layers33 × 65.5 mmOM FlexGrid Rigid PCB, the printed circuit board in 3D

    OM FlexGrid Rigid PCB

    Open-Muscle/OpenMuscle-FlexGrid

    60-sensor wearable with flexible PCB and pressure matrix

    65 parts19CERN-OHL-S-2.0

Questions

How big is the Autonomous chess playing machine PCB?

It measures 220 × 70 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Autonomous chess playing machine use?

21 parts, built around the CD74HC4067M. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Autonomous chess playing machine KiCad files?

From the rtweera/autochess repository on GitHub, at the commit this page was made from: the board is pcb_to_entc/acpm-mux_part/autonomous chess playing machine.kicad_pcb and its schematic pcb/autonomous chess playing machine/acpm-arduino_motor_part/acpm-arduino_motor_part.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Autonomous chess playing machine design in my own project?

Its repository states no licence, so its author keeps all rights: ask rtweera before reusing the design.