Interfacing Relay module to demonstrate Bluetooth based home automation application. (using Bluetooth and relay).

Computer Programming  and Technology.
By -
0

Practical: Interfacing Relay module to demonstrate Bluetooth based home automation application. (using Bluetooth and relay).

Aim

To interface a relay module with Arduino and demonstrate a Bluetooth-based home automation application using an HC-05 Bluetooth module.








Components Required

  1. Arduino UNO – 1
  2. HC-05 Bluetooth Module – 1
  3. 5V Single-Channel Relay Module – 1
  4. Jumper wires
  5. Breadboard
  6. 5V power supply/USB cable
  7. Mobile phone with Bluetooth Terminal application
  8. LED + resistor or low-voltage DC lamp for classroom demonstration

Safety: For a classroom practical, use an LED or low-voltage DC load. Do not connect students directly to 220V AC mains. If an AC load is required, it should be wired by a qualified person using appropriate isolation and safety procedures.

Circuit Connections

HC-05 to Arduino

HC-05Arduino UNO
VCC5V
GNDGND
TXDD10
RXDD11

Relay Module to Arduino

RelayArduino UNO
VCC5V
GNDGND
IND8

Arduino Program

#include <SoftwareSerial.h>

SoftwareSerial BT(10, 11); // RX, TX
const int relayPin = 8;
void setup()
{
Serial.begin(9600);
BT.begin(9600);
pinMode(relayPin, OUTPUT);
// Relay OFF initially
digitalWrite(relayPin, LOW);
Serial.println("Bluetooth Home Automation Ready");
Serial.println("Send 1 = ON, 0 = OFF");
}
void loop()
{
if (BT.available())
{
char data = BT.read();
if (data == '1')
{
digitalWrite(relayPin, HIGH);
Serial.println("Relay ON");
}
else if (data == '0')
{
digitalWrite(relayPin, LOW);
Serial.println("Relay OFF");
}
}
}

Procedure

Step 1: Connect the HC-05 Bluetooth module and relay module to Arduino according to the circuit diagram.

Step 2: Upload the Arduino program.

Step 3: Pair the mobile phone with HC-05.

Step 4: Open a Bluetooth Terminal application.

Step 5: Connect the application to HC-05.

Step 6: Send 1 from the mobile phone.

→ Arduino receives 1 → Relay turns ON → Connected load turns ON.

Step 7: Send 0 from the mobile phone.

→ Arduino receives 0 → Relay turns OFF → Connected load turns OFF.

Working Principle

Mobile Phone
↓
Bluetooth
↓
HC-05
↓
Arduino UNO
↓
Relay Module
↓
Electrical Load

The mobile phone sends commands wirelessly through Bluetooth. The HC-05 transfers these commands to Arduino. Arduino processes the received command and controls the relay accordingly.

Expected Output


Mobile CommandRelayLoad
1ONON
0OFFOFF

Result

The relay module was successfully interfaced with Arduino and controlled wirelessly through an HC-05 Bluetooth module, demonstrating a basic Bluetooth-based home automation system.

Post a Comment

0 Comments

Post a Comment (0)
3/related/default