Introduction: How to Set AT Command Mode for HC-05 Bluetooth Module
AT Commands stands for Attention command
AT commands mode is used to change default settings of Bluetooth module..
When if there some need like to change the BT device name, device role like master or slave, Password of device BT module need to set in AT Command mode and default setting can change.
Step 1: Video for Better Understanding
Please watch video for better understanding
Step 2: Material Required
Following items need to set HC-05 BT Module in AT Command
As this tutorial only covers the HC-05 bluetooth module so first check your BT module is HC-O5
1) Bread board
2) HC-05 Bluetooth module
3) Arduino board with cable
4) Some jumper wires
Step 3: Identify Your BT Module
First thing you need to do is identify your module. It can be either HC05 or HC06. Both the modules are same in functionality except the pinout. Also HC05 can act as both master and slave whereas HC06 functions only as slave. It's hard to differentiate between the two only by seeing. One probable way would be checking the back of the breakout board. If it has "JY-MCU" written on the back, it's probably a HC06. Mine has "ZS-040" written and it is a HC05. And the HC06 module I tested had a bluetooth sign behind with three pcb footprints To confirm the device identity, you can power up the module, search for new device on your pc or mobile, and look for HC05 or HC06 on found device list.
Step 4: If Key Pin Is Not Present or Not Connected
Some models of the breakout board do not have the key pin, instead they have an EN (enable) pin or WAKE UP pin which may or may not be connected to any pin just like the STATE pin. In that case you'll have to solder a wire to the 34th pin of the bt module. I soldered a male header to mine but if you can't solder or don't want to, then you can just hold a wire (the pointy end of a male to male jumper wire would be convenient ) while connecting the Vcc to 5volt. Once the bt module is in AT mode, you can release the wire.
In video i have cover both of then how to get them in AT command mode
Step 5: Wiring Detail, Sketch, Document
Now time to wire your BT device with arduino
BT MODULE ARDUINO BOARD
RX---------------------------------------------------------10
TX----------------------------------------------------------11
KEY/ENABLE/WAKUP-----------------------------------9
VCC--------------------------------------------------------5V
GND-------------------------------------------------------GND
Sketch to upload on Arduino board
PDF for AT COMMAND list
Step 6: Entering AT Commands
Type "AT" (without the quotes) on the serial monitor and press enter. if "OK" appears then everything is all right and the module is ready to take command. Now you can change the name of the module, retrieve address or version or even reset to factory settings. To see the default name, type AT+NAME. The name will be prompted, by default it is HC-05 or JY_MCU or something like that. To change the name just type AT+NAME=your desired name.
Here is an important note, if the key pin is not high, i.e. not connected to Vcc while receiving AT commands(if you did not solder the wire and released it after the module entered AT mode), it will not show the default name even after giving right command. But you can still change the name by the command mentioned above. To verify if the name has really changed, search the device from your pc/mobile. The changed name will appear. To change baud rate, type AT+UART=desired baud rate. Exit by sending AT+RESET command. Most useful AT commands are AT : Ceck the connection. AT+NAME : See default name AT+ADDR : see default address AT+VERSION : See version AT+UART : See baudrate AT+ROLE: See role of bt module(1=master/0=slave) AT+RESET : Reset and exit AT mode AT+ORGL : Restore factory settings AT+PSWD: see default password More detailed AT commands are given in the pdf.
8 Comments
2 years ago
In the circuit you connect BT Rx to pin 10 of the Arduino Mega and BT Tx to pin 11, but in the sketch you say the opposite, the comments say that you must connect BT RX to pin 11 and BT TX to ping 10. Since this is an obvious contradiction, one of the two is wrong, could you explain which is the correct statement? From my research the statement BTSerial(10,11); means that 10 will be Rx in the Arduino Mega and 11 Tx. So the question is does Tx in the Arduino go with Tx in the HC 05 (and Rx with Rx) for AT Mode? Or do they maintain their roles in AT mode?
Question 5 years ago
hi I am connection HC 05 with Weighing Scale, Weighing Scale sending data Continues but through Blue Tooth only receive data when any weight value change. means if weight value not change then blue tooth will not send data.
please suggest which configuration required to send data in continues mode.
Question 5 years ago on Step 6
HI,
AT COMMANDS NOT SHOWING WHILE ENTERING COMMANDS IN SERIAL MONITOR
5 years ago
To set the boud rate 19200, use the command
AT + BAUD5
5 years ago
Hey, i am unable to change the baud rate with the command AT+UART=19200,1,2,\r\n. plz advise.
5 years ago
Wire Rx to pin 11 and Tx to pin 10 on Arduino.
5 years ago
Hey so I have gotten it into Command mode as Indicated by the light But thats I cant get it to take any commands ?
5 years ago
I did some sort of mistake and i want to turn my transciever to factory settings.Please tell fast how to do it.I have tried ORGL command but its tx and rx pins have interchanged.Please help me.