Classifying workout exercises on an Arduino Nano 33 BLE Sense board.
Find a full presentation of the project here and the slides under project_presentation.pdf
.
Special thanks to Machine Learning Tokyo for their series on Edge AI during which this project was created.
- continuous classification of three exercise types: Jumping-Jacks, Push-Ups, Squats
- inference is running on an edge device
- total duration per exercise is accumulated and shown in some kind of visualization
- https://store-usa.arduino.cc/products/arduino-nano-33-ble-sense
- 9-axis inertial sensor. Here we make use of the 3-axis accelerometer
- Bluetooth Low Energy (BLE) used for sending the data for recording and the prediction results later in inference over to web dashboard
- support of TensorflowLite
- Sense board not required but offers way more sensors useful for other future projects, such as a humidity and temperature sensor or a microphone
- https://store.arduino.cc/products/silicone-sleeve-arduino-nano-33-ble-sense
- protects the board
- improves handling and stability in pocket
- e.g. https://www.amazon.de/gp/product/B0711PVX6Z
- for power and to write the code to the board
- allows for mobile usage of the Arduino board
- alternative: External battery
- https://www.arduino.cc/en/software
- write code and upload it to the board
- support of external libraries
- https://www.edgeimpulse.com/
- offers end-to-end deep learning solution for edge ai devices
- free for individuals
- Web browser that supports bluetooth low energy (BLE)
- for recording and visualization of data^
- for resampling of time series data
- record accelerometer data (x, y, z) while doing exercises using script at
arduino-recorder/acc_ble.ino
- board in pocket connected to power bank
- sending data over Bluetooth Low Energy (BLE) from the board to a web app running in my browser and storing it as .csv files on my local machine
- repository of ble-recorder: https://github.com/LudwigStumpp/ble-recorder
- here: aiming for constant 20ms timesteps in recording data
- create virtual Python environment of your choice and install dependencies listed in
requirements.txt
- move all your
training.csv
files in the folderpython-resampler/in
- cd into
python-resampler
- run
python resample.py
- find resamples data in folder
python-resampler/out
- data uploaded to Edge Impulse Platform
- follow proposed steps to train a classifier based on the data
- compile the trained into Arduino library using the Edge Impulse deployment features
- integrate this external library into Arduino IDE by installing from .zip file
- library can here be found under
arduino-classifier
- this results in the file
arduino-classifier/examples/workout_classification.ino
- creates BLE central station that published prediction results
- open
web-client/index.html
in your Chrome browser - and start the recording
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Also feel free to contact me on Twitter if you have any questions or issues.
This software is licensed under MIT.
All source code under arduino-classifier
is provided and licensed by EdgeImpulse Inc. under MIT.