In communication, the Bluetooth wireless technology has become very popular and it is one of the fastest growing fields in the wireless technology. Hence it is important to learn how the HC 05 Bluetooth module interfacing with the microcontroller. Nowadays, demands of mobile phones and personal communication the bandwidth are easy and convenient to use. The Bluetooth technology manages the communication channel of the wireless part. The Bluetooth modules can transmit and receives the data wirelessly by using two devices. The Bluetooth module can receive and transmits the data from a host system with the help of the host controller interface (HCI). The UART & USB are the most popular host controller interfaces and in this article, we have discussed the UART. By using the UART connections, the Bluetooth module can be integrated and it gives the best possible solutions for the Bluetooth embedded systems.
What is an HC 05 Bluetooth Module?
HC 05 Bluetooth is a wireless communication protocol; it is used in two devices as a sending and receiving the information. The Bluetooth is free to use in the wireless communication protocol as the range of the Bluetooth is less than the other wireless communication protocols like WiFi and Zigbee. The Bluetooth operates at the frequency of the 2.41 GHz and also used in many small ranges of applications.
Classification of the Bluetooth Module
There are three different types of Bluetooth module which are classified and described below
Class 1: The output range of Class 1 Bluetooth module is about the 100 mW. The distance between the two Bluetooth module devices is about the 100 meters.
Class 2: The output range of this Bluetooth module is about the 2.5 mW and the distance of two Bluetooth devices are about the 10 meters.
Class 3: The output range of this type Bluetooth module is 1mW and the distance is about the 10 centimeters of two Bluetooth devices.
The Bluetooth module requires a communication protocol to interface with the other devices. In this article we are discussing the Bluetooth module is interfaced with the microcontroller and pic microcontroller. The microcontroller can communicate with the Bluetooth devices with the following wired communications to receive and send the information to other Bluetooth devices.
We can use any one of the above three wired communication for the interfacing to a microcontroller with the Bluetooth module. There are many Bluetooth modules which are available in the market. The Bluetooth modules are following. In this article, we will discuss two modules which are HC 05 Bluetooth Module and RN-42.
RN-42 Module Interfacing with PIC-Microcontroller
The RN-42 is a class two type Bluetooth module it has UART and USB port communication interface. The RN-42 can be used for both as a receiver and send the information and it also works as a master and slave. In audio applications, the RN-42 Bluetooth module is used.
We need a voltage level shifting circuit with RN-42 to interface this with the pic microcontroller or with any microcontroller. The microchip provides its solution by giving the complete compatible board to interface with the microcontroller. The RN-42 EK board is interfaced with the pic microcontroller by connecting directly, i.e. UART-RX pin of the RN-42 Bluetooth module to the pic microcontroller of Tx pin and UART-Tx pin is connected to the Rx pin of pic microcontroller. By using the USB cable the RN-42 EK board is connected to the computer.
The following diagram shows the interfacing of RN-42 with the pic microcontroller. There are two types of modes in the RN-42. They have commanded mode and data mode and there is no antenna for the RN42. The command modes are used for the set configuration of Bluetooth modules like master or slave and serial port control. The Bluetooth module is kept in a particular form before using the data mode. Hence there is a use of the default values of the commands. We have to remember that there is a specific time for the command mode and we have to use the command mode within the time otherwise the Bluetooth module will reach the data mode behind the time.
HC 05 Bluetooth Module
The HC 05 Bluetooth module is the most popular module in the Indian market and this module is mostly used in the embedded projects. The HC 05 Bluetooth modules are easy to use & simple, its price is low and these types of modules are interfaced with the Arduino, Rasberry Pi, and Microcontroller through the serial UART interface. These modules are designed for the transparent wireless connection setup and it is very easy to use in the Bluetooth serial port protocol.
The serial port, Bluetooth module is highly qualified Bluetooth with the version of the V2.0+Enhanced Data Rate of 3Mbps. The modulation has completely 2.4 GHz radio transceiver and baseband. These serial port, Bluetooth modules use the CSR Bluecore 04-external single chip Bluetooth system by using the COMS technology and also with the Adaptive Frequency Hopping Feature. The footprint of this Bluetooth module is as small as 12.7mmx27mm. Hence it will help in the overall design and development cycle.
The following are some specifications of the H05 Bluetooth module
- The frequency is about the ISM band of 2.4GHz.
- The Bluetooth specification of the Bluetooth module is V2.0 + EDR
- The emission power is about the <4dbm and it is a Class 2 Bluetooth Module
- The input power supply is from the 3.6V To 6v
- The operating voltage of the HC 05 Bluetooth module is 3.3V
- The Dimensions are 35.7mm x 15.2mm x 5.6mm
The HC 05 Bluetooth module works at the temperature of -200C ~ + 750C.
- The security of this Bluetooth module is in authentication and encryption.
The following image shows the HC 05 Bluetooth module
This Module has two types of operation modes which are following
- AT Command Mode
- Connection Mode
AT Command Mode
The AT command mode is a module whenever the set of commands is used for the setup and configure the module. In this mode, the modules are not identified by the other Bluetooth devices. This type of mode will take the pin to high and the commands are sent to the module serially like string. The string should be in the capital letters and every command should be ended by the ‘rn’. If the command is known by the module then the module will reply with the string which contains the ‘OK’. If the command is unknown by the module will reply with the string which contains ERROR ( ). The error determines the type of error and a specific code.
The connection mode is the device which can connect directly to the other device. We can identify this device on other devices and it can connect with the help of the passkey which should be entered and the passkey is a default which is ‘1234’. In the connection mode, we cannot change configuration serially but we can only communicate with it. In this case, the pin is Not Connected.
Bluetooth Module Interfacing With the Microcontroller
To enable Bluetooth communication the Bluetooth module is used widely. This module is interfaced with the 8051 microcontrollers by using the UART and the data is transmitted in the form of packets. The path for the data transmission and reception is formed by using the pins of Tx and Rx of HC 05 Bluetooth module. The Tx pin of HC 05 Bluetooth module should be connected to the Rx pin of the microcontroller. The Rx pin of HC 05 is connected to the pin of the Tx pin of the 8051 microcontrollers. To pairing the module with our device the key pin of the module is used.
The Bluetooth terminal applications should be present in our devices like mobile & PC to communicate with the microcontroller with the help of Bluetooth. We have no. of apps which are present on the internet for the different types of like OS, Android, Windows, Mac, and other programming devices. The following circuit diagram shows the schematic diagram of the Bluetooth module interfacing with the microcontroller.
The applications are urbanized in a way to send the characters to your device, Bluetooth which should be received by the Bluetooth module is connected to the microcontroller. Even though dome of the apps is offered interactive GUI buttons which transmit the specific characters by pressing the each button. Later on, the received characters are a process in our code and the controller carries out the tasks based on the received character. The Bluetooth communication can be used in two ways the first way is it can be used for receiving data from the controller and the second one is controlling the system using our device Bluetooth.
Advantages of Bluetooth Module
- When we are traveling with the laptop and with the other wireless devices we don’t need to carry the connection cables.
- Hence it is a wireless technology.
- The cost of the Bluetooth is not an expensive.
- The Bluetooth modules are standardized protocol because they can connect with the same Bluetooth as well as with the different Bluetooth projects model.
- The Bluetooth module can connect automatically with another Bluetooth device at a range of 30 feet.
- There is a low energy consumption in the Bluetooth devices in generally we can see in the mobile phones.
Applications of Bluetooth Module
- Mobile phones
- Wireless technology
- Bluetooth speakers
This article tells about the how Bluetooth modules interface with the microcontroller. I hope that you have gained some basic knowledge about the Bluetooth modules. If you have any queries regarding this article or about the wireless communication projects, please feel free to comment in the below section. Here is the question for you, what is the technology called Bluetooth?