Get fit with Raspberry Pi

By Rob Zwetsloot. Posted

You can do pretty much anything with a Raspberry Pi or Raspberry Pi Pico, even try and improve your fitness! Whether you’re tracking your fitness more closely, getting a more efficient workout in, or just making a treadmill a little more entertaining, there’s definitely some way you can use a Raspberry Pi to improve your fitness journey.

We’ve gathered some of our favourite projects together to help you get you in tip-top shape. Grab your trainers and let’s make some gains.

Exercise bike mod

Breathe new life into that old exercise bike

One of the newer trends with exercise bikes these days is to have your cycling power a video of a wonderful environment that you could be cycling through if you had the ability to do so. The technical side of it is fairly simple – with some kind of coder or sensor, you can track how much you’re pedalling and translate that to video playback or, in this case, graphic generation.

This project by paddywwoof uses a Hall effect sensor to keep track of the speed of the bike, feeding into a Python program that renders karst, fjords, and alpine environments as you pedal. It’s easy enough to edit your own maps if you have the time too.

Some of the instructions are for a slightly older version of Raspberry Pi OS and the Python that comes with it. However, it should still work just fine.

How to build this.

HIIT Workout Trainer

Data analytics for your fitness

During 2020, when a lot of people were working from home, James Wong decided to improve his workout routine. He also wanted to combine it with his research into machine learning on Raspberry Pi. Hence, combining HIIT (high‑intensity interval training) with Raspberry Pi to track his workout and give him useful data on it.

How is your data used? To score yourself against others, naturally, taking advantage of competitive streaks to get you improving the efficiency of your workout. A Coral Edge TPU is used to aid in the machine learning part, improving the sampling rate to 30 frames per second.

The code is open-source and is readily available on GitHub. James believes it should be easily adaptable to other sports or workout types – yoga springs to mind when it comes to tracking body metrics!

How to build this.

Pi Fighter

Here comes a new challenger

Gamifying your workout has its upsides and downsides. However, having a target to beat, both in terms of a high score and pop culture characters to focus on, can make a workout much more fun. Making use of the kind of technology used by Ivan Dragon in Rocky IV, or even punch machines at arcades.

Raspberry Pi acts as an accelerometer to measure the power of your punch to calculate how many hit points (HP) are taken off the character you’re fighting – in some cases this means Luke Skywalker or Darth Vader. A simple LED screen is used to let you know how much more fightin’ you’ll need to do.

Like all good games, the different characters increase in power, meaning you’ll be worn out by the time you take down the Dark Lord of the Sith. Or, maybe you’ll need to face him twice – depends how strong you are.

How to build this.

DIY smart scales

An encouraging weight tracker for those who need it

Wii Fit was a revolution for fitness video games, spawning loads of motion-controlled workouts. If you don’t really like to use your Balance Board much anymore, you can hack it to be a pair of smart scales using a Raspberry Pi and a pencil.

The Wii Balance Board connects via Bluetooth much like Wiimotes, although you’ll need a bit of custom code to keep it paired permanently – included with the rest of the code for this project. It does require you to press a button underneath the Balance Board though, achieved by the pencil we mentioned before – a simple solution that won’t need much maintenance.

Once you step on it, 250 measurements are taken to create an average (due to electronic noise) and it then sends the info to an IoT service called Initial State which does the tracking. It also sends you texts to let you know your progress, including encouraging messages as well.

How to build this.

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.