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

  Переглядів 335,589

How To Mechatronics

How To Mechatronics

День тому

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)

КОМЕНТАРІ: 251
@howardmooers5505
@howardmooers5505 Рік тому
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 років тому
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.
@rhythms7500
@rhythms7500 4 роки тому
It took lot of time for me to do this one... But finally worked....thanks uploaded!!! Regards and well wishes to you...!!!
@aiden287
@aiden287 7 років тому
Awesome video mate, I think I'll be using this in a project I'm currently working on. Thanks!
@AnkitkumarChheda
@AnkitkumarChheda 7 років тому
At commands to set hc05 as master and slave are very helpful. Working charm for me. Thank you
@TeacherictAu
@TeacherictAu 8 років тому
Awesome and highly informative as per usual :)
@danielcarrillo2871
@danielcarrillo2871 6 років тому
Excelente vídeo y excelente explicación! Muchas gracias por tu aporte! Tu vídeo nos ayudo mucho en un proyecto escolar!
@jatinkathuria6102
@jatinkathuria6102 8 років тому
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?
@swarmrobotics
@swarmrobotics 7 років тому
Keep up the good work Dejan
@gumingu2142
@gumingu2142 3 роки тому
Thanks so much! It helped me a lot to understand about Bluetooth device.
@DiyintheGhetto
@DiyintheGhetto 6 років тому
Hello is it possible to have two of the HC-05 as transmitters and one HC-05 as receiver?
@dp0813
@dp0813 6 років тому
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?
@imadeamistake1403
@imadeamistake1403 3 роки тому
you could use the SoftwareSerial.h library
@itmaster9247
@itmaster9247 7 років тому
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
@user-vt1fn6um4d
@user-vt1fn6um4d 2 роки тому
As far as i see u have connected RX to TX and TX to Rx?
@ruitfsilva
@ruitfsilva 8 років тому
Great video, thanks Dejan :D
@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?
@edro1128
@edro1128 Рік тому
Could I use several blutooth HC05 device comunicate with one master HC05 module + arcduino ? I mean, all devices on listening the master?
@yuby985
@yuby985 7 років тому
I like your work man...
@nimishjoshi1420
@nimishjoshi1420 5 років тому
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??
@XRushaX
@XRushaX 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
@gabrielagalindo6339
@gabrielagalindo6339 Рік тому
Well explained, thank you!
@HowToMechatronics
@HowToMechatronics Рік тому
Glad it was helpful!
@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
@oadamo
@oadamo 3 роки тому
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.
@nemobondt9117
@nemobondt9117 7 років тому
could you do the same with one hc-06 and one hc-05? and if so what are the modifications in the soft/hardware?
@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?
@faresalkhawja2246
@faresalkhawja2246 7 років тому
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
@srinjoymandal458
@srinjoymandal458 4 роки тому
no
@Corbraandrewtatemindset
@Corbraandrewtatemindset 5 років тому
Hello there I have been looking on UKposts 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
@HowToMechatronics
@HowToMechatronics 5 років тому
I'm glad you found this video useful. Thanks!
@carlosafortin
@carlosafortin 7 років тому
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 7 років тому
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 7 років тому
Sounds good, thank you.
@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 2 роки тому
Great tutorial!! I also wanted to know how can we build piconet with this??
@l.nguyen860
@l.nguyen860 7 років тому
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 ?
@l.nguyen860
@l.nguyen860 7 років тому
Never mind. I got it.
@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?
@GCKteamKrispy
@GCKteamKrispy 5 років тому
*can i pair three or more bluetooth modules?*
@ERadicator49
@ERadicator49 4 роки тому
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 4 роки тому
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
@adityakumarraj827
@adityakumarraj827 3 роки тому
Can we use amplifire bt with aurdino
@mauritswoudenberg
@mauritswoudenberg 7 років тому
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
@kayosensei
@kayosensei 4 роки тому
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...
@berhanbekele8998
@berhanbekele8998 5 років тому
it is a very helpfull video. but how many motors can i control if im using arduino mega?
@kayosensei
@kayosensei 4 роки тому
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.
@rickybates2844
@rickybates2844 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
@brightideas5782
@brightideas5782 3 роки тому
Awesome information thank you! !
@HowToMechatronics
@HowToMechatronics 3 роки тому
Glad it was helpful!
@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 ?
@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
@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...
@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?
@mcm1322
@mcm1322 Рік тому
Awesome vid! Can you have the state be anything other than 1 or 0?
@johnmotor3144
@johnmotor3144 7 років тому
Thank you, good tutorial. I am trying to control 10 Servo motors this way, but I am having trouble. Any advice?
@mahmudulislam2077
@mahmudulislam2077 6 років тому
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??
@_Mqube
@_Mqube 8 років тому
new one to see , wow bro!!!
@carlosorlandovergaratorres2067
@carlosorlandovergaratorres2067 4 роки тому
Hello, what is the possibility of connecting 2 or more bluetooth modules to 1 only?
@mahdizayet4011
@mahdizayet4011 2 роки тому
If i want to control two servo motor with two potentiometer what should be changed in the code
@diddlybibble7837
@diddlybibble7837 4 роки тому
what is the largest servo i could connect to this circuit?
@FERRARI141082
@FERRARI141082 7 років тому
Hello i have a problem, i should comunicate two module bluetooth HC-05, for pass dates of sensor d18b20, this sensor is digital?
@shubhamdhiman7516
@shubhamdhiman7516 7 років тому
Sir , can we use arduino uno rather than arduino mega board
@user-xe6kg3le1x
@user-xe6kg3le1x 2 роки тому
hello and thanks for a good movie. why the maping isn't to 0-180?
@serpescuato
@serpescuato 7 років тому
are this modules compatible BLE CC2540 CC2541with lilypad or arduino?thx
@sairampilli4951
@sairampilli4951 5 років тому
1 master is connected to two or more slaves....? Is there any posibility...?
@prov_s195
@prov_s195 2 роки тому
so slave recive datas from master? right?
@obtron
@obtron 6 років тому
will it connect even if the password of the slave is unkown by the master?
@Xwicho
@Xwicho 8 років тому
hello , I want to know how to modify the program to control three cervomotors , please help me, thanks
@michaelquinn1926
@michaelquinn1926 3 роки тому
hi, can we use utrasonic sensor in this project?
@xboxgamer9216
@xboxgamer9216 3 роки тому
Yes
@carloscorazon7097
@carloscorazon7097 4 роки тому
can I use a 2.2 Ohms resistor?
@jessyvillagomez2514
@jessyvillagomez2514 2 роки тому
Did you use Arduino Uno's?
@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
@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??
@GreatNerve
@GreatNerve 5 років тому
If I have HM10 Bluetooth Module so how use it.
@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
@vickyjaiswal5817
@vickyjaiswal5817 3 роки тому
data transmission is very slow, how can we get a quick response? please help...
@chirenmoore6559
@chirenmoore6559 6 років тому
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?
@MathewPanicker1010
@MathewPanicker1010 5 років тому
No
@MabitselaD
@MabitselaD 4 роки тому
is this a full duplex?
@darthanakin3463
@darthanakin3463 2 роки тому
does this code work with HC 06?
@robotic1248
@robotic1248 7 років тому
HI my bluetooth module is not incuding the EN pin. Can I ignore 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?
@jatinkadge7297
@jatinkadge7297 6 років тому
can we send array over Bluetooth connection..
@shahnewajbd4623
@shahnewajbd4623 Місяць тому
How to change AT command mode ,,, for using with phone Bluetooth
@fajnynick5370
@fajnynick5370 2 роки тому
hi i have problem with HC-05. I did everything as in the movie, I was able to connect, but when I send information on master, I always get 248 on the slave. What's the cause?
@imeshnirangana2487
@imeshnirangana2487 6 років тому
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?
@abdulazizalosaimi7079
@abdulazizalosaimi7079 7 років тому
Hello ms.nedelkovskiI have question I have project Two circuit First Arduino and ultrasonics sensor and Bluetooth Second lcd and Bluetooth I want connect between them send data from ultrasonic circuit 1 two lcd circuit two Can you help me how can I do it?
@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
@almirbajsini
@almirbajsini 4 роки тому
I am trying to do the same thing with HC-12 and i dont know where to start
@ranner3
@ranner3 4 роки тому
Question, ur mac address seem to have format xxxx.xx.xxxxxx When i check mac address on my modules its like xx.x.xxxxxx why is that? Are there 0 digits hidden or is something wrong? Thanks.
@gkhnylmz53
@gkhnylmz53 7 років тому
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 3 роки тому
@@YatenKou_jp how connect talmatry with ardunio control in led
@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)
@yoviesigit5292
@yoviesigit5292 6 років тому
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
@slgamingbro6935
@slgamingbro6935 5 років тому
good job
@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!
@vipulkamble9702
@vipulkamble9702 7 років тому
configuration is necessary for slave mode
@munch15a
@munch15a 6 років тому
So have gotten to the AT command mode as indicated by the light but it wont take any commands ?
@nydery9063
@nydery9063 3 роки тому
Same ...
@Greg-kn9sv
@Greg-kn9sv 3 роки тому
Also same. Just a blank screen on the serial monitor
@marcost2040
@marcost2040 4 роки тому
Hey does anyone know what the name of the piece is that shows up on the far right at 0:53 and in the middle at 5:00 in the schematics? There aren't any wires connecting to it, so I'm confused as to what it is and whether it's necessary.
@njtexit8
@njtexit8 4 роки тому
That is a zoom in view showing the HC-05's pins. It is not a part.
@govorilegko
@govorilegko 7 років тому
thank you how to get RSSI from HC-05
@mohansangroula6633
@mohansangroula6633 6 років тому
How much range can be of hc 05
@bibhutibhusanbehera5160
@bibhutibhusanbehera5160 5 років тому
Can I connect the master Bluetooth with slave bluetooth also with my smart phone?
@imadeamistake1403
@imadeamistake1403 3 роки тому
yes
@nikadugashvili3811
@nikadugashvili3811 5 років тому
can i use HC 06 bluetooth as master and slave ?
@fxbootstraps
@fxbootstraps 5 років тому
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.
@anirudhsoni6529
@anirudhsoni6529 2 роки тому
ja n lawede
@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.
@Delorean29
@Delorean29 4 роки тому
Can Arduino with blutoo find blutooth speaker?
@venkatyalamati3285
@venkatyalamati3285 11 місяців тому
Thanks for the video sir.... Plz make a video on how to store the data received from Arduino (analog read data via Bluetooth) to a text file and store the text file in a shared folder like Documents folder of internal storage... I am trying for this but not successful...
@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 3 роки тому
Just unplug it and plug it in again
@serpescuato
@serpescuato 7 років тому
Will this work on lilypad? if not which does? thx
Bluetooth HC-05 Modules - How to PAIR & Transmit/Receive  DATA
18:32
Saravanan AL
Переглядів 112 тис.
MICHIEL VS JUVENTUS WOMEN 🙈📏
00:26
Celine Dept
Переглядів 52 млн
#196 Two-Way Bluetooth Serial Comms for Arduino and other µControllers
28:33
Configure HC05 in Master Slave mode in 6 min
5:51
techiesms
Переглядів 24 тис.
Arduino Joystick Control Bluetooth Car Using HC-05 Master and Slave
8:13
Aslam Hossain
Переглядів 2,8 тис.
Arduino Communication between HC05 Bluetooth Module as Master & Slave
5:32
Bluetooth 2.0 VS Bluetooth 4.0 (BLE) || Is an Upgrade worth it?
7:54
GreatScott!
Переглядів 594 тис.
Harmonic vs Cycloidal Drive - Torque, Backlash and Wear Test
21:23
How To Mechatronics
Переглядів 1,7 млн
STM32 Communication using Bluetooth Modules || HC-05
16:21
ControllersTech
Переглядів 7 тис.