Bluetooth module and mobile phone communication

Source: Internet
Author: User

1, before the communication must have something:

(1) Bluetooth serial module;

(2) Android system with Bluetooth mobile phone;

(3) serial debugging software;

(4) Bluetooth testing software;

    1. Configure the Bluetooth serial module:

Here the Bluetooth serial module is configured as a slave mode, the specific setup process is as follows:

(1) Let the Bluetooth serial module into the command set state, the specific operation is: According to the only button on the module is not put, with the USB interface to the module power, then the correct situation is the module on the LED light is a few seconds after the long light off and recycling. If the light flashes quickly, it proves that the module does not enter the command setting state, and the power supply repeats the above operation.

(2) Connect the module to the computer via the serial cable; The successful connection flag is: The Device Manager that opens the computer can see the usb-serial port under "port", such as:

(3) Open "Bluetooth test Software", click "Search Port", baud rate Select "38400", this should appear: "Port: 2 Opened";

(4) on the right side of the "Bluetooth test Software", enter the information you want to configure, the main common information is:

① Device Name: You want to give Bluetooth serial module Bluetooth name, support Chinese and English; This is set to "Bluebooth";

② master-Slave role: is the role of the module, where selected "from the role";

③ Device class: Is the Bluetooth device type, which is set to COD:

④ connection Password: means to connect with other Bluetooth devices need to enter a matching password, here is set to "1234", can support at least 8 bits of length, letters and numbers mixed;

⑤ Query Access code: set to the general query access code 9E8B33;

⑥ Connection mode: Master-Slave and loopback mode selection, here select "From role";

⑦ Query access mode: Select 0 or 1,0 is the standard mode, 1 is the Rssi enhancement mode, can connect multiple devices, here choose 1;

⑧ communication baud rate: In the common baud rate selection, because the mobile phone communication baud rate is 9600, so it is recommended to choose 9600;

Finally click "Update module Information"

Figure 1 Setting up the interface

See the blue typeface with OK on the left, the configuration is successful, the software is turned off.

(5) The serial port of the Bluetooth serial module and the computer disconnect, power off, and then re-power the module, note that this time do not need to press the button on the module, directly on the power, and then connect with the computer serial port, you can see the correct phenomenon is the module LED lights are relatively fast flashing.

    1. Install the Serial Assistant software (Androi System p serial assistant) on the mobile phone, install the hc-pda-android.apk file on the phone, and the Btclient program icon after installation. Click to run.
    2. Mobile phone with module Bluetooth connection:

(1) because the Bluetooth serial module has been set up before Bluetooth for slave, so here the Bluetooth on the phone as the host initiates the connection. Directly click on the phone btclient software on the "connection", "Find the Device", select our Bluetooth serial module "Bluebooth", prompted "successful connection";

(2) Open serial debugging software, select serial number 2 and baud rate 9600, data bit 8 bits, stop bit 1 bit, check bit and data flow control are none;

(3) in the serial debugging software to send data to the phone, or mobile phone to send data to the computer, support letters and numbers, do not support Chinese. The following is a sample communication result:

Figure 2 Data received by the Bluetooth serial module

Figure 3 The data received and sent by Bluetooth on the phone

At this point, we have successfully completed the Bluetooth module and mobile phone communication.

Bluetooth module and mobile phone communication

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.