Fitness Tracker MCT Howest

by rubenvandendriessche in Circuits > Raspberry Pi

41 Views, 1 Favorites, 0 Comments

Fitness Tracker MCT Howest

448353716_450436137773683_9083301367698230387_n.jpg
bb.png

Hello, I am Ruben Vandendriessche and I am a student at Howest Kortrijk. In our first year we have the assignment to make a Project 1. This project combines all courses we have had in the first year and takes up the entire month of June.

Fritzing

sh.png
bb.png

Before we could start, we needed to know what we all would need and how we would connect them, that's where fritzing came in handy. This software makes it easy for you and others to know how to connect everything before needing to rebuild it.

Database

A database is to log and store data. In the database I designed there are 4 tables.

The EER diagram is shown in the image above.

1.Action

This table stores all available actions that a device can have.

2.History

This table stores the history of every device.

3.Device

This table stores all the devices that are used in my project.

4.Settings

This table stores all the settings that can be changed by the user on the webpage.

Code

Backend

For the backend I used Python in Visual Studio Code. The annoying part is that you need to make sure your Visual Studio project is connected to your Raspberry Pi, this means your LAN cable has to be connected to your RPi and to make an SSH connection.

I used my own classes and these are also all included in my GitHub. These are all in a different file in my backend map so everything can be used separately and so that my main code doesn't look as overwhelming and is easier to read with all the different threads. I used threading to run all the different classes at once. And at the bottom, you got all the routes so we can easily get data in our frontend.

Frontend

If the backend is done, you can start writing the frontend, here it is important to know what you want your website to look like. If you need some help, you could first draw it on paper or on an app, like I did it. I used Figma to first make a design I liked before I did my frontend because it could become a mess if you need to change it up too many times. Once you have your design, the only thing left is the JavaScript file. Here you will use a lot of Event Listeners, as well on Socket IO as on the page itself.

Code

If you need the code, here is the link to my GitHub repository with the full code.

Housing

448115370_3825464311044308_3306004517331744643_n.jpg
448353716_450436137773683_9083301367698230387_n.jpg

I tried to make it like a watch, but because of all the sensors etc. it didnt realy fit in such a small formfactor, and i had to make it a lot bigger than intended. Even with this design, was it still hard to fit all sensors and actuators in the build.