Automated Chess Board – Harry Potter Style
By Michael Guerero. Posted
This article was originally published as part of HackSpace magazine, which has since been incorporated into Raspberry Pi Official Magazine.
My name is Michael Guerero and I’m a recent graduate from Cal Poly Pomona, with a bachelor’s degree in mechanical engineering. I just recently started building my own projects to build up my portfolio and gain experience in prototyping.
In this project, I set out to replicate the Wizard’s chess game from the Harry Potter series, because I liked the idea of using technology to emulate magic in the real world.
The box was made from quarter-inch MDF, with steel rods for the linear bearing blocks to slide across. I added various scrap pieces of wood to make supports, to hold the stepper motors and limit switches in the proper locations. A pair of timing belts are used to move the electromagnet along both axes. Each chess piece has a loose steel ball inside, which gives the magnet a way of attracting the plastic pieces.
Take back control of your online data, with Raspberry Pi.
The code starts by zeroing both stepper motors and returning the electromagnet to position A1 on the board. The serial monitor will prompt the first player to enter the square address of the piece to be moved, and the location for the piece to be moved to. The magnet moves to the first square, turns on the magnet, and then moves to the next specified square.
When the piece is being moved, the magnet will initially offset to the corner and then move along the lines between squares, which allows pieces to be moved around each other without colliding (for example, this allows the knight to be moved without having to first move the pawns in front of it)
Contributor to HackSpace magazine
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles
8BitDo 64 Controller review
A near perfect replica of the original N64 controller, but laid out for modern sensibilities and comfort.
Read more →
Paper console
Look at those physical controls! This device is built to be beautiful: it’s made out of walnut and brass.
Read more →
Take Back Your Cloud in Raspberry Pi Official Magazine 165
We’re all-too accustomed to the feling of being watched on the internet. A search for any product leads to adverts, emails, and goodness knows how many bots tracking you. It feels weird and intrusive, and we aren’t being paranoid – they really are watching us. Luckily you don’t have to reply on online services that […]
Read more →