Bukit Mertajam, Penang

Control Mobile Robot through WiFi with ESP-WiFi Shield (Arduino + Andriod)


In this tutorial, you will learn to control the mobile robot from your Android smartphone through WiFi connection. The Cytron ESP8266 WiFi Shield is used to create a WiFi Hotspot from the mobile robot while WiFly Remote apps is installed on the smartphone to control the mobile robot.

Hardware Required


Cytron ESP8266 WiFi Shield

2Amp Motor Driver Shield

Aluminium Robot Chassis Set

2x18650 Battery Holder

3.7V 1100mAh Li-Ion Battery

DC Jack(Male) to DG126 Converter

PCB Stand (screw & nut)15mm

Software Required

Circuit Diagram

The diagram below shows the connection of the Motor Driver Shield with the gear motor.

The -ve of the motor is connected to B on the motor driver.

The +ve of the motor is connected to A on the motor driver.

(if the motor rotation is reverse, you need to change the connection to -ve =>A ; +ve =>B)

Step by Step (Hardware)

1. Attach the CT UNO board to the desired position on the chassis by using PCB Stand 15mm (screw & nut).

2. Stack the WiFi Shield onto the CT UNO. Make sure the jumper link is connected on D2 and D3.

3. Stack the Motor Shield onto the WiFi Shield.

For this tutorial, we are connecting the jumper to Vin because the input is supplied from the CT UNO board.

If the power input is supplied from external source, the jumper should be connected to PWRIN.

4. For the motor connections

LEFT motor    => MOTOR 1 ( A => -ve , B => +ve)

RIGHT motor  => MOTOR 2 ( A => -ve , B => +ve)

The jumper for Pin 4,5,6,7 are connected as shown.

5. Screw the battery holder with DC jack to the robot chassis.

Then, connect the DC jack to CT UNO board.

Finally, your hardware setup is done.

WiFly Remote apps setup (Android)

1. Download the WiFly Remote from Play Store on your android phone.

2. Connect your device to your WiFi Shield.

For this tutorial,

ssid = CytronESPShield

pass = RobotHeadToToe

The ssid and password can be change in the coding later.

3. Open the WiFly Remote and fill up the IP address ( and Port (80). Then press “CONNECT”.

4. When the arrow is press, it will sent the data to the connected network.

Now you can enjoy playing with your WiFi Mobile Robot !!!

Additional Information

The default IP address for the WiFi Hotspot is and the port should be 80 as set in the coding. It is needed when using the WiFly Remote apps.

After done uploading the program, you can open the Serial Monitor to test for the connection.

Make sure the port to the board is selected before open the Serial Monitor. (Tools > Port > COM)

Set the baud rate to 115200 and Both NL & CR.

The IP Address will be shown after the WiFi Hotspot is initialize.

When you control using the WiFly Remote, the direction of the robot will be displayed on the Serial Monitor.

Code Overview

Click the link below to download the code.

WiFi Mobile Robot code


Related Posts

Comments (6)

Im New to Arduino. I got this error when verify the code.

master\wifi_mobile_robot\wifi_mobile_robot.ino:1:30: fatal error: CytronWiFiShield.h: No such file or directory



compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

Sorry. problem solved. I forgot to install Cytron ESPWiFi Shield library….tq

“Unfortunately , WiFly remote has stopped” error message in android app.

In serial terminal window, its showing IP address but when I try to connect showing
above message. What might be technical issue..? Please help.

Can u guys guide me how to connect cytron ESP8266 WIFI shield to Mysql database using local xampp Sever. i dont know where I have to modify the wifi demo code to access the database and do checking. (i.e. I already tried to connect the wifi shield to the hotspot )

Hi, can you guide me on how to connect my device to Wifi Shield? The wifi ssid did not appear on my phone. please advice me

Hi, you may need to program your Arduino board and run it first before you can connect to WiFi Shield SSID. For further technical questions, please post at Cytron technical forum. Thanks.

Leave a comment