Purchasing link

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

 

1Objective

In this lesson, you will control your OSOYOO V3 Robot Car wirelessly using a Bluetooth-enabled smartphone.

Unlike the WiFi control project in Lesson 6, Bluetooth communication provides a simple, low-power, and direct connection between the robot and a mobile device without requiring a wireless router or network configuration.

To create a more realistic driving experience, the OSOYOO Robot APP uses a virtual steering wheel and gear selector, allowing you to control the robot in a manner similar to driving a real vehicle.

After completing this lesson, you will learn:

2Parts and Devices:

Please ensure all parts of lesson 1 are accounted for prior to commencing the build

 

3MPU6050: Principles of Operation

 

4Hardware Installation

Step 1: Install basic framework as robot car Lesson 1 . If you have already completed hardware installation in Lesson 1 , just keep it as is. If you complete lesson 2, please remove MPU6050 module.

 

5Software Installation

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 imitation driving Robot APP search “OSOYOO imitation driving” in
Google Play Google Play or Apple APP store
(Note: If you can not find this APP in Google Play,
you can directly download the APP from following link: https://osoyoo.com/test/mockdrive.apk )

 

1. Arduino IDE Setup: Download and install the latest version of the Arduino Integrated Development Environment (IDE) from https://www.arduino.cc/en/Main/Software?setlang=en.


2. Code Acquisition: Download the provided sample code for Lesson 7 from here. Extract the contents and you will get a v3car-lesson7.ino in the folder v3car-lesson7.

3. Board and Port Selection: Connect the OSOYOO Basic Board (compatible with Arduino UNO) to your computer via a USB cable(Crucially, ensure the robot car’s power switch is OFF and the battery is disconnected before connect the board to your PC). Launch the Arduino IDE. Navigate to Tools > Board and select Arduino Uno. Then, go to Tools > Port and select the appropriate serial port. If unsure, check your operating system’s device manager for the assigned port.

4. Code Upload: Open the v3car-lesson2.ino sketch in the Arduino IDE. Click the “Upload” button (right arrow icon) to compile and transfer the sketch to OSOYOO Basic Board.

5. Found the the BLE device address

Click Serial Monitor (at right upper corner), wait a moment, then you should see as following. Write down the BLE Address shown in above red circle. You need to connect this BLE device in the Imitation Driving APP.


6APP setting

Step 1: Download and Install OSOYOO Imitation Driving APP, and install APP in your cell phone.

Step 2: Please put your robot Car on the ground, turn on the battery power. Wait until the D13 LED (in the central of the ESP32 Wifi board) Blink 3 times which means E32 BLE signal is ready for connection.

Connect APP to HC-02 Bluetooth Module

Note: For Android device, when you click BT search button and get the following error pop, Please follow the next steps:
1. long-press the APP inco, then click “APP info”
2. click “Permissions”
3.click “Nearby device”, then change the option as “Allow” (To learn more about settings, you can visit the video: https://osoyoo.com/picture/V2.1_Arduino_Robot_Car/Lesson7/APP.mp4)

Drive your Robot Car

Now you have installed your hardware and software for this lesson, let’s drive our car!

Step 1)Put your robot car onto the ground and turn on the switch.

Step 2)Go to your mobile phone ->Setting ->Bluetooth setting and search a Bluetooth device called HC-02, pair it with code 1234

Step 3)Open OSOYOO imitation driving Robot APP, Click BT Search button and find the bluetooth you have paired

Step 4)Turn on Engine toggle, click Speed+ to make the robot speed up as the robot car is very slow at first. When you rotate your mobile phone angle, your car will change direction.

Enjoy your driving!

6Test the Car

Now you can put the car onto the ground, turn on the power. Put your robot car onto the ground and turn on the switch.  Open OSOYOO imitation driving Robot APP, Click BT Search button and find the bluetooth you have paired. Turn on Engine toggle, click Speed+ to make the robot speed up as the robot car is very slow at first. When you rotate your mobile phone angle, your car will change direction.

8 Troubleshooting

1. Cannot Find ESP32
Check:

2. Bluetooth Connects but Robot Does Not Move
Verify:

3. Steering Response Is Delayed
Possible causes:

4. Upload Failed
If Arduino IDE reports upload errors:

  1. Disconnect the Bluetooth module.
  2. Upload the sketch again.

Reinstall the module after programming completes.

Parts and Device:

Wire Connection:

After install the V2.1 Robot Car or 2WD Robot Car framework, please insert to OSOYOO ESP32 Wifi/Bluetooth Shield into the UNO board. Connect the H-Bridge Motor board to Arduino Pins as per following picture:

Use Jumper cap to Connect D4 to ATTX and D5 to ATRX pin in ESP32 Shield

Download The Arduino Code from following link:
https://osoyoo.com/download/e32_mockdrive.zip

Unzip the e32_mockdrive.zip file, double click  e32_mockdrive.ino file and open it in Arduino IDE.
Step 1) Found the the BLE device address

 

Write down the BLE Address shown in above red circle. You need to connect this BLE device in the Imitation Driving APP.
Finally, please   put the robot car on the ground and turn on the battery.

Step 2) Download and Install OSOYOO Imitation Driving APP

OSOYOO imitation driving Robot APP search “OSOYOO imitation driving” in
Google Play Google Play or Apple APP store
(Note: If you can not find this APP in Google Play,
you can directly download the APP from following link: https://osoyoo.com/test/mockdrive.apk )

After Install Above APP in your cell phone.  Please put your robot Car on the ground, turn on the battery power. Wait until the D13 LED (in the central of the ESP32 Wifi board) Blink 3 times which means E32 BLE signal is ready for connection.

Step 3) Connect Robot Car BLE device to mobile Phone
Open the APP and Click Connect Button as following:

After Clicking Connect, a Bluetooth device list manual will pop up. As ESP32 is a BLE device, the list will show BLE device Scanning as following picture:

After about one minute, BLE device scanning will change to BLE Device Found,  please select the BLE device whose address matches the address shown in Step 1). If you are using iPhone, select the Device name “C3_BLE” or “OSOYOO_BLE” or the name you set in the Arduino Code.


Once the BLE  is connected, you can DRIVE the car  with APP.
Control Button in the APP

Trouble Shooting

Question:
My Robot Car power is ON, but the D13 LED does not blink  and my iPhone APP can not find C3_BLE device name and my Android Phone does not find the BLE address in Arduino IDE?
Answer:
This problem happens when initializing of ESP32 does not complete properly. You need press the EN button in the ESP32 for 10 seconds,   turn off power for 5 seconds and turn on battery again. Then Robot Car will try to initialize ESP32 BLE again. Once you see the D13 LED blink 3 times, you can use APP to connect it.