electroSome

Interfacing HC-05 Bluetooth Module with Arduino Uno

Contents

In this tutorial, I will explain about Interfacing HC-05 Bluetooth Module with Arduino Uno. HC-05 uses bluetooth classic and can be configured in master or slave modes. It can be interfaced with a microcontroller using UART.

Components Required

Software Required

HC-05 Bluetooth Module

HC-05 Bluetooth Module

Pin Out

Circuit Diagram

Interfacing HC-05 Bluetooth Module with Arduino Uno

Description

Arduino Bluetooth Controller

Hope you installed this app from Google Play Store. This app will act as a Bluetooth remote controller for Arduino. It is very easy to use this app. Open the app and connect to the HC-05 device. Then select the option as switch mode. Now you can control the LED using the app.

Program

char data = 0;           //Variable for storing received data

void setup() 
{
    Serial.begin(9600);  //Sets the data rate in bits per second (baud) for serial data transmission
    pinMode(13, OUTPUT); //Sets digital pin 13 as output pin
}

void loop()
{
    if(Serial.available() > 0)       // Send data only when you receive data:
    {
        data = Serial.read();        //Read the incoming data and store it into variable data
        Serial.print(data);          //Print Value inside data in Serial monitor
        Serial.print("\n");          //New line 
        if(data == '1')              //Checks whether value of data is equal to 1 
            digitalWrite(13, HIGH);  //If value is 1 then LED turns ON
        else if(data == '0')         //Checks whether value of data is equal to 0
            digitalWrite(13, LOW);   //If value is 0 then LED turns OFF
    }                            
}

Description

Practical Implementation

Interfacing HC-05 Bluetooth Module with Arduino Uno – Practical Implementation

Video

Conclusion

I hope that you understood about HC-05 and interfacing it with Arduino Uno. Try to modifying the above code as per your requirements. Please feel free to comment below if you have any doubts.

Exit mobile version