Chess Piece Identification Technology

How do you detect which chess piece occupies a square in an unobtrusive and reliable way?

This is the holly grail of chess computer technology. Here we review a number of approaches in a quest to see if any of them are suitable for a hobbyist build. We start with the “Rolls Royce solution” DGT and then look a a number of other lesser technologies from Reed switches, Hall effect sensors, RFID/NFC, light switches, weight, computer vision and maybe more.

If you have any ideas on how to practically achieve any of these, please comment below.

The problem: To detect if a board position is occupied is easy, you just need 1 bit of information, on/off. To know the colour and piece type you need 4 bits (6 piece types = 3 bits, colour = 1)

The technologies:

DGT Chess e-Boards

DGT is the gold standard for chess piece recognition. It is used in tournaments throughout the world. I do not own one, but understand it offers unobtrusive and highly reliable identification of pieces. The only drawback is the price. The cheapest I have seen a new set complete with board and pieces is around $600.

According to chessprogramming.wikispaces.com it works this way:

The patent-registered DGT sensor technology [1] recognizes pieces containing piece-type and piece-color specific passive LC circuits with a resonance frequency of 90 to 350 KHz, the coil on ferrite core. Squares and their respective pieces (if any) are scanned by 2 x 8 silver-ink printed trace loops on a polyester film placed under the board, file and rank sequentially selected by analogue switch multiplexers, feeding back the output signal of an amplifier via the selected inductive coupled LC circuit to its input, forcing oscillation in piece specific resonance. Measuring the signal frequency or its period via a digital input port by the controller firmware to convert it into appropriate piece codes takes about 3 ms per square [2] .

What this means (I think) is that each different piece/colour combination has within it a ferrite core with specific windings. This is then detected by the board which is a large multiplexed antenna and passed to a single sensor.

 

Reed Switches to Detect Chess Pieces

At the other end of the scale we have the cheap, dumb but reliable reed switch. This is used in the vast majority of commercial chess computers. Because it can only sense on and off, it is used for piece detection (is anything there?) but cannot do identification. Each piece just needs to contain a small equally cheap magnet. This is what I used to make my chess computer and it works well and reliably, but does not identify pieces.

However if you know the starting position of all pieces and then track their moves you can infer (but not definitely know) the identity of each piece.

The system is used in the much admired, but now defunct Mephisto range of chess computers and by many of their competitors such as Novag and  Saitek. Apart from DGT, I know of no other widely produced commercial chess computers that use anything other than reed switches.

 

Hall Effect Sensor to Detect Chess Pieces

A Hall effect sensor is a transducer that varies its output voltage in response to a magnetic field. Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications. In its simplest form, the sensor operates as an analog transducer, directly returning a voltage. (wikipedia.org)

The upshot is that it will not only detect if a magnet is present but the output will vary according to the strength of the field. So in theory if you had 4 different strength magnets, in combination they could provide enough data to identify a piece. The problem is that a chess piece will not always be precisely in the same same place, a slight error in positioning will lead to a variation in the field detected. As a result the system is unlikely to be reliable in practice. There are chess boards out there with hall detectors, but only working as on/off switches.

The detectors are more expensive than reed switches, although at 50c each on ebay, they are still cheap. Also they have three pins +, -, data so that wiring and code is much more complex than reed switches. This is probably why they have not been used in commercial systems.

RFID/NFC  chess piece identification

In theory RFID should be the ideal solution for chess piece identification. Tags for the pieces are cheap and small (I used to have one in my cat). Individual sensors are not cheap considering that you need 64 of them. The cheapest I could find on Ebay was about £2 each. However in theory it might be possible to multiplex an RFID antenna so that you need only on reader per board.

In the various forums, there are lots of discussions on this topic, but I cannot find anyone who has built one.

Problems include the difficulty of multiplexing RFID antenas, overlaping reads, read time etc,

However I have found one site www.eitschess.de, that offers a commercial system.

This paper seems to describe how to build such a system.

I would be interested if anyone has practical experience in building such a chess system.

Computer Vision chess piece identification

A webcam is used to view the board and recognise pieces and when they move. The underlying technology is OpenCV and there are several examples about on the web. I have not tried any of them yet but  Voids Vault offers a description and downloadable code.

OpenCV will run on a Raspberry Pi, but I am not sure it will have the processing power to run these applications.

 

 

16 Responses to Chess Piece Identification Technology

  1. Fritzmann says:

    RFID chess board sounds great. I just found on youtube a 5 year old Video https://www.youtube.com/watch?v=dpp8gGnpSgM that shows a working RFID chess board. If you look closely you will see that he builds up the board vertical from a-h instead of horizontal 1-8 and on the screen it shows up vertical too. And one time he moved a piece twice. So i think, that it is really piece identification and not just following chess rules! I think he could have moved a peace to wherever he wanted to move it on the board to proof this. The link on the video leads to a Professor of Electrical Engineering from South Korea. Perhaps he is willing to cooperate with you for a really huge and nice DIY Project ; ) and perhaps he has access to cheap sensors from Korea?

    Forget about the Raspberry Pi only reed switch buildup i asked about a few days ago ; )

    I hope that i could help you a little bit.

  2. Spira Matic says:

    We have developed working prototype of RFID based chess board, as an example of using antenna arrays. Our main products were Intelligent Patch Panels, Smart Shelves and similar solutions, based on RFID antenna arrays.

  3. Max says:

    That sounds wonderful, is the component technology available at a price hobbyists can afford, if so how can I get one?

  4. Ty says:

    I don’t know much about diy electronics but how about this: use an array of cheap cmos camera sensors to photograph the underside of the pieces. A 0.3MP sensor should be good enough to distinguish between 16 images (4 bits). Getting the pieces in the right place could be done with positioning magnets or contours in the board. Please let me know if this doesn’t sound totally crazy because I’d love to give it a try.

  5. Max says:

    Ty, it might be possible. There is only one way to find out and that is to try and build it. You only need to prove the concept on one test square. If it works for one it will work for 64. Maybe you could use barcode technology, there is quite a lot of code around on that.
    The challenges you will need to cover are:
    Seamless: The ideal technology needs to be invisible to the user, like the RF based DGT boards. I assume your Cmos technology would require holes in the board to read the underside of pieces.
    Robust: The player should not be required to position pieces precisely so they can be read. How will your system works f a piece is placed off centre but in a square?
    Cost: Reed switches are really cheap. Piece identification could easily done by having one RFID reader per square, then you have the cost x64 which is a lot. There is a link above to a matrix RFID reader, commercial ones are a bit expensive, but maybe with the right antennas it might be affordable. 64 cameras, even cheap ones sounds expensive. Could one camera cover 4 squares?
    Give it a try.

    • Ty says:

      I’m looking into it. It seems the first difficulty is getting a device that can handle many camera’s connected to it. Then there’s some testing of macro photo’s to see if close up images can be taken reliably. I’ll try and let you know about any progress.

  6. Glenn Lake says:

    I had a crazy idea for a way to detect which piece is on which square. What if you had a QR code on the bottom of each piece and played on a glass board with a sensor under that could read the code? I even thought if you could use a document scanner as a chess board and software like openCV to read each piece and its position and feed that into a computer. Just a though. I don’t have a clue about how to do this.

  7. João says:

    Regarding the hall sensor, the configuration must be made by identifying the voltage variation in the 64 houses and applying the corresponding part. Thus we will have:

    def volt_var (volt)
    if (volt > 0 and volt = 0.5)
    return “R”
    if (volt > 0.5 and volt = 1)
    return “N”
    ……

  8. ss says:

    FYI, I discovered this thread while researching solutions for a digital chess board, and my idea isn’t mentioned here. It’s not right for everyone, but it’s a very, very cheap option:

    MOLEX.

    This has the added advantage of centering the pieces on the squares (as the molex must be seated). But, on the bright side, the only thing that has to happen inside the chess piece itself is bridging a voltage pin to a data pin. Might not be right if you’d like the piece to read accurately being placed “anywhere” on the square, but since I’m doing camera work, it’s not necessarily a con for the pieces to be perfectly centered for my use case.

    • Max says:

      Definitely an alternative. However the design objective was “created as closely a possible the experience of playing chess against another person.” If you allow physical connectors you do not gain much and you introduce an artificial element. A reed switch costs £8.50 for 100 and the magnets were £3.99 for 64. I would guess that 64 Molex with sockets is not much cheaper. The rest of the circuitry would be the same. The real win might be some form of cheap touch screen, but I have not been able to find one that would work.

  9. Richard says:

    I successfully use computer vision for my chess robot as described here:
    https://create.arduino.cc/projecthub/ricpd/chess-playing-robot-arm-that-will-beat-you-678035

    • Max says:

      Richard,
      This terrific and quite a breakthrough.
      Your realisation that the computer only needs to distinguish between 3 square cases: Black, White Empty greatly simplifies the coding and I should think improves reliability. Previous image recognition systems end up using software like OpenCV to try and recognise piece type, which is highly complex. In fact I wonder why you need to discriminate between White & Black. In my reed switch build I could only check Piece/No piece.
      You also say you used a 3D printer to reduce cost compared to the AL5D. I might have a go at replicating your project but do not have a 3D printer, although this might be a good excuse to get one. What sort Model of printer would be an economic option? Or I might just get an ALD5.
      Great work
      Max

Leave a Reply

Your email address will not be published. Required fields are marked *