The car makes its own Wi-Fi hotspot; drive it from any phone browser.
Built and tested by Vishnu M · Industrial Robotics Institute

A robot car controlled over Wi-Fi from a phone or laptop. The ESP32 creates its own hotspot called ESP32_Robot and serves a control page with Forward, Back, Left, Right and Stop buttons. Each button press tells the ESP32 to drive the motors through an L298N motor driver. No router or internet needed.
| Component | Qty |
|---|---|
| ESP32 Dev Board | 1 |
| L298N Motor Driver Module | 1 |
| BO Gear Motors | 4 |
| Robot Chassis | 1 |
| Wheels and Caster Wheel | 1 |
| 18650 Lithium Batteries | 2 |
| 2-cell 18650 Battery Holder with Switch | 1 |
| Jumper Wires | As needed |
| From | Connect to |
|---|---|
| L298N IN1 (left motor) | GPIO 26 |
| L298N IN2 (left motor) | GPIO 27 |
| L298N IN3 (right motor) | GPIO 14 |
| L298N IN4 (right motor) | GPIO 12 |
| Battery + | L298N 12V |
| Battery − | L298N GND |
| ESP32 GND | L298N GND |
Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the ESP32.
#include <WiFi.h>
#include <WebServer.h>
const char* ssid = "ESP32_Robot";
const char* password = "12345678";
WebServer server(80);
int IN1 = 26;
int IN2 = 27;
int IN3 = 14;
int IN4 = 12;
String webpage = R"====(
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{ text-align:center; font-family:Arial; background:#222; color:white; }
button{ width:120px; height:60px; font-size:20px; margin:10px; border-radius:10px; }
</style>
</head>
<body>
<h2>ESP32 Robot Control</h2>
<button onclick="location.href='/forward'">Forward</button><br>
<button onclick="location.href='/left'">Left</button>
<button onclick="location.href='/stop'">Stop</button>
<button onclick="location.href='/right'">Right</button><br>
<button onclick="location.href='/back'">Backward</button>
</body>
</html>
)====";
void handleRoot() { server.send(200, "text/html", webpage); }
void forward() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
server.send(200, "text/html", webpage);
}
void backward() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH);
server.send(200, "text/html", webpage);
}
void left() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
server.send(200, "text/html", webpage);
}
void right() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH);
server.send(200, "text/html", webpage);
}
void stopRobot() {
digitalWrite(IN1, LOW); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, LOW);
server.send(200, "text/html", webpage);
}
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
WiFi.softAP(ssid, password);
server.on("/", handleRoot);
server.on("/forward", forward);
server.on("/back", backward);
server.on("/left", left);
server.on("/right", right);
server.on("/stop", stopRobot);
server.begin();
}
void loop() {
server.handleClient();
}A robot car controlled over Wi-Fi from a phone or laptop. The ESP32 creates its own hotspot called ESP32_Robot and serves a control page with Forward, Back, Left, Right and Stop buttons.
You need: ESP32 Dev Board (1), L298N Motor Driver Module (1), BO Gear Motors (4), Robot Chassis (1), Wheels and Caster Wheel (1), 18650 Lithium Batteries (2), 2-cell 18650 Battery Holder with Switch (1), Jumper Wires. Software: Arduino IDE, ESP32 board package, WiFi and WebServer libraries.
It is rated intermediate and takes about 3–4 hours to build, using the ESP32. The guide on this page explains every connection and step.
The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.
Yes. IRI sells a kit with the parts for this project (PRJ-030). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.