Electronics > Projects, Designs, and Technical Stuff
First and last Basic Stamp Project - Chessboard - now with its own topic!
(1/1)
Veramacor:
Sorry about the topic hijack - a bit of a blog newbie as well,

Well here is my first stab at a micro controller project a couple years ago.  I went the route of using a basic stamp + development board, which included a serial interface.

That meant all the nitty gritty hardware problems were taken care of for me.  The only problem was (and still is) the $50 price tag of the basic stamp chip!

Now I'm back in the the electronics hobby having some basic fun with these < $2 pics MCUs!  Add an $15 programmer and I'm off.

Anyway,  the main goal of the project was to play chess against live opponents for free using real tournament pieces.  The project was a success for the most part  The one thing I did not anticipate on was setting up the pieces for another match was worst part.


Specifics:

Capturing the movement of the pieces was the heart of the project.  I needed a way to pass information to the micro controller that a piece was moved from one square to another.   Nowadays there are board squares with rfid antennas and pieces with rfid tags, but to implement this was and still is far beyond my current understanding.

I used REED SWITCHES and MAGNETS to convey piece movement.  This is not fool proof by any means,  but works well enough as I scored about 100 used reed switches for cheap for the project.   As you see in pic2,  each piece has a  Neodymium 1/16 inch thick disk epoxied to the bottom.  I chose  Neodymium because even thin magnets are STRONG.  Each square has under it a reed switch (pic4 sorry about the quality) and the magnet closes the switch when it lands on a square.

I used 16 input pins on the basic stamp and some matrix logic (with the help of diodes)  to scan the 64 squares continuously, looking for changes in the 'board state'.  When I sensed a change I sent the board state to the serial port where my Visual Basic program was monitoring.

BTW, I have a laptop with no serial port so my life was made a little more difficult because I need to aquire a serial to USB interface (wont do that again, now that I'm 'stamp free'!).   That is the USB cord you see in pic2

The big break I got was using the Free Internet Chess Server (FICS).  Boy did that save me a lot of work.  With the VB program I was able to go out and make a telnet connection to FICS, log in to the chess server and ask the server to find me an opponent (text commands via telnet).   Once an opponent was found all I needed to do was monitor FICS for the moves coming back to me and sending the moves back to FICS.  If an illegal chess move was sent to FICS,  I get a 'illegal move' string coming back.  So move checking is basically taken care of for me.

Now piece movement capture it isn't fool proof by any means.  Take for instance the situation where I move one piece and capture another piece without first lifting the captured piece off the board.  You often have the situation where two pieces occupy the same square so the reed switch for that square may never have opened (my cue to tell my program a pieces was lifted/set down).  But, if you are deliberate, most all games can be completed.

The way I tell the VB program to send a move is very similar to how speed chess players play with a clock.  You move a piece, then hit that black arcade button on the left (Pic1).   The basic stamp remembers what square a piece was lifted from the board, and also what piece was placed on the board.  Special cases like capturing required the stamp to remember:

1) The lifting of the captured square piece
2) The lifting of the capturing origin square
3) The placing of the capturing piece on the captured square.

If there is enough interest I can get this project up and running again and video demo it.  Its been a couple years so I'd have to brush the rust off!

One of the goals is to replace the stamp with a nice pic16F.  The stamp is a bit slow in reading 64 squares continuously.

I'm having more fun with learning about pics from the ground up I don't know when I'd actually get to that point!   I'm so excited about my first Oscilloscope (Yes still gunning for the Rigol!),  I'm having more fun turning on a single led than I did with the chess board project.  Did I just make that little black chip turn that on???!!!

V
Mastro Gippo:
How do you plan to solve the "ghost" problem on your matrix?  ;D
Veramacor:
I'm probably going to look at RFID.

With the magnets I'm using right now,  In a speed game the magnets to tend to attact pieces together, which can be an annoyance.

Also currently in capturing information is lost.  I do know the state of switches before and after the move and that works fine for non captures.  

Right now I scan the board for the last piece, and next to last piece that were picked up (before commiting the move).   I can determine which piece was the moving piece because the switch reads low for that square.   This works great if the capturing piece was lifted off the board first.  The problem is during scanning if a player captures with one hand and the capture square switch never gets toggled off.

Another reason for RFID is that I'm guessing I could have a PCB with 64 RFID antennas etched right into the PCB (I know, tuning nightmare!).

http://iloapp.marcboon.com/blog/rfid?ShowFile&image=1194698818.jpeg

But that would make it a lot easier than a PCB with 64 diodes and 64 reed switches to solder.

Speaking of the pcb I might sectionalize the pcb board itself.  I'd be hard pressed to find a 24x24" pcb to etch!

All distant ideas for now, but these guys have already done the concept:

http://www.chessbaron.co.uk/dgt_electronic_boards.php

Check out that price!  Not exactly within everyones reach.  

Veramacor:
This looks interesting -

http://www.printed.cz/assets/photos/fullsize/_uploaded_85.jpg

Stuff is called Pyralux from Dupont.  Flexible PCB -  If I were to only route antennas for the board this would be quite promising.

The typical speed chess players you might see in the park use these flexible roll-up boards:

http://img.hisupplier.com/var/userImages/20071015/donghuisuye/163138.gif

Interesting project!   

Dave,  I'm about $25 away from my Rigol BTW  ;D
chess12345:
Very Interesting, been meaning to find a solution for this but unable to do so, not sure if you go anywhere with this?
Navigation
Message Index
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod