You can download the user manual from:  

https://osoyoo.com/manual/sportcarkit.pdf

Note: ALL OSOYOO Products for Arduino are Third Party Board which is fully compatible with Arduino

Authorized Online Retailers

Buy from USA Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES ここでご購入を!

Objective

In this lesson, we will use Mobile to control our robot car and make an imitation driving. Since is a mock driving, we will use a virtual steering wheel and gear in our APP to imitate their counterparts in the real car.

You must complete lesson 2 Basic Movement before you continue on with this lesson.

If you don’t complete the frame of car, please review lesson 1

Parts and Devices

No. Device Picture Qty. Accessories
1 ESP8266 Wi-Fi Shield 1 Click here to buy

Wire Connection

ESP8266 Wi-Fi Module must be inserted into Soft Serial Port Slot and two Wi-Fi jumper caps are installed as following picture.


Remove Jumper on ENB,IN3,IN4

PART Motor Shield
IN1 jumper D7
IN2 jumper D8
ENA jumper D5
Steer Servo D9
Back Motor cable K1 or K2
E_TX jumper D4
E_RX jumper D11

Software Installation

Step 1) 

Download OSOYOO Wi-Fi UDP Robot Car control APP
In Google Play or Apple Store, please search keywords “OSOYOO IoT UDP Robot Car”, 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 ):

Step 2)Please download PWMServo library from https://osoyoo.com/driver/sg90car/PWMServo.zip if you haven’t installed the library in lesson 2.

Also, Please download the WifiESP-Master library zip file from https://osoyoo.com/driver/WiFiEsp-master.zip

Now Open Arduino IDE →click Sketch →Include Library →Add .ZIP library, then load above two zip files into OSOYOO Basic Board for Arduino.

Step 3) Sketch code Installation:
The Car can work in two Wi-Fi modes: STA mode and AP mode. The sketches for these two modes are different. Let’s explain these two modes one by one

A)STA mode
In STA mode, Robot Car will be a client device of your LAN router. You need to 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) Please download STA mode sketch code from https://osoyoo.com/driver/sg90car/sg90car-lesson5A1.zip. Unzip the file, you will see a folder “sg90car-lesson5A1”. Open Arduino IDE → click file → click Open → choose code “sg90car-lesson5A1.ino” in above folder, load the code into OSOYOO Basic Board for Arduino

2) You need to change the code in line 65,66

char ssid[] = “***”; // replace *** with your router wifi SSID

char pass[] = “***”; // replace *** your wifi password

3) Please change the default value 90 in line 19 as the FRONT value in lesson 1. If you align the wheel direction via the option 1 in Step 5, please skip this step.

#define FRONT 90        //degree when steering facing straight forward

4) Upload the sketch to OSOYOO Basic Board for Arduino. Finally, click the Serial monitor window in upper right corner of Arduino IDE, you will see following result:

5) In this mode, you will see an IP address, which is our LAN IP address assigned by my router. Please write down this IP address and click Setting to set up robot IP address and set this IP address to your APP Setting section and Port to 8888 in settings.

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, forward Port 8888 to Robot car LAN IP address, then you can use Router IP to control the car. This feature makes our robot car A REAL INTERNET OF THING device

B)AP mode
Sometimes we are in outdoor and do not have a LAN or Wi-Fi 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 Wi-Fi Hot Spot. Our cell phone can connect to Robot Car as its Wi-Fi client. The IP address of Robot is fixed as 192.168.4.1, and It is not connected to WAN.
1) Please download sketch from following link: https://osoyoo.com/driver/sg90car/sg90car-lesson5B1.zip. Unzip the file, you will see a folder “v3car-lesson5B1”. Open Arduino IDE → click file → click Open → choose code “v3car-lesson5B1.ino” in above folder, load the code into OSOYOO Basic Board for Arduino

2) Open your Arduino Serial monitor, and you will see a similar result as STA mode. A new Wi-Fi SSID “osoyoo_robot” with IP address 192.168.4.1 will show up in the window. This means your Robot car has a Wi-Fi Hot Spot name “osoyoo_robot”, its IP address is 192.168.4.1

3) Connect your cell phone to “osoyoo_robot” Wi-Fi 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 Wi-Fi Hot Spot, you can use Mobile phone to control the robot car.

Final Testing

Turn on the car. Now click Setting to set up robot IP address.

A) In STA mode, you need to connect cell phone to the same LAN SSID of your robot car and set IP address same as the Robot IP showed in Arduino Serial Monitor.

B) In AP mode, you need to contact your cell phone to “osoyoo_robot” Wi-Fi hot_spot and set IP address as 192.168.4.1

you can click the button to make left turn (rotate steering wheel counterclockwise), click button to make right turn (rotate steering wheel   clockwise), if you keep press these two buttons, it will turn at sharper angle.
button will make car move forward and key will make car move backward.