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 ESP8266Step 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 http://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: Download app. in Android phone from the link: https://raw.githubusercontent.com/osoyoo/driver/master/BTcar_20180607.apk.
Or scan the following QR code with Android phone to download the app.:
Note: Android APP Source code：https://raw.githubusercontent.com/osoyoo/driver/master/BTcar_20180607.apk (Please note: the APP is just compatible with Android OS)Step 7: install App. in your Android phoneTesting:Step 1：Turn on switch in the battery boxStep 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 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:
The HC-06 is a class 2 slave Bluetooth module designed for transparent wireless serial communication. Once it is paired to a master Bluetooth device such as PC, smart phones and tablet, its operation becomes transparent to the user.