当前位置:网站首页>Bluetooth module: use problem collection

Bluetooth module: use problem collection

2022-06-13 02:01:00 Cheems_ Pak Choi

One 、 Materials required

 If you use the computer serial port assistant for debugging , Please make the following connection :
1、 Modules required 
(1)USB turn TTL modular 
	 Because the level standard of the computer serial port is inconsistent with that of the Bluetooth module , The computer is RS232,
 Bluetooth is not , So you need to convert , To communicate normally , Specific reference 《 Electrical standards 》.
(2) DuPont line 
     Used to connect the Bluetooth module and USB turn TTL modular .
(3) Bluetooth module 
     For Bluetooth communication .  

Two 、 Wiring problems

 1、 Bluetooth module +5v And USB turn TTL Of +5 Connected to a 
 2、 Bluetooth module GND And USB turn TTL Of GND Connected to a 
 3、 Bluetooth module RXD And USB turn TTL Of TXD Connected to a ( Receive and send )
 4、 Bluetooth module TXD And USB turn TTL Of RXD Connected to a ( Receive and send ) 
  After the above connection , then USB turn TTL Connect to the serial port of the computer , After following the above connection ,
  You can communicate normally .	

3、 ... and 、 Bluetooth module AT Instruction debugging problem

1、 The official baud rate of the Bluetooth module is 9600, But the Bluetooth module I use in the company is 
38400, So when you use it, please refer to the baud rate given by the seller ,AT Instruction debugging , I use 
 The baud rate of the Bluetooth module is 38400, So I set the baud rate to... In the serial port assistant software 38400,
 Then send AT Instructions .
2、 send out AT When the command , every last AT After the instruction , Need to wrap , This is Bluetooth AT Specification for instruction debugging 
 set , Of course, some serial assistant software has checked line feed by default , You can send it directly .
3、 Every time you send AT After the instruction , Will give a feedback OK, If feedback ERROR(0), Please follow the instructions below 
 Process check :
(1) Check AT Whether the instruction is correct 
(2) Check AT Whether to wrap lines after an instruction 
(3) Check whether the baud rate set on the serial port assistant software is consistent with the baud rate of the Bluetooth module 
(4) Check the Bluetooth module and USB turn TTL Whether the wiring of is loose 
(5) Check the Bluetooth module and USB turn TTL Whether the wiring of is correct 
(6) Check whether the indicator light flashes after the Bluetooth module is powered on 
(7) Check USB turn TTL After connecting the computer ,USB turn TTL Whether the indicator light is on correctly , General electricity 
 The source light is red , The status indicator is blue , The transceiver indicator is also blue . That is, after the power is on 
 The source indicator is on ( The red light is on ), The status indicator is not on ( The blue light doesn't work ), The transceiver indicator is not on 
( This light flashes only when sending and receiving data ), If there is no corresponding light on , explain USB turn 
TTL The module is burnt out .
(8) Check whether the Bluetooth module indicator is on , If not, the Bluetooth module is broken 
 above 8 In process inspection , For reference only , Specific case specific analysis ( For example, our company welds the Bluetooth module to the ground 
 On the circuit board , Debugging is very inconvenient , Serial port for downloading program 1, Bluetooth also uses the serial port 1,
 So the above did not appear at that time 8 Medium condition , The engineer who designed the module caused me great trouble !
 So it's case by case )

Four 、 Recognize that the Bluetooth module is automatically connected to AT Command mode

1、 Automatic connection mode 
	 In this mode , The Bluetooth module indicator is displayed in 0.5 Blink every second , The Bluetooth module is waiting directly for the other 
 Bluetooth for pairing and connecting , If you know the Bluetooth name and password of the Bluetooth module , Then you can 
 Connect to it with your mobile phone , The premise is that you need to pair , Then find the corresponding Bluetooth name to connect ,
 If you don't pair on your mobile phone in advance , So in Bluetooth assistant APP The Bluetooth cannot be searched 
( This problem has been encountered before ).
2、AT Command mode 
	 In this mode , The Bluetooth module indicator is displayed in 2 Blink every second , It mainly carries out some basic tests on Bluetooth 
 Configuration of , For example, Bluetooth name 、 Bluetooth password 、 Baud rate, etc . dependent AT Please find the instruction set by yourself 
 The manufacturer who sells the module can .

5、 ... and 、 Bluetooth module and Bluetooth assistant APP Is the connection successful

1、 Bluetooth module and Bluetooth assistant APP After successful connection , Will be in the Bluetooth assistant APP Show successful connection ,
 Then you can use your mobile phone to communicate with other serial port devices through Bluetooth , For example, mobile phones and 
 MCU communicates through Bluetooth .
2、 Bluetooth module and Bluetooth assistant APP After successful connection , The Bluetooth module uses 5 Blink every second 2 Time , Schedule 
 Ming connected successfully , At this time, communication can be carried out normally .

6、 ... and 、 Use process of Bluetooth module

1、 Bluetooth module and USB turn TTL Connected to a , And then USB turn TTL Connect to the computer and check for incorrect connections ;
2、 Check whether the Bluetooth module is working properly , When the power on indicator is on, it indicates that it is normal , And then the power goes off ;
3、 Let the Bluetooth module enter AT Command mode , First press and hold the button on the Bluetooth module , Then power on , Release the button after a few seconds , this 
 When you can see the Bluetooth module indicator to 2 Blink every second , without 2 Blink every second , Then repeat the above work until you enter AT finger 
 Just make the mode ;
4、 Get into AT After instruction mode , Use the serial port assistant software , Set the baud rate to the baud rate of the Bluetooth module in the serial port assistant software , example 
 For example, my Bluetooth module is 38400, I will change it to 38400, And then use AT Command to configure the Bluetooth module , For example, set 
 Set the name and password of the Bluetooth module :
AT+NAME=HC-05;// Set the name of the Bluetooth module to HC-05
AT+PSWD=123456;// Set the password of the Bluetooth module to 123456, Note that there is also a password when pairing ( The general default is 0000 perhaps 1234)
5、 Use AT After the basic configuration of the Bluetooth module is completed , Power off and power on again ( Be careful , Do not press and hold the Bluetooth module at this time 
 The button of is powered on ), Enter automatic connection mode ;
6、 Use your mobile phone to turn on Bluetooth , Then search the Bluetooth module ( That is, search the Bluetooth module we just set up , The name is “HC-05”),
 Match it after searching , Show that the pairing is successful , If you don't find , Turn off Bluetooth , Reopen and search or 
 Refresh your search ;
7、 Open the Bluetooth assistant APP, Bluetooth assistant on mobile phone APP The connection name on is “HC-05” Bluetooth module , After successful connection , Can be 
 Communicate normally ;
原网站

版权声明
本文为[Cheems_ Pak Choi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130156042439.html