Authorized Online Retailers

Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

Objective:

In this lesson, we learn how to control the Robot car mobile APP through WiFi and Bluetooth

Parts and Devices:
Mount holder for Servo motor

Device Name
picture
qty
Screw Number
ESP8266 expansion board
1
Bluetooth module
1
Lower chassis
1
M3*5 screw x5
Copper pillar x5
Upper chassis
1
M3*5 screw x5
Gear Motor with wires
(Acrylic fastener for Gear Motor x8
Velocity encoder x4)
4
M3*30 screw x8
M3 nuts x8
Wheel
4
UNO R3 board for Arduino with USB cable
1
M3*10 screw x4
M3 nuts x4
Transparent Washer x4
OSOYOO MODEL X motor driver module
1
M3*10 screw x4
M3 nuts x4
Transparent Washer x4
Box for 18650 3.7V battery
1
M3*10 screw x4
M3 nuts x4
DC power connector with wires
1
voltage meter
1
M3*10 screw x2
M3 nuts x2
Transparent Washer x2
Tracking sensor module
5
M3*10 screw x5
M3 nuts x5
SG90 servo Motor with blade and screw

1
Ultrasonic Sensor module

1
M1.5*12 screw x4
M1.5 nuts x4
Mount holder for SG90 servo Motor and Ultrasonic Sensor

1
M3*10 screw x3
M3 nuts x3
M2*10 screw x2
M2 nuts x2
Screw for SG90 x1
Buzzer sensor module

1
M3*10 screw x1
M3 nuts x1
Jumper wires(female to female)
some
Jumper wires(male to female)
some
Cross screwdriver
1

Hardware Installation:
Step 1) Install ESP8266 Expansion Board on UNO R3 board:

Step 2) Move every wire  connected to digit ports(D2 to D13 , A1-A3)) in UNO R3 board to its counterpart digit pin in ESP8266 Expansion Board.

Note: If you want control the car through bluetooth, please install bluetooth module on ESP8266

Step 3) Turn the switch of esp8266 to “1.2” position, as following photo shows:

Step 4) Load Sample code in Robot Car DIY Lesson 1 into Arduino Uno

Note: Bluetooth module and Arduino board communicate with each other through UART serial port. Please remove bluetooth module before uploading sketch in Arduino board, otherwise the sketch will be uploaded unsuccessfully.

Step 5) If you want use wifi to control the car, turn the switch of esp8266 to “on” position(as the following picture). If you want use Bluetooth control car, put switch in “1,2” position.

Step 6) Turn on switch in the battery box. If there car can make movement as described in Lesson 1 (go forward 5 seconds, then go backward 5  seconds, then left turn for 5 seconds, then right turn for 5 seconds, then stop), it means wire connection with ESP8266 Expansion Board and R3 UNO board are all correct. Otherwise please check the each Digital Pin connection in ESP8266 Expansion Board and UNO R3.


Software Installation:

Step 1: Before upload code in esp8266, please turn the switch of esp8266 to “1.2” position, as following photo shows:

Step 2: Download Lesson 5 sample code from https://osoyoo.com/driver/smartcar-lesson5.zip , unzip the download zip file smartcar-lesson5.zip, you will see a folder called smartcar-lesson5.

Step 3: Connect Arduino UNO to PC with USB cable, Open Arduino IDE -> click file -> click Open -> choose code “smartcar-lesson5.ino” in smartcar-lesson5 folder,, load the code into arduino.

Step 4: Choose corresponding board/port for your project,upload the sketch to the board.

Note: Bluetooth module and Arduino board communicate with each other through UART serial port. Please remove bluetooth module before uploading sketch in Arduino board, or the sketch will be uploaded unsuccessfully.

Step 5: If you want use wifi to control the car, turn the switch of esp8266 to “on” position(as the following picture) and make sure Bluetooth module is NOT insert into wifi shield.

If you want use Bluetooth control car, put switch in “1,2” position.

Step 6: if you use iphone, please visit :   https://osoyoo.com/2018/08/17/how-to-use-ios-phone-control-the-robort-car/

If  you use Android phone , please search “OSOYOO Arduino ROBOT CAR V1.0” from Google play and download app..

Or scan the following QR code with Android phone to download the app.:



Note: Android APP Source codehttps://github.com/osoyoo/driver/master/BTcar_20180607.apk 

Step 7: install App. in your Android phone

Testing:

Step 1:Turn on switch in the battery box

Step 2:If you want to control the robot car through WIFI, please scan WiFi hotspot with your Android  phone which you have installed APP and search for wifi named” DoitWIFI_Config”, Click connect(no password needed).

Step 3: Open app>> select WiFi mode>> then you can controller the robot car through wifi

Step 4: If you want to control the robot car through Bluetooth, please put switch on esp8266 module in “1,2” position and turn on bluetooth of your Android phone which you have installed APP and scan bluetooth(different bluetooth module will scan different bluetooth name), Click connect and enter password “1234” or “0000” if no change (You can change wifi or bluetooth settings in Android phone to switch to control car through wifi or bluetooth):

Step 5) Open app>> select bluetooth mode>> then you can controller the robot car through bluetooth:

There are three working mode: manual control, obstacle avoidance and tracking. Users can switch freely among three working mode.
1) In manual control mode, you can click buttons (^) (V) (<) (>) to control the Robot car to move forward and backward, turn right and left. Meanwhile, the APP can observe the car real time movement.

2) Click “tracking” button of App to switch the current mode to tracking mode. The Robot car will move forward along the black line in white background. Meanwhile, the APP can observe the car real time movement. Press “||” button to stop moving and click other button to change Robot car working mode.  To learn more about this mode, please review our lesson 4:

3) Click “Obstacle” button to switch the current mode to obstacle avoidance mode. The Robot car can be driven forward continuously and stopped and steered away once any obstacle in its way.  Press “||” button to stop moving and then click other button to change Robot car working mode. To learn more about this mode, please review our lesson 3: