A browser-based RC car project powered by ESP32-C3, featuring real-time control through an intuitive web interface with virtual joystick controls. Available in both single-board and dual-board configurations.
- Browser-based control interface
- Virtual joystick with touch/mouse support
- Wi-Fi AP mode for direct connection
- Real-time motor control
- Precision turn control
- Emergency stop function
- Individual wheel speed tuning
- Live status monitoring
- Dual-board long-range option
- ESP-NOW peer-to-peer support
- Flash the code to your ESP32-C3
- Power up the car
- Connect to Wi-Fi network "Web RC Car"
- Navigate to
192.168.1.101
in your browser
┌─────────────┐ ┌──────────────┐ ┌───────────┐
│ Browser │ WS │ ESP32-C3 │ PWM │ Motors │
│ Interface │◄───►│ Web Server │────►│ Driver │
└─────────────┘ └──────────────┘ └───────────┘
┌─────────────┐ ┌──────────────┐ ┌──────────────┐ ┌───────────┐
│ Browser │ WS │ Control │ │ Drive │ PWM │ Motors │
│ Interface │◄───►│ Board │◄───►│ Board │────►│ Driver │
└─────────────┘ └──────────────┘ └──────────────┘ └───────────┘
WiFi ESP-NOW
-
Web Interface (
web_interface.cpp
)- HTML/CSS layout
- JavaScript joystick controls
- WebSocket client
- Real-time status display
- UI event handling
-
Control Board (
control.ino
)- Web server hosting
- User interface handling
- ESP-NOW transmitter
- OLED display updates
- Connection management
-
Drive Board (
drive.ino
)- ESP-NOW receiver
- Motor control logic
- Failsafe handling
- Automatic reconnection
- Status monitoring
Browser (Web Interface) → WebSocket → Control Board → ESP-NOW → Drive Board → Motors
User Input → JSON Command → ESP-NOW Packet → Motor Signal → Physical Movement
- ESP32-C3-Mini development board
- Dual H-Bridge motor driver
- 2x / 4x DC motors with wheels
- LiPo battery or AA batteries
- Chassis (3D printed, Laser Cut parts, etc)
- Basic electronic components
- Soldering is optional
*4-wheel omni-directional drive configuration* | *2-wheel differential drive configuration* |
Pin | Function |
---|---|
7 | Left Motor PWM |
0 | Right Motor PWM |
8 | Left Motor Forward |
9 | Left Motor Reverse |
4 | Right Motor Forward |
3 | Right Motor Reverse |
Motor | Enable Pin (PWM) | Direction 1 | Direction 2 |
---|---|---|---|
Left Front | 5 | 6 | 7 |
Right Front | 20 | 21 | 3 |
Left Back | 8 | 9 | 10 |
Right Back | 2 | 1 | 0 |
An alternative version using two ESP32 boards with ESP-NOW communication:
- Long-range control (hundreds of meters)
- Direct peer-to-peer communication
- No WiFi network required
- Split control and drive functionality
- More reliable communication
- Control Board: Handles web interface and user input
- Drive Board: Controls motors and receives commands
- ESP-NOW protocol for board-to-board communication
- Separation of concerns
- Extended range capability
- Reduced latency
- More reliable motor control
- Independent WiFi and control systems
The code for this version is in:
control.ino
: Web interface and ESP-NOW transmitterdrive.ino
: Motor control and ESP-NOW receiver
The interface includes:
- Interactive joystick
- Real-time wheel speed indicators
- Quick control buttons
- Fine-tuning controls
- Status monitoring panel
- 10-bit PWM resolution (0-1023)
- 50Hz PWM frequency
- Minimum PWM threshold for reliable start
- Individual wheel speed tuning
- Proportional turn control
- AP Mode:
Web RC Car
- IP: 192.168.1.101
- No password required
- Optimized for low latency
- Motor Dead Zone: Adjust
MOTOR_MIN_PWM
if motors don't start smoothly - Turn Sensitivity: Modify the turn rate mapping in the web interface
- Wheel Balance: Use the tuning sliders to compensate for motor differences