Skip to content

imbadatgit/cycleUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cycle UI

alt text

Cycle UI is a desktop tool to read out and visualize the data from a stationary bicycle. This way, you can place a laptop over the bicycle computer and yet be able to monitor your progress. The connection to the bicycle is established with a Digispark microcontroller.

Features

So far, the UI features the following basic functionality, displaying

  • active ride time, i.e., time spent on the bicycle during which the wheels were actually turning,
  • speed, which is really just a guesstimate calculated from
  • revelations per minute,
  • and the total number of revelations.

In addition, speed is plotted on a graph to keep me motivated. Here's a quick screenshot of the UI in action, shown above a random YouTube cycling video:

alt text

The overlay stays on top and is quite unintrusive.

Requirements

Python

  • pySerial (tested with version 2.6)

For the microcontroller

  • Digispark or some other Arduino-like board
  • 3.5mm stereo audio jack
  • 10K ohm resistor (for pulldown)

In addition, you need to install some of the "DSEG" fonts.

How to run

Upload the cycle.ino sketch onto a Digispark. Any other Arduino will also work with slight modifications to the serial commands.

Then connect the Digispark to your computer (via the primary USB port) and start the UI:

python ui.py

Depending on your OS settings, you may have to change USB permissions for this to work.

Wiring

Somewhere inside the bicycle, a switch closes at a fixed point during each revolution. My bicycle (of the renowned "Ultrasport" brand) has a 3.5mm stereo headphone jack connecting the bicycle internals to the stock computer. Unfortunately, the switch does not make use of the ground wire but instead connects to the left and right channel.

I simply connected these to the pin #2 and 5v on the Digispark. I further added a pulldown resistor between pin #2 and ground. The Digispark counts revolutions and measures the time between, from which the UI calculates speed and distance.

alt text

About

Visualization tool and USB interfacing for stationary bicycles

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages