SLAVE ROLE :
To configure the HC-05 as the slave role. Do the AT commands after entering your BT into the AT command mode.
[
Remember:
You should upload a program with Empty Void Setup and Void Loop function and then open your Serial Monitor to perform the AT Commands
NOTE :
During AT Command modes, the TX of Bluetooth should be connected to TX of Arduino and RX of HC-05 should be connected with the RX f the Arduino ]
FUNCTION |
COMMAND |
RESPONSE |
PARAMETER |
Test |
AT |
OK |
None |
Restore Default |
AT+ORGL |
OK |
None |
Name |
AT+NAME ? |
OK |
HC-05(Default) |
Mode |
AT+CMODE=0 |
OK |
0- To Connect to specific BT address
1- To connect to any nearby open BT |
Role Perform |
AT+ROLE ? |
OK |
0 - Slave , 1 - Master |
Role Assign |
AT+ROLE=0 |
OK |
Work as Slave to Connect with the Master device |
To know Address |
AT+ADDR ? |
OK |
2015:43:234567 ( Will Vary for every BT Module ) |
Sync Speed |
AT+UART =9600,0,0 |
OK |
9600,0,0
(To Match with the Serial port of your computer)
|
Ready to Pair |
AT+INIT |
OK |
None
|
After this is done,
remember the address of your slave device.
MASTER ROLE :
Its time to configure the master devices. After following the below steps.
FUNCTION |
COMMAND |
RESPONSE |
PARAMETER |
Test |
AT |
OK |
None |
Restore Default |
AT + ORGL |
OK |
None |
Name |
AT + NAME ? |
OK |
HC-05
(Default) |
Role Perform |
AT + ROLE ? |
OK |
0-Slave
1-Master |
Role Assign |
AT + ROLE=1 |
OK |
Work as Master to connect to Slave |
Sync Speed |
AT + UART=9600,0,0 |
OK |
38400,0,0
(Default) |
Ready to pair |
AT + INIT |
OK |
None |
Connection Mode |
AT + CMODE? |
OK |
0 - Connects to specified address
1 - Connects to any available address |
Connecting |
AT + BIND <addr> |
OK |
Type slave address to connect.
addr - Address of Slave |