Hello! Im traying to change name and pass of module bluetooth hc-05 , the compile without error, but when i try to connect to my Phone, the name assigned trough to code, it dont show in the Phone.
This is my code:
char name[10] = "Bluetooth Test";
char pass[10] = "00000";
char baud = '4'; //4 = 9600 baud
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
Delay (15000);
Serial.print("AT");
delay(1000);
Serial.print("AT+NAME");
Serial.print(name);
delay(1000);
Serial.print("AT+PIN");
Serial.print(pass);
delay(1000);
Serial.print("AT+BAUD");
Serial.print(baud);
delay(1000);
digitalWrite(13, HIGH);
}
void loop(){}
Diagram
[/code]
The HC05 must be in "AT mode" to change the password and name. The baud rate is 38400 when in AT mode.
This page shows how to use an Uno to change those parameters.
You are using commands and baud rate for HC-06, not HC-05. Check HC-05 datasheets and code. Baud is 38400 for AT mode. You cannot communicate via phone when in AT mode. You might find the following background notes useful.
http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino
Why
groundFungus:
The HC05 must be in "AT mode" to change the password and name. The baud rate is 38400 when in AT mode.
This page shows how to use an Uno to change those parameters.
I don understand, why are using library SoftwaeeSerial.h in that code if arduino have pin serial TX and RX
Because you can only connect one thing to a serial port. To be able to use serial port to upload code and serial monitor to debug the code and see the program output we use the hardware serial port (TX pin 0 and RX pin 1). The hardware port connects the PC via USB. That means that we need a separate serial port for the HC05. Since the Uno has only one hardware serial port can use the SoftwareSerial (or an alternative) library to create the port for the HC05.
groundFungus:
Because you can only connect one thing to a serial port. To be able to use serial port to upload code and serial monitor to debug the code and see the program output we use the hardware serial port (TX pin 0 and RX pin 1). The hardware port connects the PC via USB. That means that we need a separate serial port for the HC05. Since the Uno has only one hardware serial port can use the SoftwareSerial (or an alternative) library to create the port for the HC05.
Hmmmm..... thanks so much
In working in that code
In your schematic, there is no voltage divider on the HC05 RX input. The Uno outputs 5V and the HC05 is a 3.3V device. I think it unwise to connect a 5V output toa 3.3V input. That is the reason for the voltage divider (see the schematic on the linked page and in Nick's Guide).
I changed my code, like this:
#include <SoftwareSerial.h>
SoftwareSerial EEBlue(10,11); //RX, TX
char nombre[10] = "Gerarca";
char pass[10] = "0000";
int led = 13;
void setup() {
Serial.begin(9600);
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
delay(10000);
digitalWrite(13, LOW);
EEBlue.begin(38400);
Serial.println("Enter AT Comands");
Serial.print("AT "); //Inicia la COnfiguracion
delay(1000);
Serial.print("AT+NAME "); //Cambia el Nombre
Serial.print(nombre);
delay(1000);
Serial.print(" AT+BAUD "); //Cambia Baudios
Serial.print(38400);
delay(1000);
Serial.print(" AT+PIN "); //Cambia la COntrase�a
Serial.print(pass);
delay(1000);
Serial.println("Configuracion Terminada...");
}
void loop() {
if(EEBlue.available())
Serial.write(EEBlue.read());
if(EEBlue.available())
EEBlue.write(Serial.read());
}
This work changing the name , but it not connect because im trying to connect through my Phone and this show
https://www.4shared.com/photo/tEhjRu9rgm/Screenshot_2019-07-28-15-21-52.html
It dont ask me about pass '0000'
You might find it useful to read reply #2 again - twice. The phone won't ask about pass until it is able to communicate.
Nick_Pyner:
You might find it useful to read reply #2 again - twice. The phone won't ask about pass until it is able to communicate.
Hello! I Found the error, it's about mode AT. Im cheking!
No amount of checking AT mode will save you if you insist on using the wrong code.
Hello Everyone! It Done!
I Applicated this method:
- I compiled the following code in my arduino:
#include <SoftwareSerial.h>
SoftwareSerial miBT(10, 11); // RX, TX
void setup(){
Serial.begin(9600);
Serial.println("Listo");
miBT.begin(38400);
}
void loop(){
if (miBT.available())
Serial.write(miBT.read());
if (Serial.available())
miBT.write(Serial.read());
}
- schematic:

-
connect ours arduino through USB and upload code
-
Before it running, you have to disconnect vcc 5V of module, so connect it again and press button Bluetooth simultaneously until the bluetooth module LED turns off and on it slowly
-
open Serial Monitor and select opcion "Ambos NL & CR"

5)write in serial Monitor AT+NAME=New_Name, in my case AT+NAME=MIBT after AT+UART=38400,0,0

- if you want to change pass, write AT+PSWD=New_Pass
7)Write AT+RESET
8)Ready it! the name's bluetooth changed