Home Automation System | Voice & Remote Control

These are the following steps:-
Introduction:

Home automation is the automatic control of electronic devices in your home. These devices are connected main automation control board, which allows them to be controlled remotely. With a home automation system, you can control electronic devices via an app or voice assistant. For example, you can turn on and off lights of your room remotely with voice commands. Home automation gives you access to control devices from a mobile device that makes life more easy and convenient. The home automation system We have designed is based on Arduino, Bluetooth module, and four relays. We have also created an Android app that allows the user to access the voices command remote control buttons to turn on and off the devices.

Step 1:

First, you need to design the PCB layout and then upload it to PCB gogo and get the desired circuit. Then You need to install the application from Google play. To protect your voltage you need to follow our article and protect your system.

Step 2:

First we need to pair our smart phone with Bluetooth module then we need to open the app and select the Bluetooth device now we are ready. The app has eight buttons they send capital alphabets to turn on the device and small alphabets to turn off the device. We are using four relays so we will use first four buttons. The buttons send these commands using app to control the relays.
The button 1 will send “A” to turn on the relay 1 and “a” to turn off the relay 1.
The button 2 will send “B” to turn on the relay 2 and “b” to turn off the relay 2.
The button 3 will send “C” to turn on the relay 3 and “c” to turn off the relay 3.
The button 4 will send “D” to turn on the relay 4 and “d” to turn off the relay 4.
We can send these voice commands using app to control the relays.
“Turn on all relay” to turn on all relays and “Turn off all relay” to turn off all relays.
“Turn on relay 1” to turn on relay1 and “Turn off relay 1” to turn off all relay 1.
“Turn on relay 2” to turn on relay2 and “Turn off relay 2” to turn off all relay 2.
“Turn on relay 3” to turn on relay 3 and “Turn off relay 3” to turn off all relay 3.
“Turn on relay 4” to turn on relay 4 and “Turn off relay 4” to turn off all relay 4.

Step 3:

Now upload the code to Arduino.

#define led1 2
#define led2 3
#define led3 4
#define led4 5
#define relay1 7
#define relay2 8
#define relay3 9
#define relay4 10
#include <SoftwareSerial.h>
SoftwareSerial mySerial(11, 12); // RX, TX
String ms;
void setup() {
  mySerial.begin(9600);
Serial.begin(9600);
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
pinMode(led4,OUTPUT);
pinMode(relay1,OUTPUT);
pinMode(relay2,OUTPUT);
pinMode(relay3,OUTPUT);
pinMode(relay4,OUTPUT);
}

void loop() {

  while(mySerial.available()>0){
  ms=mySerial.readString();
  
Serial.println(ms);}
 
   if(ms=="A"|ms.equalsIgnoreCase("turn on relay 1")|ms.equalsIgnoreCase("turn on relay one")){
digitalWrite(led1,HIGH);
digitalWrite(relay1,HIGH);
   }
   else   if(ms=="a"|ms.equalsIgnoreCase("turn off relay 1")|ms.equalsIgnoreCase("turn off relay one")){
digitalWrite(led1,LOW);
digitalWrite(relay1,LOW);
   }
   else if(ms=="B"|ms.equalsIgnoreCase("turn on relay 2")|ms.equalsIgnoreCase("turn on relay two")){
digitalWrite(led2,HIGH);
digitalWrite(relay2,HIGH);
   }
   else   if(ms=="b"|ms.equalsIgnoreCase("turn off relay 2")|ms.equalsIgnoreCase("turn off relay two")){
digitalWrite(led2,LOW);
digitalWrite(relay2,LOW);
   }
   else if(ms=="C"|ms.equalsIgnoreCase("turn on relay 3")|ms.equalsIgnoreCase("turn on relay three")){
digitalWrite(led3,HIGH);
digitalWrite(relay3,HIGH);
   }
   else   if(ms=="c"|ms.equalsIgnoreCase("turn off relay 3")|ms.equalsIgnoreCase("turn off relay three")){
digitalWrite(led3,LOW);
digitalWrite(relay3,LOW);
   }
   else if(ms=="D"|ms.equalsIgnoreCase("turn on relay 4")|ms.equalsIgnoreCase("turn on relay four")){
digitalWrite(led4,HIGH);
digitalWrite(relay4,HIGH);
   }
   else   if(ms=="d"|ms.equalsIgnoreCase("turn off relay 4")|ms.equalsIgnoreCase("turn off relay four")){
digitalWrite(led4,LOW);
digitalWrite(relay4,LOW);
   }else if(ms.equalsIgnoreCase("turn on all relay")){
digitalWrite(led1,HIGH);
digitalWrite(relay1,HIGH);
digitalWrite(led2,HIGH);
digitalWrite(relay2,HIGH);
digitalWrite(led3,HIGH);
digitalWrite(relay3,HIGH);
digitalWrite(led4,HIGH);
digitalWrite(relay4,HIGH);
   }
   else   if(ms.equalsIgnoreCase("turn off all relay")){
digitalWrite(led1,LOW);
digitalWrite(relay1,LOW);
digitalWrite(led2,LOW);
digitalWrite(relay2,LOW);
digitalWrite(led3,LOW);
digitalWrite(relay3,LOW);
digitalWrite(led4,LOW);
digitalWrite(relay4,LOW);
   }
  
   
 
}
Components:
Circuit Diagram:
Icon

4ch_bt_automation 790.86 KB 161 downloads

...
Gerber files
Icon

4ch_bt_automation 790.86 KB 161 downloads

...
Arduino Code
Icon

4ch_bt_automation 0.57 KB 79 downloads

...
Icon

4ch_bt_automation 2.39 KB 62 downloads

...
Useful Tools

Leave a Comment