aeabc67e-c616-45b8-a7fb-30cc0340044d-removebg-preview

MoveMate

An Exercise Detection and Repetition Counting Module for Dumbbells

About the Project

We are working on the idea of creating a seamless workout experience in gyms using IoT-based retrofittable modules on exercise equipment that can track workouts automatically for the user. This was the main motivation for pursuing this topic for the final project.

block-diagram

This module uses data from accelerometer and gyroscope to detect the exercise the user is performing and count the repetitions.

The Team


team

From left - Saurabh Parulekar, Essa Alkhunayn, and Amogh Gajare


The final setup

1 2

Algorithm

For developing the algorithm for repetition counting and exercise detection, we collected the accelerometer and gyroscope data from Pico4ML on-board IMU.

image image

We found that Y-axis and Z-axis data is relevant for exercise detection, whereas X-axis data is not very relevant for exercise detection, but can be used for form correction in the future.

image

We found that there is a clear distinction between values of peak-to-peak amplitudes of the accelerometer data of both the exercises.

image

image

This seems to be consistent in a particular range of values for multiple repetitions. So, we use these values to detect the exercise. For repetition counting, we use Gyroscope data and find that X-axis data is relevant for repetition counting, Y and Z axis Gyroscope data cannot be used directly without cleaning the data for repetition counting.

image

From the gyroscope data, it is possible to count the repetitions by considering the X-axis Gyroscope data. We observe that the X-axis gyroscope data averages at nearly zero, so we count repetitions by zero-crossing detection.

Implementation

image


Code-Flowcharrt-3-drawio

1) The code initializes all the sensors as well as sends initialization message via Bluetooth to the GUI

2) After Initialization it waits for RFID card, once a RFID card is read a loop is initialize which calculates the repetitions done by the user, the loop runs for 40 secs and sends repetition data via Bluetooth to the GUI

3) Once the loop is terminated Exercise is detected from the data collected and sent via Bluetooth to the GUI

Graphical User Interface


GUI-In-action


Repetition: Repetition is continuously sent as and when it is incremented The Center Progress bar and Digits show a 40 secs timer in which the user need to perform maximum number of repetitions Exercise: After the 40 sec timer is completed the data is analysed and the field is updated accordingly to Bicep Curls or Lateral raises The Bottom test displays the Name of the user who has scanned their RFID tag on the movemate device.

1) The GUI consists of 3 files, E7.py, GUI.py, Bluetooth.py

2) E7.py is the main file which needs to be executed, this files initializes the GUI and start individual threads for parsing the Bluetooth data

3) GUI.py file contains the GUI formatting, when this file is called by the E7.py file, it will create the GUI, GUI runs on a separate thread initialized by the E7.py file

4) Bluetooth.py file contains a serial reader which reads the Bluetooth data from the laptop Bluetooth and a parser. The parser waits for commands from the device and displays the received data accordingly

5) Threading becomes essential here as the GUI is a looping code, it needs to continue to loop otherwise the GUI gets stuck, for this reasons a separate thread is needed to run the Bluetooth data receiver and parser

Challenges

1) One of the main challenges we faced during our embedded course project was designing the circuit and selecting the appropriate sensors. We had to come up with multiple proposals and carefully consider which sensors would best meet the goals of our system.
2) The second challenge we faced was building the code to connect each sensor to the microcontroller RP2040. This required a lot of attention to detail and careful planning, as we had to ensure that the code was properly configured and optimized for the sensors and microcontroller we were using.
3)The third challenge we faced was with the processing part of the project. We used a simple algorithm to process the data from the sensors, but there were other algorithms that could have potentially provided better results. However, these algorithms were beyond our capabilities and we didn't have enough time to explore them.
4) Overall, these challenges required us to have a good understanding of circuit design, sensor selection, and coding, and to be able to troubleshoot and problem-solve when issues arose. Despite some initial difficulties, we were able to overcome these challenges and complete our project successfully, which helped us to develop our skills and confidence in working with embedded systems.

Leaderboard

Leaderboard-Bicep-Curls Leaderboard-Lateral-Raises