Setting Up Bluetooth HC-05 With Arduino

Introduction: Setting Up Bluetooth HC-05 With Arduino

In this project, we will employ HC05 Bluetooth module with Arduino to send messages from smartphone to Arduino unit and display on the computer.

About HC-05 Bluetooth module:

The HC-05 module is easy to use Bluetooth SPP (Serial Port Protocol) module, designed for transparent wireless serial connection setup. 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 Bluetooth system with CMOS technology and with AFH (Adaptive Frequency Hopping Feature). It has the footprint as small as 12.7mmx27mm. Hope it will simplify your overall design/development cycle.

Step 1: Pin Configuration and Function:

Pin Description

State - To know the state of the connection. (Paired or disconnected)

Rx - Receive Pin of the module for receiving Data.

Tx - Transmit Pin of the module for sending Data.

5v - Power pin

GND - Ground pin

EN/Key - Enables or Disable the module.

Step 2: Components Required:

- Arduino board 1

- HC05 Bluetooth module 1

- Jumper wires 6

- Breadboard 1

You can buy these components, which are TESTED for quality, from elegocart.

Step 3: Project Setup:

Step 4: Code:

#include<SoftwareSerial.h>
SoftwareSerial EEBlue(10, 11); // RX | TX void setup() { Serial.begin(9600); EEBlue.begin(9600); //Default Baud for comm, it may be different for your Module. Serial.println("The bluetooth gates are open.\n Connect to HC-05 from any other bluetooth device with 1234 as pairing key!."); } void loop() { // Feed any data from bluetooth to Terminal. if (EEBlue.available()) Serial.write(EEBlue.read()); // Feed all data from termial to bluetooth if (Serial.available()) EEBlue.write(Serial.read()); }


Step 5: Android App:

On Play store there are numerous apps to connect Bluetooth module HC05 to an Android phone, you can use any of them. I used Bluetooth Terminal app.

Share

    Recommendations

    • Metalworking Contest

      Metalworking Contest
    • Water Contest

      Water Contest
    • Tiny Home Contest

      Tiny Home Contest

    Discussions