Bluetooth module is a wireless communication module that is used in different types of smart devices. For the consumer, this module is a semi-finished product. The Bluetooth serial module simply allows all serial-enabled devices to commune with each other through Bluetooth. There are different types of Bluetooth modules available that are used in different biomedical applications like HC-05, RS 232, ITEAD BT, HC-06, TTL, BLE mini, BLE link Bee, Blue SMiRF, JY-MCU, Bluetooth mate, and many more. Among all these modules the most commonly used Bluetooth modules are HC-05 & HC-06. This article discusses an overview of an HC-06 Bluetooth Module – working with applications.
What is HC-06 Bluetooth Module?
The Bluetooth module which is designed to facilitate wireless serial communication between any microcontroller & other Bluetooth-enabled devices is known as the HC-06 Bluetooth module. This is a slave Bluetooth device that provides UART serial communication. So, a master is necessary to set up a successful wireless interface. When it is connected to a master Bluetooth device like a smartphone, tablet, or PC then its operation becomes clear to the consumer. The data which is received throughout the serial input is transmitted immediately over the air. Once the Bluetooth module obtains wireless data, then it transmits out above the serial interface in a similar format like it was received.
HC-06 Bluetooth Module Pin Configuration:
The pin configuration of the HC-06 Bluetooth module is shown below. This module includes only power & communication pins.
- Pin1 (Key): This key pin simply verifies whether the Bluetooth module works in normal mode or AT command mode. When this pin is at a high state then the module works in AT commands mode whereas this pin is at a low state then the module works in normal mode.
- Pin2 (Vcc): This pin is used to provide a +5V Positive supply to power the Bluetooth module.
- Pin3 (GND): This pin is connected to the ground.
- Pin4 (TXD): This pin is used to transmit serial data by module.
- Pin5 (RXD): This pin is used to receive serial data by this module.
- Pin6 (State): This pin is simply connected to the LED on the Bluetooth board to signify the condition of the module.
Features & Specifications:
The features & specifications of the HC-06 Bluetooth module include the following.
- USB protocol is USB v1.1/2.0.
- Bluetooth 2.0+ EDR standard protocol.
- The operating current is 40mA.
- The operating frequency of this module is 2.4GHz ISM frequency band
- The modulation mode is Gauss FSK (Frequency Shift Keying).
- Transmit power is less than or equal to 4dBm.
- Sensitivity is less than or equal to-84dBm on 0.1% Bit Error Rate.
- Its transmission speed is 2.1Mbps maximum or 60 kbps asynchronous, 1Mbps/1Mbps Synchronous.
- The safety feature of this module is authentication & encryption.
- Bluetooth serial port supported configuration.
- Its size is 36.5*16mm.
- Its voltage supply is +3.3 VDC 50mA.
- The operating temperature ranges from -20 to 55℃.
- Module weight is 4 grams.
- Its baud rate by default is 9600.
- This module is designed with the ROHS process.
- It includes an external 8-Mbit flash.
- It has an in-built 2.4 GHz antenna, so the user does not require a test antenna.
HC-06-Bluetooth-Module Interfacing with Arduino Nano Board
Before interfacing the HC-06-Bluetooth-Module with the Arduino Nano development board, you need to set up your Bluetooth module. For this, you have to enter the AT mode. To enter the AT mode, you need the USB-TTL Serial Converter module. To connect the USB-TTL Serial Converter module with the HC-06 Bluetooth module, you need female-to-female jumper wires like the following.
The TX pin of the USB-TTL converter is connected to the RXD of the Bluetooth module.
The RX pin of the USB-TTL converter is connected to the TXD of the Bluetooth module.
The GND pin of the USB-TTL converter is connected to the GND of the Bluetooth module.
The 5V pin of the USB-TTL converter is connected to the VCC of the Bluetooth module.
Now, need to plug the USB-TTL Serial converter module into your PC. The LED on this converter module must be turned ON if it is working correctly. The Bluetooth module is arranged permanently to be a slave &is always within AT mode once not connected to any other device.
Open Arduino IDE –> go to Tools –> Serial Monitor.
The Baud rate needs to be set to 9600 & the ‘line ending’ toward ‘Both NL & CR’.
Type in ‘AT’ without the quotes & click send. If the Serial Monitor shows “OK”, then the module works in AT mode.
For the corresponding functions, need to use the following AT commands.
AT command is used to verify the connection.
AT+NAME command is used to verify the default module name.
AT+VERSION command is used to get the version.
AT+BAUD command is used to verify the module’s default baud rate.
AT+PIN is used to get the module’s password.
AT+NAME’DESIRED NAME command is used to modify the default module name to the required name.
To modify the HC-06 Bluetooth module’s baud rate, type in AT+BAUDx, wherever ‘x’ ranges from 1 to 9 like the following.
1–> 1200 baud rate.
2–>2400 baud rate.
3–>4800 baud rate.
4–>9600 baud rate.
5–>19200 baud rate.
6–>38400 baud rate.
7–>57600 baud rate.
8–>115200 baud rate.
Sending AT+BAUD3 will change the baud rate from 9600 baud to 4800 baud.
Connect HC-06 Bluetooth Module to Arduino Nano Board
The interfacing of the HC-06 Bluetooth module with the Arduino board is shown below. In this interfacing, an Arduino nano R3 board is used for interfacing the Bluetooth module. HC-06 Bluetooth module is mainly designed to establish short-range wireless data communication below 100 meters. This module helps in easily interfacing and communicating with the Arduino board. It can be easily interfaced with nearly all types of processors or microcontrollers because it uses a UART interface. So, this module has the capability to transmit different files at up to 2.1Mbps speed & works on Bluetooth 2.0 communication protocol. Not like the HC-05 module, this module acts as a slave device only.
Connections
The required components to build this mainly include; an Arduino Nano board, an HC-06 Bluetooth module, Resistors like 1kΩ & 2kΩ, Male to Male Jumper wires, Male to Female Jumper wires, and Arduino IDE. The connections of this interfacing follow as;
- The RXD of the Bluetooth module is connected to the 5V pin of Arduino Nano.
- The GND of the Bluetooth module is connected to the GND pin of Arduino Nano.
- The TXD of the Bluetooth module is connected to the D2 pin of Arduino Nano.
- The RXD of the Bluetooth module is connected to the D3 pin of Arduino Nano through a resistor.
The Arduino nano boards include serial ports at D0 & D1. It communes through these two pins with the computer through USB. Here, serial functions are used thus we cannot utilize these pins. So, we are using both the D2 & D3 pins for communication through the Bluetooth module. We know that the D2 pin is simply connected to the TXD pin of the Bluetooth module & the D3 pin is simply connected to the RXD pin of the Bluetooth module.
The Bluetooth module is connected to +5V standard RPS (regulated power supply) & the voltage divider rule is used to change the 5V logic signal transmitted by the D3 pin of the Arduino board to 3.3V which is appropriate for the module. If separate power sources are utilized for the Bluetooth module & Arduino development board then their ground should be connected for voltage reference.
Code
For this Bluetooth and Arduino interfacing, you need the Software Serial library which is an in-built library, so it does not require to be installed. This library is developed to permit serial communication on other Arduino digital pins & this is why we need the library to be utilized for this interfacing, so we need to allow D2 & D3 pins for Serial communication.
#include <SoftwareSerial.h>
SoftwareSerial BTSerial (2,3);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println(“Enter AT Commands”);
BTSerial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if(BTSerial.available()){
Serial.write(BTSerial.read());
}
if(Serial.available()){
BTSerial.write(Serial.read());
}
}
Bluetooth Communication Testing
Now test the communication between Bluetooth & another device. So, if you have an Android-based device, then download and install the ‘Bluetooth Terminal’ app. Ensure that you have enabled Bluetooth on your android device.
Open the menu symbol on the top right corner of the display & click on ‘Connect a device. After that, ‘Scan for devices’, you will find the Bluetooth module name. So, to connect with your module, the device will request the secret word. Once you provide the right secret word, then you will observe that the module & device are allied. On the Bluetooth module, the LED will flash every two seconds.
Now, need to open the Serial monitor within the Arduino IDE & set the right baud rate. From the Bluetooth app, send a message &you will observe the displayed message over the Serial monitor. Try to send a message using the Serial monitor. If this connection is successful, then the message will be obtained by your Android-based device.
Advantages
The advantages of the HC-06-Bluetooth module include the following.
- The HC-06-Bluetooth module is extremely simple to interface with and also to communicate.
- This module is not expensive.
- This Bluetooth module uses very low power to function & can be utilized on mobile systems operated through the battery.
- HC-06 module is the best option once short-distance wireless communication is required.
- This module can also be interfaced with nearly all processors or controllers because it utilizes the UART interface.
Applications
The applications of the HC-06-Bluetooth module include the following.
- HC-06 Bluetooth module is used in various electronic devices like a laptop, mobile, personal computers, and many more.
- This module is used in various industrial projects for data transmitting & receiving.
- This Bluetooth module is used in various robotics projects.
- The HC-06 Bluetooth module is mainly designed for transparent wireless serial communication.
- It is used for connecting small electronic devices like mobiles through a short-range wireless connection for exchanging files.
- It allows wireless serial communication between Arduino microcontrollers & other Bluetooth-based devices.
- HC-06 is a Bluetooth module designed for establishing short-range wireless data communication between two microcontrollers or systems.
- It is used in wireless accessories of mobile phones.
- These modules are applicable to Hobby projects and engineering applications.
- These are used in servers of a data center, computer peripherals, USB dongles, and Leisure & sports equipment.
Please refer to this link for ESP12E WiFi Module.
Please refer to this link to know more about HC06 Bluetooth Module Datasheet.
Thus, this is an overview of the HC06 Bluetooth module – pin configuration, specifications, features, interfacing, and its applications. Here is a question for you, what are different wireless modules available in the market?