This week I spent the majority of my time wrapping up the website. I have the back-end and front-end code written, and I will need to test it this coming week with the Jetson by sending POST commands As for testing and verification, I have started testing the PCB with the Arduino. So far, I have gotten 100% accuracy on the 128/128 test I did, though I have only tested the top half so far. I have also started to solder the LEDs together and am trying different configurations (such as 1, 2, 3, or 4 LEDs underneath each test square). This is because, during testing, I noticed that with 4 NeoPixel LEDs, the light sometimes bleeds into neighboring squares, which makes it difficult to clearly identify the white squares. I also spent time designing the enclosure box that fits under the PCB holder and buttons; this is where the Jetson, Arduino, and wires will be located.
Top View:
The bottom right corner is for the Jetson.
Bottom View:
As you can see right now, I have a sliding mechanism so we can pull the Jetson in and out, and the hole provided also allows us to plug in a power source.
Side View:
On the sides, we can see the ventilation holes for the Jetson. This is to ensure that nothing overheats and the air from the running fan doesn’t get trapped. On the front left, you can see an extra hole, which is for the camera’s CSI port.
This following week, I will finish testing all of my components. Additionally, I will 3D print this box and glue it to the demo parts. I am on track to finish all testing and integration before the final presentation!
This week was dedicated to the software side of our project, we worked specifically on CV and website. We also did additional testing with hardware components such as the PCB to acquire data for our final presentation/report. We will also conduct additional end-to-end testing to verify that our system meets the requirements for move detection accuracy, illegal move detection, and response latency.
The risks of integration stand from last week. We will be integrating the hardware and software this coming week. In the case that our PCB doesn’t work with the Jetson we can mitigate it by keeping it with the arduino and just plugging the arduino into the Jetson. We also talked about other pathways for detection other than the CV with our TA last week. We can possibly use the last and current state of the PCB to find which squares have changes, and using that determine if a move is in-process or completed. This does pre-requisite the board being set up correctly initially which was not part of our initial user story, although this can be used as a mitigation path in case our CV doesn’t meet our testing requirements. There have been no changes made to the design, and no updates on the schedule.
As we move to the final integration phase, our main priority is making sure that all hardware and software components are communicating reliably so that we can meet our design requirements. We also plan to prioritize integration testing this week so that any remaining issues can be identified and addressed before the final demo.
This week I was mainly focused on the software integration and making sure that the chess logic was correctly handling moves detected from the physical board and ensuring that the software can reliably update the board state. I also looked into making sure that move validation and logging functionality were being handled correctly. I was also working on preparing the software for further integration with the CV system and audio feedback.
Next week, I continue to test with the integration between physical chessboard and software and particularly focusing on the accuracy of the move detection and board-state updates. I also want to make more progress on integrating the CV results into the existing chess logic and verify that the audio feedback provides clear feedback to the users.
At this point, the main challenge is to make sure that all the different software and hardware components work reliably together. Even though the individual chess logic is functioning correctly in the software testing phase, I need to make sure that the system performs as expected when we connect it to the physical board. I will continue to prioritize the integration aspect of the software and hardware.
This week, I have worked towards the CV aspect of the project. I have researched some suitable open-source models that can output the types of pieces; this will be needed for move detection and enabling the user to set up the board. I also worked towards integration by tinkering with the Jetson’s python I/O libraries. The most vital integration will be for the PCB through the GPIO pins on the Jetson. The python library seems easy to use, and next week I will try to actually connect the PCB to the Jetson and get the board detection set up and integrated with our software stack. I will be in Pittsburgh for the break, and I will aim to get substantial integration work completed then. Also getting some CV working is another main goal next week.
We have already done the necessary testing of the PCB and have gotten near perfect results on digital board detection, validating our > 98% hall sensor accuracy user requirement. The chess software is mostly based on preexisting libraries which have already been tested, we also observed no issues with making moves solely in software. This validates our 100% illegal move detection user requirement. The next testing step will mainly focus on CV piece detection; since we already have the infrastructure built to capture from the camera on the Jetson, this week we intend on doing a lot of testing and verification of the models we use.
We also got some good feedback from the interim demo from the use case standpoint. We need to make sure that all aspects of the game can be differentiated by a fully visually impaired user, which includes the pieces. The chess squares already can be differentiated from black and white based on the depth of the square, however, the color of pieces themselves currently cannot be distinguished without visually seeing them. So, some tactile features will be needed on those. To validate these improvements, we will plan to conduct testing to determine if users can correctly distinguish between two sets of pieces without relying on visual information. This will help make sure that the physical board meets the accessibility needs of our intended users.
Also as we begin to move towards system integration, we will need to do validation across several subsystems. Along with complete system validation tests to check if our latency user requirement is met. The biggest priority will be getting moves to be detected by both the PCB and CV into the chess software, all on the Jetson. This will by far be the main integration challenge, and all the other peripherals on the Jetson will need to be ported to Linux, which we do not foresee to be much of an issue.
For our upcoming verification and validation testing, we plan to measure the accuracy of each subsystem with specialized tests. For the CV subsystem, we will be comparing the detected chess pieces and their locations against the actual board configuration to determine whether we meet our piece classification accuracy of greater than 98%. We will also be testing different board configurations and lighting conditions to evaluate consistency. For full system integration, we will compare physically executed moves against moves registered by the chess software, including legal and illegal moves. We will also measure the time between a physical move being completed and the corresponding feedback being generated to verify that the system meets our end to end latency requirement of 1.5 seconds.
The biggest risk will be integration, as we were able to show all main subsystems working as intended in the interim demo. Our main plan for integration will be to get a correct end to end move detection from physical to software working. All other features are of lesser importance and will be integrated later.
One main part of the integration is getting the PCB to work on the Jetson. Currently it works perfectly using the arduino, so we have to transfer the code from C++ to Python so it can work well with the software side.
No changes have been made to the existing system design from last week. The main focus of the remaining weeks will be integration which we have already mentioned above. Other than that, we need to update all of our previous documentation to reflect the current system design, as it has changed since the design document.
This week I worked on putting all the demo parts together, including the CAD parts which I had printed out. I also worked a bit more on the website. I have completed both the front-end static pages (this consists of the CSS files for each page along with their corresponding HTML files, and then a style.css file for the overall format which applies to all pages). Here are the static pages:
I ran these static pages using the GitHub Codespaces Live Server feature.
I decided to use the Model-View-Controller (MVC) architecture for this website. This means there will be two parts: front-end and back-end.
This is an architecture I learned in my full-stack class. A key point of this website is that it will connect to the Jetson. We have decided to use Wi-Fi, so the Jetson, through Wi-Fi, will send information through a JSON HTTP request. Here is a path flow of how it will work:
The HTTP request is as follows:
HTTP
POST /api/games/123/moves
{
“from”: “e2”,
“to”: “e3”,
“color”: “black”,
“piece”: “pawn”
}
At this point, the move has already been validated through the validation code running on the Jetson. Hence, all we have to do is store it in the database and add it to the front-end. There will be a .ts file in the client folder (front-end), current.ts, which will parse this information and send it to the server controllers along with updating the HTML file in the front-end. Based on the request and information (POST and the JSON information), the controllers will choose which model to send it to (in server models). Then, this model will make the changes to the database.
On top of the software portion, I worked a bit on the hardware. I worked on soldering parts together to the Arduino this week, so the wires to the LEDs and the LEDs. Initially, my plan was to separate the LEDs per row and then solder one row to the other. Although, the distance between the LEDs and the solder pads is very minimal, so anytime I tried soldering onto the pads it would burn into the LEDs. So I decided to, instead of wires, just have 4 LEDs of the strip not being used for each row. So this is the new diagram:
Here is a two-row example. As you can see, we still maintained the 4 LEDs per square = 32 LEDs per row. Then we will have an extra 4 transition LEDs on the side pockets, which have already been modeled in our old CAD system instead of wires. We will need a total of 7 transition LED sets for the 8 rows total; this means 7 * 4 = 28 LEDs which will never turn on. So the total number of LEDs we need is 7 * 4 + 32 * 8 = 284. The LEDs I bought are two sets of 144 LEDs, so we will have the perfect amount and hence no additional cost.
In terms of progress, I am just a bit behind in getting this LED setup. I already have it working; it’s just in terms of getting it physically embedded into the physical design and doing any extra printing. This won’t take long, just an hour of extra work, so I should be able to catch up on this next week.
This coming week we are starting integration and testing. I have completed one preliminary round of testing on the PCB. I know that each square works with the layered model (the chessboard and LEDs between), although I want to do more detailed tests. In addition, I want to start with integration between the hardware components, like the buttons, to the software side. Finally, I would like to complete the back-end of this website.
Verification:
Here are some of the specific subsystem verification tests I will be running:
Subsystem
Design Req
Testing Plan
Pass Criteria
PCB
100% correct per-square detection
Two placement/removal cycles per square, total 256 transitions. Compare reported (digital matrix) with expected (ground truth/what we see)
256/256 correct, no unintended square changes (no false positives)
LEDs (Feedback)
feedback events fully correct ≥ 95%
100 commands total including 50 hints and 50 illegal move commands. Hint commands should result in green blinking lights in the pathway from the current square to the next square (based on the specific piece’s move rules). Illegal move commands should result in blinking red light on the current illegal move square and green blinking light on previous move square. Compare reported to expected (ground truth/what we see).
≥95/100 fully correct. Fully correct is defined as the hint/illegal move color is emitted correctly, and other LEDs are not changed. This means the white squares which have white LEDs (which are not part of the hint/illegal path) should remain white with no changes. If either path/squares emit incorrect incorrectly or other LEDs are impacted it will be considered incorrect.
Button (Input)
Input events fully correct 100%
20 presses per button, including short presses and long holds.Compare digital printed input to actual button press.
20/20 fully correct per button. This means as the button is pressed the exact button input should be seen in the software side at each attempt. Along with no false positives.
This week I worked on preparing the software components for our interim demo on Monday and Wednesday. My main priority was making sure that the chess logic, board-state tracking, and text-to-speech functionality could all be demonstrated together. I also worked on organizing the software workflow so that moves could be processed for the user. Lastly, I made some changes so that the text-to-speech implementation is also adaptable to the Jetson’s Linux environment.
Next week, I will be focusing on integrating the existing chess software with the physical board’s Hall-effect sensors. This involves mapping sensor inputs to individual chessboard squares and making sure that the changes in sensor readings can be translated into valid chess moves. I will also continue to test the move validation and audio-feedback systems, particularly for illegal moves and situations where the detected board states don’t match the expected chess positions.
The main challenge is making sure nothing breaks during integration between the software and physical hardware since the chess logic needs to correctly interpret sequences of piece removals and placements rather than receiving moves directly from the user. Another concern would be ensuring that the board can recover from missed sensor readings or unexpected changes in the board state.
This week I spent the majority of my time getting the camera integrated with our software. I have gotten image/video capture in python with OpenCV, and everything’s ready to feed into a model to detect the types of pieces from the last move. I have also researched some pretrained models that might be suitable for our needs. This upcoming week, I will do some further testing on some various models, and begin fine tuning the one that we end up choosing. I will start getting some benchmark metrics for everything, and report them in the next status report; I intend on getting about 99% detection accuracy on the last moved piece and correctly forwarding that move to the rest of the software. This last step should be minimal work as everything is being done with python, with c++ running under the hood with OpenCV. Also depending on the speed of the detection, I may need to do a custom reinstall of OpenCV to utilize CUDA, although this is quite involved.
One risk that we identified is that the NeoPixels require a 5V output which the Jetson is unable to output. This may require us to use an Arduino which the Jetson would send outputs to and would output onto the NeoPixels. While this isn’t exactly an elegant solution, it would be very simple to implement and wouldn’t cause much of a scheduling problem. Another issue we faced this week was with the camera on the Jetson, it has turned out to be more difficult than initially thought to get correct drivers for the specific camera we purchased, and getting CUDA support with OpenCV on the latest version of Jetpack (the Jetson’s Ubuntu-based OS) is difficult, and there is little online support for this. A fall back option in the worst case would be to downgrade to Jetpack 5, which shouldn’t cause much issue with other subsystems. Some remaining integration challenges we will face will be forwarding the logging outputs from the Python Chess to our speakers and NeoPixels.
We are also struggling a bit to get braille to show up well with 3D printing, due to the heat of the filament some of the dots tend to connect. A mitigation for this would be to purchase separate braille strips that we will tape onto the board.
The hardware/electric design has changed.
As mentioned earlier, we are intending on using an Arduino to send our LED outputs to the board, the Jetson will still be responsible for telling the Arduino what to output. We will also run the button inputs through an arduino. Here is a new wiring/electric diagram:
This will cost us extra for parts like the arduino and an additional power source.
Although, for the material of the chess board & box we have decided to use PLA/PETG, as it is more accessible and environmentally friendly compared to acrylic. This also decreased our cost as we are able to use an at home 3D mini printer and Robo Club printers. So the earlier costs for additional parts have been mitigated.
Additionally, our solution for sending moves to Python Chess may change. Instead of relying on the camera output to cross verify moves, we will only use it to identify the type of piece moved. We think this will still maintain our projected technical design requirements because the Hall Sensors on the PCB have proved to be very reliable and continuously output a correct state of the locations of all pieces. And using the PCB outputs to locate the position of a move and using the CV output to identify the type of piece moved will integrate nicely for our Python Chess software.
This change should also help simplify our software integration process. Rather than having to rely on both the camera and Hall sensors to independently determine the board state, we can use the Hall-effect sensors to track the locations of chess pieces and the camera to help identify which pieces are being moved. This reduces the amount of image processing required while also allowing our digital board-state tracking and python-chess implementation to handle move validation. However, we still need to make sure that the two inputs are reliably identifying moves, particularly if multiple pieces are moved or if a piece is incorrectly placed.
There were some movements and additional tasks
For hardware we added some tasks such as Designing Hardware Integration and printing the 3D board.
We also had to move the integration back a bit due to a delay in component delivery. This means we will have to do testing and integration together.
On the software side we were able to successfully get the software chess code running on the JETSON you can see the image in the below link:
For hardware we started building the prototype board. As you can below each square fits right above the sensors with the led underneath. The black dots on the board are our magnets, fit into their slots.
Here in the results when running a simple loop test. We can see all 16 squares are detected to have a magnet over it!
This week I have been working on building the physical board to prepare for the demo.
This is my initial design of what I wanted it to look like:
With this being the top of the board:
My biggest concern was the distance between the Magnets and the PCB (vertically). I needed the components between them (Chess board & LEDs) to not take much space so that sensors would still be able to detect the magnets. Additionally we intend to incorporate tactile features such as raised black squares and holes for the magnets to go into. All the magnets are the same size so that means we need to minimize the distance from the bottom of the magnet hole of the black square to the PCB. Thankfully I was able to move the PCB delivery date Thursday so I used it to prototype and find the right size for the chess board and the led holders.
I first started with the chess board design, this was my initial design:
The left is the CAD version and the right is the real output.
As you can see it has the features of raised black squares and holes for the magnets. I used the given size for the magnets on the amazon link and made the “top holes” the same size. When the print came it seemed that the magnets would not go in due to small extra PLA within these holes. Although when testing this board with the PCB Sensors the sensors were able to pick it up. But when I placed a neopixal strip between the sensors and the printed Chess board The detection no longer worked. So I made two changes to the chess board: I increased the diameter of the holes and I decreased the overall thickness for the board. I then printed/tested a simple two chess tile demo (one black one white).
In terms of the Neopixal strips I need to build a base for them to stick on. As per my old idea I will have 4 neopixals for each square perfectly. But if i put a complete base below it it just adds to more distance between the sensor and the magnets above. So I decided to use a grid method I first tested out one grid. From the order website I found that the max height is 2mm, I made the gap of this grid 2mm and the top and bottom 0.5mm. The fact that the top and bottom are 0.5mm makes it flexible to push the LED through but tight enough such that it stays in place and doesn’t stick to the PCB. I tried porotype one cell and once i can push the LED through I made the full grid as shown below:
The extra space on the edge of the grid is for the wires where I can connect one LED strip to the other.
Finally I porotyped the extra sheet (layer) that is below the PCB (which holds it). On JLCBC I saw that the width of the PCB is 1.6mm (this does not include the extra height of the sensors). But the sensors are at the center of the grid opening and the chess board holes are right above that, so the height of the sensors won’t hit the top chess board. But we still need to align the PCB with the grid and to do that I created a bottom sheet which a 1.6mm edge Right where the Grid edge is. Then if both these edges are glued/nailed together we minimize the distance from the chess board to the PCB. Here is the prototype for the PCB holder :
The final part I made was the letters & braille. This is the prototype for it:
The final part I made was the letters & braille. This is the prototype for it: The braille came out a bit sharp and there were also some strands/strings between the braille. This is because the way 3D printing works is with melted PLA, so when the nozzle moved from one small braille dot to the other quickly, they attached. I am going to try using sandpaper on it to see if it refines it a bit. If not, I will try using braille stickers.
Together this is what the final setup looked like (right now only the bottom layer has LEDs but I will wrap and solder them soon.) I also ran some tests and all the magnets are detected through this layered system.
For next week, I hope to finish up the website and also start integration. I am not behind on my personal tasks, but as a team we are a bit behind on integration. As of now, I have only tested the LEDs and PCB working with Arduino. I hope to get them working with the Jetson by next week as well.