HC-06 module has six pins as shown in the pinout. In them we only need to use four for successfully interfacing the module. Some breakout boards will only leave four output pins only because of this reason.
The pin state determines whether the module works in AT command mode or normal mode
[High=AT commands receiving mode(Commands
response mode), Low or NC= Bluetooth module normally working]
+5V Positive supply needs to be given to this pin for powering the module
Connect to ground
Serial data is transmitted by module through this pin (at 9600bps by default), 3.3V logic
Serial data is received by module through this pin (at 9600bps by default),3.3V logic
The pin is connected to the LED on the board to represent the state of the module
HC-06 Features and Electrical characteristics
Bluetooth protocol: Bluetooth V2.0 protocol standard
Power Level: Class2(+6dBm)
Band: 2.40GHz—2.48GHz, ISM Band
Receiver sensitivity: -85dBm
USB protocol: USB v1.1/2.0
Modulation mode: Gauss frequency Shift Keying
Safety feature: Authentication and encryption
Operating voltage range:+3.3V to +6V
Operating temperature range: -20ºC to +55ºC
Operating Current: 40mA
How to use HC-06 Bluetooth Module
The communication with this HC-06 module is done through UART interface. The data is sent to the module or received from the module though this interface. So we can connect the module to any microcontroller or directly to PC which has RS232 port (UART interface). A typical interface circuit of the module to an arduino is shown below.
Here the module is connected to +5V standard regulated power supply and UART interface is established as shown in figure. All you need to do is connect RXD of arduino to TXD of module and TXD of arduino is connected to RXD of module through a resistor voltage divider. This voltage divider is provided for converting 5V logic signal sent by arduino to +3.3V logic signals which are suitable for the module. The ground of arduino and module must be connected for voltage reference in case separate power sources are used.
After connecting the module you have to write the program in arduino IDE to receive and send data to the module. For successful wireless communication you need to remember a few things:
In programming you need to set default baud rate of UART serial communication to 9600. The value is default setting of module and can be change in program.
The module is a slave and so you need a master to establish a successful wireless interface. For that you need another [arduino + module (with master feature)] setup or you can use a smart phone as a master and search for HC-06 slave.
The master searches for slave and connects to it after authenticated with password. The HC-06 module has default password ‘1234’ which can be changed.
In program you can receive data master sends (After authentication) and perform tasks based on it.
Also you can download libraries for module through the websites and use them to make communication easy. All you need to do is download these libraries and call them in programs. Once the header file is included, you can use simple commands in the program to tell the arduino to send or receive data. The module sends this data to master through wireless Bluetooth. If the module receives any data from master, it will transmit it to arduino through UART serial communication.
You can also interface HC-06 to PC using RS232 cable. Once you interface is done you can use serial terminal on PC or any similar software to send or receive data to module. You need to type in AT command in serial terminal to communicate with the module and these commands can be downloaded here.