ESP32 BLE Distance Measurements
Distance Measurement HC-SR04 sensors connected to ESP32 pretending to be heart rate sensor for logging with fitness apps.
Inspired by the Berlin project Radmesser, this version connects to tracking apps by pretending to be a heart rate sensor. This enables you to write the distance to a gpx file and use it later in video editing software like Dashware or Garmin Virb Edit to show the distance in your video.
The prototype by Zweirat used the following:
With LiFePo Batteries you can power the device directly and avoid step-up/step-down losses that you have when using a powerbank. On the other hand you need the HC-SR04P instead of the HC-SR04 sensor if you don't have 5V power supply.
- ESP32 device driver
- Neil Kolbans ESP32 BLE Library
- Arduino IDE
- clone or download repository
- open in Arduino IDE
- compile and upload to ESP32
- Connect sensor
- power up device
- Use BLE Scanner or your favorite BLE app to send ond permanently save offset (for example the distance from sensor to handlebar)
- Start your favourite tracking app Good results were made with RunnerUp, Strava had some issues on Android, look here for alternatives, no experience with iOS so far.
- Connect heart rate sensor
- Write nice tutorial how to process video data and create synchronized overlays
- Develop an own app to record videos in loop mode and only save short clips when distance is low. At the end of the ride, ask user to confirm that a car was overtaking. Possibility to create overlays for video and report anonymous metadata of overtaking incidents (good and bad ones) to open data platform.
Inspiration, code snippets, etc.