Skip to the content
2 layers68.6 × 68.6 mmRobot circuit borad, the printed circuit board in 3D

ESP32-based self-balancing robot using MPU6050 IMU and PID control, with wireless monitoring and tuning via Blynk.

Size
68.6 × 68.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
22
Nets
27
Pads
80
Tracks, vias
150, 0
Pours
89
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
23 Dec 2025
Updated
23 Dec 2025

Overview

Robot circuit borad is an open-source printed circuit board by abdelrauf-44, from the abdelrauf-44/Self-Balancing-Robot repository on GitHub. It is a 2-layer board of 68.6 × 68.6 mm with 22 parts on 27 nets, routed with 150 tracks and 0 vias.

It is built around the L293D and L7805. Its parts include 6 resistors, 4 diodes, 4 connectors, 3 ICs and 3 switches. It belongs with the robots and motor control and sensors and measurement boards and the ESP32 and RISC-V boards of this library.

Main components

2

README

README.md

🤖 Self-Balancing Robot (ESP32 + MPU6050)

A two-wheeled self-balancing robot based on ESP32 and MPU6050 IMU, implementing PID control to stabilize an inverted pendulum system in real time. The project focuses on practical control engineering, embedded systems, and electromechanical integration.

📌 Project Overview

This project demonstrates the design and implementation of a self-balancing robot using:

Real-time sensor fusion for tilt angle estimation

Closed-loop PID control for balance stabilization

PWM-based DC motor control

Embedded implementation on an ESP32 microcontroller

The robot is capable of maintaining an upright position and recovering from small disturbances.

🧩 System Architecture

Main subsystems:

Sensing: MPU6050 (accelerometer + gyroscope)

Control: PID controller running on ESP32

Actuation: Dual DC motors via motor driver

Power: Battery supply with onboard 5V regulation for the motor driver

🛠️ Hardware Components

ESP32 super mini

MPU6050 IMU

DC Motors (2×)

Motor Driver (L293D)

3D-printed mechanical frame

Battery pack with power switch

🔌 Electrical Schematic

The schematic below shows the complete electrical design including:

Power regulation stage

ESP32 GPIO connections

Motor driver interface

Electrical Schematic

🧱 Mechanical Design & Assembly

🎯 Control Strategy

Angle Estimation

MPU6050 accelerometer and gyroscope data are combined to estimate the robot tilt angle.

Gyroscope data provides short-term accuracy, while accelerometer data corrects long-term drift.

PID Controller

The controller minimizes the tilt angle error using:

Proportional (P): Immediate correction based on angle error

Integral (I): Reduces steady-state error

Derivative (D): Improves damping and stability

Controller output is converted to PWM signals driving the motors.

💻 Software Architecture

Platform: Arduino framework (ESP32)

Main loop:

Read IMU data

Compute tilt angle

Apply PID control

Update motor PWM outputs

Modular structure for easy tuning and testing

📡 Features

Real-time balance stabilization

Adjustable PID parameters

Compact embedded implementation

🧪 Results & Observations

The robot can balance successfully for short to medium durations.

System stability is sensitive to:

PID tuning

Sensor noise and drift

Loop timing consistency

The project highlights real-world control challenges beyond simulation.

🚀 Future Improvements

Implement complementary or Kalman filtering

Add encoder feedback for velocity control

Improve mechanical rigidity

Implement auto-tuning or adaptive control

Wireless parameter tuning and monitoring

▶️ How to Run

Upload the firmware to the ESP32 using Arduino IDE

Power the robot on a flat surface

Tune PID parameters carefully

Gradually test balance recovery

⚠️ Start with low motor speed limits to avoid damage.

👤 Author

Mohamed Abdelrauf Electrcial Engineering (UTM) Self-Balancing Robot Project

Parts

22
QtyValueFootprintReferences
4330Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R4, R5, R6
4LEDLED_THT:LED_D3.0mmD1, D2, D3, D4
3Conn_01x02_PinConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ1, J2, J4
2330uFCapacitor_THT:CP_Radial_D6.3mm_P2.50mmC1, C3
24.7KResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR2, R3
2SW_PushButton_Switch_THT:SW_TH_Tactile_Omron_B3F-10xxSW1, SW2
1Conn_01x04_PinConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1ESP32-C3_SUPERMINI_THESP32-C3_SUPERMINI_TH:MODULE_ESP32-C3_SUPERMINIU5
1L293DPackage_DIP:DIP-16_W7.62mmU3
1L7805Package_TO_SOT_THT:TO-220-3_VerticalU2
1SW_Wuerth_450301014042Button_Switch_THT:SW_Slide-03_Wuerth-WS-SLTV_10x2.5x6.4_P2.54mmSW3

Similar boards

  • 2 layers100 × 100 mmFlipdot H Bridge, the printed circuit board in 3D

    Flipdot H Bridge

    comakingspace/FlipDotDisplay

    They were bought at the Makerfaire Hannover 2016.

    76 parts3
  • 2 layers136.5 × 185 mmFaduino-1, the printed circuit board in 3D

    Faduino-1

    silveirago/Kicad-Gustavo

    My Kicad libs

    102 parts3
  • 2 layers72.2 × 53.6 mmLow cost robotics, the printed circuit board in 3D

    Low cost robotics

    gabs911/low_cost_robotics

    Low cost robotics platform for STEM programs.

    19 parts2MIT
  • 2 layers76.2 × 94 mmSumo, the printed circuit board in 3D

    Sumo

    Yourself1011/sumo-bot

    The code for Li Feng Yin and Daniel Zhang's sumo robot, for TEJ3MI

    57 parts2
  • 2 layers30.7 × 57.8 mmOpenturret hat, the printed circuit board in 3D

    Openturret hat

    mrpossoms/openturret

    Opensource designs and software for autonomously aiming gimble

    8 parts1
  • 2 layers73.9 × 42.4 mmSumobot, the printed circuit board in 3D

    Sumobot

    personion222/sumo-robot

    TEJ3MI Final Sumo Wrestling Robot Project Files

    43 parts1
  • 2 layers75.7 × 59.4 mmBbot pcb, the printed circuit board in 3D

    Bbot pcb

    SharpCoder/bbot

    balancing robot

    16 parts1MIT

Questions

How big is the Robot circuit borad PCB?

It measures 68.6 × 68.6 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Robot circuit borad use?

22 parts, built around the L293D and L7805. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Robot circuit borad KiCad files?

From the abdelrauf-44/Self-Balancing-Robot repository on GitHub, at the commit this page was made from: the board is robot_circuit_borad/robot_circuit_borad.kicad_pcb and its schematic robot_circuit_borad/robot_circuit_borad.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Robot circuit borad design in my own project?

Its repository states no licence, so its author keeps all rights: ask abdelrauf-44 before reusing the design.