Smart Home Automation System Wiring Diagram (Using Arduino)



Hi, in this article, we are going to see the Wiring diagram for Smart Home Automation System using Arduino. This automation system will help you to control your home appliances such as lights, fans, and others using a smartphone wirelessly. It is a very simple Arduino-based automation system where we have used the relay modules with the Arduino to control appliances like lights, fans, etc. The Bluetooth module helps to connect our smartphone to the Arduino wirelessly. There are a lot of Mobile Applications that can help to control our appliances through the smartphone. Some of them are Blynk, Bluetooth Terminal, Virtuino, etc.

We have made this system because it is very simple. The HC-05 Bluetooth module is easy to interface with the Arduino, requiring just a basic serial communication setup. No complex networking configurations are needed. Once paired with a smartphone or tablet, controlling lights and fans is straightforward. Users can send commands directly from their device(e.g.; smartphone), even they can do it easily with limited technical knowledge.


List of Components


Here is the below list of components required for this system,
  • Arduino Uno Module - 1 Pcs
  • Bluetooth Module HC-05 - 1 Pcs
  • 5V Single Channel Relay Module - Here we used 4 modules, you can use more also
  • 230V AC / 5V DC Power Adapter - 1 Pcs
  • 230V AC Power Source
  • Lights and Fans that are to be controlled - Here we have used two lights and two fans, you can use more
  • Wires and Connectors as per requirement


Wiring Diagram


Here, you can see the Smart Home Automation System Wiring Diagram using Arduino.

Wiring Diagram for Smart Home Automation System using Arduino Uno, Relay Module, Bluetooth Module HC-05


Connection Procedure


Bluetooth Module HC-05 and Arduino Connection

  1. Connect the VCC pin of the Bluetooth Module to the 5V pin of the Arduino.
  2. Connect the GND pin of the Bluetooth Module to the GND pin of the Arduino.
  3. Connect the TX pin of the Bluetooth Module to the RX pin of the Arduino.
  4. Connect the RX pin of the Bluetooth Module to the TX pin of the Arduino.
  5. Leave the KEY pin of the Bluetooth Module unconnected for regular operation.

Arduino Uno and Relay Modules Connection

  1. Use each relay module to control individual lights and fans.
  2. Connect the VCC pin of all the relay modules together and then connect to the 5V pin of the Arduino.
  3. Connect the GND pin of all the relay modules together and then connect to the GND pin of the Arduino.
  4. Connect the Signal Pin of the relay modules to the digital output pins of the Arduino. Here, we have used 8, 9, 10, and 11 Pins.

Relay Modules and Loads(Lights, Fans) Connection

  1. Connect NO(normally open) terminals of all the relays together and then connect it to the phase terminal of the 230V Power Source.
  2. Now connect the common terminal of each relay to the phase terminal of their respective loads e.g. here we have connected the phase terminal of Bulb 1 to the common terminal of Relay 1. Similarly, Fan 1 to Relay 2, Bulb 2 to Relay 3, and Fan 2 to Relay 4.
  3. Connect the neutral terminal of all the loads e.g. lights and fans together and then connect it to the neutral terminal of the 230V power source.

Power Supply Connection


Use the 230V AC / 5V DC Power Adapter to power the Arduino Uno and the 5V relay modules. Connect the 5V and GND outputs from the adapter to the Arduino's Power jack or the 5V and GND pins, respectively. As the Relay modules are already connected to the Arduino's 5V and GND pins so they will get the power supply through the Arduino. We do not need the extra connection between the relay modules and the power adapter.


Coding and Configurations


Here below, we have given a simple code to operate this system. You can modify this code as per your requirement e.g; changes in the number of loads, delays, status, etc

#include<SoftwareSerial.h>

int bulb1 = 8;
int fan1 = 9;
int bulb2 = 10;
int fan2 = 11;

SoftwareSerial bt(0,1); /* (Rx,Tx) */

String str;

void setup() {
bt.begin(9600);
Serial.begin(9600);

pinMode(bulb1,OUTPUT);
pinMode(fan1,OUTPUT);
pinMode(bulb2,OUTPUT);
pinMode(fan2,OUTPUT);

}

void loop() {

if (bt.available())
{
str = bt.read();
Serial.println(str);
//bulb1
if(str=="bulb1 on")
{
digitalWrite(bulb1,HIGH);
Serial.println("BUlB 1 is ON");
}
else if(str=="bulb1 off")
{
digitalWrite(bulb1,LOW);
Serial.println("BUlB 1 is OFF");
}
else
{
digitalWrite(bulb1,LOW);
}
//fan1
if(str=="fan1 on")
{
digitalWrite(fan1,HIGH);
Serial.println("Fan 1 is ON");
}
else if(str=="fan1 off")
{
digitalWrite(fan1,LOW);
Serial.println("Fan 1 is OFF");
}
else
{
digitalWrite(fan1,LOW);
}
////bulb2
if(str=="bulb2 on")
{
digitalWrite(bulb2,HIGH);
Serial.println("BUlB 2 is ON");
}
else if(str=="bulb2 off")
{
digitalWrite(bulb2,LOW);
Serial.println("BUlB 2 is OFF");
}
else
{
digitalWrite(bulb2,LOW);
}
//fan2
if(str=="fan2 on")
{
digitalWrite(fan2,HIGH);
Serial.println("Fan 2 is ON");
}
else if(str=="fan2 off")
{
digitalWrite(fan2,LOW);
Serial.println("Fan 2 is OFF");
}
else
{
digitalWrite(fan2,LOW);
}

}
}

After making all the connections properly as shown in the above wiring diagram and loading the above Arduino Code Turn on the Bluetooth in your smartphone and connect the HC-05 module. While connecting you need to enter the password. By default, the password is “0000” or “1234”. After successfully connecting your smartphone with the HC-05, Open the “Bluetooth Terminal" app on your smartphone. Once you open the application it will show your device connected to HC-05. Now you can send the data to turn on or off any bulb or fan.


Read Also: 

Thank you for visiting the Website. Keep visiting for more Updates.

Smart Home Automation System Wiring Diagram (Using Arduino) Smart Home Automation System Wiring Diagram (Using Arduino) Reviewed by Author on September 14, 2024 Rating: 5
Powered by Blogger.