Introduction: Automatic Chessboard

Our team has set out to create a self moving chessboard. The board itself will be played by AI designed by the team to play certain openings such as the Italian Game. Our board will consist of Arduino Uno's for programming and a CNC shield to control various stepper motors.

Automatic Chessboard was inspired by WizardChess and our teams love for the game of chess.

We would like to give a thanks to Mr. Eberts and Mr. Elias at the WBA STEM Academy for encouraging us to pursue our idea.

Supplies

To build the Automatic Chessboard you will need the following:

  • NEMA 17 Stepper motors (4)
  • DRV8825 stepper drivers (4)
  • 12V 3A Power Supply (2)
  • Arduino Uno's (2)
  • CNC Shield
  • Heat sinks (4)
  • Electromagnet
  • Arduino USB cable (2)
  • Female to Female jumper cables (5)
  • Male to Male jumper cables (2)
  • 3D Printer
  • CAD Software (Onshape)
  • Hot Glue Gun
  • 24" by 24" wooden board
  • 24.5" by 25.5" wooden board
  • 10" by 4.5" wooden boards (Referred to as Planks) (2)
  • 26" by 26" wooden board
  • Sandpaper
  • Caster Rubber 1-1/2" Rigid Wheel
  • 1109 Series goRAIL (624mm Length)
  • 2106 Series Stainless Steel REX Shaft (8mm Diameter, 624mm Length)
  • Special Equipment (Saws, Tin Snips)
  • Utility Rope 1/16in x 100 ft (Referred to as string)
  • Full Set of Metal Weighted Chess Pieces

Step 1: Arduino Assembly

(Note: The Arduino application must be downloaded before Step: 1)Now that the materials are gathered continue by connecting the heat sinks to the DRV8825 stepper drivers, then connect the 3 DRV8825 stepper drivers into the X, Y, and Z labeled sections leaving the A section empty (Make sure motor drivers face correct side aligning with EN/GND). Now connect the CNC Shield to the first Arduino Uno. Then, connect jumper cables to the EN/GND pins to enable the board. Finally, connect the power supply terminals to the power terminal block on the CNC shield making sure the VREF values are set correctly.

Now connect Arduino to your computer using the Arduino USB cable. Open up the Arduino app and use this code from the Wizard Chess Instructable to test the three stepper motors:

Step 2: Mechanism Assembly

Boards

First take the 24.5" by 25.5" and sand two parallel sides so that it may fit in between the wheel, axle, and shaft system in step Wheel, Axle, and Shaft. Then, paint the board to your desire so long as a grid with squares with a 9" area (3" length 3" width) is painted onto it making sure it is painted closer to one side than the other (the board is not evenly sized so that it may reach both planks to be placed perfectly).

When building the Automatic Chessboard a 26" by 26" board is needed for the base. On top of the center of the base goes a 24" by 24" wooden board labeled by drawing squares in a repeated pattern horizontally and vertically with an area of 9" per square (3" length 3" width). The wooden board can be glued directly in the middle of the 26" by 26" board. On top of the 26" by 26" wooden base at its sides, the 10" by 4.5" planks can be screwed, or glued in so that it stays on the base.

The two 10" by 4.5" planks will be at the side of the base as in the pictures (Note: due to circumstances our team was not able to access planks following these dimensions). These planks will only be 10" in length so that the stepper motors on the X-axis may move around the board as the Y-axis moves (using the wheels) freely.

Now with the base setup completely, 3D print the Onshape file named Chess p1, p2, p3 provided in the supplies step twice. These 3D prints will be stationed 3/4 an inch away from the middle wooden board (measuring 24" by 24") adjacent to the 10" by 4.5" standing planks used to hold up the second board.

(On the Onshape document one will see Chess p1, Chess p2, and Chess p3. You must print Chess p1x4, Chess p2x1, and Chess p3x1 to comply with this Instructable. After doing so it is recommended to hot glue the 3D prints together through the male end of each Chess p1 and p3. You should make sure to keep the print perfectly straight when connecting with glue) (If needed the viewer may drill the female ends of Chess p1 and p2 if the female end serves too small).

Wheel, Axle, and Shaft

Now that the base is done continue by 3D printing out the Wheel chess Onshape file listed on the supplies step. These 3D printed wheels will be connected to the 1109 series goRAIL, but first, the REX shaft must be cut exactly two inches using special equipment (our team used a Hacksaw). Finally, the REX shaft is cut position the 1109 Series goRAIL inside of it then connect the side of the 3D printed wheel with the hexagon shape to the 1109 Series goRAIL on both sides.

Stepper Motor Connect

  • Now that the wheel, axle, and shaft have been made place it in between both Chess p1, p2, p3 3D prints. On top of both sides of the 3D print Chess p1, p2, p3's place a stepper motor. Position the shafts of each stepper motor into the circular part of the wheels (make sure that the CNC shield connected to both motors is currently placed under the wheel, axle, and shaft.)
  • Now place the Caster Rubber 1-1/2" Rigid Wheel adjacent to the most left side of the 2106 Series Stainless Steel REX Shaft and hot glue the platform of the Caster Rubber Rigid wheel to the REX Shaft so that the Rubber Rigid wheel stays up straight and able to roll with the wheel, axle, and shaft system.
  • Hot glue and place the third and last stepper motor on the Caster Rubber Rigid wheel's platform so that the stepper motor stands up straight and balanced (make sure that this stepper motor is also connected to the CNC shield in the same fashion as mentioned in the Arduino Assembly stage. Repeat this step to the opposite side of the REX shaft. (These steppers will be used to move the electromagnet across the X-axis).

Electromagnet Setup

  • Now that the wheel, axle, and shaft system has been set up with stepper motors, the electromagnet must be set up to go onto the shaft. Hot glue the bottom of the electromagnet to the Electromagnet Base (making sure it doesn't burn the electromagnet), and set it on top of the REX Shaft. The Electromagnet Base can be 3D printed.
  • Now that the electromagnet is set up take 42" of the Utility Rope (as mentioned in the supply step) and tie a knot around the shaft of the last stepper motor set up on top of the Caster Rubber Rigid wheel (hot glue the knot if needed to keep tightness), take the other end of the Utility Rope, and hot glue it to the closest end of the Electromagnet Base glued to the electromagnet. Repeat this step on the other stepper motor. Now swirl the Utility Rope around the shaft of one stepper motor until the rope reaches tension to the electromagnet (as shown in pictures).
  • In order to connect the electromagnet to the CNC shield, you must combine multiple jumper cables to make a longer male to female cable. First, take a standard male to female jumper cable. Connect it to a male to male jumper cable and then secure it with electrical tape. Attach a female to female jumper cable to this one and use electrical tape again to combine them. Repeat this by attaching a male to male cable to the previous wire and then a female to female cable at the end.
  • Finally connect the electromagnet using the wiring below Electromagnet: SIG-> SpnEn, VCC-> 5V, GND -> GND:

Electromagnet: SIG-> SpnEn, VCC-> 5V, GND -> GND (Goes on to the second Arduino)

  • When the electromagnet is setup successfully to the second Arduino, connect it to the second power supply making sure the polarities of both the Arduino and the power source are equal (Negative to Negative, Positive to Positive).

Arduino

  • Now that the mechanics have been set the wires can all be organized with zip ties so that it can be taped to the bottom of the painted Chessboard (this is so that the wires may not interfere).
  • Place the painted chessboard with the Arduino on top of the Planks so that the board fits in between the wheels of the wheel, axle, and shaft system. Place the Metal weighted Chess Pieces evenly on to their respective squares

The mechanics are now finalized and coding can be done.

Step 3: Explanation of Automated Chess Board

Electromagnetism

The reason for having the electromagnet is the electromagnet is what will pull the pieces along the board. The pieces have metal within them which are the weights that the pieces come with inserted inside of them. The electromagnet can pull the pieces along using this which allows the pieces to seem as if they are moving on their own. The reason for the board being rather thin is so that the electromagnet can pull the pieces through it.

Y axis Movement

The wheels and axle powered by the stepper motors are what allows movement along the y axis in the board. The wheels are enclosed within the board and can only move forwards and backwards. They are along a track that has pegs that fit into the wheels' slots. This allows the wheels to stop precisely next to a row on the chess board. The wheels and axle carry the goRAIL which has the electromagnet. This allows the electromagnet to move along the y axis of the board.

X-axis Movement

X-axis movement is done along the goRAIL by pulling the electromagnet left and right. This is done with a stepper motor that has a string attached to it which is also attached to the electromagnet. The stepper motor can wind in the string to move the electromagnet towards it and wind it back to push the electromagnet the other way as it will be pulled by a spring.

Combined Movement

The x-axis and y-axis move together in order to be able to move the electromagnet along the 2-dimensional chessboard. For example, if the electromagnet starts on g8 on the chessboard and needs to move the pawn on e2 to e4, first the wheels will roll the mechanism down 6 squares to the second rank. The stepper motor on the goRAIL will then wind in the string to pull the electromagnet into the e file. Now that the electromagnet is right under the pawn, it can turn on to attract it. The wheels will then roll the pawn over to the fourth rank to bring it to e4. The electromagnet can then switch off, dropping off the piece. After this, the system will move back to its original position on the board.

Coding

We envisioned for the chessboard to be able to send the board's current position to a computer that will have an AI running on it. The AI would decide on a move and the move would be sent to the chessboard and played. However, this was too complex for the time we had so we decided on a simpler approach which involved the board playing out a set sequence of moves by itself. We weren't able to fully accomplish this as some of our electronic components got fried as we were testing and we were unable to run any code successfully. We plan on ordering new parts and continuing the project with the hope of fully completing it.

Electronics Contest

Participated in the
Electronics Contest