Introduction: Configure HC-05 Bluetooth As Master and Slave

Picture of Configure HC-05 Bluetooth As Master and Slave

In some projects, there is need for communication between two Bluetooth Devices so that wireless data can be transferred . For communication between two Bluetooth devices, they must be configured as Master and Slave. This instructable comprehensively covers all the steps required for beginners to configure their Bluetooth modules into master and slave mode.

Step 1: Components Required

  1. Arduino Uno R3 x 1
  2. USB cable x 1
  3. HC-05 Bluetooth Module x 2
  4. Breadboard x 1
  5. Connecting wires (Male - Female) x 5

Step 2: Upload the Arduino Sketch

Step 3: Interfacing the Bluetooth Module With Arduino

Picture of Interfacing the Bluetooth Module With Arduino

HC-05 Bluetooth Module is a wireless communication module that transmits data serially.

  1. VCC pin of HC-05 is connected to +5V
  2. GND pin is connected to GND of the microcontroller.
  3. EN is the Enable pin.
  4. It is used to configure the module in AP mode.
  5. RX pin refers to receiver
  6. TX pin refers to transmitter.

Circuit Connections:

  1. Connect the Female end of all the Male to Female wire to the VCC, GND, RX and TX pins of the HC-05.
  2. Connect the GND of HC-05 to the GND of Arduino Board.
  3. Connect the RX of the HC-05 to Digital Pin 11 of Arduino Board.
  4. Connect the TX of the HC-05 to Digital Pin 10 of Arduino Board.
  5. Leave the VCC Pin Floating.
  6. Now keep reset of Bluetooth module pressed and connect VCC to Arduino VCC.
  7. The Bluetooth LED should blink every 2 seconds. This shows that the BT is now in AT mode.

Step 4: Configure Bluetooth As a Slave

Now open the Serial monitor and write following commands:

  1. Type “AT” and Press Enter. This is used to Confirm that we are in AT Mode
  2. You should get a response which says “OK”.
  3. Type “AT+ROLE=0” and Press Enter. With this command, we are Configuring the Bluetooth device as Slave.
  4. You should get a response which says “OK”.
  5. Now Type “AT+ROLE?” and Press Enter. With this command, we are confirming that Bluetooth Device is in Slave Mode.
  6. You should get a response which says “0”.
  7. Now Type “AT+ADDR?” and Press Enter. With this command, we are checking the address of Bluetooth Device.
  8. You should get a response which says something like this. “98d3:32:708b76”.
  9. Save the above address. This address will be used for pairing this Bluetooth device with the master device.

Step 5: Configure Bluetooth As Master

  1. Connect the other Bluetooth module in AT mode to the Arduino Board with the same connections.
  2. Now open Serial Monitor and again type “AT”
  3. You should get a response which says “OK”.
  4. Type “AT+ROLE=1” and Press Enter. With this command, we are configuring the Bluetooth device as Master.
  5. You should get a response which says “OK”.
  6. Now Type “AT+ROLE?” and Press Enter. With this command, we are confirming that Bluetooth Device is in Master Mode.
  7. You should get a response which says “1”.
  8. Now Type “AT+CMODE=0” and Press Enter. With this command, we are asking the Bluetooth device to communicate with the fixed address.
  9. Now Type “AT+BIND=98d3,32,708b76”. This is the address of Slave Bluetooth device that you have saved. Note:Replace the “:” in the Address with “,”.
  10. You should get a response which says “OK”. Now the Bluetooth Devices are configured as Master and Slave.

Comments

DIY Hacks and How Tos (author)2017-07-01

Hello there!

We're glad you want to share something with the Instructables community!

And we’re here to help you out.

Due to some recent changes on the site, we are no longer able to publish stand-alone videos and other forms of incomplete posts. In order to be published live on the site, Instructables must consist of the following things:

- Multiple steps showing how you made your project

- Written instructions in each step

- Your own original images

Beyond making your Instructable simply publishable, this guide (https://www.instructables.com/id/How-to-Create-a-Feature-Worthy-Instructable/) explains what is required to have your Instructables featured by our site editors. It’s very helpful, and definitely worth checking out.

We would love to review your project again after you have made the necessary edits, and we will publish your project if it is eligible.

If you have any questions, please feel free to ask right here or send us an email at service@instructables.com.

Best,

Instructables Community Manager

Hi,

Could you be more specific as to where we need to do the necessary correction?

P.S. We have written the code, instructable, drawn circuit diagrams and created a thumbnail image, all by ourself.

About This Instructable

34views

0favorites

License:

Bio: Technomentis is a venture to foster innovation and hands on learning for youngsters at formative ages. We explore, create, design, tinker and innovate at Explorato ... More »
More by Explorato_Technomentis:MQTT Based Fire Detection SystemHow to Read Arduino Sensor Data on Android App Using BluetoothAutomated Garbage Collector
Add instructable to: