Demo Video : https://youtu.be/4lIo-_HLwI4?si=84_xpetgZaO4iB7U
A smart car powered by ESP32 that can be controlled via WiFi from any mobile phone or computer.
- Project Overview
- Features
- Components Required
- Circuit Diagram
- Installation
- Usage
- How It Works
- Troubleshooting
- Code Customization
- Learning Resources
- Contributing
- License
- Author
- Support
This project is a remote-controlled car built using the ESP32 microcontroller. You can control the car via WiFi from your mobile phone or laptop. The ESP32 hosts a web server that provides a simple, responsive interface with:
- Forward, Backward, Left, Right buttons
- Stop button
- Speed control slider
- 📱 Web-based Remote Control
- 🎮 Easy-to-use Controls
- ⚡ Adjustable Speed Control
- 📶 WiFi Connectivity
- 🎨 Responsive Web Design
- 🔄 Real-time Interaction
- ESP32 Development Board (1x)
- L298N Motor Driver Module (1x)
- DC Gear Motors (2x or 4x)
- Robot Car Chassis (1x)
- Wheels (4x)
- 18650 Batteries (2x) or 9V Battery (1x)
- Battery Holder (1x)
- Jumper Wires
- Breadboard (Optional)
- Soldering Iron (optional)
- Screwdriver
- Wire Stripper
ESP32 Pin → L298N Pin → Function
GPIO 27 → IN1 → Motor 1 Direction
GPIO 26 → IN2 → Motor 1 Direction
GPIO 25 → IN3 → Motor 2 Direction
GPIO 33 → IN4 → Motor 2 Direction
GPIO 14 → ENA → Motor 1 Speed (PWM)
GPIO 12 → ENB → Motor 2 Speed (PWM)
GND → GND → Ground
Ground
OUT1, OUT2 → Left Motors
OUT3, OUT4 → Right Motors
Battery (+) → L298N 12V Input
Battery (-) → L298N GND
L298N 5V Out → ESP32 5V
-
Download Arduino IDE
-
Add ESP32 Board Manager
-
Open Arduino IDE → File → Preferences
-
In "Additional Board Manager URLs", add:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
-
-
Install ESP32 Board
- Tools → Board → Boards Manager
- Search for "esp32"
- Install ESP32 by Espressif Systems
-
Open
esp32_car_remote.inoin Arduino IDE. -
Replace WiFi credentials:
const char* ssid = "YOUR_WIFI_SSID"; const char* password = "YOUR_WIFI_PASSWORD";
-
Select the board:
- Tools → Board → ESP32 Arduino → "ESP32 Dev Module"
-
Select the port (ESP32 connected via USB).
-
Click Upload and wait until complete.
- Mount motors, wheels, ESP32, and L298N on the chassis.
- Connect wires according to the circuit diagram.
- Connect the power supply (battery).
-
Power on the car.
-
Open Serial Monitor in Arduino IDE (baud rate: 115200).
-
Note the ESP32’s IP address (e.g., 192.168.1.100).
-
Connect your phone/laptop to the same WiFi.
-
Open the IP address in a web browser.
-
Control the car using the web interface:
- ▲ Forward
- ▼ Backward
- ◄ Left
- ► Right
- ⬛ STOP
- Speed Slider
- ESP32 connects to WiFi and starts a web server.
- You access the server via browser using the ESP32’s IP address.
- Pressing a button sends an HTTP request to the ESP32.
- ESP32 interprets the request and sets motor control pins.
- L298N motor driver amplifies the signal.
- Motors rotate, and the car moves.
- ESP32 not connecting to WiFi → Check SSID/password, WiFi strength, or move closer to the router.
- Car not moving → Verify connections, check battery charge, confirm correct pins in code.
- No IP address → Reset ESP32 and recheck Serial Monitor (baud 115200).
- Web interface not loading → Ensure same WiFi network, try
http://, clear cache.IP> - Car speed issues → Adjust speed slider, change
dutyCyclein code, or check battery voltage.
-
Change Initial Speed:
int dutyCycle = 200; // Value between 0-255 (default: 200)
-
Change Pin Numbers:
const int motor1Pin1 = 27; const int motor1Pin2 = 26;
-
Switch to AP Mode:
WiFi.softAP("ESP32_Car", "12345678"); IPAddress IP = WiFi.softAPIP(); Serial.println(IP););
Feel free to fork this repo and submit pull requests. For major changes, open an issue first.
This project is open source and available for educational purposes.
Created with ❤️ for ESP32 enthusiasts
If you face any issues or have questions, please open a GitHub issue.
Happy Building! 🚗💨