Better Keep Peddling This Raspberry Pi Stationary Bike If You Want to Watch YouTube
Adafruit’s Jeff Epler developed this Raspberry Pi-based stationary bike that only lets you watch YouTube videos while you're peddling.
According to the U.S. Department of Health & Human Services, less than 5% of American adults get more than 30 minutes of physical activity a day. If you’re one of the other 95% of us, you probably know that you should be getting more exercise in order to stay fit and healthy. But it’s difficult to make exercise a priority when we have so many other activities and obligations competing for our attention. The best solution is to work out ways to force yourself to exercise and to combine that exercise with other activities. To help you achieve that, Jeff Epler has a guide on how to use a Raspberry Pi with Adafruit Blinka to create a stationary bike that will only let you watch YouTube while you peddle.
Cycling, even on a stationary bike, is a great way to get in your cardio and burn some calories. Exactly how many calories you burn will depend on your body, your peddling speed, and the bike’s resistance setting, but 30 minutes at a moderate intensity should burn roughly 250 Calories. You’ll also build core and leg muscle and improve your cardiovascular health. But peddling for 30 minutes isn’t easy and you’re going to want some motivation. This project provides that by letting you watch the YouTube content you crave, but only when you’re actually peddling. If you need a break to catch your breath, the current YouTube video will automatically be paused. To get it playing again, you have to resume peddling. You can also alter this behavior if you like, maybe to require that you peddle really fast to skip to the next video.
The two primary components needed for this build are a Raspberry Pi 4 Model B and a Wahoo RPM Cycling Cadence Sensor. You will also need the usually Raspberry Pi accessories, like a power supply and microSD card. That cadence sensor is a handy little CR2032 battery-powered device that contains an accelerometer to monitor your peddling RPM. It connects to the Raspberry Pi via Bluetooth, so no soldering or even wires are needed. Just attach the cadence sensor to one of the peddles (using glue, tape, or whatever) and then follow Epler’s guide to install the Raspberry Pi OS, pip3 with the Adafruit Blinka libraries, and a Chrome extension for controlling YouTube via keyboard shortcuts. The provided Python script will monitor your cycling through the cadence sensor and then send the appropriate key presses when you start or stop peddling. It’s an affordable and easily-implemented way to help motivate you to get the exercise that you need.