Skip to main content

Bluetooth Module HC-05

Bluetooth Module HC-05

Bluetooth Module HC-05


  1. Introduction
  2. Bluetooth Module HC-05
  3. Hardware Features
  4. Software Features
  5. Pin Description
  6. How to connect HC-05 Bluetooth module with Arduino Uno?
  7. Hardware and Software Required
  8. Hardware Connections
  9. Program for HC-05 Bluetooth Module

Introduction

HC‐05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module,designed for transparent wireless serial connection setup.The HC-05 Bluetooth Module can be used in a Master or Slave configuration, making it a great solution for wireless communication.This serial port bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Bluecore 04‐External single chip Rluetooth system with CMOS technology and with AFH (Adaptive Frequency Hopping Feature).


Bluetooth Module HC-05

The Bluetooth module HC-05 is a MASTER/SLAVE module.By default the factory setting is SLAVE.The Role of the module (Master or Slave) can be configured only by AT COMMANDS.The slave modules cannot initiate a connection to another Bluetooth device, but can accept connections.Master module can initiate a connection to other devices.The user can use it simply for a serial port replacement to establish connection between MCU and GPS, PC to your embedded project, etc.Just go through the datasheet for more details Datasheet.pdf

Hardware Features
  • Typical ‐80dBm sensitivity.
  • Up to +4dBm RF transmit power.
  • 3.3 to 5 V I/O.
  • PIO(Programmable Input/Output) control.
  • UART interface with programmable baud rate.
  • With integrated antenna.
  • With edge connector.


Software Features
  • Slave default Baud rate: 9600, Data bits:8, Stop bit:1,Parity:No parity.
  • Auto‐connect to the last device on power as default.
  • Permit pairing device to connect as default.
  • Auto‐pairing PINCODE:”1234” as default.


Pin Description

Bluetooth Module HC-05
The HC-05 Bluetooth Module has 6pins. They are as follows:

ENABLE:  When enable is pulled LOW, the module is disabled which means the module will not turn on and it fails to communicate.When enable is left open or connected to 3.3V, the module is enabled i.e the module remains on and communication also takes place.

Vcc:  Supply Voltage 3.3V to 5V

GND: Ground pin

TXD & RXD:  These two pins acts as an UART interface for communication

STATE: It acts as a status indicator.When the module is not connected to / paired with any other bluetooth device,signal goes Low.At this low state,the led flashes continuously which denotes that the module is not paired with other device.When this module is connected to/paired with any other bluetooth device,the signal goes High.At this high state,the led blinks with a constant delay say for example 2s delay which indicates that the module is paired.

BUTTON SWITCH: This is used to switch the module into AT command mode.To enable AT command mode,press the button switch for a second.With the help of AT commands,the user can change the parameters of this module but only when the module is not paired with any other BT device.If the module is connected to any other bluetooth device, it starts to communicate with that device and fails to work in AT command mode.



How to connect HC05 bluetooth module with Arduino Uno?

Hardware and Software Required
Hardware Connections

As we know that Vcc and Gnd of the module goes to Vcc and Gnd of Arduino.The TXD pin goes to RXD pin of Arduino and RXD pin goes to TXD pin of Arduino i.e(digital pin 0 and 1).The user can use the on board Led.But here,Led is connected to digital pin 12 externally for betterment of the process.



Program for HC-05 Bluetooth Module

The program given below is the HC-05 bluetooth module program.This process is quite different from others since we are going to use android mobile to control and communicate with arduino.Here the bluetooth module acts as an interface between our mobile and Arduino board.Before getting into the execution process,follow the given procedure:

  • First of all,the user should install an application called Bluetooth SPP PRO from the playstore which is a free application.
  • After installation,pair the bluetooth module to your mobile as like connecting one device to other using bluetooth.The default pairing code is 1234.
  • Upload the given program to the Arduino Uno board.After uploading the code,unplug the USB from the arduino.
  • Now use external power adapter to power the Uno board.
  • The Bluetooth SPP PRO has three types of communication mode.Here Byte stream mode is used to communicate.So select that mode and give the input as 1,as soon as the input has given the led will turn on and for 0 led will turn off.
Bluetooth Module HC-05
click the image to enlarge it

________________________________________
#include SoftwareSerial 

mySerial(0, 1); 

 int ledpin=12; 

 int Data; 

 void setup() {

mySerial.begin(9600); pinMode(ledpin,OUTPUT); } 

void loop() 

 if (mySerial.available()) { Data=mySerial.read();

if(Data=='1') 

{ digitalWrite(ledpin,HIGH); mySerial.println("LED On! "); 

 } 

else if (Data=='0') 

{  

digitalWrite(ledpin,LOW); mySerial.println("LED Off! "); }

 } }

________________________________________

Comments

Popular posts from this blog

7400 - Quad Two Input NAND Gate

7400 - Quad Two Input NAND Gate 74LS00 is part of the 74XXYY IC series. 74xxyy integrated circuits are logical gates of digital electronics. The 74LS00 IC has four NAND gates(NAND Gate is the combination of AND and NOT Gate). In addition, each door has two entrances. Hence the name QUAD TWO INPUT NAND GATE.     Pin Diagram of 7400 IC 74LS00 is a 14-pin device. The chip is available in different packages and is chosen according to the needs.  The description of each pin is given below. Pin Number Description 1 A1-INPUT1 of GATE 1 2 B1-INPUT2 of GATE 1 3 Y1-OUTPUT of GATE1 4 A2-INPUT1 of GATE 2 5 B2-INPUT2 of GATE 2 6 Y2-OUTPUT of GATE2 9 A3-INPUT1 of GATE 3 10 B3-INPUT2 of GATE 3 8 Y3-OUTPUT of GATE3 12 A4-INPUT1 of GATE 4 13 B4-INPUT2 of GATE 4 11 Y4-OUTPUT of GATE4 7 GND- Connected to ground 14 VCC-Connected to positive voltage to provide smdksmkm power to all four gates Internal Ci

Arduino Code Basics - C, Pins

Code Basics -Arduino C The Arduino uses a slightly reduced C/C++ programming language. In this recipe, we will remember a few basics of C/C++. Ensure that you have Arduino IDE Installed on your Laptop/PC. Here is a simple example of basic Arduino C/C++ manipulating two variables: // Global Variables  int var1 = 10;  int var2 = 20; void setup() {   // Only execute once when the Arduino boots   var2 = 5;   // var2 becomes 5 once the Arduino boots } void loop(){   // Code executes top-down and repeats continuously   if (var1 > var2) {  // If var1 is greater than var2 var2++; // Increment var2 by 1   } else {  // If var1 is NOT greater than var2     var2 = 0; // var2 becomes 0   }  } When we upload a sketch to the board, the Arduino software first compiles the code. If there is an error in the code, it will write it in the Status Display area and will stop the upload. If no errors are found, it will begin writing the compiled co

Arduino Mega 2560

Arduino Mega - Description & Pinout Surely Arduino UNO is one of the most popular Microcontroller development board for project hobbyist and for some professionals also. When cheaper boards are available, why choose Arduino Mega? The main reason behind this is the additional features that are built into this board. The first feature is the large I/O system with 16 analog and 54 built-in digital pins supporting USART and other communication modes. Secondly, it has a built-in RTC and other features like an analog comparator, an advanced timer, an interruption of the controller's wake-up mechanism to save more power and a faster speed with a 16MHz crystal clock to get 16 MIBS. It has more than 5 pins for Vcc and Gnd to connect other devices to Arduino Mega. Other features include JTAG support for programming, debugging, and troubleshooting. With a large FLASH and SRAM memory, this card can easily handle a large system program. It is also compatible with different typ