Add Bluetooth to Treadmill

Add Bluetooth speed output to treadmill. Arduino on ESP32 and Treadmill Speed sensor. Zwift compatible with realtime Webpage stats.

Public Chat
Similar projects worth following
This project had three objectives:
1. Determine the rpm of treadmill flywheel/roller with magnetic sensor
2. Mimic a footpod and send treadmill speed over BLE to Strava and Zwift
3. Run Zwift with accurate speeds and optionally add additional variance on top of actual speed.
4. Webpage to display real time running statistics.

Future objective.
5. Send accurate cadence over BLE too.

The program works, however, the code hasn't been cleaned up as yet, since I'm still tweaking the program.

The basic principle is that the Universal 2Pin Treadmill Speed Sensor Magnetic Sensor triggers an interrupt whenever it detects the magnetic field of a magnet on the flywheel.     

(In my case, i've used the existing flywheel magnet on my Reebok Jet 100+ treadmill.)

The interrupt records the time between rotations to calculate the flywheel RPM.   The belt speed and distance traveled are then calculated and displayed on the ESP32 webpage.

This software can be adapted to any treadmill by setting the belt_distance variable, which is the circumference of the flywheel and treadmill belt.  (Distance traveled between interrupts)

A basic solution  could just read the rpm and send the current speed over bluetooth.

This project displays the speed(kph), distance(meters), uptime, bluetooth kph speed upshift speed, current rpm, total revolution count.

Webpage UP/Down buttons are used to vary the bluetooth kph speed.  (which is the sum of the treadmill belt speed and the manually adjusted speed.

The Reset button can be used to reset all counters.

ino - 18.74 kB - 10/07/2020 at 01:12


  • 1 × ESP32 dev module (4Mb flash)
  • 1 × Universal 2Pin Treadmill Speed Sensor Magnetic Sensor Connect to Ground and ESP32 Pin 26. Fast acting reed switch. (A hall sensor could be used instead)

  • 1
    Physical Layout

    The Magnetic Sensor should be located near the rotating flywheel magnet.

    The Magnetic Sensor wires connect to ground and ESP32 pin 26.

  • 2
    Arduino Code Modification

    The only variables that need to be modified in the Arduino code are the wifi username, wifi password, and belt_distance (measured in mm)

    const char *ssid = "Your_SSID_here";
    const char *password = "Your_Wifi_Password_here";

    volatile long belt_distance = 142;

  • 3
    Arduino - Board Setup

    Use the following partition scheme to fit the program on the ESP32 board:     


View all 3 instructions

Enjoy this project?



paytufo wrote 05/18/2021 at 00:48 point

I don’t know if you know CSAFE protocol. Many treadmills and other kind as rowers or bikes has a CSAFE port, this can send the status of every parameter (speed, slope, cadence) of the treadmill and receive from other platforms to modify speed as example (only available) just need to make a BLE FTMS to be a bridge between this port and Zwift  and other platforms.

north pole engineering has a solution for that. But would be great an open source solution.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates