Design and Implementation of an Arduino-Based Two-Wheel Self-Balancing Robot
🔷 Abstract
A two-wheel self-balancing robot is a robot that maintains its upright position using feedback from motion sensors. This project uses an Arduino UNO, an MPU6050 accelerometer & gyroscope, and DC motors to continuously measure the tilt angle and correct it using a PID control algorithm. The robot behaves like an inverted pendulum and balances itself in real time.
🔷 Objectives
-
To design a self-balancing robot using Arduino
-
To understand gyroscope & accelerometer sensors
-
To implement PID control
-
To control motors using motor driver
-
To study real-time feedback systems
🔷 Block Diagram
🔷 Components Required
🔹 Hardware
| Component | Quantity |
|---|---|
| Arduino UNO | 1 |
| MPU6050 (Gyro + Accelerometer) | 1 |
| L298N / L293D Motor Driver | 1 |
| DC Gear Motors | 2 |
| Robot Chassis + Wheels | 1 set |
| 18650 Battery / 12V Battery | 1 |
| Buck Converter (optional) | 1 |
| Jumper Wires | As required |
| Power Switch | 1 |
🔷 Working Principle
-
The MPU6050 measures tilt angle (pitch).
-
Arduino calculates error between current angle and setpoint (0°).
-
PID algorithm calculates motor speed correction.
-
Motors rotate forward or backward to balance robot.
-
This loop runs hundreds of times per second.
🔷 Circuit Connections
🔹 MPU6050 → Arduino
| MPU6050 | Arduino |
|---|---|
| VCC | 5V |
| GND | GND |
| SDA | A4 |
| SCL | A5 |
🔹 Motor Driver (L298N) → Arduino
| L298N | Arduino |
|---|---|
| IN1 | D5 |
| IN2 | D6 |
| IN3 | D9 |
| IN4 | D10 |
| ENA | D3 (PWM) |
| ENB | D11 (PWM) |
🔷 Arduino Code (Basic Working)
🔷 Output
-
Robot stands upright automatically
-
Maintains balance when pushed slightly
-
Corrects tilt in real time
🔷 Advantages
✔ Real-time control system
✔ Educational (PID, sensors, robotics)
✔ Low cost
✔ Expandable (Bluetooth, obstacle avoidance)






0 comments:
Post a Comment