Quick HC-05 AT startup guide - Arduino RoboMaster Part 3

 I wanted to control the Arduino based RoboMaster that I am prototyping wirelessly over Bluetooth. For that purpose I can use the HC-05 Bluetooth module to run the motor from a mobile phone and I have already used HC-05 in my earlier blog posts Bluetooth and IR sensor Interfacing and Bluetooth Controlled LED using Arduino. It is now years back I haven't touched the HC-05 module. I had uploaded a code to control the motors into Arduino and also connected the HC-05 Bluetooth module with Arduino. The Bluetooth got connected to the Mobile phone but the car wheels were not moving when clicking on the RC remote car console on the mobile. 

I tested the Bluetooth module and even bought a new HC-05 module but the problem wasn't gone. So thinking there was something wrong in the setting, baud rate most probably and to see whats in the configuration of the bluetooth module I wanted to enter the configuration setting which is done using the AT command protocol. I wanted to make a record of the process of configuring HC-05 Bluetooth module for future reference.

So here is what I did to enter into AT command mode:

1. Hardware Connection

Arduino HC-05 Interfacing Picture

 To enter the AT command mode make the hardware connection between Arduino and Bluetooth HC-05 module as shown in the circuit diagram below.

Arduino HC-05 Interfacing command mode
Here I will use Arduino Mega 2560 which has the same hardware connection.

2. Upload a Blank Sketch into the Arduino(Uno, Mega, Nano and alike)

blank arduino sketch
Of-course, you should select the proper Arduino board and set the port number as well. 

2.Set HC-05 module into command mode.

There are two ways to put the HC-05 bluetooth module into command mode. One is via a program(Arduino Sketch) or using physical push button on the module. Here we will set the module into command mode using the push button on the device.

To set the module in command mode, 

1. disconnect the +5V input to the Vcc pin of the module. 

2. Disconnect the RX pin 0 on the Arduino

2. Press the push button on the module. 

3. While still pressing the button, reconnect the +5V input to the module

4. When LED is turned on, release the push button. 

Once you have released the push button the LED will blink after each 2 seconds. This is to indicate visually that the bluetooth is now in the command mode.

5. Reconnect the RX pin 0 on the Arduino

 6. Send AT Commands

Now we can then use the serial monitor to send AT command and receive configuration information from the Bluetooth module. Following are some useful AT commands for HC-05 Bluetooth

> AT

>AT+NAME?

>AT_ADDR?

>AT_VERSION?

Example is shown below.

baud configuration

So in this way we can start the AT command mode of HC-05 bluetooth module. To change the baud rate for example we can issue the following command:

>AT+UART=9600,1,0

which sets the baud rate to 9600symbol/sec, parity bits and stop bit.

Video below shows how to put the HC-05 bluetooth module in command mode and how to get configuration details.


Post a Comment

Previous Post Next Post