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)
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  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  .
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.