Using a manual treadmill to scroll a web page and more

I bought a manual treadmill recently. The purchase coincides nicely with my continued weight-loss and my plans to experiment with virtual reality when I finally receive my Oculus dev kit. It also happens to be a perfect fit for the IKEA standing desk that I’ve been using for several months.


This particular model of treadmill is a very simple machine. As you might expect, the base is just a board with a couple of rollers and a belt. The front roller includes two small solid iron flywheels and, importantly, a built-in sensor. The sensor connects to a display on the front of the support railings. The display shows the usual time/distance/calorie stats but, since I want to fit the treadmill under my desk, I’ve detached the railings entirely. Removing the railings means that I lose the display but who needs a silly little circuit board when I can just combine the sensor with the full power of my desktop PC :) Luckily, pulling this off is easier than I anticipated.


As it turns out, the sensor is a simple switch that is triggered when a magnet, embedded into one of the flywheels, passes by. This makes it very easy to connect to my Arduino and, with a little bit of code, I am able to turn the periodic switching into a speed reading. The following Arduino code increments a counter every time the switch is triggered and then sends that counter value to the computer over the USB serial port every 200 milliseconds.

Now that I have data from the treadmill streaming into my PC, the fun begins. I use a small Python script to read the treadmill data from the serial port and, borrowing a bit of code (literally one line) from my previous project, I simulate a mouse scroll wheel event on the PC. I’ve written additional code around this core that allows me to visualize and control the rate of scrolling but the basic code is only 30 lines long (including comments!).

So now I have a great source of motivation to keep myself active; Want to keep reading that engrossing article about how Obama hired radical techies to win the election or about how Google’s autonomous car is worth trillions? Better keep walking then! I can also honestly say that I have never been so exhausted after only a few hours of testing and debugging code :)

Update: Throttling the Internet

In response to an idea from reddit I’ve applied the treadmill setup to throttle my Internet connection. The implementation is made trivial thanks to the Throxy Python library. I’ve hacked-in a few lines that change the download throttle dynamically as content is being downloaded in to the browser. I simply run the modified Throxy code and configure Firefox to use the proxy. The faster I walk or run, the faster the content downloads. You can see in the video below that it works for web pages, images and videos as well.

6 Pingbacks/Trackbacks

  • Pingback: Browsing the web one step at a time

  • Pingback: Treadmill-Powered Internet Connection Fueled By Runner’s Speed [Video] - PSFK

  • Pingback: Would you run on a treadmill to stream your favorite TV show? | Digital Trends

  • Pingback: Will a Treadmill-Powered Internet Connection Really End Your Exercise Procrastination? | Fluency21 – Committed Sardine Blog

  • Pingback: Walk The Web With A Web Browser Treadmill | Codeduino

  • Pingback: Stay Fit By Scrolling Web Pages with a Treadmill

  • Ahmed Fahmy

    Awesome !
    i like your ideas so much , i find them creative
    i’ve been coding for 3 years in c++, ruby, java
    i’ve a little experience in javascript and python
    how much time and effort do you think i need to begin practicing such intersting projects ?
    is it hard for me right now , should i gain more experience over a couple of years ?

    Thank you !

    • Brian Peiris

      Hi Ahmed, 3 years of coding experience if more than enough for these types of projects. If you don’t have any experience with hardware though, you might want to take a look at hacker-friendly microcontrollers like the Arduino:

  • Stephen

    Hi Brian, I am trying to ascertain if it is possible adapt a running machine to download the workout data and transmit it by 3G to be monitored over the internet. Do you think this would be possible? Difficult? Expensive? Your thoughts would be much appreciated.

    • Brian Peiris

      HI Stephen, that’s certainly possible! Whether it’s difficult or expensive is sort of relative though. It depends on whether you already have a running machine, what capabilities it has, how much electronics and programming knowledge you have and how much you’re willing to spend.

      The concept you are looking for is a “data logger”. There are many ways to build a data logger but the way would go about it is to use an Arduino to sense the speed of the running machine, connect a bluetooth communication module (“sheild”) to the Arduino, connect an Android phone to the Arduino and run an app on the Android phone to read, store and transmit the data.

      Let me know if I can help.

  • Nicolas

    Hi Brian,
    Can you tell me the model of the manual treadmill? I’m interested on doing something similar and would like to ensure the treadmill I’m getting uses a magnetic sensor for speed. Thanks!

    • Brian Peiris

      Hi Nicolas,
      The treadmill model I used was a DP Fitness EX580 but they are no longer being manufactured. I managed to get a second hand one off (the Canadian equivalent of Craigslist). However, this type of treadmill is quite cheap and there are several similar products out there. In fact, I suspect that the cheaper they are, the easier they are to hack since they all seem to use a common design. Mine was relatively easy to interface with because it used a simple magnetic sensor switch with a corresponding permanent magnet on the flywheel.
      One similar product is the Stamina InMotion ( If you look closely at the base, near the flywheel, you’ll see a small black sensor with a single cable connected to it which is almost certainly a magnetic sensor.

      • Nicolas

        Awesome, Brian. Thanks for the info.