Inspiration

We did it because it's cool

What it does

The electronic chessboard lights up all possible legal moves a player can make with their selected piece. The chessboard will also go into an error state where all tiles light up red whenever an illegal move is made. The chessboard is designed to allow beginner chess players understand the game.

How we built it

We use hall effect sensors under each tile and magnets under the base of each chess piece to determine the location of each chess piece. However, each piece cannot be uniquely identified so the starting position of each piece must given in the code and the subsequent piece positions are determined by the software. The hall effect sensors are connected to the Raspberry Pi through 8 to 3 multiplexers, allowing us to scan all the chess tiles to build a current image of the chessboard without running out of GPIO pins on the Pi. The lights in each tile are the Adafruit addressable 4 pin LEDs, as they can be daisy chained together to use one pin, while still having the full functionalities of an RGB LED.

The Electrical

We cannot use a normal breadboard as our circuit requires around 1A which a normal solderless breadboard can barely handle. Having the wires fall out of the breadboard all the time is also quite annoying. As such, we have decided to use perfboards to create 4 x 2 sections of the chessboard.

The Software

Whenever there is a change in piece position, the software will determine what piece was picked up, if that piece was allowed to be picked up and if so, light up all the legal squares. The software uses a State Pattern in Python to cycle between the different game states, this is to keep the codebase modular and efficient.

The Mechanical

The chess pieces and chessboard are designed in Solidworks & Fusion 360, with the chess pieces all being 3D printed out of PLA.

Challenges we ran into

For the chess pieces, we are looking to incorporate a cheese theme, with holes around the pieces. At first we manually carve out the holes in Solidworks and Fusion but that was too time consuming. So we begin experimenting with scripts in Fusion, to automatically carve out random holes on the pieces. Our first script process is to generate multiple randomly-sized and randomly-positioned spheres within the piece's bounding box, then subtract those spheres from the piece's body to create the holes pattern. However, did this not work as the spheres are not guaranteed to overlap with the pieces' surface and their randomised positions can make them end up too far inside the piece or too far way from the piece's surface (due to the bounding box volume encompassing the piece by a lot). So the holes are not visible on the surface of the piece.

For our 2nd script, we look to only generate spheres with starting positions on the surface of a piece, to ensure that the spheres overlap with the surface and can be cut out to create holes on the surface.

For the electrical, we found it challenging to solder all the connections and wires onto the perfboard. As all the components require the power and ground wires to be next to each other, there was a high risk of shorting the two together. This is also true for connecting the hall effect sensors to the multiplexers due to the tight space.

Accomplishments that we're proud of

Doing this project, we are proud of many things that we didn't think we would be able to do. Firstly, we design a custom PCB solution from scratch, taking multiple stages of prototyping and iterative design, as well as countless hours soldering components onto the perfboards at the elec makerspace. Secondly, we program the entire chessboard logic with Python and it was quite satisfying when we applyed the content and knowledge learnt in COMP2511 into the codebase. Thirdly, we also come up with custom design for the chess pieces and electronic housing, as well as fabricating them using 3D printing and laser cutting. Overall, this project has taught us a lot of technical skills that are relevant in our field, as well as allowing us to demonstrate our teamwork, time management, communication and leadership skills within a time- and resources-limited environment.

What we learned

CAD: Solidworks & Fusion 360,

Misc: Laser cutting, 3D printing, Custom PCB design, Python, Software development & debugging, Prototyping

What's next for Electronic Chessboard

We want to expand the software architecture so that the chessboard is able to use the stockfish AI to give real time analysis of the game and highlight the best piece to move at each turn. As we are using hall effect sensors, we cannot determine what piece the player wants their pawns to promote into, so we want to fix that in a non-convoluted method. We also want to let the players to determine the starting state of the chessboard without needing the change the code on the Raspberry Pi, so that they can practice puzzles.

We want to move away from perfboards to PCBs for a more streamlined and robust design for the electrical circuit. We also plan to change the multiplexers connecting the hall effect sensors with shift registers as the new design will require less ICs.

Further into the future, we want to change how the player performs a piece selection, as currently the player has to fully pick up a piece to see its possible moves. However, this is against the rules if the player decides against moving that piece, so we want to modify this functionality so it aligns more with the rules.

Maybe one day we will be rich enough to fit every tile with an RFID scanner.

Built With

Share this project:

Updates

Submission history