A Wi-Fi robot you drive from your phone’s browser while it streams live video.
Built and tested by Akhil K Madanan · Industrial Robotics Institute

A mobile surveillance robot that moves around while streaming live video over Wi-Fi. The ESP32-CAM captures video and hosts a small web server. Open the robot’s IP address in a browser to get a control page with movement buttons and the camera stream; each button press drives the motors through an L298N motor driver.
| Component | Qty |
|---|---|
| ESP32-CAM Module | 1 |
| FTDI Programmer | 1 |
| L298N Motor Driver | 1 |
| BO Gear Motors | 2 |
| Robot Chassis | 1 |
| Wheels and Caster Wheel | 1 set |
| 18650 Lithium Batteries | 2 |
| 2-cell 18650 Battery Holder with Switch | 1 |
| Jumper Wires | As needed |
| From | Connect to |
|---|---|
| L298N IN1 (left motor) | GPIO12 |
| L298N IN2 (left motor) | GPIO13 |
| L298N IN3 (right motor) | GPIO14 |
| L298N IN4 (right motor) | GPIO15 |
| Battery + | L298N 12V |
| Battery − | L298N GND |
| ESP32-CAM 5V | L298N 5V |
| ESP32-CAM GND | L298N GND |
Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the ESP32-CAM (AI-Thinker).
#include <WiFi.h>
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
#define IN1 12
#define IN2 13
#define IN3 14
#define IN4 15
WiFiServer server(80);
void setup()
{
Serial.begin(115200);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
}
Serial.println("WiFi connected");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
server.begin();
}
void forward() { digitalWrite(IN1,HIGH); digitalWrite(IN2,LOW); digitalWrite(IN3,HIGH); digitalWrite(IN4,LOW); }
void backward() { digitalWrite(IN1,LOW); digitalWrite(IN2,HIGH); digitalWrite(IN3,LOW); digitalWrite(IN4,HIGH); }
void left() { digitalWrite(IN1,LOW); digitalWrite(IN2,HIGH); digitalWrite(IN3,HIGH); digitalWrite(IN4,LOW); }
void right() { digitalWrite(IN1,HIGH); digitalWrite(IN2,LOW); digitalWrite(IN3,LOW); digitalWrite(IN4,HIGH); }
void stopRobot(){ digitalWrite(IN1,LOW); digitalWrite(IN2,LOW); digitalWrite(IN3,LOW); digitalWrite(IN4,LOW); }
void loop()
{
WiFiClient client = server.available();
if (client)
{
String request = client.readStringUntil('\r');
if (request.indexOf("/forward") != -1) forward();
else if (request.indexOf("/back") != -1) backward();
else if (request.indexOf("/left") != -1) left();
else if (request.indexOf("/right") != -1) right();
else stopRobot();
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println();
client.println("<html><body style='text-align:center;'>");
client.println("<h2>ESP32 Surveillance Robot</h2>");
client.println("<img src='http://" + WiFi.localIP().toString() + ":81/stream' width='320'>");
client.println("<br><br><a href='/forward'><button>Forward</button></a><br><br>");
client.println("<a href='/left'><button>Left</button></a>");
client.println("<a href='/stop'><button>Stop</button></a>");
client.println("<a href='/right'><button>Right</button></a><br><br>");
client.println("<a href='/back'><button>Backward</button></a>");
client.println("</body></html>");
client.stop();
}
}A mobile surveillance robot that moves around while streaming live video over Wi-Fi. The ESP32-CAM captures video and hosts a small web server.
You need: ESP32-CAM Module (1), FTDI Programmer (1), L298N Motor Driver (1), BO Gear Motors (2), Robot Chassis (1), Wheels and Caster Wheel (1 set), 18650 Lithium Batteries (2), 2-cell 18650 Battery Holder with Switch (1), Jumper Wires. Software: Arduino IDE, ESP32 board package, WiFi library.
It is rated intermediate and takes about 4–5 hours to build, using the ESP32-CAM (AI-Thinker). 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-015). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.