Ad Code

Knowledge is the Key to success - Learn , Practice & Grow

Bluetooth Interfacing With Arduino

Bluetooth Interfacing with Arduino 

 What is Bluetooth?

Bluetooth is a standardized protocol for sending and receiving data via a 2.4GHz wireless link.

It's a secure protocol, and it's perfect for short-range, Low-cost, Low-power, wireless transmission between electronic devices. 

Image of Bluetooth(HC-05 module):-



Connection of Bluetooth module With Arduino.



Pin 1.  Vcc:- It is connected to the 5v pin on the Arduino board.


Pin 2. GND:- It is connected to the ground pin on the Arduino board. 

Pin 3. TX:-  It is used to transmit the serial data and is connected to the RX pin of Arduino.

Pin 4. RX:- It is used to receive the serial data and is connected to the TX pin of the Arduino

Task 1: To display a message on a Serial monitor using Bluetooth.

Code:-

void setup ()

{

  Serial.begin(9600);

}

void loop()

{

  if (Serial.available()>0)

  {

    String ch =Serial.readString();

    Serial.println(ch);

  }

}

Output:-


Task 2: To display a message on a LCD using Bluetooth.

Code:-

#include<LiquidCrystal.h>

LiquidCrystal lcd(13,12,5,4,3,2);



void setup ()

{

  lcd.begin(16,2);

  Serial.begin(9600);

}

void loop ()

{

  if (Serial.available()>0)

  {

    lcd.clear();

    String ch = Serial.readString();

    lcd.setCursor(0,0);

  lcd.print(ch);

  delay(1000);

  }

}

Output:-





Post a Comment

0 Comments