Dr. Imran Haque's PeloMon Project Untethers the Peloton, Transmits Its Data via Bluetooth Low Energy
Sick of getting credited zero miles on a Garmin smartwatch, Haque's PeloMon broadcasts bike data outside the Peloton ecosystem.
Computer scientist Dr. Imran Haque has released a tool designed to unlock the popular Peloton range of exercise bikes from their proprietary platforms, using a Bluetooth Low Energy (BLE) relay to send the data to a fitness tracker of your choice: PeloMon.
"Iβve been curious about how the head unit β which runs a lightly skinned Android β was collecting stats from the actual bike," Haque writes of the project's origins, which draws inspiration from earlier efforts to un-brick Flywheel exercise bikes. "I was also a bit annoyed that though the Peloton software will happily read data from an HR sensor, and will upload your ride data to Strava, there was no way for it to broadcast data about a ride to a local fitness appliance β which meant that although I could track the fact that I was doing an 'indoor bike' ride on my Garmin watch, the watch would see a 0 mile ride because it got no bike data."
The result is the PeloMon project, which began late last year with work to reverse-engineer how the Peloton bike talks to the Android-based head unit β identifying the pinout of the connecting jack and splitting it out to an ultra-low-cost logic analyser connected to the PulseView package. With the physical layer sorted β RS232, it transpires β Haque turned his attention to decoding the data itself.
Even with the data decoded, though, the project was in its infancy: Haque then needed to turn the data Peloton reads from the bike into speed β "a pure function of power," Haque explains, which "can be accurately regressed with a two-piece polynomial fit" β and create an emulator for the Peloton to assist with the hardware stage of development.
"I chose the ATmega32U4-based Adafruit Feather 32u4 Bluefruit LE," Haque explains of the final design, "mostly because I knew that I wanted to maintain the resistance calibration table in non-volatile memory, and I knew that could be done reasonably with the EEPROM support on the ATmega whereas Iβm not familiar with how well thatβs supported on the Cortex-M0 or nRF52832 boards. This also meant I was working on the most limited platform of all of them β with only 32ish kB of code space."
Having designed a functional circuit, Haque was left with the final step: The software. In the final version of the code, PeloMon is able to read speed, cadence, and power from the bike and transmit them over Bluetooth Low Energy to a receiving device of the user's choice. There was even room for a debug console, which prints out live stats, runs an internal simulator for testing in place of a physical bike, and can dump various states for troubleshooting.
"It works," Haque concludes of the Pelomon project. "It was a fun journey from physical layer signaling and mucking about with voltages all the way through writing high-level code to handle Bluetooth."
The full write-up is available in a series of posts on Haque's personal website, while the source code and hardware schematics have been published to the PeloMon GitHub repository under the GNU General Public License 3.0.
Article header image courtesy of Peloton Interactive.