The Mechanical Turk: Difference between revisions

From Randomdata wiki
Jump to navigation Jump to search
Created page with "= The Mechanical Turk (project) = == Overzicht == ''The Mechanical Turk'' is een technisch en ambachtelijk schaakbordproject ontwikkeld binnen Hackerspace RandomData. Het project combineert houtbewerking, 3D-printing, robotica, NFC-technologie en softwareontwikkeling. Het doel is om een fysiek schaakbord te bouwen dat automatisch schakelt tussen fysieke en digitale zetten. Hiermee kunnen spelers schaakwedstrijden spelen tegen online tegenstanders via Chess.com, terwijl..."
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
= The Mechanical Turk (project) =
= The Mechanical Turk (project) =


== Overzicht ==
== Overview ==
''The Mechanical Turk'' is een technisch en ambachtelijk schaakbordproject ontwikkeld binnen Hackerspace RandomData. Het project combineert houtbewerking, 3D-printing, robotica, NFC-technologie en softwareontwikkeling. Het doel is om een fysiek schaakbord te bouwen dat automatisch schakelt tussen fysieke en digitale zetten. Hiermee kunnen spelers schaakwedstrijden spelen tegen online tegenstanders via Chess.com, terwijl de zetten live en fysiek op het bord worden uitgevoerd.
''The Mechanical Turk'' is a technical and artisanal chessboard project developed within the Dutch hackerspace [[Hackerspace RandomData]]. It combines woodworking, 3D printing, NFC technology, robotics, and Python development to create a physical chessboard that synchronizes with digital chess games played on platforms like [[Chess.com]].


Het is een moderne knipoog naar de originele ''Mechanical Turk'' uit 1770. In plaats van een verborgen schaakmeester zit er nu een programmeerbare mechanische arm onder het bord, aangestuurd door een Raspberry Pi.
Moves from an online opponent are physically executed on the board by a hidden robotic arm, while moves made on the physical board are detected and sent back to the online game. The name is a modern reference to the 18th-century chess automaton known as ''The Mechanical Turk'', which falsely appeared to play autonomously. This version is fully transparent and truly functional.


== Beschrijving van het project ==
== Project Lead ==
Het bord wordt met de hand gebouwd uit meerdere soorten hout, waaronder mahonie. Elk schaakstuk wordt geprint met een 3D-printer en handmatig afgewerkt. Onder elk stuk zit een unieke NFC-sticker.
The project is led by '''0ffset_0x52''', also known as '''UEV52'''. Those interested in contributing can contact him via SignalChat or the Mattermost channel of Hackerspace RandomData.


Onder het bord bevindt zich een gridstructuur waarin een magnetische arm beweegt. Deze arm beweegt verticaal om een stuk op te tillen en horizontaal om het over het bord te verplaatsen. Het systeem weet waar elk stuk zich bevindt dankzij de NFC-tags.
== Goals ==
* Build a working physical chessboard that mirrors and controls online games
* Automate physical piece movement using a robotic magnetic arm
* Enable real-world games against Chess.com opponents and AI bots
* Create a platform that fuses old-world craftsmanship with modern automation


Wanneer een tegenstander online een zet doet, haalt een Python-script op de Raspberry Pi deze op via de Chess.com API. De arm voert vervolgens de fysieke zet uit. Wanneer de speler zelf een zet doet op het bord, wordt deze herkend via NFC en doorgestuurd naar Chess.com.
== Technical Design ==
* Each chess piece contains a unique NFC tag
* A magnetic robotic arm moves along X, Y, and Z axes beneath the board
* Pieces are lifted magnetically and placed using scripted coordinates
* The system tracks each piece's position via NFC scans
* All movement and logic are handled via a custom Python script
* Synchronization with Chess.com is achieved using their public API


== Technische werking in het kort ==
== Required Components ==
* Schaakstukken hebben unieke NFC-tags
 
* De magnetische arm beweegt in een X/Y-grid en tilt stukken verticaal op
{| class="wikitable" style=\"text-align:left; width:100%;\"
* De Raspberry Pi bestuurt de arm via Python
! Component !! Specification / Version !! Description
* De zetten worden opgehaald of verstuurd via de Chess.com API
|-
| Raspberry Pi || Raspberry Pi 4 Model B (4GB RAM) || Controls motor logic, NFC reading, and API communication
|-
| Operating System || Raspberry Pi OS 64-bit || Platform for running scripts
|-
| Programming Language || Python 3.11 || Controls logic and hardware
|-
| NFC Reader || PN532 (I2C) || Detects pieces based on tag IDs
|-
| NFC Tags || NTAG213 / NTAG215 || Unique ID per chess piece
|-
| Stepper Motors || NEMA 17 + A4988 drivers || Moves the magnetic arm along X/Y grid
|-
| Servo Motor || SG90 or MG995 || Controls vertical lifting (Z-axis)
|-
| Magnet || Neodymium (6×3 mm) || Picks up pieces magnetically
|-
| Chess Pieces || 3D printed in PLA+ || Finished by hand: sanded, primed, painted, polished
|-
| Board Material || Mahogany, walnut, maple || Layered and lacquered for appearance
|-
| Tools || Circular saw, sander, engraver, clamps || Used in board construction
|-
| Finishing Materials || Acrylic paint, filler primer, lacquer || For visual quality and durability
|-
| Connectivity || WiFi or Ethernet || For online integration with Chess.com
|}
 
== Example Code ==
Below is a simple Python example that retrieves the last move from a Chess.com game and prints it:


== Voorbeeldscript ==
<syntaxhighlight lang=\"python\">
<syntaxhighlight lang=\"python\">
import chess
import chess.engine
import requests
import requests
from time import sleep


# Simpel voorbeeld: haal zet op van Chess.com API
def get_last_move(game_id):
def get_last_move(game_id):
     url = f\"https://api.chess.com/pub/game/{game_id}\"
     url = f\"https://api.chess.com/pub/game/{game_id}\"
     response = requests.get(url)
     response = requests.get(url)
     data = response.json()
     data = response.json()
     return data['moves'].split()[-1]
     moves = data['moves'].split()
    return moves[-1] if moves else None
 
move = get_last_move('example-game-id')


# Placeholder: zet motor aan om stuk van A2 naar A4 te verplaatsen
move = get_last_move('game-id-hier')
if move == 'a2a4':
if move == 'a2a4':
     print(\"Verplaats pion van A2 naar A4\")
     print(\"Move pawn from A2 to A4\")
     # stuur signaal naar mechanische arm
     # Insert motor control logic here
</syntaxhighlight>
</syntaxhighlight>


== Bouwplan en tijdlijn ==
== Construction Timeline ==
 
=== Fase 1 – Voorbereiding en ontwerp (week 1–2) ===
* Ontwerp van schaakstukken in CAD
* Grid- en mechaniekconcept uitwerken
* Houtselectie
* Planning


=== Fase 2 – 3D-printen en afwerking (week 3–4) ===
=== Phase 1: Planning and Design (Weeks 1–2) ===
* Printen in PLA
* Create CAD designs for chess pieces
* Schuren, primen, schilderen, polijsten
* Define board layout and grid mechanics
* NFC-tags bevestigen
* Choose wood types for contrast and durability


=== Fase 3 – Bordconstructie (week 5–6) ===
=== Phase 2: 3D Printing and Finishing (Weeks 3–4) ===
* Hout zagen en frezen
* Print pieces in PLA+ filament
* Gridstructuur maken
* Sand, prime, paint, and polish each piece
* Schaakvlak ontwerpen met inlay/gravure
* Affix NFC tags to the bottom of each piece
* Verlijmen en lakken


=== Fase 4 – Mechanische arm (week 7–8) ===
=== Phase 3: Board Construction (Weeks 5–6) ===
* Opbouw arm met servo’s/stappenmotoren
* Cut and shape wood components
* Testen op X/Y/Z-beweging
* Route out internal space for grid and arm
* Kalibratie
* Inlay or engrave chess squares
* Assemble and lacquer the board


=== Fase 5 – Software & Raspberry Pi (week 9–10) ===
=== Phase 4: Mechanical Arm (Weeks 7–8) ===
* Python-scripts schrijven
* Assemble X/Y movement system using stepper motors
* NFC-lezer integreren
* Integrate vertical servo-lifting mechanism
* Chess.com koppeling
* Test magnetic pickup and alignment
* Logging en foutafhandeling


=== Fase 6 – Eindtest en integratie (week 11–12) ===
=== Phase 5: Software Development (Weeks 9–10) ===
* Volledige systeemtest
* Write motor control scripts in Python
* Test met Chess.com en lokale AI
* Integrate NFC reader and calibrate tag detection
* Fine-tuning
* Connect to Chess.com API and handle logic
* Optionele toevoegingen zoals LEDs en geluid


== Randvoorwaarden ==
=== Phase 6: Testing and Integration (Weeks 11–12) ===
* Full system test with online games
* Refine movements and calibrate grid
* Add logging, error handling, and safety checks


{| class=\"wikitable\"
== Future Expansions ==
! Component !! Specificatie/Versie !! Toelichting
* Add local AI support via [[Stockfish (chess engine)]]
|-
* Use RGB LEDs for visual feedback
| Raspberry Pi || Raspberry Pi 4 Model B (4GB) || Voor besturing en scripts
* Add sound effects for capture, check, and checkmate
|-
* Integrate OLED display to show current notation
| OS/software || Raspberry Pi OS 64-bit, Python 3.11 || Voor API-koppeling en motorsturing
* Enable voice control or multiplayer sync between boards
|-
| NFC-lezer || PN532 module via I2C || Voor uitlezen van schaakstukken
|-
| NFC-tags || NTAG213 of NTAG215 || Unieke ID's per stuk
|-
| Motoren || NEMA 17 + A4988 drivers || X/Y-beweging van arm
|-
| Servo (Z-as) || SG90 of MG995 || Verticaal optillen van stukken
|-
| Magneet || Neodymium 6x3 mm || Voor stukkoppeling
|-
| 3D-printer || Bambu Lab P1P of gelijkwaardig || Printen van stukken
|-
| Filament || PLA+ || Beter afwerkbaar dan standaard PLA
|-
| Houtsoorten || Mahonie, esdoorn, walnoot || Visueel contrast op het bord
|-
| Gereedschap || Cirkelzaag, schuurmachine, graveermachine || Voor houtbewerking en afwerking
|-
| Verf & lak || Fillerprimer, acrylverf, houtlak || Voor professionele afwerking
|-
| Lijm & klemmen || Houtlijm, klemmen || Voor bordconstructie
|-
| Meetgereedschap || Geodriehoek, schuifmaat || Nauwkeurige plaatsing
|-
| Internet || WiFi of Ethernet || Voor communicatie met Chess.com
|}


== Projectleiding ==
== Historical Context ==
Het project wordt geleid door '''0ffset_0x52''', beter bekend als '''UEV52'''. Wie wil bijdragen aan dit project, kan contact opnemen via de SignalChat of zich melden in het RandomData Mattermost-kanaal.
The original ''Mechanical Turk'' was a hoax automaton built by Wolfgang von Kempelen in 1770. Though it appeared to play chess autonomously, it concealed a hidden human operator. This project reimagines the same premise using modern technologies—robotics, NFC, and open-source software—to achieve the illusion in reality, transparently and without deception.


== Toekomstige uitbreidingen ==
== See Also ==
* Lokale AI met Stockfish
* [[Chess.com]]
* LEDs voor visuele feedback
* [[Stockfish (chess engine)]]
* Geluid bij schaak/mat
* [[Raspberry Pi]]
* OLED-display voor zettennotatie
* [[Hackerspace]]
* Spraakbesturing of remote multiplayer
* [[Wolfgang von Kempelen]]


== Achtergrond en inspiratie ==
== External Links ==
Het originele concept van de ''Mechanical Turk'' werd in 1770 gebouwd door Wolfgang von Kempelen. Waar toen een menselijke schaakmeester verborgen zat om het spel te sturen, werkt deze moderne versie volledig transparant en digitaal. Het project combineert kunst, techniek en nostalgie tot een interactief schaakplatform.
* [https://www.chess.com Chess.com]
* [https://www.randomdata.nl Hackerspace RandomData]

Latest revision as of 19:10, 3 July 2025

The Mechanical Turk (project)

Overview

The Mechanical Turk is a technical and artisanal chessboard project developed within the Dutch hackerspace Hackerspace RandomData. It combines woodworking, 3D printing, NFC technology, robotics, and Python development to create a physical chessboard that synchronizes with digital chess games played on platforms like Chess.com.

Moves from an online opponent are physically executed on the board by a hidden robotic arm, while moves made on the physical board are detected and sent back to the online game. The name is a modern reference to the 18th-century chess automaton known as The Mechanical Turk, which falsely appeared to play autonomously. This version is fully transparent and truly functional.

Project Lead

The project is led by 0ffset_0x52, also known as UEV52. Those interested in contributing can contact him via SignalChat or the Mattermost channel of Hackerspace RandomData.

Goals

  • Build a working physical chessboard that mirrors and controls online games
  • Automate physical piece movement using a robotic magnetic arm
  • Enable real-world games against Chess.com opponents and AI bots
  • Create a platform that fuses old-world craftsmanship with modern automation

Technical Design

  • Each chess piece contains a unique NFC tag
  • A magnetic robotic arm moves along X, Y, and Z axes beneath the board
  • Pieces are lifted magnetically and placed using scripted coordinates
  • The system tracks each piece's position via NFC scans
  • All movement and logic are handled via a custom Python script
  • Synchronization with Chess.com is achieved using their public API

Required Components

Component Specification / Version Description
Raspberry Pi Raspberry Pi 4 Model B (4GB RAM) Controls motor logic, NFC reading, and API communication
Operating System Raspberry Pi OS 64-bit Platform for running scripts
Programming Language Python 3.11 Controls logic and hardware
NFC Reader PN532 (I2C) Detects pieces based on tag IDs
NFC Tags NTAG213 / NTAG215 Unique ID per chess piece
Stepper Motors NEMA 17 + A4988 drivers Moves the magnetic arm along X/Y grid
Servo Motor SG90 or MG995 Controls vertical lifting (Z-axis)
Magnet Neodymium (6×3 mm) Picks up pieces magnetically
Chess Pieces 3D printed in PLA+ Finished by hand: sanded, primed, painted, polished
Board Material Mahogany, walnut, maple Layered and lacquered for appearance
Tools Circular saw, sander, engraver, clamps Used in board construction
Finishing Materials Acrylic paint, filler primer, lacquer For visual quality and durability
Connectivity WiFi or Ethernet For online integration with Chess.com

Example Code

Below is a simple Python example that retrieves the last move from a Chess.com game and prints it:

<syntaxhighlight lang=\"python\"> import requests

def get_last_move(game_id):

   url = f\"https://api.chess.com/pub/game/{game_id}\"
   response = requests.get(url)
   data = response.json()
   moves = data['moves'].split()
   return moves[-1] if moves else None

move = get_last_move('example-game-id')

if move == 'a2a4':

   print(\"Move pawn from A2 to A4\")
   # Insert motor control logic here

</syntaxhighlight>

Construction Timeline

Phase 1: Planning and Design (Weeks 1–2)

  • Create CAD designs for chess pieces
  • Define board layout and grid mechanics
  • Choose wood types for contrast and durability

Phase 2: 3D Printing and Finishing (Weeks 3–4)

  • Print pieces in PLA+ filament
  • Sand, prime, paint, and polish each piece
  • Affix NFC tags to the bottom of each piece

Phase 3: Board Construction (Weeks 5–6)

  • Cut and shape wood components
  • Route out internal space for grid and arm
  • Inlay or engrave chess squares
  • Assemble and lacquer the board

Phase 4: Mechanical Arm (Weeks 7–8)

  • Assemble X/Y movement system using stepper motors
  • Integrate vertical servo-lifting mechanism
  • Test magnetic pickup and alignment

Phase 5: Software Development (Weeks 9–10)

  • Write motor control scripts in Python
  • Integrate NFC reader and calibrate tag detection
  • Connect to Chess.com API and handle logic

Phase 6: Testing and Integration (Weeks 11–12)

  • Full system test with online games
  • Refine movements and calibrate grid
  • Add logging, error handling, and safety checks

Future Expansions

  • Add local AI support via Stockfish (chess engine)
  • Use RGB LEDs for visual feedback
  • Add sound effects for capture, check, and checkmate
  • Integrate OLED display to show current notation
  • Enable voice control or multiplayer sync between boards

Historical Context

The original Mechanical Turk was a hoax automaton built by Wolfgang von Kempelen in 1770. Though it appeared to play chess autonomously, it concealed a hidden human operator. This project reimagines the same premise using modern technologies—robotics, NFC, and open-source software—to achieve the illusion in reality, transparently and without deception.

See Also