Back to Projects
embeddedongoing

STM32-Based Self-Balancing Robot

2026-08 – 2026-09

This project is my hands-on entry into embedded firmware development, writing bare-metal C for an STM32 (ARM Cortex-M) microcontroller using both HAL and Low-Layer drivers for direct control over peripheral registers, interrupts, and timing. I interfaced an MPU-6050 IMU over I2C to pull raw 6-axis accelerometer and gyroscope data, then implemented a real-time complementary filter to fuse the two into a stable tilt-angle estimate. Motor actuation runs through hardware PWM timers, with UART over USB-CDC providing live telemetry for debugging. I'm currently closing the loop: integrating an L298N dual H-bridge driver and tuning a discrete PID controller so the robot can actively balance itself.

Impact

Bare-metal STM32 firmware with HAL/LL peripheral drivers
MPU-6050 sensor fusion via a real-time complementary filter
Hardware PWM motor control with UART/USB-CDC telemetry
PID closed-loop balancing control with an L298N driver (in progress)

Technologies

STM32ARM Cortex-MEmbedded CHAL/LL DriversI2CPWMUART/USB-CDCMPU-6050Complementary FilterPID ControlL298N