Jan 06 2013

Getting Bluetooth modules talking to each other

Before we start, please note that most Apple devices don’t support the virtual serial link profile that these modules use.

A really easy method of making your projects wireless is to use serial Bluetooth modules, these modules take standard serial data and transparently transmit it via Bluetooth to another connected Bluetooth module, no extra code is needed.

Adding Bluetooth to your project so it can be controlled by your phone is easy, just plugging in a slave module and connecting to it from your phone is all it takes, but getting 2 modules to communicate with each other is a bit trickier.

What you need to know
Bluetooth works by having a slave and a master. The slave modules can not initiate a connection to another Bluetooth device, but can accept connections, the master can be be set to either master or slave mode, when in master mode the module can initiate a connection to other devices. Be sure not to make the mistake of buying 2 slaves like I did! 2 masters or 1 master and 1 slave is what you need.
Sometimes eBay sellers don’t put much information about their module, to find out if its a slave or master check the following:

  Slave Master
Number of pins 4 6
Firmware Linvor 1.5 or HC06 HC05

The master modules (~£8) are usually a little bit more expensive than the slave modules (~£6).


The modules contain 2 parts, the back plane and the main Bluetooth board. The main Bluetooth part of the module is designed for 3.3V, the back plane board has a 3.3V regulator built in so supplying 5V for power is fine, but there is no level conversion for the serial data, you probably don’t need to level convert the output (TXD) data since most 5V controllers see 3.3V as high, but the serial input (RXD) does need conversion, a voltage divider or resistor and zener diode will do the job.

Divider Zener
bt_res_div bt_zener

To configure the modules you will need a USB to serial converter, search for CP2102 on eBay or DealExtreme and you should be able to find them for less than £2, I’d recommend you get 2 so you can have both slave and master connected to your computer at the same time, make sure at least one of the converters has a 3.3V out as well as 5V out.

Connect the serial converter and Bluetooth modules like so:

Module Converter

The serial converters usually use 3.3V signaling for serial, so no level conversion needed.
You will need a serial console program, I use RealTerm.

The slave module can be configured whenever no other BT devices are connected to it, the default baud rate is 9600, no parity, 8 data bits, 1 stop bit. Once you’ve opened the COM port in your serial console, type AT, the module should reply back with OK.
The timing of sending characters is important, if you type too slow the module won’t recognise the command, it will see it as 2 separate commands A and T, its probably best to copy & paste.
To check the firmware copy & paste AT+VERSION and it should respond with OKLinvor1.5.


Set PIN:

There are only a few available commands for slave modules –

Command Info
AT+BAUD<setting> Set baud rate
1 – 1200
2 – 2400
3 – 4800
4 – 9600
5 – 19200
6 – 38400
7 – 57600
8 – 115200
9 – 230400
A – 460800
B – 921600
C – 1382400
AT+NAME<name> Name – Max 20 characters
AT+PIN<number> PIN – 4 digit number

Master (and master as a slave)
Configuring the master is a little different from the slave, there are 2 ways to put the module into AT mode:

Method 1

  • Turn off module
  • Connect the key pin on the module to 3.3V on the serial converter
  • Turn on module

The baud rate will always be 38400 with this method, the module must also be power cycled to get back into normal mode.

Method 2

  • Turn on module
  • Connect the key pin on the module to 3.3V on the serial converter

The baud rate will be whatever it’s configured to, default 9600, the module can be put in and out of AT mode without being power cycled.

Quick Check
The timing of commands doesn’t matter with the master modules, instead you need to end each command by pressing the enter key (\r\n), sometimes the response will be continually repeated, pressing enter again will stop it.
Entering AT should return OK, entering AT+VERSION? should return something similar to +VERSION:2.0-20100601


Master as a slave
If you’ve got 2 masters you will need to have one operating as a slave which isn’t too hard to do:

Reset to defaults:

Clear any paired devices:

Set PIN:

Slave mode:

Get the address of the device:
Now that you have the address you can skip the AT+INQ and AT+RNAME? parts for configuring the master.

Turn off the module, disconnect key from 3.3V and turn back on.


Master as a master
Now, to get the master to connect to the slave module you will need to find the address of the slave. Make sure the slave module is powered up and enter these commands into the master module:

Reset to defaults:

Clear any paired devices:

Master mode:

Need to restart after changing role:

Allow connecting to any address:

Inquire mode – Standard, stop after 5 devices found, (or) stop searching after 5 seconds:

Set PIN, should be the same as the slave:

Start SPP profile lib (needed to do any Bluetooth transmitting/receiving):
Note: If it says Error:(17) then that means it’s already loaded, you can carry on.

Start searching:

A short list of devices found should appear, one of them will be the slave module.


The format of the output is as follows:

Type can be ignored. The signal will be 7FFF since inquire is in standard mode, in RSSI mode you’ll get a load of the same device but with different signal levels which you don’t want at the moment.

Copy the address part of the devices found, for example 12:3:289431 and change the colons to commas – 12,3,289431. To find out which device is the slave module you will need to query each address for its name:
AT+RNAME? <address>

Replace <address> with address of device like 12,3,289431

Response should be +RNAME:linvor if you’re using a normal slave module or +RNAME:HC05 if you’re using a master module as a slave.

Now you’ve got the address of the slave module you need to pair with it:
Note: If you are going to make the master connect to your phone then you need to set the timeout long enough for you to type in the PIN.

Bind address:

Only allow connecting to the bound address:

And now to actually connect:


If successful the slave LED should be on solid and the master LED should have a heartbeat flash pattern.

The modules have now been configured! They should automatically connect to each other whenever possible.

A full list of commands for master modules can be found in the download below.

Sending data
Now, if you entered AT mode on the master module by connecting key to 3.3V before turning on the module, you will need to turn off the module, disconnect key and turn it back on.
If you connected key while the module was on then all you need to do is disconnect key.

If you open up 2 serial consoles and have one open the COM port to the slave and the other open the COM port to the master you should be able to type in one and it will appear in the other console, if that worked you just need to plug them in to your projects!


Extra stuff
The Bluetooth board of these modules also have connections for SPI, USB and PCM audio, no idea if they work or not.
It also seems to be possible to upgrade the firmware on the modules too, making it possible to put master firmware onto a slave module – http://byron76.blogspot.co.uk/2011/09/i-hope-you-have-good-time-soldering.html
More info about various Bluetooth modules – http://wiki.pinguino.cc/index.php/SPP_Bluetooth_Modules


btinfo_20140510.zip (564.28 kB)
Bunch of pdfs and stuff with Bluetooth commands and info
Downloaded 1953 times
MD5: BA64E38C473F7E2E21EC91A92996CFB5

btinfo_20130106.zip (243.41 kB)
Bunch of pdfs and stuff with Bluetooth commands and info
Downloaded 790 times
MD5: 9E79AD4A022DA1D4A0D694A2F6E35541


3 pings

Skip to comment form

  1. James

    Can you send me a hi-res image of the components on the backplane of your bluetooth modules? Or can you get the numbers off the regulator so I can make a backplane? The bluetooth modules I ordered did not come with a voltage regulating backplane and I plan to work in the voltage conversion circuit you diagrammed above so its all compact.

    1. Zak Kemble

      I couldn’t get a decent photo, but the number of the regulator is 662K. The backplane just contains a 3.3V regulator, some capacitors for the regulator, an LED, a resistor for the LED (2.2K), a resistor for pulling down the key pin (10K) and a diode to to protect against wiring power backwards. Any 3.3V regulator that can supply 50mA will work.

  2. bbb

    Do I have to set some setting on the module before use first time with microcontroller?

    1. Zak Kemble

      No, once configured they should just work with the microcontroller.

  3. raheela

    i have interfaced HC05 bluetooth module with arduino.. i also changed the name and password using AT commands but it doesn’t inquire device when i enter AT+INQ command.. plz help me regarding this issue

    1. Zak Kemble

      Does it just reply with OK and no list of devices after a few seconds? And what kind of device is it meant to be looking for (phone, another BT module etc)?

      1. Fred vom Jupiter

        I had exactly the same issue. Module is HC-05 with backplane that has a push button to put it into AT command mode (bought from Banggood). Most commands worked okay when powering up the module with the button pressed. Commands like AT+NAME? or AT+INQ are only working for me, when putting the thing into command mode AFTER applying power.
        For the moment this leaves me with manually pressing the button as it is not connect to one of the pins. This can be quite challenging (missing a third hand) when you want to enter a couple of commands. I just found that using a crocodile clip can be used to press the button as a workaround.

  4. yong

    why i enter command at+init , it does not reply?

  5. yong

    i solved the problem
    but i can’t c other bt module on my device list after enter command at+inq, it only reply ok

    1. Zak Kemble

      Hmm, maybe the CLASS has been changed, try entering this:
      and then search again.

  6. NicoHood

    i’ve been searching through almost the whole internet about information how to use the HC-05 as a master. This is the only tutorial i found which explains what commands you actually need to type in. Getting into AT mode wasnt that problem. So thanks for sharing this information! 🙂

    What i try to do is to connect my HC-05 device with my Wii-Mote. Sadly noone ever did that before with “real hardware”, only with usb doogles and windows/linux software. But what i want to do is to connect with my HC-05 (or whatever else i should buy) with my Wiimote. The HC-05 is connected with my Arduino so i can controll the communication very easy.

    The problem is that i cannot pair the two devices. I read that you dont need that for the Wii-Remote and linking should be fine. But i cant get a connection, it always says FAIL. Getting the Address and the name just works fine. It also responds to the inq. Maybe you can help me or know any website where i can get information/help to get this working?

    The only website i found about how the Wii-Remote works is this:

    It also sais that SPP is NOT supported. Does this mean that i can give this up?

    Here is another Datasheet what covers the Errorcodes, you might want to add this to your post:

    I got the HC-05 connected to the PC as slave (just connected after received the package and powered the module). Pairing as master might work, i am not sure. Windows sais error but my toshiba bluetooth stack wants the pin from me and the hc-05 saves the connection. At least my old sony ericsson k610i is connected properly but i do not know how the protocol works, will check this out now. (dont wanna destroy something).

    One thing i want to mention: I was confused: in your tutrial you switched the cmode possibly? the datasheet sais 0 and 1 the other way around. Not sure what is correct.

    It would be nice if you can help me or just tell me that my project just wont work 😀

    1. Zak Kemble

      If the Wii-remote doesn’t support SPP then these Bluetooth modules won’t be able work with it, don’t waste your time trying it get it so work 😛
      CMODE 0 and 1 are the wrong way around, fixed. Though it can probably be left at its default 0 in this situation. Thanks for the datasheet, I’ll add it to the download.

    2. felix

      Have you successfully connect your wiimote With the HC05 ?

      1. Zak Kemble

        The Wiimote uses the Bluetooth HID profile, so it won’t work with these HC05 modules since they use the serial profile (SPP).

  7. Lars Ole Belhage

    You saved my afternoon – after spending lots of time seaching for linux/mbed/bluez and other farout topics – I found your guide a blessing – 20min’s, and my 2 hc0x’s chatter like teenagers stapped to their breadboards 😉

    Thanks a lot
    Lars Ole

  8. ramin

    thanks for the phantastic tutorial!

    i was just wondering whether it’s possible to connect multiple slaves to one master?
    the idea is to have one “controller” and a couple of slaves that can be controlled by the
    one controller. i know that the standard arduino itself has just one serial port but the question
    is whether the bt master module can connect at all to a couple of slaves.
    i could imagine that if this is possible, we could find some wiring where the arduino
    would actively use the key-pin and direct communication to different slaves by connecting
    to the respective one via some AT commands.

    1. Zak Kemble

      Yeah it’s possible, but only 1 device at a time. The AT+DISC command will make the master disconnect and then you can run through the AT+PAIR and AT+LINK commands to connect to another BT device. Just set the key pin HIGH when you’re dealing with commands and LOW when dealing with data (once you’ve connected). You can do the AT+INQ and AT+PAIR commands while still connected to another device, but make sure you disconnect before the final AT+LINK otherwise the master will bug out.

  9. wesch

    Hi, I’m a beginner with BT, bought my HC-05 today (mounted on a BT Shield V2.2 for Netdiuno). First I’ve tried to see, if my phone can finde the device and it did. I also could connect.
    Then I started to discover it and wrote a small programm to handle AT commands. Since I’ve set Baudrate to 9600 first I couldn’t estabish a connection. Then I set the correct Baudrate, sent AT and got an ERROR back. My idea was, I have something misconfigured with the first Trials, the correct reason was some pending AT commands from previous trials.
    But since the ERROR I decided to send AT+ORGL. I think this was a mistake. The the device name changed, I found another on my phone. Then I changed the Name, AT-NAME? gives me the correct one.
    But now the HC-05 is no more shown on the phone or laptop.

    What do I have to do to get it back shown on other devices?
    I send the following commands:
    AT-STATE? which respondes “INIZIALIZED”, I assume it should be “PAIRABLE”, right? What am I missing.

    1. Zak Kemble

      CMODE and CLASS are only for master mode (ROLE=1). STATE returning “INIZIALIZED” is correct because in slave mode (ROLE=0) the module is only pairable/discoverable after setting the KEY pin low (or disconnecting the KEY pin).

  10. Samuel J Garcia

    Hello! I followed this tutorial and everything worked, congrats and thank you!

    I have a question, maybe you could help me:

    I have a HC-05(Master) and other HC-05(Slave), they are paired and connected, there’s a way to send an AT command thru HC-05(Master) to work with some HC-05(Slave)’s PIO?

    Thank you

    1. Zak Kemble

      No problem 🙂
      As far as I know there’s no way of directly sending commands to other connected BT modules. You’ll need a microcontroller connected to the slave to receive and store the command, put the slave into command mode and then send the stored command to it.

  11. Gursehaj

    I bought the module and it was HC-06 …..

    It doesn’t have Key pin but it have Wakeup pin on it.

    I can’t get it to work on AT mode !!!!

    1. Zak Kemble

      HC-06 is the slave only module. It’s in AT mode only when it’s not connected to another device (like just after turning it on). I don’t think the wakeup pin does anything with HC-06 modules.

  12. Jimit

    Hi Zak,

    Thanks for great tutorial.

    I am trying to connect HC 05 module in master mode with Android phone : “AT+LINK=” command but is always shows “fail” indication.

    HC05 is been paired successfully, also AT+FSAD= is working successfully.

    please help on how to connect master mode of HC05 with android mobile.

    Thanks in advance.

    1. Zak Kemble

      Your phone needs to be running an app that uses the serial port profile, like this one.

  13. Saurabh

    Thanks for the great Tutorial.
    I am trying to communicate between 2 AT89C51 MCUs using HC05 module.
    Currently struggling to get into AT command mode. Do I need to have MAX232 while connecting HC05 to PC using RS232 to serial USB converter.

    I am able to pair HC05 (while connected to AT89C51) using Blueterm app in Android. And it sends and receives data perfectly.
    But, I want to know is it possible to use one HC05 (connected to AT89C51) as master and other HC05(connected to other At89C51) as slave and these communicate.
    Also, can I configure AT commands by having program in AT89C51, i.e. changing the frequency of oscillator in AT89C51(through program) to the one that matches AT command mode i.e., 38400.

    Please help me.

    1. Zak Kemble

      MAX232 is only for interfacing 5V/3.3V serial devices with real serial ports which use voltages around -12V to +12V. A serial USB converter doesn’t deal with voltages above 5V so no MAX232 is needed.
      HC05 modules can be configured as master or slave and can communicate with each other once connected. They can be configured by a microcontroller the same way as you would with typing the commands in with a serial terminal program; send “AT+RST” over UART and the module will reset.
      Normally you would know the baud rate beforehand and therefore already know what clock frequency and UART divider values you should use for the controller.

      1. Saurabh

        In that case I have set Baud rate for AT89C51 as 38400. And HC05 is in AT command mode (Key pin is high – I get LED blink rate of 2 sec).
        Now should I try sending “AT\r\n” (ASCII values of \r and \n followed by “AT”) from microcontroller to the HC 05.
        I have connected LCD to check the response from HC05.

        I have been trying sending AT commands to HC05 (by connecting it to PC using USB-serial converter). In this case, there’s no MCU involved.

        HC05 – USB to serial converter
        Rx – Tx
        Tx – Rx
        Key Pin (connected to 5.5 V)
        VCC (connected to 5.5 V)

        I use Docklight, Teraterm and RealTerm on PC (Set baud rate as 38400 and Transmit as CR+LF)
        But I observe nothing getting received in response of the AT command that I send through terminal on PC.
        I observe constant 3.3 V on Tx pin (of USB to serial converter). But Rx remains always 0.
        I also tried adding Voltage divider of 3.3 V at Rx and in that case I get Tx and Rx pin (on USB to serial converter) always 3.3 V
        But no response is seen from HC05 on terminal.

        Kindly help me. Thanks a lot

        1. Zak Kemble

          The key pin should have 3.3V, not 5.5V and VCC should only have 5.5V if the module has a built-in 3.3V regulator (they usually do).
          Have you verified that the serial converter is actually sending data when nothing connected? And that it can also receive data from other devices that are known to work?

  14. Darkbyte

    It does help. My two HC-05 talked each other successfully by following your steps. Just one question, after power-off and power-on again, the connection could not be recovered automatically, anything I missed ?

    1. Zak Kemble

      Odd, the module should automatically save and load the settings. Does running AT+BIND? return the correct address and AT+CMODE return 0?

  15. Chris

    thx for that tutorial. I’ve got an arduino nano rev.3.0 clone and tried the AT-Command-Mode with the hc-05-modul. The baudrate on the arduino is 9600 and from arduino to the hc-05 is 38400. But when I start and type AT i’ll get strange signes but not really an “OK”. When I test the Modul with an USB-TTL-(FTDI)-Adapter it works fine with Realterm. So there is an Problem with the Commication of the arduino and the hc-05-modul.
    The hc-06-bluetooth-modul works with the USB-TTL-Adapter and the arduino nano clone.
    I hope you can help me to get the hc-05-modul working on the arduino nano.
    Greetings Chris

    1. Zak Kemble

      >The baudrate on the arduino is 9600 and from arduino to the hc-05 is 38400.
      Are you using software serial for the 38400 baud part?
      Sounds like a baud rate mismatch somewhere.

  16. david

    hey, trying to get my hc-05 to auto-connect with my android phone. I have the hc-05 as master and following your steps everythings works great up until AT+LINK command, just says

    +INQ: (my address here)

    any ideas why? it pairs and binds up fine

    1. Zak Kemble

      It’s been a while since I last did this, but from what I remember you need to have an app running on your phone to accept new connections. I used this one – https://play.google.com/store/apps/details?id=com.sena.bterm

    2. THAMI


  17. Sachin

    thanx for that tutorial . i am a beginner with BT, SPP etc.
    i have hc-05 module. Is it possible to send/receive .txt file from android to microcontroller( which interface with hc-05 and sd card) or microcontroller to android.? is SPP support file transfer?

    1. Zak Kemble

      SPP just sends raw bytes so you can send any type of data, but you need to implement some kind of protocol (an existing one or make up your own) so each each end knows what is going on, like for sending a file you might want to tell the receiving end the size of the file, but what happens if a few bytes are lost or the transfer is stopped early? etc etc

  18. Zubair

    I have an Android Phone, HC-05 gets paired with my phone (configured as Master) same as your steps.

    But when I have issued the command, AT+LINK=, It gives me error.

    Please recommend me with your valuable suggestions.
    @David, You also have the same issue. Please update me with solution.

  19. Zubair

    I have also installed the Sena BTerm APP. But still no Success.

    Is I need to do any setting in Sena BTerm APP?

    1. Zak Kemble

      In the Sena BTerm App go to Menu > Bluetooth Configuration > configuration > Mode > Set to ‘3: Listen To Any’ > Apply then do the AT+LINK command. Once it connects, disconnect the KEY pin and you should be able to type stuff and it will appear at the other end.

  20. Vince

    Could you please clarify the steps to set up the modules so that, after power off and back on, they will automatically ‘pair’ so that serial data can be exchanged. It seems to be: Configure one as master, other as slave. Matching PINs and Baud rates. What isn’t clear, do the names need to match?

    Thank you for a useful page.


    1. Zak Kemble

      Hey, no the names do not need to match. Once the modules have successfully connected they should automatically reconnect next time they turn back on.

  21. brandon b

    dude, thank you for documenting this. using this tutorial was a life saver. curious how you figured all this out since there doesn’t seem to be a real datasheet on the hc05

    1. Zak Kemble

      Glad you found it useful 😀 It was mostly trial and error, seeing what happens when commands are entered and narrowing it down to just the commands needed to get things working.

  22. Cesar Olivera

    [HELP!!!! is for a university project]

    Hi, thanks for the tutorial. I have succesfully connected my slave and master modules. Now i have a problem when I want to communicate between them without the arduino. When I set HIGH (3.3 V) in one Tx, i want to check that HIGH in the Rx of the other, and the same when i set LOW. But the voltage in the receptor does not change when I set a voltage in the emmiter. Can you please help me to do that? 😀

    note: both are supplied with 5V and the other pins (Tx,Rx, KEY) are connected with nothing. I am just using a cable between one of the Tx and 3.3V or GND, hopping it is received in Rx of the other module. Both HC-05

    1. Zak Kemble

      The modules are supposed to send UART serial data. Setting the RX to HIGH or LOW will not work, the other end will output a byte with the value 0 which is just a LOW pulse lasting no more than a few milliseconds depending on the baud rate. So you’ll still need something to process the incoming data, a microcontroller will give the most flexibility, but if you just want to turn something on and off then you could make a circuit with some logic gates or a 555 timer to trigger when it receives the LOW pulse from the module.

      (Comments need to be moderated before they show up)

  23. jack


    with the HC-05 module (master), how can i get it to continually talk to several slaves. i have 4 sensors i want to be read by the master module. the data sheet leads me to believe the master can talk to several devices but i cannot seem to get this to work. Any help would be great. i have five HC-05 modules, 4 set to slave and 1 as master.


    1. Zak Kemble

      You can only connect and communicate with 1 slave at a time. So you’ll need some program to send the appropriate commands to the master module telling it disconnect (AT+DISC) and connect to a different slave module.

  24. Aiman

    i am trying to connect arduino uno(slave) with arduino due (master)with the help of hc05 modules. Both the modules are successfully connected with their respective modules. I have described the role and address too but when i am trying to pair them using AT+INQ it gives nothing. Can you please help me with this

    1. Zak Kemble

      AT+INQ only searches for nearby Bluetooth devices. If it only returns OK then it couldn’t find any devices. Also once the Bluetooth module has connected it will no longer be searchable until it disconnects.

  25. Paul

    I want to be able to communicate with the Wireless Buzzband BT-88. Its device name is “watchdog”, and its pairing code is “0000”.
    I’ve been playing around for a while, sending AT commands to the HC-05 from the Arduino nano. They seem to be being accepted, with OK’s etc. I really don’t know what I should be sending, as a set of AT commands and what to expect back from the device BT-88.

    Has anyone done this before? Any clues would be appreciated. Thanks .

    1. Zak Kemble

      If you’ve sent the AT commands from the tutorial and they’ve all been accepted then everything should be ok. The BT-88 probably won’t send anything unless you tell it to, or unless you send it the correct commands (I can’t find much info about the BT-88).

  26. Sanchit

    i have bought 2 HC05 module. they have a button on top and have an enable pin. the modules only enter the AT mode when the power is provided while pressing on to the button. but certain AT commands like AT+NAME? do not work and whenever i enter the command AT+INIT it comes out of the AT mode and does not show any message. what can be the problem?

    1. Zak Kemble

      Hmm, could you link to where you brought the modules from? From what I can tell only HC-06 modules have an enable button.

  27. dales

    Thanks heaps.
    I managed to get this working but I did not use all the commands you gave.
    I used all commands up to setting the password.
    I just made my passwords identical slave/master and changed my baud rate to 38400 in my sketch and made a max of 1 device on connection, my baud was on 9600 in my sketch and i got gibberish sent to serial monitor.
    Funny but, i have to select 9600 baud in serial monitor when using my HC-05 in the serial converter?
    I really needed this for my wireless weather station transmission to an indoor LCD display.
    Have not tried to use as yet on my weather station but it works to send data from arduino to my laptop in serial monitor with the HC-05 plugged in the serial converter to program lillypad clones.

    What else do i need to do to read the data on another arduino?
    Do i just use if serial.available > 0 than serial.read?

    Many thanks!!

    1. Zak Kemble

      If you’re just getting gibbering then the baud is probably set wrong somewhere. To read the serial data on another Arduino you would use the same code as you would when reading from a PC, so yeah serial.available .read stuff is correct. However, the hardware serial (pin 0 and 1) is also used by the serial-USB chip for uploading sketches and may interfere with the bluetooth module. You could try using software serial instead if it’s a problem.

  28. Dogan


    I was able to pair hc05 and hc06. But what I send from my hc05 to hc06 (for example “M” ) appears as a weird sign. Then I decided to remake everything. I unplugged my c05 and do this tutorial. After that whenever I attempt to connect my slave c06 I get this


    What could be the reason for this ?

    1. Zak Kemble

      Receiving weird signs most likely means you’ve set the wrong baud rate somewhere.
      Does it only response with FAIL during the INQ command? If you can still get it to connect then it’s probably nothing to worry about.

  29. Kyle


    First of all thumbs up lad, its a really good tutorial.

    I have one question, I’m not using the USB to serial converter but sending direct AT commands from my microcontroller (UART). Now in order to send an AT command such as AT+NAME= I have to write \r\n at the end of each command in order to show that that’s the end of my command. The response from the BT, such as OK, Address and stuff like that, I’m trying to paste it all on an LCD. I’ve did an array and stuff like that, now when the BT sends the response does it use \r\n at the end, as I need to know when the transmitter of the BT has stopped transmitting.

    Thanks once again dude and awesome tutorial 🙂


    1. Zak Kemble

      NP :p
      Yeah, the modules respond with \r\n for a new line.

      1. Kyle

        Cheers man, another question. If I pair the slave and the master as instructed above, they will not be able to pair with any other BT devices? even if the master is not in range of the slave? I understand that if the master is in range of the slave and is paired no other BT can connect to it, but what basically i’m asking is, if the master is not in range of the slave and someone else tries to connect to the slave, will it be possible.. or since that address and stuff like that have been set its not possible?

        Thanks once again,

        Kyle 🙂

        1. Zak Kemble

          Hmm, it might be possible. I think the master module can store multiple pair addresses. Run the AT+PAIR command to pair with different devices and keep AT+CMODE set to 1, that might make it connect to whatever device it can find that’s in the paired list. The command AT+ADCN? will show the number of paired devices.

  30. Carlos

    Great Tutorial!
    Just one question can I connect and pair 1 HC05 master with two to 4 slaves (SPP) Bluetooth in order to receive some readings?
    If it is possible and reliable any suggestions how to do it?


    1. Zak Kemble

      No, these modules can only connect to one device at a time. You need to manually tell it to disconnect (AT+DISC) and connect when you want to talk to a different module.

  31. Dharmender

    Thanx bro. Thank yu very much

  32. Versha Jindal

    Great tutorial !!
    My two bluetooth modules are paired. But, whenever i send data from one arduino, weird symbols are obtained on another arduino’s serial monitor. I know there is something wrong with baudrate. Can you please help me to fix it out…

    1. Zak Kemble

      Try different baud rates on the serial monitor, there’s a list of possible bauds in the configuring slave section.

  33. bhuvaneshnick

    hi, if u having trouble in making into AT mode of HC-05 (ZS-040)(especiall if one having en/wakeup up pin instead of key pin). Follow they bellow procedure
    Power off HC-05 module.
    Press and hold small button above EN pin.
    Power on and keep pressing small button.
    Small LED should start to blink slowly about once every 2 seconds.

    for more info visit below site:

  34. Fauzy Satrio Wibowo

    Excuse me,
    is that possible when 1 master bluetooth send a data to several slave bluetooth simultaniously?

    for example :

    when 1 master bluetooth send this data ‘abcdefg’

    and then
    several slave bluetooth (i.e=5 slave bluetooth) receive data ‘abcdefg’ at simultaniously (at the same time) not alternately.

    thanks for help

    1. Zak Kemble

      Hey, no, these modules only support 1-to-1 communication.

  35. avishek

    i am trying to send AT commands to my bluetooth using UART. whenever i am sending any command like AT+ROLE1, i am getting only ok response from my bluetooth. i think it is because whenever i send some command to bluetooth it is being sent byte wise byte and by the time by bluetooth is getting AT it is not waiting for the remaining part and it is responding only for AT as ok. kindly help me to solve this problm..

    thanks in advance

    1. Zak Kemble

      That would be what it should do. Most of the commands only respond with “OK”.

  36. Leo

    Hi, I am very new to this so please excuse me for the dumb question. I have an HM-10, I connected it to a 3.3v battery and I can see it on my phone. Now, what I want to be able to do is very simple: I want to attach a button on the HM-10 and when its pressed, to be able to detect it on my phone app. Maybe one way to do this would be to configure the HM-10 as a “beacon” transmitting an specific guid and the button could simply connect the battery when pressed. The problem with this is that if it take too long to the HM-10 trasmit the data (does it?), the user would have to hold the button pressed so it is not very elegant. I do not need to send a lot of data, just a “ping” from the HM-10 to my app… is this possible without extra components like an arduino or such?


    1. Zak Kemble

      Hey Leo, I think one way would be to connect a button between the RX pin of the bluetooth module and ground, and maybe a 10k resistor from the RX pin to VCC. Pressing the button might make the module send some random data, however if you need some kind of device ID then you’ll need a microcontroller. A small ATtiny10 will do the job of sending some valid serial data when a button is pressed, though I think the smallest Arduino compatible chip is an ATtiny85.

  37. Kanchan shinde

    Hi i have connected two HC05 bluetooth module and set as master and slave. Now i want to send data from master to slave so please which should i use to send the data read from sensor on master to slave serial monitor.

    1. Zak Kemble

      Once the 2 bluetooth modules have connected you can send data from either module, it doesn’t matter which one is the master or slave.

  1. Telemetry: Bluetooth | Abboud's Corner

    […] Before connecting these modules to the scanner and stm32, you have to set the modes, one to master, and the other to slave. There is already a great blog that describes these steps, which I used to set my modules. Getting-Bluetooth-modules-talking-to-each-other, by Zak Kemble […]

  2. Pairing two HC-05 bluetooths with each other using arduino mega

    […] should help. http://blog.zakkemble.co.uk/getting-…to-each-other/ Reply With […]

  3. notes on bluetooth | Wearables and Soft Computing

    […] connecting to a serial console and use of AT commands, as well as setting specific baud rates. Here is a nice blog post that explains all this in greater detail. I used these HC-05s to make my tester units talk to each other, a very exciting moment! seen […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Are you human? *