#5 Arduino Mega - How to Configure HC-05 Bluetooth Module using AT Commands? | APDaga Tech

#5 Arduino Mega - How to Configure HC-05 Bluetooth Module using AT Commands? | APDaga Tech

IoT Tutorial #5 [ Arduino Mega Tutorials #5 ]
Here, I will show you can configure the HC-05 Bluetooth Module using AT (Attention) commands.

These AT commands can be used to Check and Change the Name, Password, Baud Rate for Communication of HC-05 Bluetooth Module.

Follow these steps:
  1. Connect Arduino Mega Board to Laptop and upload a Blank Sketch to the Arduino.
    (Note: Don't make any other connection to Arduino Board while uploading a blank sketch)
  2. Connect HC-05 Bluetooth Module in configuration mode:
    Arduino Mega -> BluetoothModule
    Pin0 (Rx0) -> Rx
    Pin1 (Tx0) -> Tx
    Gnd -> GND
    Vcc -> VCC(+5V)
    3.3V -> Pin 34

    Serial Communication through USB cable(Tx0 and Rx0) to
    Arduino Terminal(Desktop) is used just to cross verify.
  3. Enter into configuration mode:
    Plug out  Gnd or Vcc wire of Bluetooth (HC-05) module and Plug it back.
  4. To verify whether HC-05 is in configuration mode,
    LED on Bluetooth module must blink at a slower rate.   
  5. Open Serial Arduino serial monitor and Set Baud Rate = 38400 and select "Both NL and CR" Option
  6. Type following AT commands in given Sequence
    --<Expected Output>

    :Attention Command
    AT +NAME
    :To Check the name of the module
    :To change name of the module to AKSHAY
    AT +PSWD?
    :To check the current password of the module
    AT +PSWD=0000
    :To set the password to 0000
    AT +ADDR
    :To check the address of the module
    AT +UART
    :To check the Baud Rate of the module for communication
For All the AT Commands Download this file:

To understand better Watch the demonstration video below.


Click here to see more codes for Arduino Mega (ATMega 2560) and similar Family.

Feel free to ask doubts in the comment section. I will try my best to solve it.
If you find this helpful by any mean like, comment and share the post.
This is the simplest way to encourage me to keep doing such work.
Thanks and Regards,
-Akshay P. Daga


  1. What is the TX, RX pin in ATMEGA2560 for the program ?

    1. I have already mentioned the pin numbers for ATMEGA2560 TX and RX in step 2 in above blog post.

Post a Comment
Previous Post Next Post