Overview
In the last lesson, we introduced how to adjust the parameters of the PID to balance the car.In this lesson we will introduce how to use the APP of mobile phone to control the balance car. Using the mobile phone APP to control the car's forward, backward, left turn , right urn , left and right rotations.
The following will describe in detail how to install the APP, how connect APP to the balance car and how the APP controls the car.
Installing APP
Currently, the balance car temporarily supports the Android version of the APP.APP download address: APP.After the APP is downloaded, it is installed on an Android phone.
APP has a connection with balance car
Arduino cannot connect directly to the mobile phone APP for data transmission,in order to use the mobile phone APP to control the balance car, need to install an extra module on the balance car for data exchange between the mobile phone APP and Arduino.A Bluetooth module is installed on the balance car, the Bluetooth module model is HC-06,the function of this module is making the mobile phone APP can interact with arduino indirectly. The Bluetooth module is connected to the arduino controller via a serial port,the mobile phone APP first passes the control command to the Bluetooth module,the Bluetooth module then passes the command to the arduino via the serial port, eventually achieving control;The reverse is the same, first the arduino transmits data of the status of the car to the Bluetooth module through the serial port, and finally the Bluetooth module sends the data to the APP.
Here's how to connect APP to Bluetooth
- step1:Turn on the balance car power,put the dial switch labeled "bluetooth" on the expansion board to the "on" side,turn on the Bluetooth module and connect the Bluetooth module to the arduino serial port.If the dial switch is turned to the "on" side, the red LED on the Bluetooth module will flash, and the red flashing will have two meanings: ① Bluetooth module work.②The Bluetooth module is waiting for connection.
- step2:Turning on the phone Bluetooth in the "Settings" of the phone,Clicking and Searching Bluetooth to find the "HC-06" Bluetooth device in the list of Bluetooth devices that pop up.This is the Bluetooth which the app is need to connect. Clicking on "pair" and enter the pairing code.The default is 1234 or 0000. After successful pairing, there is a Bluetooth device called HC-06 inside the paired device.

- step3:Opening the mobile phone APP, clicking and searching, find the Bluetooth module you just paired,clicking on "Connect"If you have a Bluetooth module connected,the red light on the Bluetooth module will no longer blink and it will turn on.Second, the "Connect" button on the APP becomes "disconnected."


Note: In order to avoid errors when connecting Bluetooth module, in step2 It's better to unpair the Bluetooth device that your phone is paired with.Then search for Bluetooth to pair.
APP control
Note: In order to avoid errors when connecting Bluetooth module, in step2 It's better to unpair the Bluetooth device that your phone is paired with.Then search for Bluetooth to pair.
- Front: Advance
- Rear: Back
- Left: Low speed left turn
- Right: Low speed right turn
- Stop: The balance car stops when it is in motion station
- Left rotation: fast rotation to the left
- Right rotation: fast rotation to the right