Arduino Bluetooth Basic Tutorial





Introduction: Arduino Bluetooth Basic Tutorial

Ever thought of controlling any electronic devices with your smart phone ?Controlling your robot or any other devices with your smartphone will be really cool. Here is is a simple and basic tutorial for interfacing Bluetooth with arduino

Step 1: Things You Need



Step 2: Watch How Does It Works ?

Watch the video tutorial

Step 3: Let’s Start Building

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

Arduino Pins___________Bluetooth Module Pins

RX (Pin 0)___________________TX

TX (Pin 1)___________________RX



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

Step 4: Upload the Code

/* Bluetooh Basic: LED ON OFF - Avishkar
* Coder - Mayoogh Girish
* Website -
* Download the App :
* 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 =;        //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

Step 5: How Does It Works ??

HC 05/06 works on serial 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

Step 6: Android Application

In this tutorial I will not be covering tutorial on android app development.You can download the android application from here

How to use the app ?

Watch in video how to pair to bluetooth module
  • Download the Application from amazon app storeor here
  • Pair your device with HC 05/06 bluetooth module
    1) Turn ON HC 05/06 bluetooth module
    2)Scan for available device
    3)Pair to HC 05/06 by entering default password 1234 OR 0000
  • Install LED application on your android device
  • Open the Application
  • Press paired device

  • Select your Bluetooth module from the List (hc 05/06)

  • 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 arduinoThis project can improved to higher level like Home automation using smartphone, Smartphone controlled robot and much more

For more cool DIY projects visit my Blog

4 People Made This Project!


  • Paper Contest 2018

    Paper Contest 2018
  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Science of Cooking

    Science of Cooking

We have a be nice policy.
Please be positive and constructive.




Sir how to read data from arduino to via Bluetooth..(ex.temp valve )

your help much appreciated sir

Very clear.

I wanted to ask if you know what should be done at the Android application level if want to add a switch that would also allow to manually switch on/off the led. And then my question is how to read the switch status ? (i.e. is it in a pressed state or not?)

hi AVISHKAR .. can you do the code to upload in ATTINY85 ? support and aplication androit pleaseee... thank you .

Good job. you kept it simple to understand!!

How about if i wanted it to unlock my car when i get near and lock as i walk away with bluetooh on my phone

morning, want to ask, can nggk its bluetooth module in settings if clicking the connect / connect a bluetooth module with android android just close enough to the module, then connect automatically. thank you

pagi master, mau tanya, bisa nggk modul bluetooth nya di setting jika meng konek kan/ menghubungkan modul bluetooth dengan android cukup mendekatkan android saja ke modul, maka terhubung secara otomatis. terima kasih

Hi, I was wondering if you can help me out? I want to make a bluetooth switch interface. It is like your project but different. Instead of the iphone being the switch, the switch is push device (3.5mm jack) connected to bluetooth and thru bluetooth acts as if your touching the screen. I wondering if I can set it up like this Mini USB Nano V3.0 ATMEGA328P Module CH340G 5V 16M Micro-controller board for Arduino with the Bluetooth HC-06 BLE and instead if leds like your project it will be 3.5mm jack. I added a link check it out, something similar of what I want to make but without a timer and just 2 jack
Thank you any info is appreciated
Rodney @

May i ask, i want to make the bluetooth seperation alert. using arduino nano and hc-06(non-BLE) or hc-08(BLE), when our smartphone and the bluetooth disconnects our smartphone will ring an alarm. can you give suggestions on programs and circuits on this project. thnx

i like