Jump to content

Arduino chess robotic arm


Recommended Posts

Say I were to make a robotic arm powered by arduino. This robot could play chess against you and maybe even win. This would require artificial intelligence but I do not know how to make that for arduino. Could someone please post the code to do this sort of thing. The sample robotic arm has 4 degrees of freedom and looks like this.


Link to comment
Share on other sites

If you want to play chess against a computer, buy a chess computer or a chess program for your PC.

If you want to to see a robotic arm move under influence of an Arduino, buy these components and start fiddling yourself to get it to do what you want it to.

If you want to combine the two, work on making the arm move, then talk to some open-source chess program devs (gnu chess or some such) on ways to interface with it.

If you want someone else to do all this for you, aquaint yourself with the hourly fee of a developer and then decide that you don't want to play chess against a robic arm *that* much.

Link to comment
Share on other sites

Arduino powered arm is easy enough, and you can buy camera modules with basic image processing onboard, but an Ardunio doesn't have enough grunt to do everything. It could probably be done really poorly with a new model rPi to handle the image processing with something like OpenCV, and an Arduino to control the arm movement, if you want something small/embedded. You would need a good computer instead of a rPi if you didn't want it to suck at chess as image processing alone eats up resources like a bastard.

Anyway this type of project would take months, and isn't super interesting, so you will need to do it yourself, or drop a fair chunk of change.

Link to comment
Share on other sites

  • 4 months later...

This reminds me of an MIT lecture that a guy did on goal trees. He demo'ed a simple ai program with stacking boxes. (

) Something like this may work if the arm controller calculates the kinematics.(it would need to be tailored specifically to the arm and would need to clear the tops of the chess pieces) You'd also need the computer to know where the different chess pieces are after you (the human) moves them. You could try and do something with cv but it may be easier to program around the problem by using magnetic switches under each square on the board and small magnets on the bottom of each chess piece. You could then allow the computer to track what piece was picked up and where you placed it. You may run into a problem with this setup with that move where you swap around the king and the rook but you could code in specific logic for recognizing that scenario.

Honestly if I were doing this, I'd work on building a "smart" chess board first, building the physical robotic arm second, the controlling mechanism that take simple "a1 to a7" chess movement commands third, then finding / borrowing chess logic from somewhere.

Just an opinion, you can do what ever suits your fancy.



oh and the hand too, not sure the best way to do the grabber. the image you show has what looks like a suction cup thing. good for apple, bad for chess piece.

Edited by oddsight
Link to comment
Share on other sites

  • 1 month later...

There are a few open source chess engines out there, like Gnu Chess. If you can figure out how to read the board position in physical space, and transfer that to text format, then you can feed that text into GNU Chess as moves. (like A2-B2 or whatever). It will respond with text representing the computer move (C5-D4), which can be translated into the robot arm motion. However this would require an attached "real computer" as stated above, GNU Chess is probably at least a megabyte of RAM.

However there is a chess engine called 'Nano Chess', which takes a very small amount of memory in C (there is even a wiki page). You might be able to fit this onto an arduino with a lot of work, or by using multiple arduinos (one for chess, one for motion control, one for reading position)

Link to comment
Share on other sites

I am reading through an arduino book, I don't think this project is quite feasible at this point, but I have some links which may be useful to you. I haven't tried coding the arduino in C++, but if one could it would be very convenient from a coding perspective, as object oriented does make certain things more feasible.


Additionally you should think about getting the right arduino for the job. As someone who has taken an introductory robotics class, you never know exactly how little RAM you have until you try to do something with your robot with a program which uses way too much memory. My experience was with a Lego NXT brick. Ended up not being able to implement the last leg of a robotic obstacle course, but the teacher let me upload the rest of my code part way through. Would have done some things in the code a bit differently if I did it again. Was a younger coder at the time. Point being, you should get an arduino with ample memory.



The Yun looks promising, but I am still dubious on the RAM, especially since as more of an application/web developer I am used to seeing it in GB, and not KB/MB. The Yun actually has linux on board, as well as WIFI. I am presuming even if you did run into memory constraints you could literally open up a socket/network connection to another computer for the actual chess processing part of the operation. Objects would be useful especially if you had to write a chess processor on board. Additionally make sure you have enough of the input/output pins you need before buying anything. One of the Raspberry pi variants might also be useful for something like this. It's surprising something so small can run an actual OS.

Just curious how big does the GNU Chess application compile to?

Regaurdless, my gut tells me that the arduino can't do image processing, chess processing, and kinesthetic processing with the given RAM/CPU available. These things are microcontrollers, not full fledged PC's. You would probably be better off turning your little arduino project into a sensor/peripheral robot. The brain will probably have to be on a better PC, heck even a tablet.

Am looking for a job now lol, but programmers are expensive, and there would be a retooling cost / learning buildup which would only make things worse.

Edited by overwraith
Link to comment
Share on other sites



It is doable and cheap, but are you creative enough? This tutorial shows how to control 2 motors with python (both can move forward and reverse)

I have plans for building a mechanical arm for aiming a directional antenna that I have mounted in my attic space... I need to scroll left, right, up and down... could even use some kids toys or legos for the arm and a string pully system...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...