How To Configure and Pair Two HC-05 Bluetooth Module as Master and Slave | AT Commands
HTML-код
- Опубликовано: 14 окт 2024
- howtomechatron... ► 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:
► howtomechatron...
Like my page on Facebook:
► / howtomechatr. .
Add me on Google+:
►plus.google.co....
Music: Aduro by Jens Kiilstofte (machinimasound.com/music)
I know this video is older, but it just saved my day. This it a clear, easy-to-follow HC-05 setup tutorial. Thanks!
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.
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
I found the problem I forgot reopening the serial monitor
i have also same problem plz help me
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.
Hello is it possible to have two of the HC-05 as transmitters and one HC-05 as receiver?
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?
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.
As far as i see u have connected RX to TX and TX to Rx?
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
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
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?
you could use the SoftwareSerial.h library
Awesome vid! Can you have the state be anything other than 1 or 0?
At commands to set hc05 as master and slave are very helpful. Working charm for me. Thank you
Excelente vídeo y excelente explicación! Muchas gracias por tu aporte! Tu vídeo nos ayudo mucho en un proyecto escolar!
It took lot of time for me to do this one...
But finally worked....thanks uploaded!!!
Regards and well wishes to you...!!!
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 ?
Never mind. I got it.
Great tutorial!! I also wanted to know how can we build piconet with this??
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.
Thank you for the quick reply but I can't find it. I am referring to the Fritzing part, not the Bluetooth item itself.
Sounds good, thank you.
Thank you i love this video soo much
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
no
Thanks so much! It helped me a lot to understand about Bluetooth device.
Awesome video mate, I think I'll be using this in a project I'm currently working on. Thanks!
Awesome and highly informative as per usual :)
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
Thank you, good tutorial. I am trying to control 10 Servo motors this way, but I am having trouble. Any advice?
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?
Do AT+BIND= (Address) make sure there is a space between the = and the address
Hello there I have been looking on RUclips 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
I'm glad you found this video useful. Thanks!
Well explained, thank you!
Glad it was helpful!
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.
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
i'm learning assembler but still cant interfacing bluetooth module xD
Keep up the good work
Dejan
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?
+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.
Could I use several blutooth HC05 device comunicate with one master HC05 module + arcduino ? I mean, all devices on listening the master?
I like your work man...
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 :/
Awesome information thank you! !
Glad it was helpful!
hello and thanks for a good movie. why the maping isn't to 0-180?
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...
Great video, thanks Dejan :D
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.
ja n lawede
Круто ❤
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?
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??
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.
it is a very helpfull video. but how many motors can i control if im using arduino mega?
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?
Hello sir, my module is blinking at a proper rate of 2 sec, but when I am giving the AT commands on the serial monitor, there is no response on the monitor. What can be the possible mistake?
@Electronica para todosPress enter ( AT command ) while pressing the button in hc-05
Switch the RX and TX pins in the video they are wrong on the picture but right when he says
@@bbbbsammich910 none of those methods work..
@Blender Tutorials by AMK Guys. If you have chinese clone arduino, It wont work because it communicates differently as original one does. If you try loopback on TXD and RXD, it wont work. Idk why but yeah...
i have same problem for my hc05 not cominicate with serialport. just cant see AT commands. i tried any baudrate, TX-Rx pin, any voltage divider and otherthing. Serialport exactly working but no reaction from bluetooth module!!
could you do the same with one hc-06 and one hc-05? and if so what are the modifications in the soft/hardware?
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.
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??
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?
*can i pair three or more bluetooth modules?*
Hello I need help with my project, my question is can we connect bluetooth module with BASYS2 and send data via bluetooth module?
Hello, what is the possibility of connecting 2 or more bluetooth modules to 1 only?
I have one question, Every single module Bluetooth has a single direction or u can find 2 modules with the same direction?
What do you mean? In the AT mode, you can make one moulde slave; thus making a 2 way communication.
Can I use master/slave mode with two different models arduino boards? For example if I have an Arduino Mega 2560 can I set It as Master and an Arduino Uno R3 as slave?
I currently have my Mega2560 R3 connected via HC-05 to my UNO, Yes.
Nice video, But i have question how to give address to arduino as master and slave?
because i want to use xbee to communication
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...
Hi, I need to put a transmitter on the collar of my dog, so when he barks it would trigger a device in the house. I also need to keep track of the barks on an app on my phone that I will later make. What technology do you recommend? How? Thank you so much.
you would need the bluetooth module of course, and a microphone that detects if your dog barks. In the code you can say when the microphone detects a high enough sound, it will send a signal to your phone. And the app on your phone can track how many times this signal is sent, and when it is recived it can sound a buzzer or something
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?
No
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 ??
hc-06 are slave only modules - you need either both hc-05 or one of each hc-05 and one hc-06
can i determine to auto connect 10 bluetooth module to to master ? Can i bind 10 module ? and my phone ?
looking for the same setup, got any answers?
@@YatenKou_jp how connect talmatry with ardunio control in led
So have gotten to the AT command mode as indicated by the light but it wont take any commands ?
Same ...
Also same. Just a blank screen on the serial monitor
Can we use amplifire bt with aurdino
If i want to control two servo motor with two potentiometer what should be changed in the code
are this modules compatible BLE CC2540 CC2541with lilypad or arduino?thx
connect arduino tx to bt tx and arduino rx to bt rx, power up arduino while pressing the button in bt module, open serial com set the baudrate to 38400 and Both NL and CR
This will workin some BT module version
data transmission is very slow, how can we get a quick response?
please help...
So, to have multiple slaves the only thing to do is setting “AT+CMODE” to 1 in the master?
I want to control 4 servo motors from the master to the slave suing 4 potentiometer.......
can i do it using this Bluetooth module...
Hello i have a problem, i should comunicate two module bluetooth HC-05, for pass dates of sensor d18b20, this sensor is digital?
Did you use Arduino Uno's?
what is the largest servo i could connect to this circuit?
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 ?
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?
Just unplug it and plug it in again
Please give tutorials on the RFID MFRC522 13.56MHz Module and Arduino Ethernet Shield WizNet W5100.
can you plz make a robotic arm project ?? they dont exist on youtube it will be new and awsome !!
wow !! great ! I would like to create two bluetooth stations, one that starts a timer on the smartphone and the other blocking it .. is it possible ?
😊
will it connect even if the password of the slave is unkown by the master?
hi, can we use utrasonic sensor in this project?
Yes
Hi I had following the step, the bluetooth module seen like connected, but the button-LED and the Servo Motor didn't workout
good job
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?
I figured it out. You can send char commands from master to slave
how would i set up 2 servos and 2 potentiometers? do i add a different angle or just connect it to a different pin?
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);
and for the slave side you would do the same just with the servos
Sir , can we use arduino uno rather than arduino mega board
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?
so slave recive datas from master? right?
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??
Good day! How to send different data (Example: temp and humidity) to the slave arduino, one at a time? Hope you can help me :)
in the master code change what is being written to serial. For example instead of the normal
potValue = analogRead(A0);
int potValueMapped = map(potValue, 0, 1023, 0, 255);
Serial.write(potValueMapped); // Sends potValue to servo motor
delay(10);
you can change it to
humidity = digitalRead(pin the sensor is on);
temp = digitalRead(Pin the sensor is on);
Serial.write(temp);
delay(10);
Serial.write(humidity);
delay(10);
and then make the change on the slave side as well
Paired but slave get nothing..
Slave doesn't shows output in serial monitor.
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!
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?
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
Can I connect the master Bluetooth with slave bluetooth also with my smart phone?
yes
1 master is connected to two or more slaves....? Is there any posibility...?
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?
hello , I want to know how to modify the program to control three cervomotors , please help me, thanks
Thanx man.!!!!!
Thank you for this tutorial. Can you please help me understand why can't I enter the command mode? My HC06 seems to be a knock-off, it does not have the reset button like the one yours has. Anyways, I would appreciate any tips on this. Thanks!
There is likely an issue with your enable pin. It isn’t often actually soldered to the corresponding input on the Bluetooth chip from factory.
new one to see , wow bro!!!
I am trying to do the same thing with HC-12 and i dont know where to start
can i use this code with HC-12 modules or what should i need to change in this code to use with HC-12 modules
The same code won't work, but I do have a separate HC-12 module tutorial so you can check that out.
Please ,can you give me a code to use with hc-12 modules like this, i need to control drone gimbal roll.then we cam add gimbals to toy grade drone too.please give me a code or do a tutorial ,it will be very helpful to drone fans.