3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.


How to Build an Arduino Powered Chess Playing Robot

How to Build an Arduino Powered Chess Playing Robot
Judging by the sheer number of chess related Instructables, I think it's safe to say the community enjoys the game.  It can be difficult, however, to find someone who plays on the same level you do.  To solve this dilemma, and to increase my playing skills, I built this arduino powered chess playing robot.

**UPDATE**  PCWorld just posted about this project on their blog! Thanks, guys!
This project is entered in the 13-18 division of the robotics week contest.


The board works like any other xy table, with a few key differences.  First, the x axis has an extra servo attached to it, which raises and lowers a magnet.  The magnet is attracted to pieces on the chess board above, allowing them to move.  Second, embedded in the board are 64 magnetically activated reed switches, allowing the arduino to know the location of each piece. 

What I love about this project is its adaptability.  If you decide you're done with it as a chess board, it can instantly convert into a CNC mill by modifying a few pieces.  I'll talk more about this possibility at the end.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Parts and Materials

Parts and Materials
«
  • a.jpg
  • b.jpg
  • c.jpg
  • d.jpg
You may have many of the parts for this project already, but if you don't, the whole list costs ≈ $350, depending on where you get your parts from.  Many, many of them can be salvaged, so look to recycle before you buy!
  • 1 Arduino Uno or Diecimila
We'll be using this arduino to drive our stepper motors and servos.  You can pick these up just about anywhere online.  I got mine from Adafruit. $30
  • 1 Arduino Mega
This is the most expensive item in the project.  It'll be dealing with the inputs from each chess square to let the computer know where you've moved.  We're using the mega here due to its speed and number of inputs.  Adafruit $65
  • 1 Mux Shield
The mux shield (short for multiplexer) gives us even more inputs for our arduino mega.  We'll need 64 inputs in total, one for each square.  Sparkfun $25
  • Motor Shield
The motor shield will be controlling our stepper motors and servo.  You'll need to solder it together.  Adafruit $19.50
  • 1 Large chess board with pieces
This one is a little more self explanatory.  We want a large chess board here because the pieces need to be able to move in between each other with disrupting others.  Make sure you measure the diameter of the bottoms of the pieces.  We'll need that in a moment.  I'm not sure where mine is from, but you can pick them up from a flea market for a bargain.  The playable area of my board is 24".
  • 64 NO Reed Switches
Reed switches are magnetically activated switches.  They'll help us find the location of moved pieces.  NO stands for normally open, that is, the circuit is disconnected   Digikey ≈$30
  • 16 10K 1/4 Watt Resistors
These are the pull up resistors for the built in digital pins.  The mux shield, luckily, has integrated pull downs, so we don't need to worry about those. Digikey ≈ $2
  • Roughly 90 feet of 30AWG Wire

This is the hookup wire for all of our sensors. Radioshack ≈ $16
  • Neodymium Magnets to fit your pieces
This is where the measurements from the bottoms of your chess pieces come in handy.  You'll need disc magnets to fit underneath each piece.  For proper strength, they should be about 1/8" think.  A great source for these is K&J Magnetics.  ≈ $55
  • 1 Large Neodymium Magnet
This magnet will be attached to the XY table underneath the board, to move each piece around.  K&J Magnetics $19  Note: This was Waaaay too powerful.  It would draw in pieces it shouldn't have.  You'd be better off going with some smaller ceramic magnets, like you'd find at Staples or another office supply store.
  • 2 Pairs of 24" Drawer Bearings
The size of your bearings will depend on the playable area of your chess board.  These allow for the stepper motors to move back and forth underneath the board. Amazon ≈ $30
  • 2 Stepper Motors
Stepper motors can move in very precise increments.  In the late 90s they were in just about every piece of tech you could find.  The best place to get these are in old dot-matrix printers.  You can them at the flea market for next to nothing!
  • 2 Vex Rack and Gear Sets
The rack gears allow the stepper motors to travel on the drawer bearings.  See the Step 4 for a more detailed explanation.  Vex Store $40
  • 1 Standard Hobby Servo
This servo will be raising and lowering the powerful magnet below the board. You can find them at a hobby shop for ≈ $10, or Amazon ≈ $12
  • 1 2' x 2' Perf Board
The perf board is super thin and will be the mounting surface for all of our reed switches.  The price will vary greatly on this one, but I got mine from Home Depot for ≈ $5
  • 1 2' x 2' x 1/2" MDF Board
Similar to the perf board, I got this from Home Depot for  ≈ $5
  • Various lengths of scrap 1"x2" wood
This wood forms the bridge between the X-Axis drawer bearings.  Go behind any hardware store and you'll see dumpsters full of this stuff for totally free!
  • 5 Minute Epoxy
This stuff is a godsend.  It's used for just about everything in this project, from mounting motors to attaching the rack gears.  I'm in love -- and  I picked mine up from Radio Shack for $3
  • 1 Wood Saw
You probably already have this one, but if you don't, I picked mine up at Ace Hardware for $10 a couple of years ago.

« Previous StepDownload PDFView All StepsNext Step »
45 comments
1-40 of 45next »
Mar 21, 2011. 2:50 PMblazinEagle says:
nice job man
Mar 22, 2011. 6:57 PMgrundisimo says:
By the looks of the vote count, I think you have a VERY high chance of winning. Good Luck!!!
Mar 23, 2011. 5:27 AMa+b=a-b says:
Probably because it has an arduino
Mar 24, 2011. 8:10 AMboltfox20 says:
I remember having one of these. I had a chess board that worked off of magnets and was attached to a tiny computer. Unfortunately it was crash happy. Kept giving me a 601 error, whatever that was.

I'd love to have another real-life computer chess opponent. Too bad I am no good at these projects. ^_^;;;

Looks great. I hope you win.
Mar 27, 2011. 5:11 AMNoseyNick says:
Not bad! Personally I'd have saved the cost of the Mega by adding a shift register to the uno though.

Instead of 64 seperate inputs, you'd need 8 row wires, 8 column wires... 2 arduino outputs go to "clock" and "ser" on a shift reg (EG 74HC595) so you can choose to power one row at a time. Connect each square as row-reedsw-diode-col. Then the 8 cols go to 8 arduino inputs... or even through the other type of shift register if you need to reduce that down to 3 pins.

64 diodes and a shift register are much cheaper than a mega, and your wiring is likely to be neater too. Really cool project though, thanks for sharing! Love the XY construction, makes me wonder why this technique isn't used for CNC projects (much? at all?) :-)
Apr 6, 2011. 7:25 AMTechnochicken says:
Congratulations on winning! Have fun with the laser cutter.
Apr 6, 2011. 8:52 AMynze says:
Congrats! Great idea and I'ble. Have fun laser cutting!
Apr 25, 2011. 8:31 AMscottinnh says:
Congrats on a well done and ambitious project.

When will you have the upgraded version which allows 2 player over the Internet? [grin]
Apr 19, 2012. 7:18 AMamirhemat says:
hello
i am
amir hemat
iran
plz add me
tanx
Feb 20, 2012. 4:20 AMcheukhengc says:
If the horse need to jump out on the first step, how will it move?
Sep 2, 2011. 9:38 PMtjesse says:
Can't wait to see what you will do next. How is the laser?
Oct 24, 2011. 5:54 AMmasterzeb318 says:
but what if your chess set is wood?
Jul 12, 2011. 9:48 AMmickey12vt says:
That's awesome.
Jun 29, 2011. 11:35 AMtinker234 says:
hey at think geek . com they are selling harry poter chess set be cool to make a program so i can say e4 to ee5 something like that
Apr 30, 2011. 2:50 PMWizenedEE says:
Why don't use the integrated pull up resistors in the arduino (a digitialwrite on a pin does it) instead of using external ones?

Also, couldn't you use just one arduino? The mux shield can go on top of the motor shield. They both use pin 2, but you can cut the trace and rewire it, and that costs way less than $30. Even better, you could add a fourth multiplexer and use just one uno.

This project is really cool, though.
Mar 20, 2011. 5:03 PMsamedirection says:
Very cool project. It'd be nice to see more than a few seconds of video of the thing actually moving the pieces, though. How well does it handle a knight jumping over other pieces? Can it castle? Do you ever have to 'help' it? (Besides, say when 'queening' a pawn). Can it move a bishop across the long diagonal through a crowded board?
Apr 15, 2011. 5:08 AMmdon says:
Hmm just wondering whether this sol. works....i.e., before moving the knight, move the crowded pieces to empty spaces and make the code remember these changes and revert back when the knight is moved. It would look like a witch spell moving things around :-) :-) ...........

by the by its a great project, but can we scale down the size?
Apr 7, 2011. 11:36 PMMBurg says:
When a piece is captured do you just remove it from the board? Also can you just lift up your piece and place it on the spot you want to move to or must you drag it on the board? I am guessing the size of the chess pieces matters you want them small enough to move by other pieces. I hope I try this out, also would like to add support to be able to play against people online and be able to use the board just like one of those DGT eboards they don't move the pieces for you tho at what they want for them they should.
Apr 12, 2011. 3:47 AMMBurg says:
My current chess board looks very close to yours. I am worried that the reed switches on the bottom wont get triggered by the magnets. Did you have any problems with this? I am also going to try and use shift registers. You posted this at a great time, I was thinking about buying a board that moved it's pieces but you have to push down on the board and it's rather loud.
Apr 6, 2011. 5:13 PMsponges says:
Congrats! :)
Apr 6, 2011. 1:50 PMAdamMunich says:
:'(
Apr 6, 2011. 6:55 AMSolarPoweredGardener says:
Congradulations...Enjoy your prize....
Apr 3, 2011. 4:27 PMaleceatsfood says:
Awesome! I'd love to see a longer game though! Who ever said you couldn't play chess by yourself!?!? =D
Mar 26, 2011. 9:44 AMPurple Guy says:
Great, but it would be nice to see some more moves?
Mar 25, 2011. 6:18 PMchicopluma says:
wow the computer realy moves the peon awsome
Mar 24, 2011. 3:25 PMNitroRustlerDriver says:
To unsure a perfect hole with the hole saw and have no tear out, drill through one side until only the center pilot drill breaks through. Then flip the part over and finish drilling.
Mar 22, 2011. 5:45 PMmartzsam says:
EPIC!!!!
Mar 21, 2011. 7:14 PMydichev says:
nice man!
Mar 21, 2011. 3:17 PMallpcnews says:
Thanks for the news.
The interesting thing:)
Mar 21, 2011. 12:11 AMjoen says:
I don't have a Mac. How can I use this?
If it can't work with out a Mac shouldn't that bit of information be at the START of the instructable instead of the END?
1-40 of 45next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
16
Followers
1
Author:mJusticz(Max Justicz)