Squat-O-Meter is a Python GUI application that counts the number of squats performed by the user using accelerometer data from the Phyphox smartphone app. It provides real-time feedback and voice notifications to the user.
- Counts the number of squats performed by the user.
- Provides voice feedback to the user.
- Allows the user to set a target number of squats.
- Adjustable parameters for squat detection:
- Moving window size: The number of samples considered in the moving window for analyzing accelerometer data. Higher values may improve accuracy but increase processing time. A Higher value may affect real-time performance if your pc is slow.
- Minimum time between squats: The minimum time interval (in seconds) allowed between two consecutive squat detections. This helps prevent rapid, false detections.
- Change between absolute and acceleration in the z-direction: Allows the user to choose between using absolute acceleration or acceleration in the z-direction for squat detection. While using absolute acceleration the phone can be held in any orientation. It uses acceleration in z-direction by default, and phone should be held parallel to the ground plane (if used in default mode).
- Acceleration threshold: The minimum value of acceleration required to detect a squat. Squat detection occurs when the acceleration surpasses this threshold.
- Analyze data tab: View squat progress over the month.
- Python 3.x
- Required Python packages (install using pip):
- tkinter
- PIL
- ttkbootstrap
- requests
- scipy
- numpy
- pyttsx3
- pandas
- matplotlib
- Clone the repository:
git clone https://github.com/manavthakkar/squat-o-meter
- Navigate to the project directory:
cd squat-o-meter
- Create a virtual python environment:
python -m venv myenv
- Activate the created virtual environment:
.\myenv\Scripts\activate
- Install the required packages:
pip install -r requirements.txt
It uses the Phyphox app for receiving the accelerometer sensor data from the phone. The app can be installed from the Google Play (Android) or the App Store (iOS). Start the app and select Acceleration with g and then click on Allow remote access. You'll see an IP address displayed on the bottom of the screen.
Note: Your phone and PC should be on the same network. For best performance and to avoid any latency, use personal mobile hotspot from the phone.
- Run the
main.pyfile:
python main.py
-
Enter the IP address from the smartphone app when prompted (without the port number 8080).
-
Set the target number of squats and adjust other parameters as needed.
-
Start performing squats, and the application will count them in real-time.
-
Save your progress after each set by clicking on the
Save to Databasebutton. In case of fake detections, the count can be updated by clicking and dragging on the meter. -
View squat progress over months in the "Analyze Data" tab.
Contributions are welcome! Feel free to open issues or pull requests to suggest improvements or fix any bugs.
This project is licensed under the MIT License.

