Ruhr-Universität Bochum · Personal Project · 2020

Self-Balancing Two-Wheeled Robot

Built and programmed a Segway-style balancing robot from a kit of electronic components — going beyond the official tutorials to fix a bug in the reference code and achieve stable balance with Bluetooth control from a mobile phone.

Completed robot balancing on two wheels — controlled via Bluetooth serial terminal from a mobile phone

Background

As part of the Mechatronic Systems module at Ruhr-Universität Bochum, students were offered an entirely voluntary side project — no grade bonus, no credit points, purely optional. Those who signed up received a kit of electronic components and a set of video tutorials (~13 hours of recorded instructions) to build a small self-balancing robot.

The robot's concept is similar to a Segway: two motorised wheels, an IMU sensor to track orientation, and a microcontroller running a control loop to keep the robot upright by continuously adjusting wheel speed and direction.

Hardware

Robot components laid out
Kit components — Teensy microcontroller, IMU, DC motors with encoders, Bluetooth module

The Problem with the Official Tutorials

The video tutorials covered construction and wiring in detail — but stopped short of a working solution. At the final stage, where the robot was supposed to actually balance, the tutorial authors abandoned the project. The robot in their videos never achieved stable balance.

This meant that completing the project required going beyond the provided material and finding an independent solution.

What I Did

After working through the assembly and getting the hardware running, I analysed the reference code carefully and identified a bug in the control logic — a flaw in the way the IMU readings were being used to drive the motors.

I corrected the bug, tuned the control parameters, and extended the implementation. The result was a robot that balanced stably and could be driven in real time via Bluetooth from a mobile phone using a serial terminal app.

What This Project Demonstrates

This was a fully voluntary project with no academic incentive. I took it on because the intersection of mechanics, electronics and software genuinely interested me — and because I wanted to build something that actually worked, not just follow instructions.

When the official guidance ran out, I did not stop. Finding and fixing the bug in someone else's code, then extending it further, is the part I am most satisfied with.

Tools & Skills

Teensy microcontroller IMU sensor integration DC motors & encoders Control loop programming Bluetooth serial communication Soldering & electronics assembly Debugging embedded code C / C++
Battery Safety KTL Simulation