Smart car Bluetooth module learning

Smart car's Bluetooth module (a)

Background understanding

The task for the design and development of multi-purpose intelligent robot guide the blind, to have a preliminary understanding and knowledge in the study of single-chip connectivity and Bluetooth module.

HC05 Bluetooth module

Here Insert Picture Description
Here Insert Picture Description
According to find information,
hc-05 Bluetooth module appearance and pin:
command response mode pin (key or en), used to start at command mode, the Bluetooth module used to adjust the setting
Bluetooth module HC05 port definition (6-pin)

state-- Bluetooth connected, not connected to the low output, the output connected to a high

TX-- signal issued

RX-- signal received

GND-- ground

+5V

EN-- enable terminal, then you need to be brought 3.3V AT mode, the microcontroller then i / o pins are available, a high level

AT command mode and method of setting the Bluetooth module

Bluetooth module has two modes: automatic online (pass-through mode) and a command response (AT mode).
state-- microcontroller then any i / o

rx-- usb serial connection end of tx, P3 ^ 0

tx-- usb serial connection of the ends of rx, P3 ^ 1

gnd-- ground

5v-- connected to 5V power

en-- microcontroller then any i / o, a high level

1, required to be turned en, and a high level

2, a communication line: PC -> usb to serial -> hc05 Bluetooth module (for serial transmission between computers and the Bluetooth module)

3, hold down the Bluetooth module key keys, the microcontroller development board is powered, Bluetooth module indicator light flashes slowly into the state, explained to enter AT mode

4, you can set the operating parameters and status of the Bluetooth serial port of a PC tool

5, the tool performs the computer serial port SSCOM3.3, set the bit rate 38400,8 bit data, 1 stop bit

6, send a test command AT \ r \ n, returns OK indicates if the communication is normal.

7, you can execute the desired command himself.

8, transmits an instruction to restore the default state AT + ORGL \ r \ n, if successful returns OK indicates settings.

The factory default state:

①. Equipment: 0

②. Access code: 0x009e8b33

③. Module job roles: Slave Mode

④. Connection mode: mode Bluetooth devices earmarked

⑤. Serial port parameters: Baud rate -38400bits / s; Stop Bit: 1; Parity: None

⑥. Pairing code: "1234"

⑦. Device Name: "HC-2010-06-01"

9, 9600 is provided with a chip serial matching, 1 stop bit, parity bit 0

• Execute AT + UART = 9600,1,0 \ r \ n. Returns OK

10, to see whether the UART status change is successful, execute AT + UART ?, returned + UART: 9600,1,0 OK

11, the state set up the parameters, can be powered down, ready to enter the working mode

Automatically connect into the work mode Bluetooth match

state-- microcontroller then any i / o

tx end connected rx-- microcontroller, P3 ^ 1, and correspondingly in the opposite order mode

rx end connected tx-- microcontroller, P3 ^ 0

gnd-- ground

5v-- connected to 5V power

en-- do not take

1, no en ON

2, a communication line: Bluetooth phone control terminal -> HC05 Bluetooth module -> SCM

3, the electric board microcontroller development, a Bluetooth module enters the flash lamp state, is connected into the automatic mode of operation described

4, open the Bluetooth phone, you can search the Bluetooth module, connect

5, open the phone side Bluetooth serial tools, the connection is successful, a Bluetooth module enters the double flash status indicator

6. At this point the connection is successful, ready to send data

#include <reg52.h>

void main(void)

{

while(1);

}

Setting parameter status, the above-described matching test few lines of code.

Experience

This study is only a preliminary understanding of some knowledge of the operation command and AT command of hc05 Bluetooth module. We hope the next study to understand more.

appendix

Published an original article · won praise 0 · Views 50

Guess you like

Origin blog.csdn.net/painting520/article/details/104082048