Virtual “Exercise” Bike

This is just an idea.  I have no actual plans yet to create this project, but it does sound like an interesting idea.  I can’t find any specific homemade projects out there that have done this yet.  Maybe I just haven’t looked hard enough, if you know of any then please share.

The Idea

An exercise bike that allows you to cycle around virtual routes, to view the route you’re on visually, as you move and to adapt to the terrain’s topography or riders speed demands, using virtual gears.

Hasn’t that been done already?

Yes, but the products I’ve found to purchase can be expensive.  The idea here is to turn an ordinary exercise bike into a more sophisticated machine.  There are some open projects I’ve found, but not quite like this.

The Concept

I recently inherited a cast off exercise bike.  It’s a York Fitness c202 “anniversary” upright static bike. It was about to meet its demise as there was an error on the computer that drives the programmed modes. When you tried to set the force on the pedals, the screen kept displaying E-02 error message intermittently.

First thing to do was take it apart and see how worked.  After removing the pedal cranks and outer casing, I discovered a black box.  Inside the black box is mounted a DC motor, a gearbox, which drives and output shaft that is connected to a variable resistor.  The rotational output from the gearbox is converted into linear motion via a bowden cable, which is attached to a magnetic shoe.  The black box is essentially a servo.

Initially, I though the magnetic shoe was a conventional brake pad, but then I noticed it never actually touched the flywheel as the servo box moves the shoe.  As the shoe moves closer to the flywheel, the force required to turn the pedals needed requires a greater effort.  Then the penny dropped; I realised that is was an eddy current brake. In basic terms, the wheel cutting the magnetic field of the magnet induces a current within the flywheels outer circumference, this then generates it’s own magnetic field.  These two fields oppose each other, which creates the frictional feel at the pedals; clever.  No external power is required for this.

How did I fix the E-02 Error message?

From what I observed during operation, when you commanded the minimum friction upto to maximum friction, the servo would gitter around the middle point, throw the E-02 message on the computer screen and then eventually it would drive to the final position.  I’ve witnessed this behaviour before in hobby servos, more often than not, it’s crud and carbon built up on the variable resistor that provides feedback of the servo position.

I removed the variable resistor, blasted it with compressed air, twiddled the axle a few times before a final blast of air, then reassembled the gearbox and powered up the bike.  Commanded again min to max friction, “hey presto” no gittering and the error wasn’t present.  I’ve not seen the error since, and all the preset programs, which attempt to imitate varying terrain work a treat.

There was a slight mechanical issue too with the clutch bearing that allows the flywheel to spin freely with the pedals static, but drive the wheel once force is applied to the pedals.  The clutch was slipping in the wrong direction and not driving the flywheel at all, for certain points of drive.  I soaked the bearings in solvent, cleaned out the old oil and then re-oiled the bearings. After reassembly, the clutch no longer slips!

I now have a fully functional exercise bike, which got me thinking…

How the servo is controlled

All the output sensors and inputs for the bike mechanics feed directly to the main computer that sits on the handlebars.  There is no electronic logic within the main body of the bike itself.  There is a 10 wire cable running from the computer down to all the electrical equipment.

Here’s a list of what there is:

  • A DC motor, which drives the gearbox to the servo, two cables.
  • A variable resistor for the servo position feedback, three cables.
  • A small variable resistor for some kind of adjustment/calibration, two cables.
  • The power cable which plugs into the back of the bike frame and runs up through two cables to the computer.
  • A magnetic hall effect sensor, which reads the revolutions from the pedals, again, two cables.

All of these feedback up into the computer. This makes it potentially viable to replace the computer with my own homemade computer setup, which would provide the same control strategy as the current computer, difference being, mine could be supercharged!

So what’s wrong with the current computer?

Technically nothing, but on a cool-o-meter it reads “luke warm”.  There is no way of feeding in your own terrain profiles from an external source.  You can painstakingly adjust the friction levels for a small pattern that continuously loops, but that’s all.  It’s designed for non-technical people to use, so it has to be basic in operation.

The Replacement Computer

The “theoretical idea” this blog has been [slowly] leading up to is this:

  • Using an IoT style board, like a Particle (formally Sparks) Photon, or an Arduino, Raspberry Pi, whatever takes your fancy, to replace the computing element and provide inputs and outputs to the various bike components.
  • Create the circuitry to plug into the bikes multi-plug that provides:
    • DC motor control to position the magnetic friction shoe based the feedback from the variable resistor.
    • Feed the output (PWM) of the hall effect magnetic sensor, from the pedals, into the controller for “speed” processing.
    • Add a dual pole toggle switch to the handlebars to emulate a gear changer mechanism, the output is fed into the controller for processing.
  • Create software on the controller will provide the following information or commands:
    • A command to set the friction level of the magnetic brake shoe.
    • An RPM output from the pedals.
  • I would personally link the serial output/input from the controller board into a PC/Mac (whatever your flavour) and use the controller as an interface board, reading sensor data and feeding back via the serial connection via commands.

What could you do with the new controller interface board?

The opportunities are as limited as your mind.  I personally would like to consider the following ideas:

  • A route creator tool that takes topographical data, mainly incline/altitude information and simulates riding on a road or track based on a pre-programmed route.  This could be taken from Google earth by plotting paths.
  • Your route is then converted into commands which vary the friction of the drive for the bike depending on gear selection and incline of the terrain.
  • The virtual gears would change your forward speed by emulating high or low gears.
  • I’d like to see the route visually represented, possibly using Google Street View or maybe just Earth.  The speed you move depends on the virtual gear selection, rotational input from pedals and terrain incline or decline.
  • It would be fantastic to be able to race between a couple bikes for the same route. However, you’d need a second bike, and you’d have to ensure the calibration of both bikes was the same, i.e. the commanded friction v.s. actual friction was equivalent.  Very possible however.
  • Maybe if you cycle “real” routes, on a “real” bike, you could log the profile of the route and simulate it when the weathers not so great.


Like anything, there has to be limitations.  On a real bike, if you set the highest gear (i.e. most effort required) and you attempt to ride up a near 50% incline, you’d eventually come to a stop once you had run out of forward speed and pedal power.   The magnetic friction (from testing) can make it darn hard to pedal, but it cannot simulate the scenario of the real bike we’ve just considered.

If the virtual bike is ridden within normal limits, theoretically, it wouldn’t have to simulate such extremes, as for any real world bike, you’d change down a gear to make the drive train easier to pedal, as the sacrifice of forward speed.

Project Fruition

I have too many projects on the go to take this on at the moment.  It’s a relatively simple project to build and code, so hopefully in the future I’ll get around to it.

Thanks for reading, comments and suggestions welcome.


  1. Funny–I was just starting on a similar project! I worked for a company that built gym versions of such a fitness bike, but I want a home version. I just got my Raspberry Pi and I am looking for an eddy brake when I came across your post. I am unsure how to control the output, so I have some problems to solve. Send me an email, I would love to discuss this project!

Leave a Reply

Your email address will not be published. Required fields are marked *