Configuring The HC-05 Bluetooth Module with AT Commands

Поділитися
Вставка
  • Опубліковано 2 жов 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...

КОМЕНТАРІ • 119

  • @thibaultdenoix1763
    @thibaultdenoix1763 6 років тому +27

    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

    • @filipurbanek3797
      @filipurbanek3797 4 роки тому +1

      THANK YOU !!!!!!!!!!!!!!!!!!!! U saved me 2 hrs of my life.

    • @kokilareddy4745
      @kokilareddy4745 4 роки тому

      THANKS Lad

    • @chrisb.9865
      @chrisb.9865 4 роки тому

      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.

    • @anfilshajo5958
      @anfilshajo5958 4 роки тому +1

      Thanku bro.
      You actually saved my time

    • @edwardcox7169
      @edwardcox7169 4 роки тому

      TKS BRO

  • @steveclauter6802
    @steveclauter6802 9 років тому

    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!

  • @laurissilmanovics7566
    @laurissilmanovics7566 2 роки тому

    Liels paldies. visu izmēģināju ar savu moduli. Palīdzēja tikai jūsu palīdzība.

  • @mrunalshinde6589
    @mrunalshinde6589 7 років тому +9

    when I send AT there is no response from the module?

  • @dariusg5515
    @dariusg5515 7 років тому +13

    why not just turn the hc-05 around so we can see the wiring?

    • @timlucas143
      @timlucas143 4 роки тому +4

      Why not just click the link in the desciption where it is all documented in a propper diagram?

  • @kev4yala
    @kev4yala 5 років тому

    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

  • @robinjain12
    @robinjain12 10 років тому +3

    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...????

  • @janintelkor
    @janintelkor 8 років тому +5

    To fix red light blink:
    Disconnect hc-05
    HOLD small button, connnect
    In serial monitor set BOTH NL and CR
    baudrate 38400

  • @nappychef35
    @nappychef35 8 років тому +3

    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.

  • @Softwarekitchen
    @Softwarekitchen 10 років тому +8

    i did all steps 5 times, but it doesnt answer my at command

  • @amitamittal1978
    @amitamittal1978 4 роки тому +1

    In my case the led of module is start but do not blink please help me

    • @arletpaz8010
      @arletpaz8010 3 роки тому

      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

  • @hmbitar6164
    @hmbitar6164 11 років тому

    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.

  • @w0083e5c
    @w0083e5c 10 років тому +14

    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.

    • @thestrokes67
      @thestrokes67 10 років тому

      Thanks man, u r so awesome.

    • @DushanAPatabendige
      @DushanAPatabendige 9 років тому

      Nasen Bär Thanks man, You saved us! We spent almost 24 hours with this issue

    • @archyada
      @archyada 8 років тому

      Thanks man...really appreciate it. It should've been pointed out in the instructions itself.

    • @dhruvapandey17
      @dhruvapandey17 7 років тому

      Thanks man .. you really saved me. Wasted whole day

    • @kennyhubbell813
      @kennyhubbell813 6 років тому

      You're a legend

  • @abpccpba
    @abpccpba 4 роки тому +1

    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.

  • @williammann6198
    @williammann6198 10 років тому

    Thank you for making this video!

  • @dejnol93
    @dejnol93 9 років тому +2

    Hi, in my case, the solution of getting into AT mode was to change wiring i.e.Rx-Rx and Tx-Tx

    • @GlennnD
      @GlennnD 6 років тому

      Had the same problem and now it works!

    • @kokilareddy4745
      @kokilareddy4745 4 роки тому

      @@GlennnD how did you make it work

  • @codexrat
    @codexrat 2 роки тому

    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

  • @kithuatvasangtao121
    @kithuatvasangtao121 4 роки тому +1

    can you for me ask,why do i sent a singnal to arduino but no answer for hc05,thank you

    • @arletpaz8010
      @arletpaz8010 3 роки тому

      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.

  • @musicFreeverse
    @musicFreeverse 2 роки тому

    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

  • @MPElectronique
    @MPElectronique 9 років тому +7

    Hi. The red led is blinking all the time :( what's happening ? :(

    • @eduhza
      @eduhza 9 років тому +1

      +Marc Paradis got the answer? I have the same problem, It appers "Enter AT commands:",but when I type nothing happens

    • @viniciusmonteiro2538
      @viniciusmonteiro2538 8 років тому

      +Augustin Charles-Hermans Thank you!

    • @SlayKernels
      @SlayKernels 8 років тому

      +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?

    • @NamanJhawaralpha
      @NamanJhawaralpha 8 років тому

      +Augustin Charles-Hermans Hey, I tried doing what you said. But it still doesn't work. Plz suggest.
      Thanks.

    • @TheCarloszoom3000
      @TheCarloszoom3000 8 років тому

      +Augustin Charles-Hermans Thank you man. I just did like you said and it worked for me.
      Regards,

  • @munch15a
    @munch15a 7 років тому +1

    hey uve gotten it into command mode but it wont acsspet any commands ?

  • @arletpaz8010
    @arletpaz8010 3 роки тому

    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.

  • @steve8939123
    @steve8939123 9 років тому +1

    Great video and instruction. Can I use the HC-06 in place of the HC-05 you are using?

  • @anipjuaini3835
    @anipjuaini3835 9 років тому +2

    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

    • @ariellevy7009
      @ariellevy7009 9 років тому +1

      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

    • @hjhjhj5934
      @hjhjhj5934 3 роки тому

      @@ariellevy7009 this is still not working 😕😕

  • @kquttersanford3635
    @kquttersanford3635 9 років тому +1

    No

  • @dhruvapandey17
    @dhruvapandey17 7 років тому

    One IMPORTANT thing, Newline feed (
    ) and Carriage return (
    ) are needed on every AT command entered .... Credit to @Nasen Bar

  • @mrunalshinde6589
    @mrunalshinde6589 7 років тому

    is the potential divider necessary?

  • @ClearNinjaFox
    @ClearNinjaFox 8 років тому

    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

  • @lucasvoichick2157
    @lucasvoichick2157 4 роки тому

    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

  • @Loundre3
    @Loundre3 6 років тому +1

    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.
    ua-cam.com/video/x3KAXjnP06o/v-deo.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.

  • @FrankLopezx
    @FrankLopezx 8 років тому

    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");

  • @aitorsierra
    @aitorsierra 11 років тому

    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.

  • @christianromero7982
    @christianromero7982 3 роки тому

    my device didn´t answer back the comand lines

  • @technomaniac6822
    @technomaniac6822 8 років тому

    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.

  • @SusanAmberBruce
    @SusanAmberBruce 3 роки тому

    I like your video, hope you are well

  • @caribbeanchild
    @caribbeanchild 5 років тому

    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?

  • @ashishsahu1069
    @ashishsahu1069 9 років тому

    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.

  • @dalmatino04
    @dalmatino04 8 років тому

    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?

  • @jaysunx1
    @jaysunx1 4 роки тому

    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??

    • @arletpaz8010
      @arletpaz8010 3 роки тому

      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

  • @sainathreddy753
    @sainathreddy753 9 років тому

    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

  • @TeddyKrimsony
    @TeddyKrimsony 7 років тому

    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??

  • @MikevomMars
    @MikevomMars 3 роки тому

    Where is the ORANGE wire going to that you never mentioned in the video??

    • @arletpaz8010
      @arletpaz8010 3 роки тому

      just go to the link below is more detailed there

  • @AsadAliP
    @AsadAliP 9 років тому

    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??

  • @ricardovalle2757
    @ricardovalle2757 3 роки тому

    I was struggling with this, but your video solve my problem. Thanks

  • @viankaleighpatron5950
    @viankaleighpatron5950 8 років тому

    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.

  • @pabloav903
    @pabloav903 11 років тому

    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?

  • @hmbitar6164
    @hmbitar6164 11 років тому

    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

  • @rockamania7
    @rockamania7 4 роки тому

    Thank you very much! But in your instructions the " " for the PSWD change are missing.

  • @mohamedmounir1886
    @mohamedmounir1886 7 років тому

    the black wire connected with what port in bluetooth to what port in arduino ??

  • @teamdictionary2412
    @teamdictionary2412 10 років тому

    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!!!

    • @teamdictionary2412
      @teamdictionary2412 10 років тому

      MAKE SURE TO MAKE YOUR DEVICE VISIBLE WHEN YOU DO THE INQUIRY/SCAN PART!!!

  • @GabrielSousa
    @GabrielSousa 10 років тому

    only with arduino i can send AT commands ? with a serial 2 usb dont work ?

  • @MohamedFazilsulaiman
    @MohamedFazilsulaiman 8 років тому

    What should the baudrate be set in the serial monitor.

  • @zahed.ice14
    @zahed.ice14 4 роки тому

    many many thanks dear. It helps me a lot

  • @kokilareddy4745
    @kokilareddy4745 4 роки тому

    its blinking fastly even with en->pin9

    • @arletpaz8010
      @arletpaz8010 3 роки тому

      nothing to do with, the fast blink is just the module looking for a paired partner in its known network.

  • @vpat_patv
    @vpat_patv 10 років тому

    is it possible to pair 2 hc 05's ? if so please help

  • @arismunandar512
    @arismunandar512 9 років тому

    Source code SoftwareSerial for arduino uno?

  • @TheTmrgnc
    @TheTmrgnc 9 років тому

    hi
    Where can I find the program that is used in this video

  • @rifathshaarook1030
    @rifathshaarook1030 10 років тому

    what happened to the crystal of your arduino ?

  • @antoniobugarin
    @antoniobugarin 10 років тому

    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.

    • @milan_shah
      @milan_shah 9 років тому

      facing same problem ...
      if anyone has solution or tips regarding this then please please reply ... !!

    • @antoniobugarin
      @antoniobugarin 9 років тому

      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());
      }

  • @nobrief
    @nobrief 7 років тому

    thanks for the video and tutorial with the code. It has helped me a lot.

  • @tarektaamali7392
    @tarektaamali7392 8 років тому

    how to send data arduino to android

  • @DariusJones
    @DariusJones 11 років тому

    Are you doing a project like this?

  • @Create_o_raptor
    @Create_o_raptor 7 років тому

    what mode does it come in by default?

    • @arletpaz8010
      @arletpaz8010 3 роки тому

      it should be in neutral but some sellers change it to test before shipping.

  • @VladyVeselinov
    @VladyVeselinov 8 років тому

    Good stuff dude!

  • @johngonsalves5268
    @johngonsalves5268 7 років тому

    Thanks!

  • @SirArghPirate
    @SirArghPirate 9 років тому

    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.

  • @VirendraSharmaviru9990
    @VirendraSharmaviru9990 9 років тому

    what is the need to create a voltage divider between arduino and this BT module?

    • @madeshb7171
      @madeshb7171 9 років тому

      Since the voltage levels are different for these devices. Arduino High = 5V while for BT module it's 3.3V.

    • @mojo3398
      @mojo3398 9 років тому

      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?

  • @ohthetrivia
    @ohthetrivia 6 років тому

    Hey,
    Can you send me your code? For configuring UART?

    • @arletpaz8010
      @arletpaz8010 3 роки тому

      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.

  • @mariemsoserel4674
    @mariemsoserel4674 7 років тому +1

    plz give me library of hc_05 (isis)

  • @aitorsierra
    @aitorsierra 11 років тому

    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) ?

  • @rarevisionfxproductions5895
    @rarevisionfxproductions5895 9 років тому

    Will u help me create a board ill pay you