Powered by Fuzzy Labs. Formerly known as 'AI-for-your-feet'.
Wearable My Foot (WMF) is an Open Source wearables project built on Arduino.
The primary aim is to try and replicate a 'running power' metric similar to that produced by state of the art commercial products such as Stryd. We're using the gyroscope and accelerometer built into the Arduino along with some clever maths in order to produce an estimation of running power.
Future ideas include attaching a pressure sensitive insole to the device and tracking things such as gait and posture.
The project covers:
- Building the physical hardware.
- Writing and deploying the firmware to the hardware.
- Gathering gyroscope and accelerometer data from the hardware.
- The algorithm(s) used to transform that data into useful metrics (running power, step counter, ground time, etc.)
- An Android app that pairs with the hardware and displays the metrics in realtime.
The hardware is based on an Arduino Nano IOT microcontroller.
n.b. the current generation of hardware is a prototype. Future iterations will have a better form-factor by using smaller components. Example product links are included for purchasing the components.
- 1 breadboard: https://www.amazon.co.uk/ELEGOO-Breadboard-Solderless-Distribution-Connecting/dp/B01M0QJTI5
- Arduino Nano IOT microcontroller: https://www.amazon.co.uk/Arduino-Nano-IoT-headers-mounted/dp/B07WPFQZQ1/
- TODO: battery stuff
The firmware code for the Arduino is built using PlatformIO.
Feel free to skip if you're installing / have installed PlatformIO using a different method. To initialise the environment using Python 3 and pip
:
python -m venv env
env/bin/activate
pip install -r requirements.txt
To activate the environment, source env/bin/activate
.
To Just build
platformio run
Build and upload
platformio run -t upload
Attach a serial monitor
platformio run -t monitor
Run the tests - this builds a new image and uploads it so that tests are run on the device
platformio test
The Android app allows the device to connect via Bluetooth and upload data. It's written in Kotlin.
- Enable the development mode on your Android device, and connect the device with a USB cable
- Clone or download the repository code
- Open the project in Android Studio (File > Open)
- Run the app (Shift+F10 or Run > Run 'app'), this might display a prompt on the Android device to confirm that you trust the computer (if it is not on the trusted list yet)
TODO (scrcpy)
- Have the Arduino powered on
- Open the app. The app will request access to location data, which is required for Bluetooth scanning.
- Tap 'Scan' to scan for BLE devices, if the compatible device is found, its MAC address will be displayed on the screen.
- Tap 'Connect' to connect to the Arduino. After successful connection, the orange LED will light up on the Arduino, and current readings will be displayed on the screen.
- Tap 'Disconnect' to disconnect and end the session.
- Tap 'Save' to save the results of the session into a CSV file (saved at
Android/data/ai.fuzzylabs.wearablemyfoot/files/
on the Android device
The notebooks directory contains notebooks with code used in the experiments
- powermetre.ipynb -- the notebook for estimating the power of a walk in a straight path. Requires three CSV files
- Measurements of acceleration when the device is at rest for calibration (provided at data/still.csv
- Measurements of acceleration during a walk with the Arduino mounted on a chest (can be recorded with the provided app, and the sample data is provided at data/chest3.csv
- Measurements of acceleration during a walk taken with the Android device for comparison (provided at data/chest-android.csv
See here for a nice description of the problems associated with versioning Jupyter notebooks and some suggested solutions.
We're using nbstripout to remove the outputs and state data from the committed versions of our notebooks.
nbstripout --install
nbstripout --install --attributes .gitattributes
nbstripout --install --global
nbstripout --status
Mean average cadence (in steps per minute) recorded with different methods:
Test case | Stryd | Garmin | (WMF) Peak Detection | (WMF) FFT | (WMF) Autocorrelation |
---|---|---|---|---|---|
1km mixed run | 82.56 | 82.48 | 71.50 | 170.17 | 154.48 |
The data directory contains some example data generated by the device.
Several sample CSV files containing IMU measurements (acceleration and angular velocity)
still.csv
-- several minutes of the devices sitting still on a table; used to assess the accuracy and the bias of the IMUleg.csv
-- a short walk with the device strapped to a side of a legchest3.csv
-- a short walk (4.5 metres) with the device attached to a chestchest-android.csv
-- a short walk (4.5 metres) recorded with an Android phone (at the same time aschest3.csv
)
The dash directory contains a dashboard generated by the Dash framework. Dash is Python-based, and uses the Flask web framework; Dash is similar to R-Shiny.
pip install -r requirements.txt
python app.py
- For a guide to Plot.ly graphs etc, see here.
- Nurvv - aimed at runners but this one doesn't like it
- Arion - aimed at runners
- Digitsole - running / cycling / health
- Retisense - aimed at gait analysis / physio tool
- Salted - aimed at golfers
TODO
- Stryd - Running power meter, they are quite opaque about how it works although it seems to generally get good reviews.
- RunScribe - Measures gait, power and others. More transparent than Stryd on how they calculate running power.
- Garmin Running Dynamics Pod - Measures cadence, stride length etc, can also do power when used with other Garmin devices. DC Rainmaker review
- Coros - Running power and other metrics
TODO
- George Ron on the Physics
- George Ron on Stryd
- George Ron on RunScribe (GOVSS)
- Difference between Running and Cycling Power
- Running Power meters compared by Outside Online - interesting references to VO2 measurements.
- Running Power meters compared by DC Rainmaker - focussed initially on Garmin but interesting comparisons with Stryd and RunScribe.
- Running Power meters compared by Sport Tracks
- Polar measure running power using only their smart watch - no need for a foot pod. Uses their "proprietary algorithm and it is based on your speed and altitude gradient"