Bluetooth HC-06 - configuration

Hi
I'm trying to set the baud of the HC -06 device by serial windows of arduino IDE, but I don't have any answer from the device.

I'm following the instruction found in this link:

http://www.gandotech.net/arduino-bluetooth-hc-06-bluetooth-module/

To get an answer from the HC - 06 should be easy. Writing "AT" in the serial monitor should give me back an answer "OK", but I don't receive nothing.

Can you help me?

Thanks :wink:

What baud rate are you using on your terminal?
Most of these modules come with 9600 stock, try that.

Don't just try it, do it. The HC-06 must be configured @ 9600, irrespective of the baud rate it is configured to. I believe the problem with configuration is to do with timing, carriage returns etc., and it is best to do the whole job automatically.

This is the code I use. If you don't use a Mega, you can adapt it by replacing Serial1 with software serial.

/* 
 This is for MEGA
 
HC-06 only responds to 9600 internally.  Even if you set the baud rate to 115200, you don’t need to know that, and you can reprogramme the module again with 9600.
 
 JY-MCU board pins
 RX    - 18   Tx1     orange
 TX    - 19   Rx1     white
 GND   - GND        black 
 VCC   - 5v             red
 
 Kudos to marguskohv - he sowed the seed....
Serial monitor is just aide memoire
 */

String command = ""; // Stores response from HC-06 

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);       //monitor
  Serial1.begin(9600);      //bluetooth 

  Serial.println("AT");  
  Serial1.print("AT");                  //PING
  if (Serial1.available()) {
    while(Serial1.available()) { // While there is more to be read, keep reading.
    delay(3);
    char c = Serial1.read();
      command += c;    
    }
  }

  delay(2000);
  Serial.println(command);
  command = ""; // No repeats
  Serial.println("AT+NAMEFosters"); 
  Serial1.print("AT+NAMEFosters");        //CHANGE NAME
  if (Serial1.available()) {
    while(Serial1.available()) { // While there is more to be read, keep reading.
        delay(3);
      command += (char)Serial1.read();  
    }
  }

  delay(2000);
  Serial.println(command);
  command = ""; // No repeats
  Serial.println("AT+PIN1234");
  Serial1.print("AT+PIN1234");        //CHANGE PASSWORD
  if (Serial1.available()) {
    while(Serial1.available()) { // While there is more to be read, keep reading.
        delay(3);
      command += (char)Serial1.read();  
    }
  }

  delay(2000);   
  Serial.println(command);
  command = ""; // No repeats
  Serial.println("AT+BAUD8");  
  Serial1.print("AT+BAUD8");               //CHANGE SPEED TO 115K
  if (Serial1.available()) {
    while(Serial1.available()) { // While there is more to be read, keep reading.
      command += (char)Serial1.read();    
      delay(2000); 
      Serial.println(command);
    } 
  } 
}

void loop(){
}   //one-shot - nothing here

It also depends on which HC-06 you have.
Some require commands to be upper case, some require lower case, some don't care.
Some require nl &cr characters to be appended to the command, others don't.
Most are shipped with 9600 bps but this speed is not guaranteed.

Also, double check the connections, even if you think they are correct.

For further help you need to say what exact model you have and if it has a blue LED on the daughter board or not.

Hi everybody,

I also have the same problem with my HC-06 module, I'm trying to configure it through AT commands but I receive no response from the module. I also tried uploading the sketch posted by Nick_Pyner and the same thing I have no response.

Can anybody give me some tips how to configure it?
Thanks in advance.

I think the code I posted might be a bit misleading.

1.Are you using a Mega? If not, note the note.
2. Is wiring correct Rx>TX and Tx>Rx?

Hi,
I'm not.using a Mega but I'm using softwareserial for the Serial1. About the connections in TX and rx they are right, I also tried to change it and do the same so the connections I think is not the problem.