I originally picked up a Pro-Form Tour de France spin bike from Costco at a decent price, lured by its sturdy build and smooth magnetic resistance. The catch? The bike’s included computer was, to put it kindly, abysmal. A monochrome LCD with four buttons (one locked behind an iFit subscription) can be manageable if it actually works. Unfortunately, like many other buyers, mine never did. The pedal resistance system repeatedly failed, leaving the original computer as a glorified paperweight.
After countless attempts to debug, calibrate, and reset the thing, I finally threw in the towel—and threw together a homebrew solution. In line with the spirit of the Hackster Junk Drawer Competition, I harnessed the random electronics languishing in my junk pile to build a custom spin bike computer. It not only controls the pedal resistance but also displays relevant workout stats (like cadence, speed, distance, etc.) while I’m pedaling away.
At the core of this system is a Raspberry Pi CM4 (4GB) on a Waveshare IO baseboard, paired with a 5" DSI display. A regular Raspberry Pi would have worked just fine, but I already had this CM4 and an NVMe drive lying around from a previous project. The CM4 likely doesn’t need a heatsink for this light workload, but I added one anyway since I’m running a fan-less enclosure.
The 5" touchscreen DSI display keeps everything compact—it is powered by the Pi and provides the touch interface through a single flat-flex cable. In true junk-drawer style, my display even has a cosmetic crack in one corner from its past life, but it still works perfectly.
Bike Electronics
With zero manufacturer documentation, I had to reverse-engineer the bike’s internal wiring. I discovered two main subsystems: the pedal rotation sensor and the pedal resistance system.
Everything runs off the Pi’s 3.3V supply. I verified that the motor current draw is low enough that the Pi’s regulator can handle the load (though for longer term reliability, an external regulator wouldn’t hurt).
Pedal Rotation Sensor
This sensor is tucked away inside the frame near the flywheel, with two wires peeking out. Based on testing with a multimeter, it behaves like a reed switch that closes whenever a magnet (attached to the pedal wheel) passes by. In fact, there are two magnets on the wheel, so each pedal revolution generates two pulses.
To safely interface with the Pi, I placed a 1 kΩ current-limiting resistor between the 3.3V pin and the sensor’s positive lead. The sensor’s other lead goes to ground. A single GPIO pin on the Pi reads the sensor output. Every time a magnet triggers the reed switch, the Pi sees a momentary drop from high to low.
Each pulse increment is counted to calculate cadence (RPM). Since the pedal wheel has a belt system linking it to the main flywheel, I factor in the ~1.8:1 diameter ratio to estimate speed and total distance.
Pedal Resistance System
The bike’s “resistance” is adjusted by shifting the position of a set of magnets relative to the large weighted flywheel. The magnets move closer or farther from the flywheel via a cable wrapped around a small DC motor hub. As the motor turns, the cable spools in or out, thus adjusting the magnetic force on the flywheel.
The motor itself has a potentiometer attached to its axle, so the system behaves almost like a servo. As the motor spins, the potentiometer changes its resistance, providing a real-time position readout.
I use one channel on a DRV8833 motor driver module, which takes two GPIO inputs from the Pi—one for forward, one for reverse. This way, I can spool the cable in either direction under software control.
The potentiometer’s three wires are connected with color-coding from the original assembly:
- Red = 3.3V supply
- White = Wiper tap (goes to ADC CH0)
- Black = Ground
Using an ADS1115 16-bit ADC breakout over I2C, I track the voltage on the wiper to figure out where the magnets are positioned. I know 16 bits of resolution and the PGA are overkill, but it was what I already had lying around.
By toggling the DRV8833’s input pins, the motor can spool the cable in or out. I wrote a simple a “bang-bang” controller in the software to move the magnets to the desired position based on the ADC reading.
I added an I2C temperature/humidity sensor for fun, though I’m not currently using it. It could log the ambient conditions in my workout area or even track the bike’s internal temperature if placed strategically.
Enclosure:I initially hoped to fit my new computer in the original display’s space, but the 5" screen was a few millimeters too tall. (Waveshare does sell a 4" version that might have fit perfectly.) Instead, I designed a new enclosure in FreeCAD and 3D-printed it in a leftover spool of Barney-purple filament on my Bamboo Lab P1P. It bolts right onto the bike’s original screw locations and sits above the tablet holder, giving me clear access to the touchscreen while I ride.
I wrote a minimalist Python application using PyQt6.
The interface has big buttons and sliders for easy touchscreen input on a 5" display. A horizontal slider commands anything from 1% to 100% resistance. Given the high-resolution ADC feedback, I can fine-tune the magnets far more precisely than the original 12-step system.
Cadence (Instantaneous RPM) and Average RPM read directly from the pedal rotation sensor pulses. The Speed & Distance are calculated using the approximate gear ratio between the pedal wheel and the flywheel. An animated Matplotlib plot on the lower half of the screen shows speed and cadence over time, which is informative to watch during HIT intervals.
Future Feature Ideas: Logging workouts for later review, tapping into that temperature/humidity sensor to track environmental conditions, or adding a heart-rate monitor via Bluetooth.
Further Improvements and Final Remarks:There’s plenty of room for refinement. A smaller display, improved enclosure design, or software additions (like workout history and sensor-based analytics) would make it even better. But for now, this overkill spin bike computer has turned a once-frustrating piece of hardware into something I actually enjoy. The bike’s sturdy frame and smooth magnetic resistance were always great—it just needed a real brain. Thanks to some junk-drawer magic, it has one.
Comments
Please log in or sign up to comment.