1

I have a HC-05 Bluetooth module Version (+VERSION:2.0-20100601). I am using Linux Mint Rosa on an Acer laptop

Section 1 - How it's wired Wiring

HC-05       Arduino
VCC         5V
GND         GND
TX          pin 1
RX          GND via voltage divider (GND to 2k resistor{2k to HC-05 RX and a 1k resistor} 1k to pin 0)

Section 2 - Sequence to get into AT command state The sequence I use to get the BT module in AT command state

  • Unplug the Arduino Uno
  • Unplug both the RX and TX
  • Press the button on the HC-05
  • Plug in the Arduino
  • HC-05 LED flashes 1 time every 2 seconds
  • Initialize com ports via Linux terminal - sudo chmod 0777 /dev/ttyACM*
  • Upload an empty sketch
  • Plug in the HC-05 RX to Arduino pin 0, and TX to pin 1
  • Open the Serial monitor
  • Set Both NL & CR and 38400 baud

Section 3 - AT commands issued I use the following AT commands with the noted results.

AT                                  > OK
AT+ORGL                             > OK
AT+RMAAD                            > OK
AT+VERSION  +VERSION:2.0-20100601   > OK
AT+ADDR     +ADDR:98d3:b1:fd85b0    > OK
AT+NAME=Master1                     > OK
AT+UART  +UART:38400,0,0            > OK
AT+ROLE  +ROLE:0                    > OK  

NOTE:HC-05 is set to slave and it will pair (see Section 4 below)

THE PROBLEM IS AFTER PAIRING, I RETURN TO AT COMMAND MODE (Section 2) and SET ROLE=1 (Section 5) BUT IT WILL NOT PAIR IN MASTER MODE.

Section 4 - Pairing I do the following to pair the HC-05 to my phone

  • Unplug the Arduino
  • Plug the Arduino back in
  • HC-05 LED flashes quickly blink/blink/blink
  • Android phone>settings>connections>Bluetooth>Scan
  • 1 device found > Master1 > pair 1234
  • Android app > Serial BT terminal>device>Master1>connected
  • Once Android app connects:
  • HC-05 LED flashes blink/blink 2 seconds then blink/blink
  • Remove the RX and TX cables from Arduino and put a jumper to connect HC-05 TX to RX (loopback)
  • Serial BT terminal>hello>send
  • Output both green and blue - which means the data was sent via RX and returned via TX.

Section 5 - change ROLE=0 (slave) to ROLE=1 (Master) I then follow the same sequence that I used previously in Section 2 to return to AT command state.

Issue the following AT commands

AT                      > OK
AT+ROLE  +ROLE:0        > OK
AT+ROLE=1               > OK

Since I changed the configuration I unpair the device on my phone. I then follow the same sequence that I previously used in Section 4 to pair the HC-05 to my phone

  • HC-05 LED flashes quickly blink/blink/blink
  • Android phone>settings>connections>Bluetooth>Scan - CAN'T FIND THE DEVICE.

If I return to AT Command mode and change AT+ROLE=0 it will Pair.

In Master mode:

  • I tried to swap the TX and RX pins - won't pair.
  • I tried to pair with the TX and RX removed from the Arduino - won't pair.
  • I tried NOT UNpairing the device on the phone but it won't communicate with it via the android app once I change it to Master (Section 5).
  • As I mentioned above if I return to AT Command mode and change AT+ROLE=0 it will Pair.

Lastly I have 2 other HC-05 modules and they all fail to pair when set to Master mode, so I'm thinking I'm missing something but can't figure out what it is.

I would appreciate hearing from anyone with the same problem and anyone who can determine what I'm doing incorrectly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.