How To Configure and Pair Two HC-05 Bluetooth Module as Master and Slave | AT Commands

Поділитися
Вставка
  • Опубліковано 14 кві 2016
  • howtomechatronics.com/tutoria... ► Find more details, circuit schematics and source codes on my official website.
    In this Arduino Tutorial we will learn how to configure and pair two HC-05 Bluetooth Modules as Master and Slave devices.You can watch the following video or read the written tutorial below.
    Visit HowToMechatronics.com for more Tutorials, Tips, Projects and How It Works videos:
    ► howtomechatronics.com/
    Like my page on Facebook:
    ► / howtomechatr. .
    Add me on Google+:
    ►plus.google.com/+Howtomechatr...
    Music: Aduro by Jens Kiilstofte (machinimasound.com/music)

КОМЕНТАРІ • 253

  • @howardmooers5505
    @howardmooers5505 2 роки тому +4

    I know this video is older, but it just saved my day. This it a clear, easy-to-follow HC-05 setup tutorial. Thanks!

  • @mikelemon5109
    @mikelemon5109 8 років тому +11

    Thanks awesome video very rare unique and useful.
    Can't believe the channel doesn't get as much popularity as Great Scott!'s, keep up with the great videos.

  • @TeacherictAu
    @TeacherictAu 8 років тому +1

    Awesome and highly informative as per usual :)

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

    Awesome video mate, I think I'll be using this in a project I'm currently working on. Thanks!

  • @danielcarrillo2871
    @danielcarrillo2871 6 років тому +4

    Excelente vídeo y excelente explicación! Muchas gracias por tu aporte! Tu vídeo nos ayudo mucho en un proyecto escolar!

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

    It took lot of time for me to do this one...
    But finally worked....thanks uploaded!!!
    Regards and well wishes to you...!!!

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

    At commands to set hc05 as master and slave are very helpful. Working charm for me. Thank you

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

    Thanks so much! It helped me a lot to understand about Bluetooth device.

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

    Great video, thanks Dejan :D

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

    Keep up the good work
    Dejan

  • @jatinkathuria6102
    @jatinkathuria6102 8 років тому +2

    Hello Sir, first of all thankyou so much for a lovely explanation.
    Can you please tell me how many slaves can be connected to the master as active listeners at the same time?
    And which is the best bluetooth module with GPIOS and memory?

  • @DiyintheGhetto
    @DiyintheGhetto 6 років тому +2

    Hello is it possible to have two of the HC-05 as transmitters and one HC-05 as receiver?

  • @HamzaKhwayre
    @HamzaKhwayre Місяць тому

    Thank you i love this video soo much

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

    hi brother , thanks to your videos.. I want to ask something ,i walk on project of audio transmission using bluetooth. i use two microcontrollers thus two BTs (one slave the other is master) with audio amplfier, microphone and speaker.... can you upload a video or help with instructions about transmitter and receiver circuits

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

    could you do the same with one hc-06 and one hc-05? and if so what are the modifications in the soft/hardware?

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

    I like your work man...

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

    Hi Dejan! Great videos; love your channel! Quick question tho: what would be the most efficient way of transferring data from multiple pins on one board through the Bluetooth to the same corresponding pins on a second board?

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

    I have an application where I would like to send sync pulses at various frequencies unrelated to a particular baud rate - 5HZ or 11HZ for example instead of an RS 232 character. Would this work? Could I just pair them and then replicate random data at the other end as if I was replacing one wire with Bluetooth. Simple on an off basically.

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

    Great tutorial!! I also wanted to know how can we build piconet with this??

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

    *can i pair three or more bluetooth modules?*

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

    Hello I need help with my project, my question is can we connect bluetooth module with BASYS2 and send data via bluetooth module?

  • @user-vt1fn6um4d
    @user-vt1fn6um4d 2 роки тому +1

    As far as i see u have connected RX to TX and TX to Rx?

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

    new one to see , wow bro!!!

  • @GreatNerve
    @GreatNerve 5 років тому +1

    If I have HM10 Bluetooth Module so how use it.

  • @faresalkhawja2246
    @faresalkhawja2246 7 років тому +2

    first of all thank you for the informative video,secondly, I am using the adafruit EZ-Link Shield, does it work as a master?
    if so, how do I choose what Bluetooth device I want to connect to ?
    thank you

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

    thank you
    how to get RSSI from HC-05

  • @mauritswoudenberg
    @mauritswoudenberg 7 років тому +2

    Hi, great tutorial, thanks a lot!!!
    I'm trying to connect my HC-05 to a slightly different module: HM-10 broken out on the zs-040 board. I configured the HC-05 as master and the other one as slave. But the address the slave gives me looks quite different than in this example. It is 00:15:83:00:5E:EB. When using the AT+BIND command I get back an error (0). Do you know what I'm doing wrong?

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

      Do AT+BIND= (Address) make sure there is a space between the = and the address

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

    is it possible to put the button on the same side as the Potentiometer and the led on the servo side. how would i go about chaging the code.

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

    sir,
    I guess the resistors are labeled wrong, checked using colour band calculator which one should i go with the labeled one or the schematic??

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

    hi
    I just started searching the way to use the bluetooth module 2 days before. but when i watched your tutorial video, i learnt almost every thing, i wanted to know, just in few minutes.
    this is great and very easy to learn tutorial boss.
    i have some questions.
    if i configure 1 HC-05 as master and other HC-05 as slave on 9600 baud rate, can i use both for simple digital data communication by using both with 2 separate MCUs ?
    will these both work full duplex mode ? means if master send any data string to slave so can slave also send any data back to master?
    Thanks to help me in advance

  • @almirbajsini
    @almirbajsini 5 років тому +1

    I am trying to do the same thing with HC-12 and i dont know where to start

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

    Awesome vid! Can you have the state be anything other than 1 or 0?

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

    How do I tell if I own a hc o5 or hc 06 and I assume the 06 can only be the slave not the master ?

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

    Great video. Programmed as you showed, placed the Slave on a portable Uno and did a range test. Almost ran out of distance before I lost the link. Keep them oriented the same, as in standing up on the breadboard and don't stand between them and the 50 foot range seems to be accurate. I only needed 25 feet.
    One thing I did notice, when I asked for the UART settings it sent back 9600 even though I was communicating with the serial monitor on 38,400 to program them. It sees the 9600 only applies to the baud rate of data between the two units. That's perfect for me as well. Excellent detailed video.
    Thanks

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

    Regarding to HC-05 problems:
    My hc05 moduls does not make the 2s blinks even if they're in AT command mode. There is no visible indication. It just fast blinks like you have no connection. But if the connections are right, I can successfully use AT commands. So imho just forget about blink indication. Not every model doing that.
    Also my HC-05 moduls came with 9600 baudrate default. Also consider checking other baudrates if you can't get response from 38400. You can change it later on. "AT+UART=38400,0,0" command will put your moduls into 38400 baudrate.
    Try givining 3,3V into Enable pin instead of 5V. This could help with some models.
    After successfully solving problems and setting HC-05s, this training worked like a charm.
    Other than that; color codes on resistors are wrong but the writing is correct in the schematics. Check that if you did it wrong.

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

      I still can't get it to work though, my led is blinking slowly and I tried different baudrates, also connecting different voltages to the enable pin didn't solve it, I just don't get a response when I type AT

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

      I found the problem I forgot reopening the serial monitor

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

      i have also same problem plz help me

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

    Help are the two of my bluetooths connected? Both of them flashes once every 2 seconds? Its connected now right? I did all your steps...

  • @johnmotor3144
    @johnmotor3144 8 років тому +2

    Thank you, good tutorial. I am trying to control 10 Servo motors this way, but I am having trouble. Any advice?

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

    it is a very helpfull video. but how many motors can i control if im using arduino mega?

  • @learnings...1448
    @learnings...1448 6 років тому

    I want to control 4 servo motors from the master to the slave suing 4 potentiometer.......
    can i do it using this Bluetooth module...

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

    Is there any problem if the two modules flash at the same time or is it necessary that they do it one after the other?

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

    Hi I had following the step, the bluetooth module seen like connected, but the button-LED and the Servo Motor didn't workout

  • @l.nguyen860
    @l.nguyen860 7 років тому +1

    Thanks for the video and website.
    I read your instruction for configuring the master HC-05. Why doesn't it need the password (pin code) of the slave module ?
    Does it mean that we would need only the "address" of the slave module ?

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

    what is the largest servo i could connect to this circuit?

  • @gabrielagalindo6339
    @gabrielagalindo6339 Рік тому

    Well explained, thank you!

  • @carlosafortin
    @carlosafortin 8 років тому +1

    Great tutorial, thank you for sharing. I have a question, is that a Fritzing drawing? and if yes, where did you find the Bluetooth part? I have an HC-05 part in my library but it doesn't have the little button. Thank you.

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

      Thank you for the quick reply but I can't find it. I am referring to the Fritzing part, not the Bluetooth item itself.

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

      Sounds good, thank you.

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

    can I use a 2.2 Ohms resistor?

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

    Thank you sir for your tutorial. i followed all the steps. but i can not paired two module. Can you help me now, what can be the problem there??

  • @user-xe6kg3le1x
    @user-xe6kg3le1x 3 роки тому

    hello and thanks for a good movie. why the maping isn't to 0-180?

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

    Awesome information thank you! !

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

    Can we use amplifire bt with aurdino

  • @kayosensei
    @kayosensei 4 роки тому +2

    I cant pair my bluetooth modules since when i bind command the master bluetooth, there is a capital 'C' in the slave bluetooth's address and when i type the address with the capital 'C' it becomes small letter 'c' in the serial monitor. What's going on here? Can i change my slave's address? The 'C' doesnt stay capitalized when i set that in the bind command of the master bluetooth :/

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

    Good video, question, if I were to set CMODE=0, could I use AT+BIND to talk to more than 1 slave from the master? i.e. add 2 or more "fixed" slaves?

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

      +Taylor Schlupp Thanks Taylor, yes, I presumed you couldn't bind to different masters, once the device is paired that's usually it until you unpair it.

  • @Felipe-rw3vw
    @Felipe-rw3vw 7 років тому

    So, to have multiple slaves the only thing to do is setting “AT+CMODE” to 1 in the master?

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

    If i want to control two servo motor with two potentiometer what should be changed in the code

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

    Can you connect 2 differnt hc-05 to a single ardunio? I'm trying to send and receive data between the ardunio and my android phone?

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

    hello , I want to know how to modify the program to control three cervomotors , please help me, thanks

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

    Hi, Bro, thanks alot! I remember about 5 or 6 years ago I wasn't using Arduino, libraries etc. I was programming everything by my self. OMG, how long it take and how difficult it was to adjust 2 HC-04 modules using AVR Atmega48, assembler language, and USB-UART based on MCP 2200. I had absolutely NO KNOWLEGE how to do it. I even wasn't know how to correct write AT commands. I mean "AT+name" or "AT + name" etc. I got how to do it correct through experiments and tons of time. And now I have a choice - order these modules and spent 2-3 weeks until its arrive to me. Or take my HC-04 modules (I hope it's alive after 5 years :D), my old assembler code and rewrite it to Arduino's language)) In any case the video is pretty much useful. Good job.

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

      Lol I totally forgot what it means :D
      SB21: cpi UARTTemp,2 ;Сравнить пришедший байт с 3
      brne SB31
      ldi s,11 ;
      ldi d,11 ;
      ldi e,10 ;-
      ldi m,10 ;-
      rjmp showbatt1

      SB31: cpi UARTTemp,3
      brne SB41
      ldi s,11 ;
      ldi d,10 ;-
      ldi e,10 ;-
      ldi m,10 ;-
      rjmp showbatt1
      SB41: cpi UARTTemp,4
      brne SB51
      ldi s,10 ;-
      ldi d,10 ;-
      ldi e,10 ;-
      ldi m,10 ;-
      rjmp showbatt1

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

      i'm learning assembler but still cant interfacing bluetooth module xD

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

    Hello i have a problem, i should comunicate two module bluetooth HC-05, for pass dates of sensor d18b20, this sensor is digital?

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

    can we send array over Bluetooth connection..

  • @slgamingbro6935
    @slgamingbro6935 5 років тому +1

    good job

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

    will it connect even if the password of the slave is unkown by the master?

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

    Can I send music from my phone to one HC05, send that to another HC05, and have that HC05 send the data to a speaker?

  • @edro1128
    @edro1128 Рік тому

    Could I use several blutooth HC05 device comunicate with one master HC05 module + arcduino ? I mean, all devices on listening the master?

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

    Please help me, I want to build a device where it can connect a smartphone to play music/connect to incoming call, but the device will have two output, one to speaker (wired connection) other to connect headset(wireless connection either through Bluetooth or something else)

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

    How much range can be of hc 05

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

    HI my bluetooth module is not incuding the EN pin. Can I ignore it?

  • @PauloRicardo-pp4ml
    @PauloRicardo-pp4ml Рік тому

    I would like to create a brake light system for a motorcycle that could be activated by bluetooth where the led would be on the rider's jacket. But that didn't use a cell phone, but a button on the motorcycle's brake pedal.
    Do you have a tutorial that could help me?

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

    Nice video, But i have question how to give address to arduino as master and slave?
    because i want to use xbee to communication

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

    Thanx man.!!!!!

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

    1 master is connected to two or more slaves....? Is there any posibility...?

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

    Hello, what is the possibility of connecting 2 or more bluetooth modules to 1 only?

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

    configuration is necessary for slave mode

  • @gkhnylmz53
    @gkhnylmz53 7 років тому +3

    can i determine to auto connect 10 bluetooth module to to master ? Can i bind 10 module ? and my phone ?

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

      looking for the same setup, got any answers?

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

      @@YatenKou_jp how connect talmatry with ardunio control in led

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

    are this modules compatible BLE CC2540 CC2541with lilypad or arduino?thx

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

    Sir , can we use arduino uno rather than arduino mega board

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

    can i use HC 06 bluetooth as master and slave ?

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

    Sr. I did it. it's working for 1 button as u did but when I am using more than 1 buttons and making respective changes in programme i.e calling the both button storing it's value and then sending it to Bluetooth and then using if else loop printing it but it's not working.....
    plz give me the soln
    what should I Do??

  • @ArduBlock_Projects
    @ArduBlock_Projects Рік тому

    Круто ❤

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

    Can Arduino with blutoo find blutooth speaker?

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

    is this a full duplex?

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

    data transmission is very slow, how can we get a quick response?
    please help...

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

    Hi... default board rate of my HC-05 module is 9600,0,0. so should i need to change it to 34800. if it is yes, then how can i do it?

  • @shahnewajbd4623
    @shahnewajbd4623 4 місяці тому

    How to change AT command mode ,,, for using with phone Bluetooth

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

    Hello there I have been looking on UA-cam for hours and hours and billions and billions and billions of seconds and now I’ve found my solution thank you so much sincerely thanks

  • @fxbootstraps
    @fxbootstraps 5 років тому +6

    Anyone getting stuck - the blue green wire might be around the wrong way and they need to be attached before you start to get a response from serial monitor after uploading the blank sketch.

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

    Thanks for great explanation! But could you tell how to switch bluetooth modules from AT to Data modes back. My bluetooth modules stuck at AT modes.
    anybody knows?

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

      Just unplug it and plug it in again

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

    Can I connect the master Bluetooth with slave bluetooth also with my smart phone?

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

    so slave recive datas from master? right?

  • @minhajansari8272
    @minhajansari8272 5 років тому +7

    Solution to a problem.
    If someone is getting the getsync() error like I did, it's because you HAVE to remove the wires from tx and rx pins on the arduino before uploading the blank code. Then you may attach them.

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

    I have a couple "master" modules that plug into the Windows USB (CP2102 + HC-05-USB / HC-06-USB).. and while Windows is able to open the COM port associated to the HC-05/HC-06, the Android phone sees the bluetooth device, but is not able to connect/pair!

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

    how would i set up 2 servos and 2 potentiometers? do i add a different angle or just connect it to a different pin?

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

      use the same code
      potValue = analogRead(A0);
      int potValueMapped = map(potValue, 0, 1023, 0, 255);
      Serial.write(potValueMapped); // Sends potValue to servo motor
      delay(10);
      but double it, like this
      potValue1 = analogRead(A0);
      potValue2 = analogRead(A1);
      int potValue1Mapped = map(potValue1, 0, 1023, 0, 255);
      int potValue2Mappes = map(potValue2, 0, 1023, 0, 255);
      Serial.write(potValue1Mapped); // Sends potValue1 to servo motor
      1
      delay(10);
      Serial.write(potValue2Mapped); // Send potValue2 to servo motor 2
      delay(10);

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

      and for the slave side you would do the same just with the servos

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

    Will this work on lilypad? if not which does? thx

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

    sir thanks for make this video is very useful.
    sir pliss make video about send multiple data through bluetooth between arduino and arduino. thanks sir

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

    can use hc 06 ?

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

    How many devices can be connected to one HC-05 module?

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

    So have gotten to the AT command mode as indicated by the light but it wont take any commands ?

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

      Same ...

    • @Greg-kn9sv
      @Greg-kn9sv 3 роки тому

      Also same. Just a blank screen on the serial monitor

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

    Can I use this for two HC-06 module ? these command don't work , and if not ,is there another code to pair two of hc-06 ? or I must buy hc-05 ??

    • @Brian-sw6tp
      @Brian-sw6tp 5 років тому

      hc-06 are slave only modules - you need either both hc-05 or one of each hc-05 and one hc-06

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

    I have one question, Every single module Bluetooth has a single direction or u can find 2 modules with the same direction?

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

      What do you mean? In the AT mode, you can make one moulde slave; thus making a 2 way communication.

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

    hi, can we use utrasonic sensor in this project?

  • @drewhering1402
    @drewhering1402 Рік тому

    how do I send multiple signals from the master to the slave. For example, Joystick X and Y value + potentiometer + pushbuttons without getting signal interference. I am trying to make a bluetooth controlled car. But it seems like the signals are digital 0 and 1. Because whenever I send a number greater than 1 it is still interpreted as 1 by the slave. Any ideas?

    • @drewhering1402
      @drewhering1402 Рік тому

      I figured it out. You can send char commands from master to slave