Problem configuring BLUETOOTH MODULE HC-05

Hello Everyone

I recently bought a Blueetooth module HC_)% from a local vendor with pins namely VCC GND RX TX and KEY. For a project i need to change the Baud Rate to 57600 which i'm unable to i searched web and follow the guidelines but in serial monitor i got no rply from the module. The module is in AT mode as LED blinks once in 2 secnds i checked all the connections still no reply. Also explain me what is need to increase baud rate. I want to make a android controlled robot which is not working on current baud rate. so is baud rate the reason or something else. I'm sure that my circuit and arduino sketch is working fine so what might be the problmes. please need urgent help.

A common mistake people make with these modules is that they forget the carriage return. All commands needs to finish with a carriage return in order to be processed by the module.

Also, how are you entering AT mode? do you put KEY high the same time you powerup the module? or do you that after the module has been powered up. These are two methods to enter AT-mode, but they work on different baudrates.

I put Key pin high den applied VCC to module and the AT mode is confirmed by the blinking frequency of LED which blinks once in 2 seconds. Still no reply..

WIRING
HC-05 GND --- Arduino GND Pin
HC-05 VCC (5V) --- Arduino 5V
HC-05 TX --- Arduino Pin 10 (soft RX)
HC-05 RX --- Arduino Pin11 (soft TX)
HC-05 Key (PIN 34) --- Arduino Pin 9

sketch:

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}

void loop()
{

// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());

// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
BTSerial.write(Serial.read());
}

your actually setting the key pin high after powering up.
setup is not called the same instant power is supplies. there is a delay until your code actually starts.
Most likely AT mode is communicating at the configured baudrate and not the 38400 you expect it to be.

Hook up Key directly to VCC and try again. or try the normal operating baudrate.

If that doesn't work see if the serial communication is actually being recieved. Connect arduino reset pin to GND and switch the TX and RX wires. Your arduino will now just function as a USB-to-Serial converter.The microcontroller will be bypassed. Everything entered in the serial monitor will be send to the HC05. and everything recieved by the HC05 can now be seen on serial monitor. Just connect the HC05 to your Phone or bluetooth dongle and test if you can send and recieve data.

Hello,

I had the same problem and i solved it sending a String to the BT.

Look the change in the code:

void loop()
{

// Keep reading from HC-05 and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());

// Keep reading from Arduino Serial Monitor and send to HC-05
if (Serial.available())
String aux = Serial.readString();
BTSerial.write(aux);
}

Regards

You may need the proper line terminations. Normally for AT command sets, they need to be terminated with a carriage return, a newline, or both. It depends on the implementation.

The example code in the HC bluetooth pairing tutorial shows exactly how AT messages for HC-05 and HC-06 need to be formatted. It's a good bit of (well commented) sofware that can help anyone understand how to send AT commands to HC modules.