How to Configure and Pair Two Bluetooth Modules (HC-05)
by Chandan_Kumar in Circuits > Arduino
941 Views, 3 Favorites, 0 Comments
How to Configure and Pair Two Bluetooth Modules (HC-05)
In this article we are going to learn about how we can pair two bluetooth modules. When two bluetooth modules are connected two each other, one module is called Master and another is Slave.
So for the connectivity, we have to configure the modules as master and slave.
Components:
We have to need,
1. Two bluetooth Modules
2. One Arduino
3. Resistors (1k and 2.2 k)
4 Wires
Arduino Configuration:
First of all, open the Arduino IDE and open a blank sketch. Select the board and the port, then upload the blank sketch to the arduino.
Circuit Diagram
There are two types of circuit diagram
1. Using Voltage divider Rule:
Follow the given picture and complete the circuit.
2. Without Voltage divider Rule:
BT VCC to Arduino 3.3v
BT GND to Arduino gnd
BT TX to Arduino TX
BT RX to Arduino RX
BT EN to Arduino 5v
Start for Configuring
Before connecting with your Arduino and PC. First press and hold the button of the Bluetooth module. Then connect the data cable of the Arduino to your PC. And after that, release the button. If the LED status of the Bluetooth module blinks after every 2 seconds. It indicates that your Bluetooth module is now in Command mode.
Then open your serial monitor, and select the baud rate at 38400
Slave Configuration
Type AT and hit Enter, First you got an error,
then again type AT and hit Enter, this time you got OK
now follow these commands,
AT+ROLE = 0
AT+CMODE = 1
AT+ADDR?
(after executing this command, you got an address, like , 1232:45:4a87d8. Note down this address, this address is nothing but your Bluetooth module's address.
Master Configuration
AT (error)
AT (ok)
AT+ROLE = 1
AT+CMODE = 0
AT+BIND= 1232,45,4A87D8 ( Address of your Slave. Replace colons with a comma, and characters are must be in upper case.)
After configuring modules, give the power of both modules. And hopefully, you can see the modules are connected.