4.3.7 Bluetooth Remote Control

4.3.7.1 Introduction

Img

There is a DX-BT24 5.1 Bluetooth module in this kit. This bluetooth module comes with 256Kb space and complies with V5.1BLE bluetooth specification, which supports AT commands. Users can change parameters such as the baud rate and device name of the serial port as required.

Furthermore, it supports UART interface and bluetooth serial port transparent transmission, which also contains the advantages of low cost, small size, low power consumption and high sensitivity for sending and receiving. Notably, it solely needs a few peripheral components to realize its powerful functions.

4.3.7.2 Component Knowledge

Parameters

  • Bluetooth protocol: Bluetooth

  • Specification V5.1 BLE

  • Working distance: In an open environment, achieve 40m ultra-long distance - communication Operating frequency: 2.4GHz ISM band

  • Communication interface: UART

  • Bluetooth certification: in line with FCC CE ROHS REACH certification standards

  • Serial port parameters: 9600, 8 data bits, 1 stop bit, invalid bit, no flow control

  • Power: 5V DC

  • Operating temperature: –10 to +65 degrees Celsius

Application

The DX-BT24 module also supports the BT5.1 BLE protocol, which can be directly connected to iOS devices with BLE Bluetooth function, and supports resident running of background programs. Mainly used in the field of short-distance data wireless transmission. Avoid cumbersome cable connections and can directly replace serial cables. Successful application areas of BT24 modules:

※ Bluetooth wireless data transmission; ※ Mobile phone, computer peripheral equipment; ※ Handheld POS equipment; ※ Wireless data transmission of medical equipment; ※ Smart home control; ※ Bluetooth printer; ※ Bluetooth remote control toys; ※ Shared bicycles;

Ports

Img

① STATE:Status pin ② RX:Receiving pin ③ TX:sending pin ④ GND:GND ⑤ VCC:Power ⑥ EN:Enable pin

Connect the BT module to the development board.

Keyestudio 8833 motor driver expansion board

BT24 Bluetooth

TX

RX

RX

TX

VCC

5V

GND

GND

4.3.7.3 Download and install APP

  1. Visit www.keyestudio.com

Img

  1. Find “WiKi”,and then click “Docs Tutorials”.

Img

Img

Img

  1. Click “Download_Center” to find the APP.

Img

Img

4. Android

Find “Turtle Car” (allow APP to access“location”, you could enable “location”in settings of your cellphone).

Img

Download Turtle Car.apk.

Img

Next, follow the instructions to install the app. The app icon is shown below after installation.

Img

Click app to enter the following page.

Img

5. IOS

Find “keyes BT Car” (allow APP to access“location”, you could enable “location”in settings of your cellphone).

Img

Click Jump to the App Store to navigate to the App Store.

Img

Search for “keyes BT car” directly in the App Store.

Img

After installation, enter its interface.

Img

Click “Connect” to search and pair Bluetooth.

Img

Click Img to enter the main page of turtle smart car.

Img

4.3.7.4 Components

Keyestudio 4.0 development board *1

Keyestudio 8833 motor driver expansion board *1

Red LED Module*1

Img

Img

Img

3P F-F Dupont Wire*1

USB cable*1

DX-BT24 BT Module*1

Img

Img

Img

4.3.7.5 Test Code

Img

4.3.7.6 Wiring Diagram

RXD, TXD, GND and VCC of the BT module are connected to TX, RX, G(GND) and 5V(VCC).

STATE and BRK of the BT module don’t need connection.

Img

Note the direction of the BT module when inserting it onto the 8833 board. And don’t insert it before uploading the code.

Don’t connect the BT module when uploading the code because serial communication port will be occupied when uploading code and inserting the BT module.

4.3.7.7 Test Result

⚠️ Note: Remove the BT module when you are uploading the code, otherwise you will fail to upload it. When the code uploading process is done, open the GPS on your phone, and then reconnect the Bluetooth module.

Upload the code and power up the 4.0 board with a USB cable. Insert the BT module and then go to open BT app.

Img

After connecting Bluetooth, plug in power and LED indicator of Bluetooth module will flicker. Tap Img to search Bluetooth.

Img

Click “connect” below HMSoft, then the Bluetooth will be connected and its LED indicator will stay on.

Img

After connecting Bluetooth module, open serial monitor to set baud rate to 9600. Pressing the button of the Bluetooth APP, and the corresponding characters are displayed as shown below:

Img

Img

We have read the characters of each key on mobile APP via serial port and know the function of those keys.

4.3.7.8 Project Expansion:

Here we use the command sent by the mobile phone to turn on or off an LED light. Looking at the wiring diagram, an LED is connected to the D9 pin.

Img

Img

⚠️ Note: Remove the BT module when you are uploading the code, otherwise you will fail to upload it. When the code uploading process is done, open the GPS on your phone, and then reconnect the Bluetooth module.

Upload the code, connect to the 4.0 development board with a USB cable, power up and click Img and Img to control the LED.