Introduction
Tracer is an open-source ESP-32-based embedded project that leverages the wide variety of software libraries written for the platform and allows tinkerers to gain insight into the necessary processing and algorithms required to develop their very own fitness tracker. This is a trimmed platform with a powerful IMU and ToF to sense your environment while also having WiFi and BLE connectivity.
Before diving further, I have to thank JLCPCB for sponsoring this project. They have been a crucial part of the process by enabling me rapid prototype without compromising quality. All of the PCBAs related to this project were prototyped and assembled by them. I highly recommend them for the high quality, cost, and time-efficient, if you intend to design and build any boards of your own.
Now back to the project, here are some of the key features;
- Leverage the LSM6DSL to track your objects in real-time.
- VL53L0X Time-of-Flight sensor for gesture control and ranging functions.
- Easy mounting using high-quality velcro straps allows the unit to be mounted on various objects, from your bicycle to track lean angles to a tennis racquet for pose insights.
- On-board Li-ion battery charging using the TP4065.
- Battery Life - 2.5 hours of continuous streaming over BLE at 10Hz.
- 15m BLE range (unobstructed) - tested on a tennis court
Specification
- Microcontroller | ESP32-PICO-D4
- WiFi | 802.11b/g/n
- Bluetooth | BLE 4.2
- FLASH | 4MB
- Programming | USB over UART (CP2104)
- Inertial Measurement Unit (IMU) | LSM6DSLTR
- Accelerometer | ±2/±4/±8/±16 g at 1.6 Hz to 6.7KHz
- Gyroscope | ±125/±250/±500/±1000/±2000 DPS at 12.5 Hz to 6.7 kHz
- Time-of-Flight (TOF) | VL53L0X (Swappable to VL53L1X)
- Range | Up to 2m
- 1D Gesture Recognition
- Li-ion Battery Management | TP4065
- Power | 700mA 3.3V LDO
- Mechanical
- Weight | 20g, including velcro strap
- Dimensions | 4.2 x 3.6 cm
- Mounting Options | Velcro Strap or 3x M.2.Screws
Use cases
The example code used to test this design involves close integration with the Madgwick Filter. Using that filter to perform sensor fusion and generate an estimate for heading, roll, and pitch, the data can then be relayed to a smartphone or PC for post-processing. See below for two examples.
Real-time 3D Visualisation
This 3D visualization is by streaming data over UART to a simple script written on [Processing](https://github.com/processing).
Stream real-time data to phyphox
The real-time plots from the IMU are streamed over BLE to the phone. Data can later be exported over CSV for further analysis if required. This example shows the Tracer streaming the accelerometer data and no. of tennis ball strikes over Phyphox.
Real-time gesture recognition using Edge Impulse
This example illustrates the Tracer's ability to be highly customizable to suit a wide variety of applications and specifications. Using the Edge Impulse platform, I was able to train a neural network that would then run on the ESP32 natively to track a certain gesture or activity. More details on this here.
Hello, are you planning on making your app open source? I have a very similar project and would love to see how someone else implement the Bluetooth data stream.