1

#ZwiftNet a low Budget DIY Zwift Climber using Neuronal Nets

If you are a nerdy Zwift Rider, who likes neuronal nets, electronics and you also don’t want to buy a pricey climber this one is for you 🙂 (Total cost <100€)

Motivation

Since, as already mentioned, buying an off the shelf Zwift climber is very expensive, I decided to build my own using cheap off the shelf electronics and a convolutional neuronal net for reading the inclination data directly from the screen.

How the system works:

While riding Zwift, a python script is running in the background. It extracts the Region of interest of the inclination indicator (100x100px, shown in the picture below).

Region of Interest (right) which is extracted from the screen with a current inclination of 1%

This image is then fed to a CNN which extracts the inclination value using classification. After predicting the inclination value, the inclination is then sent to the esp 8266 server via HTTP Request.

The ESP8266, which is fixed at the bike, uses an accelerometer to compare the actual angle to the setpoint angle which it receives from the Python script.

This system should work on every Zwift client which is capable of running python in the background, consequently on an iPad it won’t work.

Why I don’t use Tesseract or some other OCR Package?

The background of the inclination indicator changes a lot over the routes in Zwift and therefore i got inconsistent results when using tesseract OCR. I am pretty sure if someone really knows how to use ocr packages and precondition the images properly, good results are possible with OCR. I am not one of those people.

I am a fan of neuronal nets, and building this was fun and more of a learning example – that is one of the main reasons I choose the CNN approach.

The Brain:

Quellbild anzeigen

The Muscle:

The core component of the climber is 200 mm 24 Volt actuator. With the travel of ~200 mm in my configuration it’s possible to reach an inclination of 10% –

200mm 24 volt Actuator (right) in assembly (left)
 L298N Modul H Brücke 

The Dataset:

Excerpt of the dataset which consists of 2000 labeled images.

The Model:

Pretty straight forward Classfication CNN using Pytorch

Model Performance:

Tensorboard Train and Validation loss of the Model, 96 % Accuracy on the test set

Conclusio:

The system works quite well, and I really enjoy the feeling of going uphill during my Zwift Rides. I totally recommend getting a climber. Adapting the pose while riding makes the ride more realistic and more diverting.

The actuator (left) and the brainbox with the microcontroller and accelerometer inside

If you are interested in the code and the CAD files please email me, i’ll be happy to guide you through 🙂

1 Gedanke zu „#ZwiftNet a low Budget DIY Zwift Climber using Neuronal Nets“

  1. Hallo,
    echt gute Umsetzung. Ich bin gerade auch dabei, eine kostengünstige Lösung für einen Climber umzusetzen. Dabei bin ich auf dein Projekt gestoßen. Habe den gleichen Motor im Blick bzw. schon eine Variante zu Hause. Ein bekannter hat einen 3D Drucker, so daß einem Nachbau nichts im Wege steht.
    Es wäre klasse, wenn du mir die CAD Daten und die Quell-Codes (ESP + PC) zur Verfügung stellen könntest.
    Danke und Gruß Christoph

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert