My automatic chess board (the "Autopatzer") has reached the point where last night I was able to play its first online game against a real person using lichess's Boards API.

Feroz described playing online chess over a physical board as "very lockdown chic", which I liked.

And, since a lot of people ask:

patzer, n. A poor or amateurish chess player.

Overview

To actuate output moves, the board has X and Y axis motion stages, driven by NEMA17 stepper motors with GT2 timing belts, with an electromagnet mounted on the carriage. It's basically like a 3d printer but with no Z axis, and with an electromagnet instead of a hot-end. To detect input moves, the board has a hall-effect sensor underneath each square.

The electronics are controlled by a Teensy 3.2, which speaks to a Raspberry Pi over USB serial. All of the source code (and CAD models, and PCB design) are in the jes/autopatzer github repo.

Miles is currently furloughed from his day job and was looking for a project to do, so he has been working on the Electron app that provides the GUI displayed on the touchscreen.

You could argue that the board-related logic could have been written in Javascript and then it could be in the same program as the Electron GUI. You'd be right. I just found it more convenient to do the board logic in Perl.

The Raspberry Pi is mounted in a 3d-printed case at the side of the board and has a 5-inch 800x480 HDMI touchscreen:

The touchscreen is there to allow seeking a game, offering/accepting a draw, and resignation, and displaying clocks, move history, and current input move. There is a Cherry MX blue keyswitch mounted on the plastic case which provides basically the function of a "clock button": having moved a piece, the user must hit the button to confirm the move and end the turn. Hitting the button triggers an interrupt on one of the GPIO pins (which I initially tried to detect in Perl, but RPi::Pin was causing segfaults, hence the Python program).

Painting the squares

I first covered the board surface in masking tape.

Then marked out the grid and cut every other square out.

Then spray-painted the whole thing black.