If you haven’t read the story of the original mechanical Turk, you really should. This was a 1770s machine that appeared to use complicated mechanisms to play competent chess against even very good human players, and it has fired the imaginations of everyone from computing pioneer Charles Babbage to today’s steampunk nerds. Here’s a great summary from Atlas Obscura.
The Turk has lent its name to many things over the years, including Amazon’s Mechanical Turk micro-job service, but the latest is the Pi-powered Raspberry Turk, which works like this:
The heart of the machine is a Raspberry Pi 3 running an open-source chess engine called Stockfish. A Pi camera module and a lot of custom Python code let the system translate the physical pieces into a chess position that the Stockfish engine can digest, and little tiny magnets embedded in the tops of the pieces let the robotic arm actually move things around.