TempoFit
Tempo Fit is a advanced device developed for Project One in the MCT program at Howest University of Applied Sciences. It uses sensors to capture vital health metrics such as heart rate, humidity, speed, and body temperature. This data is then displayed through intuitive graphs, providing users with real-time feedback to enhance their fitness routines. Tempo Fit aims to empower users with actionable insights, promoting a more effective and informed approach to personal health and fitness.
Supplies
Raspberry Pi 4 (2GB): €40.95 https://www.raspberrypi.com/products/raspberry-pi-4-model-b/
LCD Display: €22.75 https://opencircuit.be/list/lcd-displays
Vibration Motor: €2.73 https://distrelec.be/nl/miniatrillingsmotor-seeed-studio-316040001/p/30109531?srsltid=AfmBOooUE37Sk-182mJ9-DTxm139AyY2B_eIEwXrhKpHpYtAu9c1RH8vdzY
Potentiometer: €1.36 https://www.kiwi-electronics.com/nl/panel-mount-10k-potentiometer-breadboard-vriendelijk-1783?country=BE&srsltid=AfmBOopupybme_b2ORCE4LO91VCk8gUlSt0mmkT8QlZl56NW2JOJ1QmKK5E
Passive Buzzer: €2.75 https://opencircuit.be/product/passieve-5v-buzzer-5-stuks
GPS Module (U-Blox NEO-7M): €34.95 https://whadda.com/nl/product/gps-module-u-blox-neo-7m-voor-arduino-wpi430/
Button: €0.46 https://www.amazon.com/raspberry-pi-buttons/s?k=raspberry+pi+buttons
MCP3008: €3.64 https://www.microchip.com/en-us/product/mcp3008
SparkFun Pulse Sensor: €32.61 https://www.gotron.be/sparkfun-pulse-sensor.html
Frizing Scheme
In the picture above, you can find all the necessary components and a way to wire them on a breadboard. I have already named all of these components, but now I want to explain a bit about what they do:
- Raspberry Pi 4 (2GB): Serves as the main controller and processing unit for the project.
- LCD Display: Provides visual output for the project.
- Vibration Motor: Provides tactile feedback in the form of vibrations.
- Potentiometer: Used for analog input control, often for adjusting settings dynamically.
- Passive Buzzer: Emits audible alerts or tones based on the program's output.
- GPS Module (U-Blox NEO-7M): Provides location data and coordinates.
- Button: Used for user input to trigger actions or events.
- MCP3008: An analog-to-digital converter (ADC) chip that allows the Raspberry Pi to read analog signals from sensors.
- SparkFun Pulse Sensor: Used for monitoring heart rate and pulse."
Database
In a database, there are five tables: users, runningsessions, devicehistory, actions, and devices. Each user has an id, login, and password (although we won't use the password in this project). There is a foreign key between the users table and the runningsessions table to assign a session to a user. Additionally, there is a foreign key (runningsessionID) between the runningsessions table and the devicehistory table, so data from sensors can be linked to the correct running sessions.
Moreover, the devicehistory table has two foreign keys: actionID and deviceID. The deviceID links the correct sensor to the data, and the actionID links the correct action to the sensor (this is necessary because sometimes a sensor provides multiple outputs).
Frontend
In the pictures above, you can see my HTML and SCSS code.
You can find all of this in my GitHub repository.
Libraries and Classes
For this project, we will use the following libraries: DHT11, gpsd, and lGPIO. The relevant files include:
- DHT11.py
- GPS.py
- IP.py
- LCD_inlezen
- LCD.py
- MCP3008.py
- button.py
- heartrate
- buzzer.py
- vibratiemotor.py
You can find all of this in my GitHub repository.
howest-mct/2023-2024-projectone-mct-JakubTyszkiewicz
Backend
Login: The user logs in with their username. The program starts with a button press, which activates a passive buzzer to make a small noise.
Display IP Address: The IP address is written on the LCD display.
Read Sensors and Insert Data:
- The system reads data from various sensors, including the heart rate sensor, DHT11, and GPS module.
- This data is then inserted into the database.
Data Transmission:
- The data is sent via an API and socket.io.
- Socket.io handles real-time data transmission for immediate graph updates.
- The API is used to retrieve historical data.
End Session:
- Pressing the button a second time ends the running session.
- The vibration motor vibrates for one second to signal the end of the session.
You can find all of this in my GitHub repository.
howest-mct/2023-2024-projectone-mct-JakubTyszkiewicz