Combining IoT and footwear to find out more about my running.
So how does it work?
An ESP32 (ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth.) In this case I chose a SparkFun Thing Plus — ESP32 WROOM for the ease of its Qwiic Connect System that made assembling the flex and imu sensors super easy.
An IMU Sensor that allows us to read the shoes position and translate it into quaternions that can be later used to translate the motion of our threejs model on the web. The BNO080 on the SparkFun VR IMU Breakout — BNO080 (Qwiic) works incredibly well for this purpose and also offers library addons to read steps and much more.
A flex sensor to measure the bending of the sole on impact with the ground. I went with the SparkFun Qwiic Flex Glove Controller since it offered a Qwiic connector.
The basic idea:
Our ESP32 translates our sensor data into a json string that we will send via a websocket connection over Wifi. On our PC we open a hosted webpage that connects to the ESP32 via websocket, receives the sensor data in form of quaternions for movement and strings for flex, steps and accuracy and displays this data.
The Github repository:
You can find all the necessary files for this project here: https://github.com/sinnfeinn/nkshoe
The Arduino code:
After adding the board definitions we need to add several libraries to the Arduino IDE in order to work with websockets, our sensors and so on.
Install all of these:
- Websockets (https://github.com/Links2004/arduinoWebSockets)
- ArduinoJson (https://arduinojson.org/?utm_source=meta&utm_medium=library.properties)
- SparkFun ADS1015 Arduino Library (https://github.com/sparkfun/SparkFun_ADS1015_Arduino_Library)
- SparkFun BNO080 Arduino Library (https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library)
- NTPClient (