What components do I need for sensing the ID of chess pieces (Year 12 project)

KeithWalker

Joined Jul 10, 2017
3,092
I did think about doing something like this but iI came to the conclusion that I would like the board to be able to analyse a random setup and then output the best move, having individually tagged pieces would be the only way to identify what is where.
My whole idea is that it only knows what the board currently looks like and decides the best move based on that information, the magnets would work if that was the path I wanted to go down but my idea of it is a bit different.
What is your knowledge level on electronics, microcontrollers and programming? What is your budget?
These are all very important restraints that must be taken into account. We can make suggestions but you will be the one designing, building and programming your project.
 

WBahn

Joined Mar 31, 2012
30,058
having the user not know how the pieces move is not a problem since the board will analyse the board as it is and output what the board wants to move for the one specific setup, each move is analysed as a completely separate thing
I'm not talking about the player not know which moves a piece can make, but rather the mechanics of how they actually make the move. If you assume that (and rely on) the player will make the moves according to a rigid procedure, such as picking up the opponent's piece first (when capturing), then picking up their piece, then setting their piece down in the captured square last, this can cause your system to get confused, even for perfectly legal movement techniques, let alone the sloppy ways that people move in practice when there are no penalties involved for not doing it according to certain procedures.

You also have the issue of knowing what piece a pawn is promoted to.

You also have the issue of knowing when it is the AI's turn. If the player moves a piece to a new square but keeps their hand on it, they are free to make a different move with that piece. So how does the board, using the simple technique described, know when the player has released the piece?
 

BobTPH

Joined Jun 5, 2013
8,958
How about different colors? A black or white center with a ring of one of the primary or secondary colors. Two broad spectrum light sensors (one center, one peripheral and an RGB LED for illumination.
 

BobTPH

Joined Jun 5, 2013
8,958
To clarify my post #24.

The chess board would need a transparent cover. Under each square is a PCB with the listed components.

To read it, you illuminate with white light and read the center circle for black or white piece.

You then illuminate with R then G then B and read the peripheral sensor. One or two of the colors will see light and this will tell which piece it is.

The PCBs could be colored dark or light to give make the checkerboard effect.
 

KeithWalker

Joined Jul 10, 2017
3,092
I'm not talking about the player not know which moves a piece can make, but rather the mechanics of how they actually make the move. If you assume that (and rely on) the player will make the moves according to a rigid procedure, such as picking up the opponent's piece first (when capturing), then picking up their piece, then setting their piece down in the captured square last, this can cause your system to get confused, even for perfectly legal movement techniques, let alone the sloppy ways that people move in practice when there are no penalties involved for not doing it according to certain procedures.

You also have the issue of knowing what piece a pawn is promoted to.

You also have the issue of knowing when it is the AI's turn. If the player moves a piece to a new square but keeps their hand on it, they are free to make a different move with that piece. So how does the board, using the simple technique described, know when the player has released the piece?
It is necessary to have two way communication between the player and software which can be used to ensure that the game runs smoothly and that the rules are observed. It can question illegal and sloppy moves. It can ask the player for his choice of promotion for a pawn that reaches the opponent's side. It can also included a requirement for the player to acknowledge when his move is complete.
 

KeithWalker

Joined Jul 10, 2017
3,092
I did think about doing something like this but iI came to the conclusion that I would like the board to be able to analyse a random setup and then output the best move, having individually tagged pieces would be the only way to identify what is where.
My whole idea is that it only knows what the board currently looks like and decides the best move based on that information, the magnets would work if that was the path I wanted to go down but my idea of it is a bit different.
You must have two way communication between the player and the software to be able to control the game. For a random setup, the player can define the starting position of each piece, as mentioned above. I believe in keeping things as simple as possible.
I think it is time that you re-assessed your real requirements, taking into account all of the information that has been offered to you, as well as your abilities and budget.
 

Ian0

Joined Aug 7, 2020
9,816
Could you have a jack socket in each square, and move the piece by unplugging it from where it was and plugging it back in where it has moved to?
If so the piece could be identified by a resistance between the jack plug terminals.
All that would be required is 64 A/D inputs, or perhaps a way of multiplexing them on to 8 A/D inputs by using 8 line drivers.
 

BobTPH

Joined Jun 5, 2013
8,958
Could you have a jack socket in each square, and move the piece by unplugging it from where it was and plugging it back in where it has moved to?
If so the piece could be identified by a resistance between the jack plug terminals.
All that would be required is 64 A/D inputs, or perhaps a way of multiplexing them on to 8 A/D inputs by using 8 line drivers.
You could probably use a ring and center contact to do this without a jack.
 

MisterBill2

Joined Jan 23, 2018
18,502
Many of the suggestions apparently do not consider the cost, effort, or physical complexity of what they are suggesting, it appears. It is often useful to consider the process of implementing a concept prior to pushing on farther.
 

Ian0

Joined Aug 7, 2020
9,816
What is the "clever" part of this project? Is it the playing of the game of chess, or is it the sensing of the positions of the pieces?
If the TS is more concerned with the implementation of a chess playing AI system, and the sensing of the positions is of secondary importance, then go with whatever system is easiest to implement, even if it is a bit clunky (e.g plugging pieces into jack sockets)
If the project is the "front end" to an already extant chess-playing computer, then the image recognition of the pieces on a standard chessboard using a camera, or something of that ilk, is the way to go.
 

Ya’akov

Joined Jan 27, 2019
9,157
RFID for each piece on a grid orderly checked in polling mode.
This seems very promising, after all you can get 25mm vinyl disks with NFC chips very cheap, and the size will fit the base of a nicely sized chess piece.

But there are 64 squares on the chess board, that would mean 64 sensors which is not a trivial undertaking. A camera seems to make the most sense when the 64 distinct locations is considered.
 

MrAl

Joined Jun 17, 2014
11,474
You are all jumping to solutions without analyzing the requirements.
Do you really need to individually identify every piece on the board at every move?
At the beginning of the game, you know the identity and position of every piece on the board. The pieces are only moved one at a time, so during a move, all you have to know is which square became vacant and then which previously vacant square became occupied. That is all the information the software needs to track the location and know the identity of every piece at all times during the game.
You can simply use a magnet under each piece, with a sensor (magnetic reed switch?) under each square.
In a word, pawn promotion.
 

MrAl

Joined Jun 17, 2014
11,474
I am making a chess board with integrated AI for a year 12 school project and I am not sure what kind of components I will need to use to be able to sense what pieces are where at the start of each turn. I was thinking of using RFID but the range is too long I also thought about using smart card chips, but I couldn't find a source for just the identification chips in them.

Any suggestions for what kind of components to use would help or any source for the ID chips.
Did anyone mention the key detection type system used in automobiles.

You have a small circuit inside each piece that receives wireless power from the board using a set of coils. The board generates power, the piece receives the power. When the piece receives the power it generates it's own signal that the board coil receives and that contains the code using whatever protocol is convenient.
This idea is used in ignition switches to detect if the right key is in the ignition.
 

Ian0

Joined Aug 7, 2020
9,816
Did anyone mention the key detection type system used in automobiles.

You have a small circuit inside each piece that receives wireless power from the board using a set of coils. The board generates power, the piece receives the power. When the piece receives the power it generates it's own signal that the board coil receives and that contains the code using whatever protocol is convenient.
This idea is used in ignition switches to detect if the right key is in the ignition.
I thought that was RFID.
The problem is in identifying the position of the sender, given that there are 64 possible positions only 30mm between rows and columns.
 

MrAl

Joined Jun 17, 2014
11,474
I thought that was RFID.
The problem is in identifying the position of the sender, given that there are 64 possible positions only 30mm between rows and columns.
Hi,

Oh ok but what do you mean by the problem is to identify the position of the sender?
The board squares themselves never move only the pieces.
 

MisterBill2

Joined Jan 23, 2018
18,502
RFID for automotive keys can be confused if there is a second fob on the same key ring. That caused my system to lock me out many years ago, requiring a tow to the dealer for repair, and loss of the vehicle for three days. And any sensor scheme that monitors all 64 squares will be a logistic challenge to implement, and require at least 8X8 i/O to the computer, unless a lot more logic is added.
So it is useful to consider how any idea would actually be implemented, aside from what technology could be used. The solutions I see could possibly function in theory, but not exist in physical reality.
 
Top