Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Printing
    • Multicolor FDM
    • FDM
    • SLA Resin
    • MJF Nylon
    • SLS Nylon
    • SLM Metal
    • Binder Jetting
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Printing
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Printing
    • Multicolor FDM
    • FDM
    • SLA Resin
    • MJF Nylon
    • SLS Nylon
    • SLM Metal
    • Binder Jetting
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Home Automation & Smart Devices

Home Automation Using Arduino and Relay Module: Complete Guide India

Home Automation Using Arduino and Relay Module: Complete Guide India

April 1, 2026 /Posted by / 0

Home automation using Arduino and relay modules is one of the most practical and affordable ways to turn your regular Indian household into a smart home. Whether you want to control lights, fans, geysers, or water pumps from your smartphone or set up automatic schedules, an Arduino-based home automation system can do it all — at a fraction of the cost of commercial smart home solutions like Alexa-enabled switches or Sonoff devices.

In this comprehensive guide, we will walk you through everything you need to know about building a home automation system with Arduino and relay modules, specifically designed for Indian 230V AC appliances.

Table of Contents

  • What Is Home Automation?
  • Components Needed for Arduino Home Automation
  • Understanding Relay Modules for AC Appliances
  • Circuit Diagram and Wiring Guide
  • Arduino Code for Relay Control
  • Adding Bluetooth Control via Mobile App
  • WiFi Control with ESP8266 Shield
  • Safety Tips for 230V AC Wiring in India
  • Frequently Asked Questions
  • Conclusion

What Is Home Automation?

Home automation refers to the use of electronic devices and microcontrollers to automatically control household appliances such as lights, fans, air conditioners, geysers, and water pumps. Instead of manually flipping switches, you can use your smartphone, voice commands, or pre-set schedules to operate these appliances remotely.

For Indian homes, home automation is particularly useful because:

  • Power saving: Automatically turn off appliances when not in use, reducing your electricity bill
  • Convenience: Control lights and fans from your bed without getting up
  • Safety: Monitor and control geysers and water pumps remotely to prevent damage
  • Scheduling: Set timers for porch lights, garden pumps, and inverter switching

Arduino makes this possible at a cost of just ₹500–₹2,000, compared to ₹5,000–₹15,000 for commercial smart home kits.

Components Needed for Arduino Home Automation

Here is a complete list of components you will need to build a basic 4-appliance home automation system:

Component Quantity Purpose
Arduino Uno 1 Main controller
4-Channel 5V Relay Module 1 Switching AC appliances
HC-05 Bluetooth Module 1 Mobile phone control
Jumper Wires (M-F, M-M) 20 Connections
5V Power Supply / USB Cable 1 Powering Arduino
Electrical Wires (1mm copper) As needed AC wiring
Switch Board / Junction Box 1 Housing the relay
🛒 Recommended: Original Arduino Uno Rev3 — The official Arduino Uno board, perfect for home automation projects with reliable performance and extensive community support.
🛒 Recommended: 4 Channel 5V Relay Module — Control up to 4 appliances independently. Optocoupler-isolated for safe Arduino interfacing.
🛒 Recommended: 4 Channel 30A Relay Module with Optocoupler — Heavy-duty 30A relay module for high-power appliances like geysers and water pumps. Supports both high and low trigger.

Understanding Relay Modules for AC Appliances

A relay is an electrically operated switch that allows a low-voltage circuit (5V from Arduino) to control a high-voltage circuit (230V AC mains in India). This is the key component that makes home automation possible — it acts as a bridge between your Arduino and your household wiring.

How a Relay Works

Each relay has three output terminals:

  • COM (Common): Connect the live wire from your mains supply here
  • NO (Normally Open): When the relay is activated, COM connects to NO — the appliance turns ON
  • NC (Normally Closed): When the relay is de-activated, COM connects to NC — use this for fail-safe applications

The input side has:

  • VCC: Connect to Arduino 5V
  • GND: Connect to Arduino GND
  • IN1, IN2, IN3, IN4: Signal pins connected to Arduino digital pins

Active Low vs Active High

Most relay modules available in India are active LOW, meaning the relay turns ON when the input pin receives a LOW (0V) signal. This is important to remember when writing your Arduino code — sending digitalWrite(pin, LOW) will activate the relay.

Circuit Diagram and Wiring Guide

Here is how to wire a 4-channel relay module with Arduino Uno to control 4 appliances:

Low-Voltage Side (Arduino to Relay Module)

Arduino Pin 2  → Relay IN1 (Light 1)
Arduino Pin 3  → Relay IN2 (Light 2)
Arduino Pin 4  → Relay IN3 (Fan)
Arduino Pin 5  → Relay IN4 (Geyser)
Arduino 5V     → Relay VCC
Arduino GND    → Relay GND

High-Voltage Side (230V AC Wiring)

Mains Live Wire → Relay COM terminal
Relay NO terminal → Appliance Live terminal
Mains Neutral Wire → Appliance Neutral terminal (direct, not through relay)

Important: Only the live (phase) wire goes through the relay. The neutral wire connects directly to the appliance. Never switch the neutral wire through a relay — this is a safety requirement as per Indian electrical standards.

⚠️ Safety Warning: Working with 230V AC mains electricity is dangerous. If you are not comfortable with electrical wiring, please get help from a qualified electrician. Always disconnect the mains supply before making any connections.

Arduino Code for Relay Control

Here is the basic Arduino code to control 4 relays via serial commands. You can send commands like ‘1’, ‘2’, ‘3’, ‘4’ to toggle each appliance:

// Home Automation with 4-Channel Relay
// For Indian 230V AC appliances

#define RELAY1 2  // Light 1
#define RELAY2 3  // Light 2
#define RELAY3 4  // Fan
#define RELAY4 5  // Geyser

bool relayState[4] = {HIGH, HIGH, HIGH, HIGH}; // All OFF initially (active LOW)

void setup() {
  Serial.begin(9600);
  
  // Set relay pins as output
  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);
  pinMode(RELAY3, OUTPUT);
  pinMode(RELAY4, OUTPUT);
  
  // Turn all relays OFF (active LOW, so HIGH = OFF)
  digitalWrite(RELAY1, HIGH);
  digitalWrite(RELAY2, HIGH);
  digitalWrite(RELAY3, HIGH);
  digitalWrite(RELAY4, HIGH);
  
  Serial.println("Home Automation System Ready");
  Serial.println("Send 1-4 to toggle appliances");
  Serial.println("Send 'A' to turn all ON, 'B' to turn all OFF");
}

void loop() {
  if (Serial.available() > 0) {
    char command = Serial.read();
    
    switch (command) {
      case '1':
        relayState[0] = !relayState[0];
        digitalWrite(RELAY1, relayState[0]);
        Serial.print("Light 1: ");
        Serial.println(relayState[0] ? "OFF" : "ON");
        break;
        
      case '2':
        relayState[1] = !relayState[1];
        digitalWrite(RELAY2, relayState[1]);
        Serial.print("Light 2: ");
        Serial.println(relayState[1] ? "OFF" : "ON");
        break;
        
      case '3':
        relayState[2] = !relayState[2];
        digitalWrite(RELAY3, relayState[2]);
        Serial.print("Fan: ");
        Serial.println(relayState[2] ? "OFF" : "ON");
        break;
        
      case '4':
        relayState[3] = !relayState[3];
        digitalWrite(RELAY4, relayState[3]);
        Serial.print("Geyser: ");
        Serial.println(relayState[3] ? "OFF" : "ON");
        break;
        
      case 'A': // All ON
        for (int i = 0; i < 4; i++) {
          relayState[i] = LOW;
        }
        digitalWrite(RELAY1, LOW);
        digitalWrite(RELAY2, LOW);
        digitalWrite(RELAY3, LOW);
        digitalWrite(RELAY4, LOW);
        Serial.println("All appliances ON");
        break;
        
      case 'B': // All OFF
        for (int i = 0; i < 4; i++) {
          relayState[i] = HIGH;
        }
        digitalWrite(RELAY1, HIGH);
        digitalWrite(RELAY2, HIGH);
        digitalWrite(RELAY3, HIGH);
        digitalWrite(RELAY4, HIGH);
        Serial.println("All appliances OFF");
        break;
    }
  }
}

Adding Bluetooth Control via Mobile App

To control your home automation system from your Android phone, add an HC-05 Bluetooth module. This lets you send commands wirelessly using apps like “Arduino Bluetooth Controller” or “Bluetooth Electronics” from the Play Store.

Wiring HC-05 to Arduino

HC-05 VCC → Arduino 5V
HC-05 GND → Arduino GND
HC-05 TX  → Arduino Pin 10 (Software Serial RX)
HC-05 RX  → Arduino Pin 11 (through voltage divider: 1kΩ + 2kΩ)

Note: The HC-05 RX pin operates at 3.3V logic. Use a voltage divider (1kΩ and 2kΩ resistors) to step down the Arduino’s 5V TX signal to approximately 3.3V.

Bluetooth-Enabled Code

#include <SoftwareSerial.h>

SoftwareSerial bluetooth(10, 11); // RX, TX

#define RELAY1 2
#define RELAY2 3
#define RELAY3 4
#define RELAY4 5

void setup() {
  Serial.begin(9600);
  bluetooth.begin(9600);
  
  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);
  pinMode(RELAY3, OUTPUT);
  pinMode(RELAY4, OUTPUT);
  
  // All relays OFF
  digitalWrite(RELAY1, HIGH);
  digitalWrite(RELAY2, HIGH);
  digitalWrite(RELAY3, HIGH);
  digitalWrite(RELAY4, HIGH);
  
  Serial.println("Bluetooth Home Automation Ready");
}

void loop() {
  if (bluetooth.available() > 0) {
    char command = bluetooth.read();
    
    switch (command) {
      case '1': digitalWrite(RELAY1, !digitalRead(RELAY1)); break;
      case '2': digitalWrite(RELAY2, !digitalRead(RELAY2)); break;
      case '3': digitalWrite(RELAY3, !digitalRead(RELAY3)); break;
      case '4': digitalWrite(RELAY4, !digitalRead(RELAY4)); break;
      case 'A': // All ON
        digitalWrite(RELAY1, LOW);
        digitalWrite(RELAY2, LOW);
        digitalWrite(RELAY3, LOW);
        digitalWrite(RELAY4, LOW);
        break;
      case 'B': // All OFF
        digitalWrite(RELAY1, HIGH);
        digitalWrite(RELAY2, HIGH);
        digitalWrite(RELAY3, HIGH);
        digitalWrite(RELAY4, HIGH);
        break;
    }
    
    // Send status back
    bluetooth.print("R1:");
    bluetooth.print(digitalRead(RELAY1) ? "OFF" : "ON");
    bluetooth.print(" R2:");
    bluetooth.print(digitalRead(RELAY2) ? "OFF" : "ON");
    bluetooth.print(" R3:");
    bluetooth.print(digitalRead(RELAY3) ? "OFF" : "ON");
    bluetooth.print(" R4:");
    bluetooth.println(digitalRead(RELAY4) ? "OFF" : "ON");
  }
}

WiFi Control with ESP8266 Shield

For internet-based control — where you can operate appliances from anywhere in the world — upgrade to WiFi using an ESP8266 module or, better yet, replace Arduino entirely with an ESP32 board that has built-in WiFi and Bluetooth.

🛒 Recommended: ESP32 Development Board (38 Pin) — Built-in WiFi and Bluetooth, 38 GPIO pins, and enough processing power for a complete smart home controller. The best upgrade from Arduino for home automation.

With an ESP32, you can create a web server that hosts a control panel accessible from any device on your home network. You can also integrate with cloud platforms like Blynk, Google Home, or Home Assistant for advanced automation.

Simple ESP32 Web Server for Relay Control

#include <WiFi.h>
#include <WebServer.h>

const char* ssid = "Your_WiFi_Name";
const char* password = "Your_WiFi_Password";

WebServer server(80);

#define RELAY1 26
#define RELAY2 27
#define RELAY3 14
#define RELAY4 12

void setup() {
  Serial.begin(115200);
  
  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);
  pinMode(RELAY3, OUTPUT);
  pinMode(RELAY4, OUTPUT);
  
  // All OFF
  digitalWrite(RELAY1, HIGH);
  digitalWrite(RELAY2, HIGH);
  digitalWrite(RELAY3, HIGH);
  digitalWrite(RELAY4, HIGH);
  
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.print("IP: ");
  Serial.println(WiFi.localIP());
  
  server.on("/", handleRoot);
  server.on("/toggle", handleToggle);
  server.begin();
}

void handleRoot() {
  String html = "<html><head><meta name='viewport' content='width=device-width'>";
  html += "<style>body{font-family:sans-serif;text-align:center;padding:20px;}";
  html += ".btn{padding:15px 30px;margin:10px;font-size:18px;border-radius:8px;border:none;color:white;cursor:pointer;}";
  html += ".on{background:#28a745;}.off{background:#dc3545;}</style></head><body>";
  html += "<h1>Smart Home Control</h1>";
  
  String labels[] = {"Light 1", "Light 2", "Fan", "Geyser"};
  int pins[] = {RELAY1, RELAY2, RELAY3, RELAY4};
  
  for (int i = 0; i = 1 && relay <= 4) {
    digitalWrite(pins[relay-1], !digitalRead(pins[relay-1]));
  }
  server.sendHeader("Location", "/");
  server.send(302);
}

void loop() {
  server.handleClient();
}
🛒 Recommended: NodeMCU ESP8266 V3 WiFi Development Board — An affordable WiFi-enabled board that can directly replace Arduino for home automation. Supports web server hosting and cloud connectivity.

Safety Tips for 230V AC Wiring in India

Working with mains electricity in India (230V AC, 50Hz) requires extra precautions. Here are essential safety guidelines:

  1. Always use MCBs (Miniature Circuit Breakers): Install an MCB before your relay setup. If a short circuit occurs, the MCB will trip and cut power instantly.
  2. Use optocoupler-isolated relay modules: These modules electrically separate the Arduino circuit from the 230V AC circuit, preventing damage to your microcontroller.
  3. Proper wire gauge: Use 1mm copper wire for lighting circuits and 1.5mm for power-intensive appliances like geysers and ACs.
  4. Enclose everything: Mount your relay module inside a proper electrical junction box. Never leave exposed 230V connections.
  5. Earth connection: Always ensure proper earthing for all metal-body appliances like geysers and washing machines.
  6. Monsoon precautions: If installing in outdoor or semi-outdoor locations (balcony, terrace), use IP65-rated enclosures to protect against moisture during the monsoon season.
  7. Label everything: Clearly label which relay controls which appliance for future maintenance.
  8. UPS/inverter compatibility: If your home has an inverter, connect essential loads (lights) through the inverter circuit and non-essential loads (geyser) through direct mains.

Frequently Asked Questions

Can I use Arduino to control a 230V geyser in India?

Yes, but you need a relay rated for the geyser’s current draw. A typical 3kW geyser draws about 13A at 230V. Use a 30A relay module for safety margin. The 4-channel 30A relay module is ideal for this purpose.

Is it safe to use relay modules with 230V AC?

Yes, when you use optocoupler-isolated relay modules and follow proper wiring practices. The optocoupler provides galvanic isolation between the low-voltage Arduino circuit and the high-voltage AC circuit. Always use relays rated for at least 10A at 250V AC for Indian households.

Can I control AC and DC appliances with the same relay?

Yes. The relay is simply a switch — it does not care whether the load is AC or DC. You can control 230V AC lights and 12V DC LED strips with the same relay module, just on different channels.

How many appliances can I control with one Arduino?

An Arduino Uno has 14 digital pins, so you can control up to 14 relays. However, for more than 8 relays, consider using a separate 5V power supply for the relay modules instead of powering them from the Arduino’s onboard regulator.

What happens to the relays during a power cut?

When power is restored, the Arduino reboots and the code sets all relays to their default state (OFF in our code). If you want relays to remember their last state, store the state in EEPROM and restore it during setup().

Can I add more than 4 channels later?

Absolutely. You can cascade multiple relay modules. Use a 4-channel and an 8-channel module together for 12 channels, or use an 8-channel relay module from the start if you plan to control many appliances.

Conclusion

Building a home automation system with Arduino and relay modules is one of the most rewarding DIY electronics projects you can undertake. For under ₹2,000, you get a fully functional smart home setup that can control lights, fans, geysers, and other appliances — either through Bluetooth from your phone or via WiFi from anywhere in the world.

The best part is that this system is endlessly expandable. Start with 4 channels and add more as you grow comfortable. Upgrade from Bluetooth to WiFi, add sensors for temperature and motion detection, and eventually integrate with platforms like Home Assistant or Google Home.

Ready to build your own smart home? Browse our complete range of relay modules, Arduino boards, and electronic components at Zbotic — India’s largest electronics component store with fast shipping across the country.

Tags: Arduino, home automation, India, relay, smart home
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
BLDC Motor Controller Guide: H...
blog bldc motor controller guide hub motor and mid drive explained 612399
blog your first drone build complete assembly guide india 612402
Your First Drone Build: Comple...

Related posts

Svg%3E
Read more

MQTT for Home Automation: ESP32 + Mosquitto + Home Assistant

April 1, 2026 0
MQTT is the backbone protocol of professional home automation systems. If you are building a smart home with multiple ESP32... Continue reading
Svg%3E
Read more

Curtain and Blind Automation: Stepper Motor Controller

April 1, 2026 0
Curtain automation is one of the most satisfying smart home upgrades you can build. Imagine your curtains opening automatically at... Continue reading
Svg%3E
Read more

Smart Doorbell with Camera: ESP32-CAM Video Intercom

April 1, 2026 0
A smart doorbell with a camera lets you see who is at your door from your phone, even when you... Continue reading
Svg%3E
Read more

Blynk IoT Platform: Control Arduino and ESP32 from Mobile

April 1, 2026 0
The Blynk IoT platform is the fastest way to control your Arduino and ESP32 projects from your mobile phone. Instead... Continue reading
Svg%3E
Read more

PIR Sensor Automatic Light: Save Electricity with Motion Detection

April 1, 2026 0
PIR sensor automatic lights are the simplest and most effective way to save electricity in Indian homes. By automatically turning... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Customer Support Email: [email protected]
WhatsApp: 020 6913 4444

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now
Chat with us