PBR

A home training application for cycling that connects to trainer, power meter and heart rate devices.

Technologies: web, Typescript, React, HTML

During winters, I use to ride a home trainer. When the bike is attached to them, these trainers will measure the power put into the pedals. Their resistance can also be controlled to simulate steaper slopes. Based on that a bike ride or an execise can be performed.

There are plenty applications (1, 2, 3) but almost all of them require 10-20$ per month, which they deserve as they have plenty of features (including social networking) but these are all features that I don’t need.

Driven by the curiosity if I can gather the data from the trainer, I decided to make my own application: PBR (Pedal, Breath, Repeat) (yeah, maybe too much programmer thinking about REPL).

andreipana.net/pbr

Key features:
  • It’s free.
  • It runs directly in the browser, nothing to install locally.
  • Records activities in gpx format that can be uploaded to Strava or any other training tracking application.

The app can connect to a smart home trainer, a power meter and a heart rate sensor and record the values from these devices. The user can chose a predefined workout (exercise) that basically says ride 5 minutes at 200W, then ride 4 minutes at 100W, then repeat. In the end, all the data recorded are saved to a gpx file that can be stored or uploaded to a training tracking applicaiton, like Strava.

And here’s a few photos of the application and using the application:

And the activity imported to Strava:

And I can watch podcasts and conferences while training, who needs to see a 3D rendered virtual avatar on a bike that drains the tablet battery faster than ever:

Making of

Initially I started with C# as a Windows desktop application, but it turned out that working in Bluetooth with C# in Windows is more complicated than it should be and also somehow unreliable.

Studying more on the thema, I found out nowadays (in 2023) web browsers (at least the Chromium based ones, Chrome + Edge) support a very decent bluetooth API.

So it became the right choice for the project, gaining the ability of running it without installing anything and also working on pretty much every device and operating system. Now I can use it from my Android tablet or phone or using the laptop.