Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HC-06 (BT) set name,baudrate,pin etc..
#1
so,  Smile
because i just wanted to change the Bluetooth-name ("identifier") of my HC-06 BT-module->2,40€ Aliexpress or Ebay->LINK
[Image: hc-06-1000.jpg]
from "HC-06" to "Cambridge Audio 540A Remote" by example 
i had to google thousand hours again  Smile to find a working !! sketch/tutorial..
and at last i came across this site->http://www.martyncurrey.com/arduino-and-hc-06-zs-040/

it is well known (and works ;-) )

little tut:
1. upload exactly this sketch (i changed the softwareserial to 4,5 instead of 10,11..needed the pins elsewhere)

.rar   bt-name-hc06.rar (Size: 585 bytes / Downloads: 0)

// Basic Bluetooth sketch HC-06_01
// Connect the Hc-06 module and communicate using the serial monitor
//
// The HC-06 defaults to AT mode when first powered on.
// The default baud rate is 9600
// The Hc-06 requires all AT commands to be in uppercase. NL+CR should not be added to the command string
//
 
 
#include <SoftwareSerial.h>
SoftwareSerial BTserial(4, 5); // RX | TX
// Connect the HC-06 TX to the Arduino RX on pin 4. 
// Connect the HC-06 RX to the Arduino TX on pin 5 through a voltage divider.
// 
 
 
void setup() 
{
    Serial.begin(9600);
    Serial.println("Enter AT commands:");
 
    // HC-06 default serial speed is 9600
    BTserial.begin(9600);  
}
 
void loop()
{
 
    // Keep reading from HC-06 and send to Arduino Serial Monitor
    if (BTserial.available())
    {  
        Serial.write(BTserial.read());
    }
 
    // Keep reading from Arduino Serial Monitor and send to HC-06
    if (Serial.available())
    {
        BTserial.write(Serial.read());
    }
 
}

2. turn off your bluetooth (on your tab/smartphone/pc) that the module is NOT paired !!
3. reset the Arduino/or upload the sketch again ;-)
4.change the serial monitor settings in your Arduino IDE to "no line ending" ->

[Image: hc-06no_line_end.jpg]

5. if u now send "AT" in the Arduino serial monitor and if u´ll get an "OK" the HC-06 likes you  Heart
u can now type "AT+VERSION" for example; i got here: "linvorV1.80"
6. now u can type"AT+NAMEyourchoice" , if u r lucky u´ll get an "OKsetname(OK)Smile  and that was it..
(as said, module has not to be paired and other choices like AT+PIN or AT+BAUD are described in the link above)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)