Project 7 Bluetooth Remote Control

1.Description

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.

2.Specification

  • Bluetooth protocol: Bluetooth Specification V5.1 BLE

  • Working distance: In an open environment, it can achieve 40m ultra-long distance communication

  • Operating frequency: 2.4GHz ISM band

  • Communication interface: UART

  • Bluetooth certification: Accord with FCC CE ROHS REACH certification standard

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

  • Power: 5V DC

  • Operating temperature: –10℃ to +65℃

3.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. It is mainly used in the field of short-distance data wireless transmission. It enables to 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

①STATE:Status pin

②RX:Receiving pin

③TX:sending pin

④GND:GND

⑤VCC:Power

⑥EN: Enable pin

Connect the BT module to the development board.

Uno BT24
TX RX
RX TX
VCC 5V
GND GND

4.Components

Development Board *1

8833 Motor Driver *1

Red LED Module*1

img

img

img

3P F-F Dupont Wire*1

USB Cable*1

DX-BT24 Bluetooth Module*1

img

img

img

5.Wiring Diagram

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

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

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

6.Test Code

You can drag blocks to edit. Blocks listed below are for your reference.

(1).

(2).

(3).

(4).

(5).

Complete Test Code

Note: Before uploading the test code, you need to remove the Bluetooth module, otherwise the code will fail to be uploaded.Connect the Bluetooth module after uploading the code successfully.

7.Test Result

After successfully uploading the code to the V4.0 board, connect the wirings according to the wiring diagram, then connect the computer via a USB cable to power the board. After powering on, insert the BT module and the LED will flash, then we need to download the BT app.

8.Download Bluetooth APP

Apple system

(1).Open the App Store on the iPhone.

(2).Search keyes BT car and download the APP to your phone.

(3).After installation, enter its interface.

(4).Click “Connect” button in the upper left corner to automatically search for Bluetooth. When BT24 is found, click “Connect” to connect Bluetooth, and then click to enter the control interface of 4WD smart car.

Android System

(1).Enter google play store to search for“keyes 4wd”.

(2).The app icon is shown below after installation.

(3).Click app to enter the following page.

(4).After connecting Bluetooth, plug in power and LED indicator of Bluetooth module will flicker. Tap“Connect”to search the Bluetooth.

(5).When BT24 is found, click “connect” to connect Bluetooth. When “connect” turns into “is connected”, it indicates that the Bluetooth connection is successful. As shown in the picture below, the Bluetooth LED becomes will stay on.

(6).After connecting Bluetooth module, click to set baud rate to 9600. Pressing the button of the Bluetooth APP, and the corresponding characters will be displayed, as shown below:

Key

Function

wps14

Pair DX-BT24 5.1 Bluetooth module

wps15

Disconnect Bluetooth

Control character

Function

wps16

Press: F
Release: S

Press the button, the car goes front;
release to stop

wps17

Press: L
Release: S

Press the button, the car turns left;
release to stop

wps18

Press: R
Release: S

Press the button, the car turns right;
release to stop

wps19

Press: B
Release: S

Press the button, the car goes back;
release to stop

wps20

Press: “a”
Release: “S”

Click to speed up(maximum:255)

wps21

Press: “d”
Release: “S”

Click to slow down(minimum:0)

wps22

Click to start the gravity
sensing function of the
mobile phone: click again to
exit the gravity sensing control

wps23

Click to send“X”,
click again to send“S”

Start line tracking function;
click again to exit

wps24

Click to send“Y”,
click again to send“S”

Start ultrasonic avoiding function;
click again to exit

wps25

Click to send“U”,
click again to send“S”

Start ultrasonic follow function;
click again to exit

wps26

Click to send“G”,
click again to send“S”

Start restricting function;
click again to exit

9.Extension Practice

Here we look to 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.

You can drag blocks to edit. Blocks listed below are for your reference.

(1).

(2).

(3).

(4).

(5).

(6).

(7).

Complete Test Code

After successfully uploading the code to the V4.0 board, connect the wirings according to the wiring diagram, then connect the computer via a USB cable to power the board. After powering on, click and to control the LED turn on and turn off.