Problems with master HC-05

Hello.

Some contexts with my project. I am using an Arduino mega combined with a motor shield, to run four motors with Omni-directional wheels. Then I am using two HC-05 Bluetooth modules connected to each other with a series of buttons which control the forward, back, back left, etc. Then I can go from there and add stuff but that's the base idea.

I was testing the modules by getting one of the HC-05 connected to my phone and when I typed '1' and a LED would turn on. That all worked, but now I need to configure one HC-05 as a slave and one as a master.

I've been following this tutorial. How To Configure and Pair Two HC-05 Bluetooth Modules as Master and Slave | AT Commands - How To Mechatronics

I entered the module into AT mode by holding the button then powering it on then blinked every 2 seconds like the website said. Next, I uploaded a blank sketch into the Arduino, then entered serial monitor to enter 'AT' (this is a test prompt) which replied with OK. Then I entered 'AT+UART? which it replied with =UART: 9600,0,0, OK then I asked AT+ROLE? which it replied with +ROLE: 0 meaning it was a slave device. Next I told it 'AT+ROLE=1 changing it into a master device.

Now this is my problem, it wouldn't reply with anything. Normally it would say OK, then I could ask AT+ROLE? then would =1 (master) I'm not sure how to fix this and is there something I'm doing wrong or misread. When asked AT+ROLE? it replied which 0 (slave).

I have tried to do some research, but it wasn't very helpful, and I have only found a series of problem with this module.

If you need more detail or photos, just ask, and I'll try to provide you with what you need.

ON some of the HC05 modules, using the button puts the HC05 into a limited AT mode.

I have found that the method in my tutorial, Setting HC05 to AT Mode, to setup HC05 modules with good success.

Be sure to not ever put 5V on any HC05 input. That means do not put 5V onto the HC05 RX pin or the HC05 EN (enable) pin.

Hello, thank you for the reply.

I'm a little confused, so I wire up my HC05 like normal except I move the TX and RX from 0 and 1 to 2 and 3. Then change into AT mode and upload the code to the Arduino, then put in my commands (AT+ROLE=1) as normal. Also, may be a dumb question but are all HC05's ZS-040, will this still work if mine isn't.
And finally, do I need to connect 3.3v to the pin34 like it said in the Martyn Currey page.

Sorr but one more question, once I have it accepting AT commands then do I change it to 115200 baud rate.

Now I've had some extra time to test and follow your tutorial, it still doesn't work. I changed the Rx from 0 to 3 and the Tx from 1 to 2. Next, I uploaded the code and put it in AT mode, by holding down the button and plugging in power. Then put in the commands 'AT' and 'AT+ROLE?', this gave the response OK and +ROLE: 0. Then wrote 'AT+ROLE=1'. No response.
I also tried AT+ORGL, to reset the board still didn't work. Have I done something wrong?

Uploaded: Oct 25 2023
 
BTserial started at 38400
 
>AT
OK
>AT+ROLE?
+ROLE:0
>AT+ROLE=1
>AT+ROLE=1
>AT+ROLE?
+ROLE:0
>AT+ORGL
OK
>AT+ROLE=1

I think I have a similar issue. I have a HC-05 module, I can put it into command mode by pulling pin 34 high (to 3v3).

If I send it AT+ROLE=1 it does respond with OK but if you then query the role it will respond with +ROLE:0 meaning it did not go into Master mode.

It then returns odd characters if you try it with AT+INIT

Looking at other closed cases, seems that I may have a duff batch of BT modems. The previous solution was to use a different instance of an HC-05.

To be fair on the sellers website, the word Master never appears

"HC-05 HC-06 RF Wireless Bluetooth Transceiver Slave Module HC05 / HC06 RS232 / TTL to UART Converter and Adapter For Arduino NEW"

I guess I just saw the HC-05 and selected this item based on price.

Not relevant. If it's an HC-05, it should be configurable as a master, that is what HC-05s do. There are a lot of bodgie HC-05s around, and I guess most eBay stores neither know nor care about what they are selling.

in re "0 and 1 to 3 and 2."
Are you using SoftwareSerial for that?

(A Non-Pro tip: As an aside, they're 'arbitrary', but to keep them straight in my head - since 'R' comes before 'T' in the alphabet, and that's the order in SoftwareSerial, I use a lower number for 'R' than 'T', i.e. 2, 4 or 7,8.)

This following is your circuit?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.