Arduino Bluetooth Basic Tutorial © CC BY

Ever thought of controlling any electronic devices with your smart phone? Today I will show how to do it.

  • 413,910 views
  • 40 comments
  • 214 respects

Components and supplies

Apps and online services

About this project

Watch how does it Works ?

Watch the video tutorial

Let’s Start Building

The circuit is so simple and small , there is only few connection to be made

Arduino Pins           Bluetooth Pins

RX (Pin 0)     ———->      TX

TX (Pin 1)      ———->      RX

5V                ———->      VCC

GND             ———->      GND

Connect a LED negative to GND of arduino and positive to pin 13 with a resistance valued between 220Ω – 1KΩ. And your done with the circuit

Note : Don’t  Connect RX to RX and TX to TX of Bluetooth to arduinoyou will receive no data , Here TX means Transmit and RX means Receive

How Does it Works?

HC 05/06 works on serial communication.here the android app is designed sending serial data to the Bluetooth module when certain button is pressed. The Bluetooth module at other end receive the data and send to ardunio through the TX pin of Bluetooth module(RX pin of arduino). The Code fed to arduino check the received data and compares.If received data is 1 the LED turns on turns OFF when received data is 0

Open the serial monitor and watch the received data

Android Application

In this tutorial I will not be covering tutorial on android app development.You can download the android application from here and the source code of the entire project

How to use the App ?

Watch in video how to pair to Bluetooth module

  • Download the Application from here or here
  • Pair your device with HC 05/06 Bluetooth module1) Turn ON HC 05/06 Bluetooth module2) Scan for available device3) Pair to HC 05/06 by entering default password 1234 OR 0000
  • Install  LED application on your android device
  • Open the Application
  • Press paired devices
  • Select your Bluetooth module from the List (HC 05)
  • After connecting successfully
  • Press ON button to turn ON LED and OFF button to turn OFF LED
  • Disconnect button to disconnect from Bluetooth module

This is just basic tutorial on interfacing Bluetooth  module with arduino This project can improved to higher level like Home automation using smartphone, Smartphone controlled robot and much more.

Code

Bluetooh Basic: LED ON OFFC/C++
This program lets you to control a LED on pin 13 of arduino using a bluetooth module
/*
* Bluetooh Basic: LED ON OFF - Avishkar
* Coder - Mayoogh Girish
* Website - http://bit.do/Avishkar
* Download the App : https://github.com/Mayoogh/Arduino-Bluetooth-Basic
* This program lets you to control a LED on pin 13 of arduino using a bluetooth module
*/
char data = 0;            //Variable for storing received data
void setup()
{
    Serial.begin(9600);   //Sets the 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 & store into data
      Serial.print(data);          //Print Value inside data in Serial monitor
      Serial.print("\n");        
      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
   }
}

Schematics

Bluetooth arduino connection schematics
Hc 05 led%20blink%20circuit

Comments

Similar projects you might like

CPU and RAM Usage Monitor

Project showcase by thesahilsaluja

  • 1,124 views
  • 10 comments
  • 8 respects

AWS - Arduino Weather Station

Project tutorial by GilettaStefano

  • 5,319 views
  • 11 comments
  • 20 respects

Arduino Sunflower: An Electronic Sun-Dancer

Project tutorial by SURYATEJA

  • 2,683 views
  • 2 comments
  • 10 respects

Backpack Alarm

Project tutorial by Tomi Chen

  • 2,562 views
  • 12 comments
  • 28 respects

Arduino Based Security System

Project tutorial by Abishek Bhalaaji

  • 1,332 views
  • 5 comments
  • 8 respects

Hiking Tracker

Project tutorial by Shahariar

  • 5,054 views
  • 15 comments
  • 37 respects
Add projectSign up / Login