This project had three objectives:
1. determine the speed of my treadmill
2. Mimic a footpod and send my speed to zwift using BLE
3. Run on zwift with accurate speeds
UPDATE:
In line with recommendations in comments i purchased a reed switch ( $3 AUD) from ebay and replaced the LM393 sensor with it up against existing treadmill magnet. other than some denouncing required it worked a treat.
PREVIOUS:
In this project a used an LM393 speed sensor and an ESP32 to determine speed and send results to zwift using BLE and the Zwift app.
Using basic BLE GATT i fumbled my way through the running speed and cadence service and measurement characteristic to send the speed to ZWIFT.
All worked a treat but the speed sensor Measurement (ie the car clamped to the treadmill) was unsustainable.
I have also looked at using the LM393 to measure the rotation of the treadmill motor using a lip of ducktape. Also ungraceful.
Did you look at the CSAFE protocol? Supposedly it's been around for a while and Wahoo are using it for their Treadmill Zwift bridge: https://en.wikipedia.org/wiki/Communications_Specification_for_Fitness_Equipmen
Why do you put the speed in Byte 1 and 2, the stride length in 4 and 5 and the total distance in 6, 7, 8 and 9. Reading the BLE spec, I can't see why you need to put each value in more than once. Clearly I am missing something as I have seen the same thing done elsewhere. Can you help or point me at some documentation that explains it?
Were you also able to connect with a smartwatch / garmin?
Connecting to swift via PC works . With the garmin watch (fenix 5x) I am able to select / add the "footpod", but when I try to connect to it, it always fails.... :-(
Would you be keen on sharing your code for the BLE interface to Zwift? I'm trying to make a speedometer with arduino to monitor my indoor bike trainer.
Is a link to a manual version (ie i set my speed with buttons not sensor). However the sending and setup of BLE should be the same. FYI i changed the bytearray code for this running sensor from a cycling speed cadence example so there are likely already examples set up for Cycling Speed Cadence sensors
I second the idea of a magnet and reed switch. My very old salvaged treadmill uses this setup to measure speed. The magnet is in the flywheel connected to the tread rollers. Alternately you could use some sort of led and photoresistor with your duct tape flag to get rpm.
I'm interested in how you figured out the zwift protocol because I'd like to make my own zwift sensor to connect my bike rollers to the zwift bike app.
I found that the Zwift protocol just search's for the BLE outputs using existign GATT profiles. Therefore if you create a BLE profile/service for either the
CSCP - Cycling Speed and Cadence OR RSCP Running Speed and Cadence then zwift will recognize it. I use an iphone and the zwift companion app to receive it.
Interesting. But aren't you worried about drifting over to the side of the belt and stepping on it? When I ran on the treadmill I found myself wandering all over the place - sometimes even off the back, of course.
Garmin Fenix 5X connects to the device but the speed shows 0.0.
It does not show the speed at all. Any idea?