This site describes a fully working chess computer that recognises piece positions using reed switches and signals its move using a LED on each square.
It runs from an Arduino which controls the board, connected to a Raspberry PI which runs the chess engine Stockfish and a chess rules library called Chessboard. It is completely self contained, just plug it in, press the green button and you are playing.
Since building this version I have redesigned the hardware and I am part way through the build. However after many hours of work, I have stopped work on it and moved on to other projects. The new design is here I think it is fundamentally sound, I just ran out of time to get it to work.
If you are not sure if you have the skills to build this project try building the Noughts and Crosses project. Full instructions are given and I have built a fully working version, also have a look at Beginners Start Here.
Play chess by moving pieces and the computer signals its move using by flashing an LED
- Stockfish chess engine with a maxiimum rating of GM with an ELO level around 2900
- 21 levels of play
- Set personality: agressiveness and cowardice
- Play as black or white
- Play human vs human
- Validates moves against full moves of chess, signals error & allows re-move
- Recognises and makes special moves: Castling; En Passent, Pawn Promotion
- Provides hint if stuck
- Option to save game as pgn
How it Works:
The next few pages explain how it works, there are two parts:
Harware: electronics and the board
Software: The programs that drive it
Why an Arduino and a Raspberry PI?
An Arduino is great for real time control of the devices on the chess board, but it does not use a conventional operating system like Unix/Debian/Raspian. Therefore Stockfish and most other strong chess engines won’t run on it. I believe there are a few chess engines that do run on Arduino http://chessprogramming.wikispaces.com/Arduino , but they will not be as strong as Stockfish.
My interest in building chess computers started with Arduino and at the time the Raspberry Pi had not been released. Six months later it was and I realized I needed a different computer so I added the Raspberry Pi to run the engine.
On reflection I think this remains the best approach. Each device does what its best at. The Arduino controls devices and the the PI runs complex software. In practical terms it allows you to build and test the Arduino board as a separate module and then add the Pi to drive it.
I have put considerable effort in trying to build a version that will run on just the Raspberry PI with no Arduino, and I explain how the new approach here.
However although I think the design is sound I have not been able to get it to work. I have built a noughts and crosses game that uses a sub-set of the design but I cannot scale it up. This is probably due to failings in my electronics ability.
However the first version that uses a Pi and an Arduino works well and now that I have a great board that I can barely beat on level 3 out of 21, I have no reason to build another one.
I see that some people are designing robot arm playing chess computers, that sounds really cool. In that case I would use an Arduino to control the arm, board sensors etc and use a Raspberry Pi to run the chess engine.
Why the Stockfish Chess Engine?
Its the most powerful configurable Open Source multi-platform robust Chess engine
“I know what you’re thinking, punk. You’re thinking “is it mate in six moves or only five?” Now to tell you the truth I forgot myself in all this excitement. But being this is a 64 bit Stockfish, the most powerful chess engine in the world and will blow you defence clean off, you’ve gotta ask yourself a question: “Do I feel lucky?” Well, do ya, punk?”
Original inspiration from these sites:
Tony Whitby’s site, now defunct
Which set me off building a USB chessboard for connection to a PC based computer program. After that the next step was to build a complete chess computer.