Configuring The HC-05 Bluetooth Module with AT Commands
HTML-код
- Опубликовано: 14 окт 2024
- In this video, I will demo how to change the settings of the ubiquitous HC-05 Bluetooth module using the AT command set. The HC-05 comes with a rich set of AT commands to perform various tasks such as changing the module's default settings including changing the pass code, the device name, and the baud rate. Please refer to the detailed guide on to wire and set-up the HC-05 to the Arduino for AT command mode.
Follow the instructions here:
www.instructabl...
Just some additional info after struggling during 4 hours.
- In the serial Monitor, down and on the right (left from 9600 bauds) you have a menu. You click in this menu and select "Both NL and CR". I read that comment from Nasen an hour ago but didn't understand it was in a menu so I was adding "
" manually in the command but it never worked out.
- I used pins 2 and 3 for RX TX. Doesn't work with the others (and yes, I changed in the code).
- If you are using HC-05 ZS-040, you just need to wire RX, TX, 5V and Gnd. Press the push button, plug the usb, release the push button after 3 sec. You are in AT mode and the LED blinks every 2 sec
Hope this will help
THANK YOU !!!!!!!!!!!!!!!!!!!! U saved me 2 hrs of my life.
THANKS Lad
After hours of trying finally found your comment. Shortly before going nuts you saved my mind. Thank you :). And of course also thanks to techbitar for the video itself.
Thanku bro.
You actually saved my time
TKS BRO
At first I received an "error(0)" but then after I tried lower case, everything, including UPPER case commands worked just fine. Thank you for your kind efforts!
One minute after complaining I figured it out (credit to WhizzWr@instructables):
One IMPORTANT thing, Newline feed (
) and Carriage return (
) are needed on every AT command entered. So if you're using Arduino's serial monitor make sure you select "Both NL and CR" on the dropdown.
Works smooth now.
Thanks man, u r so awesome.
Nasen Bär Thanks man, You saved us! We spent almost 24 hours with this issue
Thanks man...really appreciate it. It should've been pointed out in the instructions itself.
Thanks man .. you really saved me. Wasted whole day
You're a legend
Liels paldies. visu izmēģināju ar savu moduli. Palīdzēja tikai jūsu palīdzība.
Very helpful thanks, just mention that when you enter AT commands on the arduino IDE serial monitor, you have to set it under Both NL & CR and 9600 baud for it to work with this code
HC-05 Bluetooth, according to the datasheet is 3.3Vdc RxTx level and Arduino works with 5V. In your video the bluetooth is connected directly to the Bluetooth without any level converter.
I was struggling with this, but your video solve my problem. Thanks
Great tutorial. I LED is blinking, but nothing happens when I input the AT commands. Please advise? Does the chip need to be in "Slave Mode"? If so, how? Also, I have read some information needing a voltage divider, which I did not do; is this necessary? Thanks in advance.
I did...
but i dont get OK after giving AT command....
What should i do....??
and my android device not search the hc-05 device...????
Great video and instruction. Can I use the HC-06 in place of the HC-05 you are using?
when I send AT there is no response from the module?
Try swaping Rx and Tx pins (1011). It worked for me
Can you help me out with this? I want to hard reset this hc05.
I changed the baud rate to "AT+UART=115200,1,2" and now it wont respond to any at commands. tried the at mode as well, but no luck
hello, how can you send data to the Arduino, for example I need send a array list with int numbers, you you know how to make this? thank you
do you know of a reason why i wasn't been able to see any of these AT Command confirmations on my terminal ?
i was still able to make changes but blindly, although i did do what i wanted im still not trying to walk away happy as there is a lesson to learn here and i would like to know why in case i can help someone else in our future.
Good observation. If you follow the link to my guide I have stated that this is not a good practice. The HC-05 breakout board supposedly has current limiting resistors that will provide temporary protection but not meant for prolonged use. For changing settings of the HC-05, I figured it's for a very short period. But for long term use of the HC-05 it's best to level shift to 3.3v. You only need to do it for the HC-05 RX pin. The Arduino can handle the 3.3V coming out of the HC-05 TX pin.
To fix red light blink:
Disconnect hc-05
HOLD small button, connnect
In serial monitor set BOTH NL and CR
baudrate 38400
Excelente Fixit
can you for me ask,why do i sent a singnal to arduino but no answer for hc05,thank you
i was able to make changes without seeing anything just like you so just go ahead and make changes and assume its working and before you are dont send the last AT+RESET command and the module should jump out of AT MODE and this will be your first confirmation, the second and last confirmation will be shown when you try to use it as you were IF everything would have worked out just like in the video.
I get the OK response when I sent the normal AT command, but I dont get any information when I send other commands, like AT+POWE? ... any suggestions, this is on an HM-10
why not just turn the hc-05 around so we can see the wiring?
Why not just click the link in the desciption where it is all documented in a propper diagram?
I don't know if I have a faulty board, but my board won't blink at all! I tried holding the button, pressing it quickly, and removing the KEY pin's wire. (But, there really is no "KEY" pin on my board. It is called "EN") so I don't know if I am doing this correctly.
Hi! Do you know why I don't have Standard Serial over Bluetooth Link COM port when I want connect to my bluetooth module? My PC pair with module, but can't see COM port? Maybe I need initialize the module with some AT commands?
I have followed all you steps from your tutorial in order and am still unable to get the AT to show OK. Any suggestions. Everything is wired correctly. I am using an arduino pro but that should not make a difference in the set up. So I am not sure what is the problem.please help me
anip juaini Hey i was also the same problem , i think the windos don't send "
" in the end of the line.
Nasen bar wrote commant here about this problem:
"
One minute after complaining I figured it out (credit to WhizzWr@instructables):
One IMPORTANT thing, Newline feed (
) and Carriage return (
) are needed on every AT command entered. So if you're using Arduino's serial monitor make sure you (!)select "Both NL and CR" on the dropdown(!).
"
and if you want try this:
#include
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()
{
int i=0;
BTSerial.print("AT
");
for(i=0;i
@@ariellevy7009 this is still not working 😕😕
Thank you very much! But in your instructions the " " for the PSWD change are missing.
One IMPORTANT thing, Newline feed (
) and Carriage return (
) are needed on every AT command entered .... Credit to @Nasen Bar
hey uve gotten it into command mode but it wont acsspet any commands ?
after you set this up do i use serial and what ever other baud i want in the sketch or do i use the same baud i just setup in at mode? i just binded 2 hc05 one master one slave and they can talk to one another but when i try to use this in my servo setup with pot nothing happens i dont know this is really my first time using this module and i had em for like 3months now
Hello, when you first send the AT command, what is the status of KEY pin, do you need to put in high level all the time?
Hi, in my case, the solution of getting into AT mode was to change wiring i.e.Rx-Rx and Tx-Tx
Had the same problem and now it works!
@@GlennnD how did you make it work
Hi guys I am newbie in arduino. I have a question- I upload basic code on arduino (just setup & loop with blank body).
After that I tested voltage of rx and tx pin It showing 5v on both rx and tx. My question is why rx output is 5v (according my opinion it should be 0v cause it received signal). It means I also need voltage devider between Rx(arduino)-Tx(Bluetooth). Correct me if I am wrong. Please clear my confusion.
Where is the ORANGE wire going to that you never mentioned in the video??
just go to the link below is more detailed there
i did all steps 5 times, but it doesnt answer my at command
same here
I have two BT modules that only blinks every two seconds, they never blink fast and when I try to use the AT commands nothing returns. what should I do??
I have a hc 09 and i don't know how to connect it with my arduino uno.What if I use wrong resistors. like 1kohm instead of 10kohm??
the black wire connected with what port in bluetooth to what port in arduino ??
What should the baudrate be set in the serial monitor.
In my case the led of module is start but do not blink please help me
make sure you are holding the button on the module prior to adding power to the module just hold the button down till you see it starts to blink slower then when it started
Please watch your own production so you will know why some of us find it really difficult to watch. 10/7/2023 I apologize lots of great detail. Android code is to old for mine. Thanks for your hard work.
HI, I TOOK 3 HC05 FROM DIFFERENT STORES I TRIED ALL COMBINATIONS OF CONNECTING, BUT MY DEVICE IS NOT TURNING TO AT MODE PLEASE HELP ME OUT, THANKS
hi
Where can I find the program that is used in this video
Hi. The red led is blinking all the time :( what's happening ? :(
+Marc Paradis got the answer? I have the same problem, It appers "Enter AT commands:",but when I type nothing happens
+Augustin Charles-Hermans Thank you!
+Augustin Charles-Hermans THANK YOU SO MUCH! This trick saved me so much time. I wasted almost a day for trying to put the module in AT mode. I have a question though. The HC05 exits AT mode very quickly. It doesn't wait for me to finish all the AT commands. What's the solution for this?
+Augustin Charles-Hermans Hey, I tried doing what you said. But it still doesn't work. Plz suggest.
Thanks.
+Augustin Charles-Hermans Thank you man. I just did like you said and it worked for me.
Regards,
it's cheaper to use 2 resistors as voltage divider but you can use a number of level shifters. a cheap one is CD4050 IC
My HC-05 module (FC-114) is acting really strange. Its in AT mode (LED blinks every 2 seconds), serial monitor is configured to 9600 baud (also tried 38400) with "Both NL and CR" selected. It doesn't send data back at all. With the example code of Great Scott, it somehow works.
ruclips.net/video/x3KAXjnP06o/видео.html
When i try it without the example code with the serial monitor, it ignores all commands i send.
I tried everything, checked if its connected right, and there are no mistakes so far.
It...is...making...me...mad. I need to see if AT mode works at all in such circumstances, so i can interface it with my Arduino Uno and MSP430G2553. Any advice is welcome.
thanks for the video and tutorial with the code. It has helped me a lot.
is the potential divider necessary?
only with arduino i can send AT commands ? with a serial 2 usb dont work ?
I like your video, hope you are well
When you run the command to change the baudrate, does it change the baudrate it communicates with wirelessly or the baudrate on the tx/tr pins?
Sorry if the question is answered before.
Why is that when i dissconnect my bluetooth module and test it in serial monitor it works but when i put my bluetooth module and test it in my android it won't work.
is it possible to pair 2 hc 05's ? if so please help
Guys can someone explain to me why using the software serial connection works with the module and the built in serial pins rx and tx don't work??
got me there but ill assume that the main reason would be because you will be using the main com port to use the arduino's IDE SERIAL MONITOR
what happened to the crystal of your arduino ?
Thank you for making this video!
Are you doing a project like this?
many many thanks dear. It helps me a lot
hi there, i paired up 2 hc05 master "1" and slave "0" doing this
AT commands
//SLAVE = 98d3:31:2093cb AT+ROLE=0
//MASTER= 98d3:32:204d2a AT+ROLE=1
//AT+BIND=98d3,31,2093cb
//AT+BIND=98d3,32,204d2a
The end im left with paired modules that can talk to one another now i set this in AT+UART=9600.0.0 or 38400,0,0 im not sure now but it worked out fine now in the sketch i was doing all this in terminal obvsly using the terminal baud rate which was
as follow
include SoftwareSerial.h
SoftwareSerial mySerial(10, 11); RX, TX
void setup
{ Serial.begin(38400);
pinMode(9, OUTPUT);
digitalWrite(9, HIGH);
Serial.println("Enter AT commands:");
mySerial.begin(38400);
}
so my problem is that when i try to take the 2 talking modules to use in another project im not sure but they dont communicate no more "after uploading new sketch" am i suppose to use the same baud rate as in the sketch (38400); or should i be using the baud that i set this 2 up to begin with when i did the whole AT+UART=9600.0.0 or 38400,0,0 ???
i was assuming what i have now when they were talking was a wireless RS232/terminal right? if so then all i have to do is make sure in the loop of what ever other program i go to use this modules on that they talk to that SoftwareSerial mySerial or something like this
void loop()
{
if (mySerial.available())
mySerial.write("Variable or Array here");
what is the need to create a voltage divider between arduino and this BT module?
Since the voltage levels are different for these devices. Arduino High = 5V while for BT module it's 3.3V.
madesh b i am just at this point: i have a 5V supply voltage and a hc05 board with out any breakout pins whatsoever. i didn't have a voltage regulator and now i am wondering if there is an easy way to supply the 3.3V module by the 5V supply. i didn't find any information if the module can handle 5V. has anyone tried it?
Is there any good level converter (chip or something like this) for 3.3 to 5V and 5V to 3.3 V (Rx and Tx) ?
Tried it and it didn't work. I must have spent at least three hours trying to get this to work and I got nothing. My phone pairs up with the HC-05, but I can't get my computer to communicate with the HC. Thank you for your tutorial, but something is wrong with somewhere along the way because a lot of us can't get it to work. Too Bad.
facing same problem ...
if anyone has solution or tips regarding this then please please reply ... !!
Milan Shah This is what ended up working, I uploaded this sketch and it configured my HC_5. I haven't tried it in a while but here it is. I also used a sketch that does pretty much the same thing for the HC_ 6.
#include
SoftwareSerial BTSerial(10, 11); // RX | TX
void setup(){
pinMode(9, OUTPUT); // this pin will pull the BT Module pin 34 (key pin) HIGH to switch module to AT mode
digitalWrite(9, HIGH);
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(9600); // your own BT Module default speed in AT command more
}
void loop(){
// Keep reading from BT Module and send to Arduino Serial Monitor
if (BTSerial.available())
Serial.write(BTSerial.read());
// Keep reading from Arduino Serial Monitor and send to BT Module
if (Serial.available())
BTSerial.write(Serial.read());
}
what mode does it come in by default?
it should be in neutral but some sellers change it to test before shipping.
my device didn´t answer back the comand lines
Source code SoftwareSerial for arduino uno?
Good stuff dude!
Hey,
Can you send me your code? For configuring UART?
you really dont need a code AT ALL, the module just needs to be in at mode thats all, once in that mode you just talk to it with those commands and thats it, i did just like so, the code just simplifies things but at the end of the day the code will be doing the same thing that you should be doing.
how to send data arduino to android
its blinking fastly even with en->pin9
nothing to do with, the fast blink is just the module looking for a paired partner in its known network.
Follow these steps EXACTLY in order to pair to the HC-05 bluetooth module. (Tip: Module must ultimately be in slave mode in order for communication to take place between devices!!!!)
1. AT
2. AT+CMODE=0
3. AT+ROLE=0
4. AT+INIT
5. AT+INQ
6. (nothing happens)
7. AT+ROLE=1
8. AT+INQ
9. Returns (MAC ADDRESS)
10. AT+ROLE=0
11. Copy and paste mac address
12. AT+BIND mac address (Example) (AT+BIND=50A4,C8,4858C3) Make sure to change your colons into commas!!!!!
13. AT+PAIR mac address (example) (AT+BIND=50A4,C8,4858C3,20) The 20 is a parameter. You need to enter this to give a timer to how long you are pairing.
14. Enter Pin = 1234 (Default pin that is automatically given)
15. Enter App Sena Bterminal
16. Go to Bluetooth management
17. Go to "Connect to"
18. Go to "select"
19. Go to Bonded Device Scan
20. Start Scan
21. Select paired Bluetooth device
22. Hit connect
23. It works!!!
MAKE SURE TO MAKE YOUR DEVICE VISIBLE WHEN YOU DO THE INQUIRY/SCAN PART!!!
Thanks!
plz give me library of hc_05 (isis)
No
Will u help me create a board ill pay you
dude.... why not show the most important step.... the wiring... some people are useless at teaching anything... they don't stop and think... why make us look somewhere else?
there's a link to a diagram