ESP8266/IoT B.Tech/Diploma Beginner

WiFi Controlled Robot using ESP8266 & Android App

Simple WiFi Controlled Robot using NodeMCU ESP8266, L298 Motor Driver & Android App built with MIT APP Inventor. Robot Control Code & Circuit

  • Suitable forB.Tech/Diploma ESP8266/IoT students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview: WiFi Controlled Robot
This tutorial will show you how to build an
Internet
or
WiFi Controlled robot
using
NodeMCU ESP8266
Board. There are many types of Robots or
Robotic Car
from simple ones like Toys to advanced ones like industrial Robotic Arms.
This WiFi Controlled Robot is made using
Wemos D1 Chip
as a control unit. To control the pair of
Motors
, we used
L298n Motor Driver IC
Module. We can power on the circuit using any battery as the power requirement is more than 5V. The Robot can be controlled using an
Android App
which is designed using an
MIT APP Inventor
Software.
We have already covered many types of Robots in earlier projects using different technologies, have a look at them:

Bluetooth Controlled Robot

Gesture Controlled Robot

Voice Controlled Robot
Bill of Materials
Here are the list of components that you need for making this
Robotic Car Project
. You can purchase all the components from Amazon link.
S.N.
Components Name
Quantity
Purchase Links

NodeMCU ESP8266-12E Board or Wemos D1 Mini

Amazon
AliExpress

L298n Motor Driver IC Module

Amazon
AliExpress

Robot Chasis Kit

Amazon
AliExpress

3.7V Samsung 18650 Battery

Amazon
AliExpress

Jumper Wires

Amazon
AliExpress

Breadboard

Amazon
AliExpress

USB Cable

Amazon
AliExpress
Circuit Diagram & Hardware
Here is the schematic for this
WiFi Controlled Robot
Project designed using
Fritzing
software. We will control the two DC motors via L298 Motor Driver IC. You can use
200-300 RPM
DC Motor for this application. The main control unit is Wemos D1 Board which connects and controls the entire circuit and equipment. And to power the circuit we will use a 6V DC Battery or a pair of
Lithium-Ion batteries
connected in series.
Connect the battery to the
L298 Motor Driver
power supply input. Connect all
4 inputs
of L298 to ESP8266 D3, D4, D7 & D8 Pin. Supply 5V to Wemos through L298 5V Pin. Connect the output pins of L298 to left and right motors.
Assemble the robotic car with base and chassis. I used a pair of
3.7V Samsung 18650 Batteries
to power the circuit. The batteries are connected in series and hence overall voltage is around
8V
. I have used the transparent chassis made using glass fiber. You can use metallic or wooden anything that fulfills your requirement. Tightly screw all the components and mount them on the chassis. Use good quality and strong wheels so that the robot can move even on rough surfaces.
The Android App Design
Now we need to design an Android Application for ESP8266 WiFi Controlled Robot. The easiest way to design an Android Application is using
MIT App Inventor
. The
MIT APP Inventor
lets you develop applications for Android phones using a web browser and either the connected phone or emulator. The App Inventor servers store your work and help you keep track of your projects.
I have simply designed an Interface for this
Robotic Project
. The App has 5 pairs of Switch to Send the 0 and 1 command to
Web Server
Similarly the block editor which contains assignment and programming information is given below.
Build/Compile the Application and export it to your Android Phone. You can install the
APK file
on your phone.
Download:
WiFi Controlled Robot APK File
Source Code/Program
The
source code/program
for WiFi Controlled Robot Robot is very simple and you can program the Wemos D1 Board using Arduino IDE.
In this code part, change the
WiFi SSID
&
Password
from these lines.

const
char
*
ssid
=
"Azephyrad"
;
const
char
*
password
=
"@guinevere@@@"
;
Copy the complete code from below and get your ESP8266 Board for programming.

/* include library */
#include <ESP8266WiFi.h>
/* define port */
WiFiClient
client
;
WiFiServer
server
(

)
;
/* WIFI settings */
const
char
*
ssid
=
"Azephyrad"
;
const
char
*
password
=
"@guinevere@@@"
;
/* data received from application */
String
data
=
""
;
/* define L298N or L293D motor control pins */
int
leftMotorForward
=

;
/* GPIO2(D4) -> IN3 */
int
rightMotorForward
=

;
/* GPIO15(D8) -> IN1 */
int
leftMotorBackward
=

;
/* GPIO0(D3) -> IN4 */
int
rightMotorBackward
=

;
/* GPIO13(D7) -> IN2 */
void
setup
(
)
{
Serial
begin
(
115200
)
;
/* initialize motor control pins as output */
pinMode
(
leftMotorForward
OUTPUT
)
;
pinMode
(
rightMotorForward
OUTPUT
)
;
pinMode
(
leftMotorBackward
OUTPUT
)
;
pinMode
(
rightMotorBackward
OUTPUT
)
;
//connect to your local wi-fi network
WiFi
begin
(
ssid
password
)
;
// Attempt to connect to WiFi network:
while
(
WiFi
status
(
)
!=
WL_CONNECTED
)
{
Serial
(
"."
)
;
// Connect to WPA/WPA2 network. Change this line if using open or WEP network:
// Wait 3 seconds for connection:
delay
(
3000
)
;
}
Serial
println
(
""
)
;
Serial
println
(
"WiFi connected"
)
;
Serial
println
(
"IP address: "
)
;
Serial
println
(
WiFi
localIP
(
)
)
;
//You can get IP address assigned to ESP
/* start server communication */
server
begin
(
)
;
}
void
loop
(
)
{
/* If the server available, run the "checkClient" function */
client
=
server
available
(
)
;
if
(
!
client
)
return
;
data
=
checkClient
(
)
;
/************************ Run function according to incoming data from application *************************/
/* If the incoming data is "forward", run the "MotorForward" function */
if
(
data
==
"forward"
)
MotorForward
(
)
;
/* If the incoming data is "backward", run the "MotorBackward" function */
else
if
(
data
==
"backward"
)
MotorBackward
(
)
;
/* If the incoming data is "left", run the "TurnLeft" function */
else
if
(
data
==
"left"
)
TurnLeft
(
)
;
/* If the incoming data is "right", run the "TurnRight" function */
else
if
(
data
==
"right"
)
TurnRight
(
)
;
/* If the incoming data is "stop", run the "MotorStop" function */
else
if
(
data
==
"stop"
)
MotorStop
(
)
;
}
/********************************************* FORWARD *****************************************************/
void
MotorForward
(
void
)
{
digitalWrite
(
leftMotorForward
HIGH
)
;
digitalWrite
(
rightMotorForward
HIGH
)
;
digitalWrite
(
leftMotorBackward
LOW
)
;
digitalWrite
(
rightMotorBackward
LOW
)
;
}
/********************************************* BACKWARD *****************************************************/
void
MotorBackward
(
void
)
{
digitalWrite
(
leftMotorBackward
HIGH
)
;
digitalWrite
(
rightMotorBackward
HIGH
)
;
digitalWrite
(
leftMotorForward
LOW
)
;
digitalWrite
(
rightMotorForward
LOW
)
;
}
/********************************************* TURN LEFT *****************************************************/
void
TurnLeft
(
void
)
{
digitalWrite
(
leftMotorForward
LOW
)
;
digitalWrite
(
rightMotorForward
HIGH
)
;
digitalWrite
(
rightMotorBackward
LOW
)
;
digitalWrite
(
leftMotorBackward
HIGH
)
;
}
/********************************************* TURN RIGHT *****************************************************/
void
TurnRight
(
void
)
{
digitalWrite
(
leftMotorForward
HIGH
)
;
digitalWrite
(
rightMotorForward
LOW
)
;
digitalWrite
(
rightMotorBackward
HIGH
)
;
digitalWrite
(
leftMotorBackward
LOW
)
;
}
/********************************************* STOP *****************************************************/
void
MotorStop
(
void
)
{
digitalWrite
(
leftMotorForward
LOW
)
;
digitalWrite
(
leftMotorBackward
LOW
)
;
digitalWrite
(
rightMotorForward
LOW
)
;
digitalWrite
(
rightMotorBackward
LOW
)
;
}
/********************************** RECEIVE DATA FROM the APP ******************************************/
String
checkClient
(
void
)
{
while
(
!
client
a

Technologies used

ESP8266ArduinoWiFiBluetoothBLEL298NAndroidArduino IDE

Hardware components

  • ESP8266
  • Arduino
  • L298N
  • Motor Driver

Software & tools

  • Arduino IDE
  • Fritzing

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.