ESP32 Bluetooth RC car controlled via gamepad using Bluepad32.
Bluetooth gamepad control (DualShock, Xbox, Switch, etc.)
Servo steering with proportional control
DC motor throttle with forward/reverse
Battery voltage monitoring with LED indicators
Rumble feedback support
Player LED indicators
Component
Quantity
Description
ESP32 DOIT DevKit V1
1
Main controller
TB6612FNG
1
Dual H-Bridge motor driver
SG90 Servo
1
Steering mechanism
DC Motor
1
Drive motor (6-12V)
Battery
1
6-12V LiPo or similar
MP1584EN Buck Converter
1
5V-30V to 5V DC-DC 3A (ESP32 + Servo power)
LEDs
3
Green, Yellow, Red (optional)
Resistors
3
220Ω for LEDs (optional)
Resistors
2
22kΩ + 10kΩ for voltage divider (optional)
┌─────────────────────────────────────────────────────────┐
│ ESP32 │
│ │
│ GPIO18 ──────────────────► Servo Signal │
│ GPIO25 ──────────────────► TB6612 PWMA │
│ GPIO26 ──────────────────► TB6612 AIN1 │
│ GPIO27 ──────────────────► TB6612 AIN2 │
│ GPIO33 ──────────────────► TB6612 STBY │
│ GPIO34 ──────────────────► Battery ADC (via divider) │
│ GPIO12 ──────────────────► Green LED │
│ GPIO13 ──────────────────► Yellow LED │
│ GPIO14 ──────────────────► Red LED │
│ GND ──────────────────► Common Ground │
│ VIN ──────────────────► 5V (from MP1584EN Buck) │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ TB6612FNG │
│ │
│ VM ──────────────────► Battery (+) 6-12V │
│ VCC ──────────────────► ESP32 3V3 │
│ GND ──────────────────► Common Ground │
│ PWMA ─────────────────► ESP32 GPIO25 │
│ AIN1 ─────────────────► ESP32 GPIO26 │
│ AIN2 ─────────────────► ESP32 GPIO27 │
│ STBY ─────────────────► ESP32 GPIO33 │
│ A01 ─────────────────► Motor (+) │
│ A02 ─────────────────► Motor (-) │
└─────────────────────────────────────────────────────────┘
5V Buck Converter (MP1584EN)
┌─────────────────────────────────────────────────────────┐
│ MP1584EN DC-DC Buck Converter │
│ │
│ IN+ ──────────────────► Battery (+) 6-12V │
│ IN- ──────────────────► Battery (-) / GND │
│ OUT+ ──────────────────► ESP32 VIN / 5V │
│ OUT- ──────────────────► Common Ground │
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ ESP32 VIN ◄─────── OUT+ │ │
│ │ Servo VCC ◄─────── OUT+ (Red wire) │ │
│ │ Common GND ◄─────── OUT- / IN- / Battery (-) │ │
│ └─────────────────────────────────────────────────┘ │
│ │
│ Note: Adjust potentiometer on module to output 5V │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ SG90 Servo │
│ │
│ Brown/Black ──────────► GND │
│ Red ──────────► 5V (from MP1584EN Buck Conv) │
│ Orange ──────────► ESP32 GPIO18 │
└─────────────────────────────────────────────────────────┘
Battery Voltage Monitor (Divider)
┌─────────────────────────────────────────────────────────┐
│ Voltage Divider Circuit │
│ │
│ Battery (+) ──┬── R1 (22kΩ) ──┬── ESP32 GPIO34 │
│ │ │ │
│ │ R2 (10kΩ) │
│ │ │ │
│ Battery (-) ──┴───────────────┴── GND │
│ │
│ Vout = Vin × R2/(R1+R2) │
│ Divider Ratio: 10k/(22k+10k) = 0.3125 │
│ Max Safe Input: 3.3V → Max Battery: ~10.5V │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ LED Connections │
│ │
│ ESP32 GPIO12 ── R (220Ω) ──► Green LED ──► GND │
│ ESP32 GPIO13 ── R (220Ω) ──► Yellow LED ──► GND │
│ ESP32 GPIO14 ── R (220Ω) ──► Red LED ──► GND │
└─────────────────────────────────────────────────────────┘
┌───────────────────────────────────────────────────────────┐
│ Battery Connections │
│ │
│ Battery (+) ──┬──► TB6612 VM (motor power) │
│ │ │
│ └──► MP1584EN IN ──► OUT ──┬──► ESP32 VIN │
│ │ │
│ └──► Servo VCC │
│ │
└───────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ SYSTEM DIAGRAM │
│ │
│ ┌──────────┐ Bluetooth ┌─────────┐ │
│ │ Gamepad │ ◄─────────────────► │ ESP32 │◄──┐ │
│ └──────────┘ └────┬────┘ │ │
│ │ │ │
│ ┌────────────────────│ │ │
│ │ │ │ │
│ ┌─────▼─────┐ ┌─────▼─────┐ │ │
│ │ TB6612 │ │ Servo │ │ │
│ ┌─ VM ─►│ FNG │ │ SG90 │ │ │
│ │ └─────┬─────┘ └───────────┘ │ │
│ │ │ ▲ │ │
│ │ ┌─────▼─────┐ │ │ │
│ │ │ DC │ │ │ │
│ │ │ Motor │ │ │ │
│ │ └───────────┘ │ │ │
│ │ │ │ │
│ │ ┌─────────────────────────────┘ │
│ │ │ 5V (powers ESP32 + Servo) │
│ │ ┌───────────┐ │
│ │ │ MP1584EN │ │
│ │ │ Buck │ │
│ │ │ Converter │ │
│ │ └─────▲─────┘ │
│ │ │ 6-12V │
│ │ ┌───────────┐ │
│ └───────│ Battery │ │
│ │ 6-12V │ │
│ └───────────┘ │
└─────────────────────────────────────────────────────────┘
Install Arduino CLI
Connect ESP32 via USB
# Install board core and libraries
make setup
# Compile and upload
make upload
# Open serial monitor
make monitor
# Add board manager URLs
arduino-cli config add board_manager.additional_urls \
https://raw.githubusercontent.com/ricardoquesada/esp32-arduino-lib-builder/master/bluepad32_files/package_esp32_bluepad32_index.json
# Update board index
arduino-cli core update-index
# Install ESP32 Bluepad32 core
arduino-cli core install esp32-bluepad32:esp32
# Install required libraries
arduino-cli lib install " Bluepad32" " ESP32Servo"
Input
Action
Right Stick X-axis
Steering (left/right)
Right Stick Y-axis
Throttle (forward/reverse)
Button A
Cycle LED color (Red → Green → Blue)
Button B
Cycle player LEDs
Button X
Rumble feedback
Target
Description
make compile
Compile the sketch
make upload
Compile and upload via USB
make upload-ota
Compile and upload via OTA
make monitor
Open serial monitor (115200 baud)
make setup
Install board core and libraries
make clean
Remove build artifacts
make size
Show sketch size info
make help
Show all available targets
Controller Not Connecting
Ensure Bluetooth is enabled on your device
Press the pairing button on your gamepad
Check serial monitor for connection messages
Try BP32.forgetBluetoothKeys() in setup() to reset pairings
Check TB6612FNG wiring (especially VM for motor power)
Verify STBY pin is HIGH
Ensure battery has sufficient charge
Ensure buck converter is outputting stable 5V (adjust potentiometer)
Check servo power wire connected to buck converter OUT+
Adjust SERVO_MIN_ANGLE/SERVO_MAX_ANGLE if needed
Run make setup to install required board and libraries
Check Arduino IDE Board Manager for ESP32 Bluepad32
Verify all libraries are installed: make libs
MIT License - see LICENSE for details.