In a previous post I showed how the HC-05 can auto connect to other Bluetooth devices by setting the HC-05 to pair with any device using CMODE=1. This is quick and easy but does not give any control over which other device the HC-05 connects to.
In this post I show how to set up the HC-05 to always connect to the same HC-06 (or HC-05 in Slave mode). For this we use PAIR, BIND, and LINK.
NOTE: There are now newer modules that use a 3.0-20170601 firmware. This guide does not work for these modules (AT+INQ gives an error). I do not have any of the new modules and cannot find a reliable supplier. I have ordered 3 sets of BT modules believing they were the newer ones only to receive old ones.
If you have not yet bought BT Classic modules. I recommend buying the original HC ones. These are slightly (just a little bit) more expensive but are well supported and full documentation is available. Original HC modules have the HC logo screen printed on the main BT board and the current boards have a blue LED top left.
I am using 2 separate Arduino IDEs; version 1.6.3 which is installed, and version 1.0.5 which I run from a folder (it is the non install version). This allows me to use 2 IDEs at the same time, each connected to a different Arduino. It also gives me 2 serial monitors, one for each Arduino.
The modules used are the zs-040 versions of the HC-05 and the HC-06. The HC-05 has the Wavesen/HC firmware 2.0-20100601 and any any module running the same firmware will be the same.
The HC-05 has 2 AT command modes which I refer to as “mini” AT mode and “full” AT mode and some commands only work when in “full” AT mode. To enter “full” AT mode pin 34 needs to be HIGH and kept HIGH. To accomplish this I have made a connection from pin 34 to +3.3v. See the diagram below (or after the jump).
If you are not sure about At command mode take a look at Arduino with HC-05 (ZS-040) Bluetooth module – AT MODE
If you are not familiar with how the HC-06 and HC-05 work it may be worth while checking out some of the other posts:
HC-05 and HC-06 zs-040 Bluetooth modules
Arduino and HC-06 (ZS-040)
Arduino With HC-05 Bluetooth Module in Slave Mode
Connecting 2 Arduinos by Bluetooth using a HC-05 and a HC-06: Easy Method Using CMODE