| Buy from OSOYOO | Buy from US | Buy from UK | Buy from DE | Buy from IT | Buy from FR | Buy from ES | Buy from JP |
Content
In this lesson, you will transform your OSOYOO V3 Robot Car into a WiFi-enabled mobile robot that can be controlled remotely using a smartphone application.
Unlike traditional infrared or Bluetooth control systems, WiFi communication provides greater operating range and network flexibility. The robot can communicate through a local wireless network or directly with a mobile device, making it an excellent introduction to Internet of Things (IoT) technology.
By completing this project, you will learn how wireless communication is integrated into robotic systems and how mobile devices can be used to interact with autonomous platforms.
After completing this lesson, you will be able to:
For the initial assembly phase, the following components are required. Please ensure all parts are accounted for prior to commencing the build
| No. | Picture | Device | Qty. | Accessories | Link |
| 1 | ![]() |
Ultrosonic Sensor | 1 | M1.4*8 Screw x 4 M1.4 Nut x 4 |
Click here to buy |
| 2 | ![]() |
Servo Motor | 1 | M2.2*8 Self Tapping Screw x 2 M2*4 Self Tapping Screw x 1 |
Click here to buy |
| 3 | ![]() |
Mount Holder for Ultrasonic Sensor | 1 | M1.4*8 Screw x 4 M1.4 Nut x 4 M2*4 Self Tapping Screw x 1 |
Click here to buy |
| 4 | ![]() |
Tracking sensor module | 1 | M3 Plastic Screw x 2 M3 Plastic Nut x2 M3 Plastic Pillar x 2 |
Click here to buy |
| 5 | 7pin 25cm Female to Female Cable | 1 | Click here to buy | ||
| 6 | ![]() |
20Pin jumper wire Male to female 20cm | some | Click here to buy | |
| 7 | ![]() |
Philips screwdriver | 1 | Click here to buy | |
| 8 | ![]() |
Hex Screwdriver | 1 | Click here to buy | |
| 9 | ![]() |
M2*4 self tapping screw | 1 | ||
| 10 | ![]() |
M2.2*8 self tapping screw | 2 | ||
| 11 | ![]() |
M1.4*8 screw and nut | 4 | ||
| 12 | ![]() |
M3 plastic screw | 1 | ||
| 13 | ![]() |
M3 plastic pillar | 1 | ||
| 14 | ![]() |
M3 plastic nut | 1 |
Step 1: Install the smart car as per lesson 1, lesson 4 and lesson 5. If you have completed these lessons, You can skip all steps as following. If you complete lesson 2 and lesson 3, please remove MPU6050 module and wires of IR Obstacle Sensors.

Step 3: Follow the wiring diagram provided in the lesson package



| Open-source Arduino Software(IDE) |
![]() |
Download IDE here: https://www.arduino.cc/en/Main/Software?setlang=en |
| 7 zip is a free zip utility that un-zips zip files |
![]() |
Download 7zip here for free https://www.7-zip.org/ |
| Osoyoo WIFI Robot APP | ![]() |
search “Osoyoo IoT UDP Robot APP” in Google Play or Apple Store(If you can not find this APP in Google Play, you can directly download the APP from following link: https://osoyoo.com/driver/udp-app.apk) |
Step 1) Download OSOYOO Wi-Fi UDP Robot Car control APP
In Google Play or Apple Store, please search keywords “OSOYOO IoT UDP Robot APP”, you will find a red icon APP as following (Note: If you can not find this APP in Google Play, you can directly download the APP from following link: https://osoyoo.com/driver/udp-app.apk ):

2. Install Libraries:
Firstly, download Libraries zip files from following links:
WiFiEsp-master: https://osoyoo.com/driver/WiFiEsp-master.zip
ServoTimer2 library: https://osoyoo.com/driver/ServoTimer2-master.zip
Second, do NOT unzip them, open Arduino IDE ->Sketch ->Include Library ->Add Zip Library. Then upload above zip files to Arduino One by One.

Step 3) Sketch code Installation:
Osoyoo V2 Robot Car can work in two WIFI modes: STA mode and AP mode. The sketches for these two modes are different. Let’s explain these two modes one by one
In STA mode, V3 Robot Car will be a client device of your LAN router. You need save the SSID name and password of your LAN router in sketch.
Once the sketch is running, your router DHCP service will assign an IP address to your robot car and your APP will use this IP address to access your car.
1. Upload code for STA mode
Step 1. Please download STA mode sketch code from https://github.com/osoyoo/v3car_wifi_control/blob/master/v3car_wifi.ino. Unzip the file, you will see a folder “v2smartcar-lesson6A”. Open IDE -> click file -> click Open -> choose code “v2smartcar-lesson6A.ino” in v2smartcar-lesson6A folder, load the code into your board ( Note: Please confirm you have Install WiFiEsp-master and ServoTimer2 Libraries before uploading the code)

step 2. You need change the code Line 96 and Line 98 :
char ssid[] = “YOUR_ROUTER_SSID”; // replace this with your router wifi SSID
char pass[] = “YOUR_ROUTER_WIFI_PASSWORD”; // replace with your wifi password
Step 3. Upload the sketch to your board. Finally, click the Serial monitor window in upper right corner of IDE, you will see following result:

In above picture, the 192.168.0.117 is your robot car IP address. We will set this IP address to your APP so that APP can exchange data with the robot car.
2. Osoyoo IoT UDP Robot APP setting
In STA mode, you need connect cell phone to the same LAN ssid of your robot car and set IP address same as the Robot IP showed in Serial Monitor.
Connect your phone with the same router Wi-Fi SSID as the Arduino board. Open the APP, click “settings icon(1)” to enter setting UI, enter your robot car IP address and Port to 8888, click Save, then click back icon(5) to back control UI.
Example: If your Robot Car IP is 192.168.0.107, you can set the APP as following pictures:

Now your Robot car is connected to your LAN, you can use Mobile phone under same LAN to control the robot car. If your APP is in WAN, you need to go to your Router Control Panel and use Router IP to control the car. This feature makes our robot car A REAL INTERNET OF THING device
3. Final Testing:
Turn on the car. Now click Setting to set up robot IP address. In STA mode, you need connect cell phone to the same LAN ssid of your robot car .
Note:
1) F1~F6 are further development functions in the future
2) Please remember to adjust the sensitivity of tracking sensor modules as per link lesson 4
3) Please remember to do Ultrasonic sensor direction alignment as per link lesson 5.
Sometimes we do not have a LAN or WIFI Router. In order to control the car, we need to use AP mode.
When working in AP mode, our robot car itself will become a WIFI Hot Spot. Our cell phone can connect to Robot Car as its wifi client. The IP address of Robot is fixed as 192.168.4.1 and It is not connected to WAN.
1. Upload code for AP mode
Step 1: Please download sketch from following link: https://github.com/osoyoo/v3car_wifi-ap/blob/master/v3car_wifi_ap.ino. Upload the code into your board. ( Note: Please confirm you have Install WiFiEsp-master and ServoTimer2 Libraries before uploading the code)
Step 2: Open Serial monitor, and you will see a similar result as STA mode. A new WIFI SSID “OSOYOO_Robot” with IP address 192.168.4.1 will show up in the window. This means your Robot car has a WIFI Hot Spot name “OSOYOO_Robot” , its IP address is 192.168.4.1.
2. Osoyoo IoT UDP Robot APP setting
Connect your cell phone to “osoyoo_robot” wifi hot_spot, and set IP address as “192.168.4.1” and port to 8888 to your APP Setting section
Now your Robot car become a WIFI Hot Spot, you can use Mobile phone control the robot car.
3. Final Testing
Turn on the car. Now click Setting to set up robot IP address. In AP mode , you need contact your cell phone to “osoyoo_robot” wifi hot_spot and set IP address as 192.168.4.1
Note:
1) F1~F6 are further development functions in the future
2) Please remember to adjust the sensitivity of tracking sensor modules as per link lesson 4
3) Please remember to do Ultrasonic sensor direction alignment as per link lesson 5.
1. Cannot Connect to WiFi
Check:
2. Application Cannot Control Robot
Verify:
3. Serial Monitor Displays
[WiFiEsp] >>> TIMEOUT >>>
This usually indicates an ESP32 communication problem.
Verify:
| ESP32 Pin | Arduino Pin |
| ATTX | D4 |
| ATRX | D5 |
Also ensure jumper caps are configured correctly
Q1)How to tune the robot car speed?
A: If you want change the speed performance of the robot car, please following parameters in line 11 to 13:
#define SPEED 85
#define TURN_SPEED 90
#define SHIFT_SPEED 130
SPEED value determines forward moving speed
TURN_SPEED value determines turning speed
SHIFT_SPEED value determines parallel shifting speed
Q 2)What happened when you press buttons in OSOYOO WiFi UDP Robot Car APP ?
A: When you press a button of the APP, APP will send a single-letter message through UDP protocol to target device (in this example, our WIFI Shield)
| Button | UDP message |
| F1 | F |
| F2 | G |
| F3 | H |
| F4 | I |
| F5 | J |
| F6 | K |
| ▲ | A |
| ▼ | B |
| ► | R |
| ◄ | L |
| square | E |
| F7 | O |
| F8 | T |
Q3)How does the board handle the UDP command?
Following switch(c) statements in v2smartcar-lesson6 sketch file are handling the UDP command
switch (c) //serial control instructions
{
case 'A':Drive_Status=MANUAL_DRIVE; Drive_Num=GO_ADVANCE; WorkMode="GO_ADVANCE";break;
case 'L':Drive_Status=MANUAL_DRIVE; Drive_Num=GO_LEFT; WorkMode="GO_LEFT";break;
case 'R':Drive_Status=MANUAL_DRIVE; Drive_Num=GO_RIGHT;WorkMode="GO_RIGHT";break;
case 'B':Drive_Status=MANUAL_DRIVE; Drive_Num=GO_BACK;WorkMode="GO_BACK";break;
case 'E':Drive_Status=MANUAL_DRIVE; Drive_Num=STOP_STOP;WorkMode="STOP_STOP";break;
case 'O':Drive_Status=AUTO_DRIVE_UO;Serial.println("go OBSTACLE");WorkMode="OBSTACLE";break;
case 'T':Drive_Status=AUTO_DRIVE_LF;WorkMode="line follow";break;
case 'G':track_speed=track_speed+10;
if(track_speed>200) track_speed=200
;break;
case 'J':track_speed=track_speed-10;
if(track_speed<80) track_speed=80
;break;
default:break;
} //END OF ACTION SWITCH
In above code, c in switch() brackets is the UDP data sent from cell phone APP. Once APP ▲ key is pressed, then case ‘A’ … line will handle the command and make car move ahead.
Q4) The serial window show error ” [WiFiEsp] >>> TIMEOUT>>>”

A: Please check the jumper caps and make sure that Jumper caps connect E_TX pin to D4 and E_RX pin to D5 as the Step 2 in hardware installation
DownLoad Url osoyoo.com