
Self Balancing Bot
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.
LM358 Audio Input Sensor 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 76.8 × 72.6 mm with 25 parts on 23 nets, routed with 121 tracks and 7 vias.
It is built around the LM3915 and L7805. Its parts include 11 diodes, 5 resistors, 4 capacitors, 3 ICs and 2 connectors. It belongs with the sensors and measurement and audio and music 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 |
|---|---|---|---|
| 10 | LED | LED_THT:LED_D5.0mm | D2, D3, D4, D5, D6, D7, D8, D9, D10, D11 |
| 2 | 100k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1, R3 |
| 2 | 1uF | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C3, C4 |
| 1 | 1.2k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R5 |
| 1 | 100nF | Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mm | C1 |
| 1 | 10k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R4 |
| 1 | 10uF | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C2 |
| 1 | 1N4007 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D1 |
| 1 | Audio_in | Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_Vertical | J2 |
| 1 | Battery_in | Connector_Phoenix_MSTB:PhoenixContact_MSTBA_2,5_2-G-5,08_1x02_P5.08mm_Horizontal | J1 |
| 1 | L7805 | Package_TO_SOT_THT:TO-220-3_Vertical | U3 |
| 1 | LM3915 | LM3915:DIP795W45P254L2286H533Q18B | U2 |
| 1 | Potentiometer | Connector_PinSocket_2.54mm:PinSocket_1x03_P2.54mm_Vertical | R2 |
| 1 | ~ | Package_DIP:DIP-8_W7.62mm | U1 |

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




tebl/BulkyMIDI-32
A HW build of the MT32-PI project, allowing you to emulate a Roland MT-32 using a Raspberry Pi. Includes enough additional modules to build a MIDI-mountain as well as adapters for connecting to most things retro.
/Lab_4_PSE/Lab%204%20PSE.kicad_pcb.jpg?size=s&soon)
D10G0S1LVA/Trabalhos-Faculdade
Rep para guardar projetos e trabalhos desenvolvidos na faculdade

Allen-Synthesis/EuroPi
EuroPi: A reprogrammable Eurorack module based on the Raspberry Pi Pico

peterheinrich/InternetOverSpaghetti
Transmitting IP packages over a pair of spaghetti thus demonstrating how media independent IP really is.

It measures 76.8 × 72.6 mm and has 2 copper layers, 1.6 mm thick.
25 parts, built around the LM3915 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/LM358_Audio_Input_Sensor/LM358_Audio_Input_Sensor/LM358_Audio_Input_Sensor.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.