
LM358 Audio Input Sensor
Shantu-2580/Prototypes
A two-wheeled self-balancing robot using ESP32, MPU6050 (accelerometer + gyroscope), TB6612FNG motor driver, and Bluetooth gamepad control via Bluepad32.

A two-wheeled self-balancing robot using ESP32, MPU6050 (accelerometer + gyroscope), TB6612FNG motor driver, and Bluetooth gamepad control via Bluepad32.
Self Balancing Bot is an open-source printed circuit board by Shantu-2580, from the Shantu-2580/Prototypes repository on GitHub. It is a 2-layer board of 120 × 75 mm with 11 parts on 47 nets, routed with 104 tracks and 3 vias.
It is built around the ROB-14450 and L7805. Its parts include 4 ICs, 3 connectors, 2 capacitors and 2 resistors. It belongs with the robots and motor control boards and the ESP32 boards of this library.
A two-wheeled self-balancing robot using ESP32, MPU6050 (accelerometer + gyroscope), TB6612FNG motor driver, and Bluetooth gamepad control via Bluepad32.
| Component | Notes |
|---|---|
| ESP32 DevKit | 30+ GPIO pins |
| MPU6050 | I2C address 0x68 (SDA=21, SCL=22) |
| TB6612FNG | Dual H-bridge motor driver |
| 2x DC Motors | With encoder support (optional) |
| LiPo Battery | 2S-3S (7.4V-11.1V) with voltage regulator |
| Bluetooth Gamepad | Tested with Xbox/PS4/8BitDo controllers |
ESP32 TB6612FNG MPU6050
────────────────────────────────────────────
GPIO 33 → PWMA
GPIO 14 → AIN1
GPIO 15 → AIN2
GPIO 32 → PWMB
GPIO 26 → BIN1
GPIO 27 → BIN2
GPIO 21 → SDA
GPIO 22 → SCL
3.3V → VCC
GND → GNDCodes/P1/P1.ino — Original VersionStatus: Reference implementation (has placeholder values)
Features:
Known Issues:
Kp, Ki, Kd, base_setpoint set to Add_Values_Later — won't compilebase_setpoint must be manually tuned per robotCodes/P1/Program2.ino — Optimized VersionStatus: Production-ready with all fixes
All Original Features Plus:
| Category | Improvements |
|---|---|
| Compilable | Real PID defaults: Kp=25.0, Ki=0.8, Kd=1.2 |
| Calibration | 2-second startup routine averages accelerometer to find base_setpoint automatically |
| Anti-Windup | Dual protection: integral clamped at ±400 + integration pauses when output saturates (±255) |
| Motor Deadband | MIN_PWM=25 ensures TB6612FNG overcomes static friction |
| Gamepad Deadzone | Ignores joystick input < 20 (prevents center drift) |
| Watchdog | Auto-stops motors if controller disconnects >500ms |
| Sensor Verify | Checks WHO_AM_I register (0x68) at startup, halts if missing |
| DLPF Config | Hardware low-pass filter set to 44Hz (accel) / 42Hz (gyro) |
| Telemetry | 1Hz serial output: angle, setpoint, PID terms for tuning |
| I2C Optimized | Single 14-byte read transaction per loop |
Open Serial Monitor at 115200 baud. You'll see:
Angle: 0.12 | Setpoint: 0.00 | Out: -15.3 | P: -3.0 I: -0.2 D: -12.1Ki=0, Kd=0): Increase until sustained oscillation, then reduce ~30%base_setpoint slightly (or add weight forward)Kp typically 20-50, Kd 0.5-3, Ki 0.5-2 for this hardwarehttps://dl.espressif.com/dl/package_esp32_index.jsonProgram2.ino, select board ESP32 Dev Module, upload; platformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
ricardoquesada/Bluepad32 @ ^2.0.0
monitor_speed = 115200| Symptom | Likely Cause | Fix |
|---|---|---|
| Won't compile | Using P1.ino | Use Program2.ino |
| Falls immediately | PID not tuned | Follow tuning guide above |
| Drifts forward/back | Wrong base_setpoint | Re-calibrate (reset ESP32) |
| Oscillates violently | Kp too high / Kd too low | Reduce Kp, increase Kd |
| Slow to correct | Kp too low | Increase Kp |
| Motors hum but don't turn | Deadband too low | Increase MIN_PWM (try 30-40) |
| Controller doesn't pair | Bluepad32 keys stored | BP32.forgetBluetoothKeys() runs on startup |
| MPU6050 not detected | Wiring / I2C address | Check SDA/SCL, try 0x69 (AD0=HIGH) |
MIT — Feel free to use, modify, distribute.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | 4.7K | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1, R2 |
| 1 | 0.1uF | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C2 |
| 1 | 10uF | Capacitor_THT:CP_Radial_D5.0mm_P2.00mm | C1 |
| 1 | Battery | Connector_Phoenix_MSTB:PhoenixContact_MSTBA_2,5_2-G-5,08_1x02_P5.08mm_Horizontal | J1 |
| 1 | ESP32-DEVKITC-32D | ESP32-DEVKITC-32D:MODULE_ESP32-DEVKITC-32D | U2 |
| 1 | L7805 | Package_TO_SOT_THT:TO-220-3_Vertical | U1 |
| 1 | Motor_L | Connector_Phoenix_MSTB:PhoenixContact_MSTBA_2,5_2-G-5,08_1x02_P5.08mm_Horizontal | J2 |
| 1 | Motor_R | Connector_Phoenix_MSTB:PhoenixContact_MSTBA_2,5_2-G-5,08_1x02_P5.08mm_Horizontal | J3 |
| 1 | ROB-14450 | ROB-14450:MODULE_ROB-14450 | U3 |
| 1 | ~ | MPU_Sensors:Untitled | U4 |

Shantu-2580/Prototypes
A two-wheeled self-balancing robot using ESP32, MPU6050 (accelerometer + gyroscope), TB6612FNG motor driver, and Bluetooth gamepad control via Bluepad32.

anbu-05/Robotic-Arm
a modified-servo based robotic arm project, currently under works

GonzaCerv/noah-hardware
This repo contains all the hardware description for the Noah project. Here lies 3D models, electronics PCB and Firmware software of the robot.

bonavirak/Line-Follower-Robot-Using-STM32F103C8T6-with-TCRT-5000
Line Follower Robot powered by STM32F103C8T6 microcontroller, using TCRT5000 5-way sensors for line detection, HC-05 for Bluetooth communication, TB6612FNG motor driver, and N20 motors (1000 RPM).

0x23/BallJointEmbossingMachine
A motorized linear embossing machine designed to precisely press ball joints. It was designed to automate the production of balljoint linkages for the Open-Micro-Manipulator.


team-mountaineers-urc-2023/electronics
Block diagrams, schematics, and PCB files related to the electronics subteam


It measures 120 × 75 mm and has 2 copper layers, 1.6 mm thick.
11 parts, built around the ROB-14450 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.
From the Shantu-2580/Prototypes repository on GitHub, at the commit this page was made from: the board is ESP/Self_Balancing_Bot/Self_Balancing_Bot.kicad_pcb and its schematic ESP/LM358_Audio_Input_Sensor/LM358_Audio_Input_Sensor/LM358_Audio_Input_Sensor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask Shantu-2580 before reusing the design.