Instructables

How to Build an Arduino Powered Chess Playing Robot

FeaturedContest WinnerContest Winner
Picture of How to Build an Arduino Powered Chess Playing Robot
DSC_7841.jpg
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.

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.

All in all, though I learned a lot from this project and had fun building it, the board was not as successful as I had hoped.  The magnets were way too powerful, so extra pieces would almost always drawn in when they shouldn't have. However, with a few thoughtful changes I think this could have been a better, more functional project.  Until I build another, better board, though, I think this Instructable still serves as a pretty good guide to make your own chess robot.
 
Remove these adsRemove these ads by Signing Up
1-40 of 59Next »
paquiton963 months ago

What if it has to move a horse over another pieces?

Lol! Good question!

I-robostein3 months ago

awesome!!!!!!!!!!!!!!!!!!!!!

tomshirvo4 months ago

That's what people can use VHS tapes for these days. Cool project!!

AJMansfield8 months ago
If at all possible, you really shouldn't cut of jacks like that. Get a socket that fits the plug and use that, its just a better idea because then it will be easier to take it apart to make something else with, or even just to fix it.
NoseyNick3 years ago
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?) :-)
Come to think of it... Look up Charlieplexing. This technique is usually used to light LEDs, but can be used for input too - EG https://en.wikipedia.org/wiki/Charlieplexing#Input_data_multiplexing . Your reed switches would need diodes in series (but diodes are REALLY cheap), and the code is more complicated (funky tristate stuff (ab)using IO lines for rows AND columns), but you could read all 8x8 (in fact 8x9) with 9 I/O lines, so an Arduino Uno ought to be plenty.

... oh, and use an electromagnet instead of a Z-axis servo :-)
maxjus (author)  NoseyNick3 years ago
That's a really excellent suggestion! I'll try that should I ever revisit this project. Yeah, I've always wondered why more CNC tables don't use this gearing technique.
akadi1 year ago
wouldn't it have been easier if you just built a robotic arm that can move the pieces and used the same program with the arduino board you could have also used magnets and the other pieces wouldn't get attracted too because the robotic arm is more precise
Ramssess941 year ago
Where i can download the code of XY??
in my computer out korean letters
Vogonslurp1 year ago
Hi Max
I love your project, it's just such a good idea!
I have a question regarding the coding though. What changes have to be made to Sjeng in order for it to function? I'm more of a java person, but I do know a little C. I have Windows, so unfortunately no Mac.
Thanks!
Nice project man, good work and idea! My advice for one of the changes would be to change your magnet with electro magnet.
something11 year ago
I was wondering how does the arduino get instructions from the chess engine and how does it send a move please tell me I need to know.
will36751 year ago
Really cool project but what does it do with a piece like the knight that might have to jump over other pieces?
Hello! thats a great project man ! i'm a 4th year mechatronics engineer and i wonder if i can program this arduino on PC cause i don't have mac ! plaz help me with this :) thank you anyway
crabbypup1 year ago
for everyone still looking for the sjeng application, you can find it here: http://sjeng.org/indexold.html

also, where is the code to program the two arduinos? and are the arduinos attached just by USB, or are they wired together first? the 'ible isn't really clear on this. thanks!
diy_bloke2 years ago
impressive. I am not gona build this, but I have been thinking about a raised 4x4 ft plant bed in which individual plants would be watered via a similar setup. Would not be moving chesspieces but a nozzle. This has given me some idea's
amirhemat2 years ago
hello
i am
amir hemat
iran
plz add me
tanx
cheukhengc2 years ago
If the horse need to jump out on the first step, how will it move?
tjesse2 years ago
Can't wait to see what you will do next. How is the laser?
maxjus (author)  tjesse2 years ago
It's pretty fantastic!
but what if your chess set is wood?
mickey12vt3 years ago
That's awesome.
tinker2343 years ago
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
WizenedEE3 years ago
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.
scottinnh3 years ago
Congrats on a well done and ambitious project.

When will you have the upgraded version which allows 2 player over the Internet? [grin]
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?
maxjus (author)  samedirection3 years ago
(removed by author or community request)
mdon maxjus3 years ago
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?
maxjus (author)  mdon3 years ago
That would definitely work, but would take much, much longer than the current solution with this setup. Go for it!
MBurg3 years ago
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.
maxjus (author)  MBurg3 years ago
(removed by author or community request)
MBurg maxjus3 years ago
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.
sponges3 years ago
Congrats! :)
maxjus (author)  sponges3 years ago
Thanks! I ordered some ferric chloride for my business cards :)
grenadier3 years ago
:'(
ben_k3 years ago
Congratulations on winning! Have fun with the laser cutter.
ynze ben_k3 years ago
Congrats! Great idea and I'ble. Have fun laser cutting!
Congradulations...Enjoy your prize....
Awesome! I'd love to see a longer game though! Who ever said you couldn't play chess by yourself!?!? =D
1-40 of 59Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!