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

Introduction

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

CT UNO

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 desire position onto the chassis by using PCB Stand 15mm (screw & nut).

2. Stack the WiFi Shield onto the CT UNO. Make sure the jumper is connected to 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 (192.168.4.1) 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 192.168.4.1 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

Buy

, , , ,

Related Post

How to Make your Line Following Robot Faster?

Let ESPresso thingSpeak for You

Thief Detector !!

Lights Up Your Twitterland! :)

2 thoughts on “Control Mobile Robot through WiFi with ESP-WiFi Shield (Arduino + Andriod)

  1. 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

    #include

    ^

    compilation terminated.

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

Leave a Reply

Your email address will not be published. Required fields are marked *