In order to configure HC05 (or HC06), we use AT Commands.
- Upload
Bare Minimum Codefrom Arduino examples to Arduino. - Connect:
- Arduino RX0 to HC05 TXD
- Arduino TX0 to HC05 RXD
- Arduino GND to HC05 GND
- Arduino 5V to HC05 VCC
- Arduino
- Press and hold the push button on the HC-05 module (Instead can supply Arduino 5V to HC05 EN ).
- Supply power to the module.
- Password
- UART parameters (baud rate, stop bit, parity)
- Role
- Bind address
- CMODE value
-
Make sure that both the Bluetooth modules have the same password.
- Set with
AT+PSWD
- Set with
-
Also make sure that UART parameters in each module are:
- baud rate: 115200
- stop bit: 1
- parity: 0
AT+UART=115200,1,0
-
Set roles in each module as follows:
- In one module, set role to 0 to make it slave:
AT+ROLE=0 - In another module, set role to 1 to make it master:
AT+ROLE=1
- In one module, set role to 0 to make it slave:
-
Bind the address of slave to the master.
- Get address of slave first and note it:
AT+ADDR?(e.g.0021:09:01183A) - Then set the bind address in master:
AT+BIND=21,9,1183A(Leading 0s can be ignored; also replace:with,)
- Get address of slave first and note it:
-
Change the value of CMODE in both modules to 0. 'CMODE=1' means 'connect to any address'.
AT+CMODE=1