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
- Arduino UNO – 1
- HC-05 Bluetooth Module – 1
- 5V Single-Channel Relay Module – 1
- Jumper wires
- Breadboard
- 5V power supply/USB cable
- Mobile phone with Bluetooth Terminal application
- 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-05 | Arduino UNO |
|---|---|
| VCC | 5V |
| GND | GND |
| TXD | D10 |
| RXD | D11 |
Relay Module to Arduino
| Relay | Arduino UNO |
|---|---|
| VCC | 5V |
| GND | GND |
| IN | D8 |
Arduino Program
#include <SoftwareSerial.h>SoftwareSerial BT(10, 11); // RX, TXconst int relayPin = 8;void setup(){Serial.begin(9600);BT.begin(9600);pinMode(relayPin, OUTPUT);// Relay OFF initiallydigitalWrite(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
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.







