Hey all,
One of my first entries on my robotlab
This is regarding my chess board project and since a few days I have been talking with GroG and Alessandruino on the shout box regarding this project, so Grog suggested that I post more details about this one so it can be a more permanent thing :P
Heres what im doing in this project:
I am trying to make an automated chessboard. (ie: the moves played by computer will magically move on the board)
Well not exactly magically, I'll be using 2 stepper motors and an electromagnet for making the movement.
A similar project has been already done using MRL and thats what brought me here. Almost all of the hardware is ready for this project, and ill be using an Arduino board to interface the hardware with the computer.
So for most of the software part ill be using MRL and little Arduino programming.
- Chess service (this will be the main game running, al the brain work :D)
- Serial Service (Will send moves to and from the Arduino board and the chess game)
- Log (Will make a note of all the moves during the game)
Since im not much familiar with python coding, ive been using GUI tab to make all the connections. (Ive posted screenshts below showing them).
Things where I need help using MRL are:
- Serial Communication (thanks to Grog and Alessandruino for releasing the serial service and writing a python script for the communication)
- Sending the incoming chess moves into chess service (As of now the moves are coming as ascii values, need a function in serial service to print whatever data is incoming so that i can directly connect this to inputMove(string) function of the chess service) (solved with the update of serial service)
(ascii value of char "a")
- Sending the moves made by the chess game (Best Move) into the Serial service so it will forward it to the Arduino, I think this can be done by connecting the makeMove of chess with the write(string) function of Serial. Havet tried it yet because the makeMove function publishes both user move and the computer played move (shown belo in this screenshot of log)
Few Pics of the project hardware:
The Motors, Driver IC, Power Supply and the drive chain
the base is made of acrylic and stands are 3D printed
The reed Array which will detect the movement and send that to the PC
*Will update with images as the project progresses.
Project Update [chess . Automated v1.0] - http://myrobotlab.org/content/chess-automated-10-project-update
Very good project ! I'll
Very good project !
I'll follow your progress with interest
Hello mehtaatur
Looks like a great project, and thanks for all your careful detail - it certainly helps (so do the pictures) .
Ok, lets get started....
Step 1 - I suggest moving to a Python script. Although the gui is intuitive, a script provides more control, and as you get more accomplished it is easier to load, versus setting up everything through the gui every time.
I've created the following short script.
It creates the necessary services and creates some message routes
I added message routes from the Arduino / Serial service to the log, but don't know if this is needed or desired.
A human starts by moving a piece on MRL's chessgame
This sends a command to the chessboard to move the piece
The computer counter-moves and this information is sent to the arduino..
Description of gameplay
Adding functions to the script
What is the format of the
What is the format of the message from the serial---to--->chessgame ? Is it a common chess notation (http://en.wikipedia.org/wiki/Chess_notation) , is it always fixed width - can you attach your Arduino sketch?
The chess notations will be a
The chess notations will be a string with 4 characters always,
the above image shows the coordinte system which I will be using.
the incoming string will contain the initial and the final position of the movement.
Eg: if the knight moves from block b1 to c3 then incoming string will be "b1c3"
the arduino will detect the movement using reed switches and the following command will be used for sending the string to PC
Serial.println("b1c3");
Here's an example script to
Here's an example script to get string values from the Arduino
Arduino Sketch
Python Script
Build 1666 - (you can update
Build 1666 - (you can update to bleeding edge) has new easy methods for chess game.
with the following python script - you can send moves and recieve moves back from the computer
Supper project
Nice would be nice to see movie of this project in action
Thanks!
Thanks AdolphSmith.
I just posted an update on this project - http://myrobotlab.org/content/chess-automated-10-project-update
Do let me know if you have any feedback or suggestions
Ciao!
The LED's in the new board
The LED's in the new board are great ! .. Not only are they functional, but the look great too
Reed Switches
How did you attach each of the 64 reed switches to your Arduino? I have a Mux shield which gives me 64 pins. But just from looking at yours you seem to have it done differently. Could you explain how you wired up yours?
Reed switch wiring
Hello Paddymcd,
You do not need 64 IO pins to control the switches.
An 8x8 Matrix would do the job. You would require 16 pins for reading values from the switches. Following is the wiring diagram for reed switches used in chess automated 1.0
By wiring in this manner you will get 8 VCC pins and 8 Input pins, you can control in double for loop to detect the switches.
I got your email regarding the chess board. Could you make a post about what exactly you are trying to do, so I can help you better.
Ciao! :)