This week, I completed several tasks for the integration of our system, as well as continued to add functionality and improve the accuracy of our system.
For total system integration, I setup the Raspberry Pi anchor station, transferred/ran all the firmware for the Pi on SSH, installed Matthew’s web dashboard code onto it, and setup the connection between the output of the firmware onto the web dashboard hosted by the Pi. Now, the pipeline from anchor/wireless input to the web dashboard, which other devices are able to connect to, is complete. It was validated real data from our pool testing with simulated anchor input, and was able to show the motion of the swimmer live on the web dashboard.
To do so, I expanded the firmware on the Pi by creating the script streaming each tag to the web dashboard, as well as created the file to upload the pool’s configuration to the dashboard. I also completed several accuracy improvements. As mentioned last week, the formula was overcounting several strokes as two strokes due to the change in motion in the arm in air versus in water. I adjusted the formula to track the continuous rotation along the swimmer’s axis in addition to looking at the peaks of gyroscopic motion. Together it weigh both factors to better see what peaks are a continous stroke. That reduced the margin of error from our real data from ~43% to ~15%. To further reduce the number, I implemented wall detection firmware that will take the swimmer’s position and IMU data to determine when the swimmer touches the wall. It can then know to ignore motion associated with wall touches, which should further reduce the amount of overcounted strokes. Wall detection will also help with our location accuracy, as it provides a reference point to where exactly the end of the pool is. Another major firmware change I worked on was converting function calls in my c code into Zephyr formats to get those to run on the NRF, since our final prototype doesn’t have a Pico.
My progress is on schedule. For now, I have done most of the firmware of my system, so I will spend the remaining time working with the rest of the team towards full system integration. That will include both the physical setup of the devices, pool testing, further fine tuning of my system to improve accuracy, and work towards deliverables like the final presentation and report.
Over the course of this project, I learned a lot about the practical integration of systems, which differs a lot from studying the details of how components work and such. For example, I am currently taking a MEMS class and part of the class is studying how devices like accelerometers work; it is a completely different task to take an IMU and learn how to process the data it outputs and connect it to other devices.
Overall, I would say the greatest challenges were not limitations of ECE knowledge, but the task of getting all the different interfaces to connect, (such as converting c code to run on a Pico, getting the Pico to convert into binary and then into Zephyr for the NRF). And on the anchor side the conversion from reading serial into Python, and then converting them into webhook calls for the web dashboard. All of that effort went into just converting formats. There’s also the physical aspect of integration challenges. During the planning phase, I had to search digikey extensively to find the right components to connect the various components we were buying. There were all sorts of different variables to consider such as connector layout and voltage it runs on. All that planning was necessary to reduce the orders needed and save on shipping costs.
Our antenna adapter illsutrates the challenges of that. No specific harness existed, so we would have to build it from scratch, so I researched the correct connectors, pins, and UART boards to create the adapter. But during physical assembly, we found that the connector did not give us enough pitch to solder individual wires to pins. So I again scoured DigiKey to find an alternative connector that had different pitched output pins. And once we got the components I had to consult the datasheets to know which pins to connect and so on.
A huge part of my learning in this project was just how to efficiently find resources to handle those types of practical challenges. I learned how to efficiently find datasheets for components and know where to look to find the information I’m looking for, as well as find and understand guides for setting up and using development tools/libraries to convert between all sorts of formats. I also found that I did have to utilize a lot of informal sources to find solutions to specific problems. I mentioned the antenna connector above, and the replacement component that worked well I actually found through a link on some random forum. In general, this course taught me a lot about the practical challenges of integrating a multifaceted system, which has been very different than the conceptual learning done in courses.