Self-Balancing Robot

A modular robotics project using Arduino + PID control

Project Overview

A self-balancing, two-wheeled robot built with off-the-shelf components and a custom 3D-printed chassis. It uses an MPU-6050 IMU and a PID control loop to maintain balance in real time.

Hardware

  • Controller: Arduino Nano
  • IMU: MPU-6050
  • Motors: 2x yellow DC geared motors
  • Driver: TB6612FNG
  • Power: 3.7V or 7.4V LiPo
  • Chassis: 3D printed black PLA+

Control System

The robot fuses gyroscope and accelerometer data using a complementary filter to estimate tilt. A PID controller then adjusts motor speeds to stay balanced.

  • P: Immediate error correction
  • I: Drift compensation
  • D: Stability and damping

Key Challenges

  • Sensor noise required careful filtering
  • PID tuning without external tools
  • Voltage dips caused resets
  • Balance affected by smooth surfaces

CAD & Fabrication

Designed in SolidWorks and printed with black PLA+. The frame balances minimalism with function and uses bearings and mounting holes for easy assembly.

Download STL

Source Code

All code and wiring diagrams are available on GitHub.

View on GitHub

Video Demo

Future Improvements

  • Switch to ESP32 (wireless + ROS 2)
  • Add LiDAR or camera
  • Replace PID with LQR/Kalman
  • Custom PCB for clean wiring

Return

Want to see more projects?

← Back to Projects