This project demonstrates the design and implementation of a Wi-Fi-controlled car using an ESP32 microcontroller, an MX1508 motor driver, and simple 3V DC toy motors.
The ESP32 hosts a local Wi-Fi access point and provides a control webpage that can be accessed via any smartphone browser to steer and drive the car.
- Control a toy car wirelessly using Wi-Fi (Access Point mode).
- Provide a simple and responsive web interface for control.
- Explore power supply challenges and learn to stabilize the ESP32 during motor operation.
- Gain practical experience with PWM motor control, embedded systems, and basic robotics.
- ESP32 Dev Board – microcontroller with Wi-Fi
- Old Toy RC Car chassis
- MX1508 Motor Driver – dual H-bridge for motor control
- 2 × 3V DC Motors – one for drive, one for steering
- 4 × AA Alkaline batteries – to power the motors
- Buck Converter (MP1584) – step down battery voltage to 3.3V for ESP32
- Jumper wires, solder, electrical tape
- (Optional) 4 × AAA batteries (initially used separately for ESP32, to solve wifi resets)
- Both motors and ESP32 powered from 4 × AA alkaline batteries → ESP32 kept resetting due to voltage sag.
- Tried separate 4 × AAA pack for ESP32.
- Motors powered by 4 × Alkaline AA batteries.
- ESP32 powered via buck converter at 3.3V.
- All grounds tied together.
- ✅ Stable operation, some resets.
Lesson: ESP32 is highly sensitive to voltage drops. Always ensure regulated supply and proper grounding, runtime of the car is less.
- ESP32 → MX1508 Motor Driver
- IN1 → GPIO 26
- IN2 → GPIO 27
- IN3 → GPIO 25
- IN4 → GPIO 33
- Motor Driver VCC → 4 × AA Alkaline battery pack (+)
- Buck Converter
- IN+ → Battery VCC
- IN– → Battery GND
- OUT+ → ESP32 3.3V
- OUT– → ESP32 GND
- Common Ground: battery negative, buck negative, ESP32 GND, motor driver GND
- Platform: Arduino IDE with ESP32 board package
- Web Interface: hosted via
WebServerlibrary- Sliders for drive & steering speed control (0–100%)
- Buttons for Forward, Reverse, Left, Right (hold-to-drive)
- Responsive design for mobile use
- Motor Control:
- PWM at 1 kHz, 8-bit resolution (0–255)
- Functions:
driveForward(),driveReverse(),steerLeft(),steerRight(),stopAll() - Default speed: 50% for drive motor, 100% for steering motor
- Insert batteries and power on.
- ESP32 creates Wi-Fi hotspot:
- SSID:
ESP32-Car - Password:
12345678
- SSID:
- Connect smartphone to Wi-Fi.
- Open browser → http://192.168.4.1.
- Use buttons to drive and sliders to adjust speed.
| Challenge | Cause | Solution |
|---|---|---|
| ESP32 kept resetting | Voltage sag due to motor load | Used additional 4 x AAA batteries |
| Loose wires | Long jumper wires | Soldered connections, secured with tape |
| Steering inverted | Wrong pin mapping | Swapped IN1/IN2 |
| Car not moving at low PWM | Motors need torque to start | Set minimum speed ~50% |
| Power confusion | Multiple supplies unstable | Used common ground |
- Legacy BJT drivers (L298N, L293D): bulky, inefficient, large voltage drop.
- MOSFET drivers (MX1508, TB6612FNG, DRV8833): efficient, compact, cooler, better PWM response.
- ✅ MX1508 chosen: cheap, compact, efficient for small DC motors.
- Buck Converter: best choice (stable 3.3V).
- AMS1117 regulator: simple but wastes power as heat.
- Direct AAA supply: unstable until common ground added.
- ✅ Buck converter + 4 x AA cells + 4 x AAA cells = most stable(but Ni-Mh & Li-ion batteries preferable).
- Alkaline AA: voltage sag under load.
- NiMH AA: better current delivery, rechargeable.
- NiCd: outdated.
- Li-ion 18650: best long-term, needs protection/charging circuit.
- Bluetooth/BLE: lower power but requires custom app.
- Wi-Fi: universal, works via any browser.
- Add ultrasonic sensor for obstacle avoidance.
- Stream video using ESP32-CAM.
- 4 x AA Ni-Mh Batteries.
This project is licensed under the GNU General Public License v3.0.
