D. Design Diary - sikadm/387FinalProject GitHub Wiki
Overview
The project was broken down into 4 parts before integration. These parts can be described as the circuit, the graph, the form, and the leaderboard.
The Circuit
The circuit was fairly easy to put together. The Arduino playground code made it easy to read two pulses at once. However, as with many cheaply made parts, one of the pulse sensors broke in usage. The wire soldered on to ground fell off and since I have never soldered, tried to keep it into place without having to attempt that. To make this more wearable, I would consider attaching the sensor to a wristband with a smaller microprocessor and bluetooth connection. However, with limited time, funds, and expertise, the project has not reached thus far.
The Graph
Using my knowledge from the group project, using the matplotlib module was easiest to use for the graphs. While the Arduino Plotter does something similar, I took the approach of using python to make it more customizable and easier to read. It was difficult to get the animation to cooperate but using some of the tutorials found on matplotlib.org, the graph came together and functioned as expected.
The Entry Form
Again, wanting to focus more on python, I researched ways to create entry forms. In my research, the Tkinter module kept appearing as a suggestion so this was the approach I chose. The first problems I ran into was figuring out how to limit a user to only entering in numbers from the age and the weight and then deleting that once the information what "submitted". I was able to limit the entry form to only allowing digits but this complicated the clearing of the entry forms.
The Leaderboard
For the leaderboard, I found that most people used modules such as BeautifulTable and PrettyTable to create tables in python. While not as attractive as I had hoped it to be, it met the needs of this project. The leaderboard can easily be fed a series of lists that can be sorted. For this, the information collected through the entry form and the pulse data was put into lists and equations. This was probably the easiest component of the code.
Calorie Calculation
While it is not possible to know exactly how many calories a person burns based only on their weight, age, and pulse, it is possible to estimate within reasonable certainty. The equation used can be see in the figure below. As the figure explains, it is based on a person's sex, weight, age and pulse but is more accurately calculated if you can consider the amount of oxygen entering and leaving in the body.
Integration (Issue)
While I thought these separate components would be easy to integrate together since it mainly used one program, it ended up being the downfall of this project. Several hours were spent trying to figure out the issue that kept appearing in the terminal (see below) regarding running matplotlib and tinter together. I read several forums and watched many youtube videos but each one lead me right back to this error. This is where the integration goal ended.