Arduino Bluetooth Basic Tutorial

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.

  • 713,635 views
  • 72 comments
  • 422 respects

Components and supplies

Apps and online services

About this project

Watch how does it Work?

Watch the video tutorial

Before the build check out my blog for more similar tutorials

Link to my link

Let’s Start Building

The circuit is so simple and small, there are only a few connections 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 you're done with the circuit

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

How Does it Work?

HC 05/06 works on serial communication.here the android app is designed to send serial data to the Bluetooth module when a certain button is pressed. The Bluetooth module at the other end receives the data and sends it to Arduino through the TX pin of the Bluetooth module(RX pin of Arduino). The Code fed to Arduino checks the received data and compares it.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 tutorials on android app development.You can download the android application from here and the source code of the entire project. In future, I may be posting it tutorials here http://mgprojecthub.com

How to use the App?

Watch in video how to pair to Bluetooth module

  • Download the Application form 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 the LED
  • Disconnect button to disconnect from Bluetooth module

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

UPDATE : Check out my Bluetooth RC robot using Arduino.



Check out my blog for my new projects

If you have any doubt leave a comment here. It's my blog. I will be regularly checking for feedback there rather than here.

Also, see my similar tutorials and Projects

Support me by buying me a coffee


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 : 
 *  This program lets you to control a LED on pin 13 of arduino using a bluetooth module
 */
char Incoming_value = 0;                //Variable for storing Incoming_value
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)  
  {
    Incoming_value = Serial.read();      //Read the incoming data and store it into variable Incoming_value
    Serial.print(Incoming_value);        //Print Value of Incoming_value in Serial monitor
    Serial.print("\n");        //New line 
    if(Incoming_value == '1')            //Checks whether value of Incoming_value is equal to 1 
      digitalWrite(13, HIGH);  //If value is 1 then LED turns ON
    else if(Incoming_value == '0')       //Checks whether value of Incoming_value is equal to 0
      digitalWrite(13, LOW);   //If value is 0 then LED turns OFF
  }                            
 
}                 
Arduino Bluetooth Basic Code
Upload Arduino-Bluetooth-Basic.ino sketch to arduino NOTE : Remove Bluetooth module Tx Rx connection before uploading the program.

Schematics

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

Comments

Similar projects you might like

Add WiFi to Arduino UNO

by Jefferson Paredes

  • 298,435 views
  • 112 comments
  • 186 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 349,280 views
  • 62 comments
  • 394 respects

Bluetooth control led with lcd led status display real time.

Project tutorial by Youssef Sabaa

  • 28,510 views
  • 6 comments
  • 54 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 326,575 views
  • 101 comments
  • 786 respects

ESP8266 ESP-01 Webserver

by Robin Kanattu Thomas

  • 125,830 views
  • 22 comments
  • 163 respects
Add projectSign up / Login