HC-06 Bluetooth Module
Hc-06 is a Bluetooth module designed for establishing short range wireless data communication between two microcontrollers or systems. The module works on Bluetooth 2.0 communication protocol and it can only act as a slave device. This is cheapest method for wireless data transmission and more flexible compared to other methods and it even can transmit files at speed up to 2.1Mb/s.
HC-06 uses frequency hopping spread spectrum technique (FHSS) to avoid interference with other devices and to have full duplex transmission. The device works on the frequency range from 2.402 GHz to 2.480GHz.
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
HC-06 Bluetooth Module Advantages
- HC-06 is best option when short distance wireless communication is needed. The module is used for wireless communications of less than 100 meters.
- The module is very easy to interface and to communicate.
- The module is one of the cheapest solutions for wireless communication of all types present in the market.
- The module consumes very less power to function and can be used on battery operated mobile systems.
- The module can be interfaced with almost all controllers or processors as it uses UART interface.
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.