Description:
A Bluetooth control home automation system is a technology that enables you to control your home appliances and devices wirelessly through your smartphone or other Bluetooth-enabled devices. The system involves the use of a microcontroller and Bluetooth module that allows you to communicate with the appliances and devices from a distance.
The Bluetooth control home automation system typically consists of a central control unit, which is the microcontroller that sends and receives signals from the appliances and devices. This control unit is usually connected to a Bluetooth module that allows it to communicate with your smartphone or other Bluetooth-enabled devices. You can use an app on your smartphone to control the appliances and devices, or you can use voice commands if the system is integrated with a voice assistant like Alexa or Google Home.
The system can control a wide range of home appliances and devices, including lights, fans, air conditioners, TVs, and home security systems. The appliances and devices are connected to the control unit via relays or other switching devices that enable the system to turn them on or off or adjust their settings.
One of the significant advantages of a Bluetooth control home automation system is that it provides convenience and flexibility. You can control your home appliances and devices from anywhere in the house, and you don't have to be physically present to turn them on or off. The system can also help you save energy and reduce your electricity bills by turning off appliances and devices when they're not in use.
Overall, a Bluetooth control home automation system is an innovative and convenient technology that can help you manage your home appliances and devices more efficiently and comfortably.
Arduino Code:
//Viral Science www.youtube.com/c/viralscience www.viralsciencecreativity.com
//Home Automation Bluetooth App Controlled
String readString;
#define relay1 2 //Connect relay1 to pin 2
#define relay2 3 //Connect relay2 to pin 3
#define relay3 4 //Connect relay3 to pin 4
#define relay4 5 //Connect relay4 to pin 5
void setup()
{
Serial.begin(9600); //Set rate for communicating with phone
pinMode(relay1, OUTPUT); //Set relay1 as an output
pinMode(relay2, OUTPUT);
pinMode(relay3, OUTPUT); //Set relay2 as an output
pinMode(relay4, OUTPUT);
digitalWrite(relay1, HIGH); //Switch relay1 off
digitalWrite(relay2, HIGH); //Swtich relay2 off
digitalWrite(relay3, HIGH); //Switch relay1 off
digitalWrite(relay4, HIGH); //Swtich relay2 off
}
void loop()
{
while(Serial.available()) //Check if there are available bytes to read
{
delay(10); //Delay to make it stable
char c = Serial.read(); //Conduct a serial read
if (c == '#'){
break; //Stop the loop once # is detected after a word
}
readString += c; //Means readString = readString + c
}
if (readString.length() >0)
{
Serial.println(readString);
if(readString == "switch all on"){
switchallon();
}
else if(readString == "switch all off"){
switchalloff();
}
else if(readString == "relay1 on"){
digitalWrite(relay1, LOW);
}
else if(readString == "relay1 off"){
digitalWrite(relay1, HIGH);
}
else if(readString == "relay2 on"){
digitalWrite(relay2, LOW);
}
else if(readString == "relay2 off"){
digitalWrite(relay2, HIGH);
}
else if(readString == "relay3 on"){
digitalWrite(relay3, LOW);
}
else if(readString == "relay3 off"){
digitalWrite(relay3, HIGH);
}
else if(readString == "relay4 on"){
digitalWrite(relay4, LOW);
}
else if(readString == "relay4 off"){
digitalWrite(relay4, HIGH);
}
readString="";
}
}
void switchalloff() //Function for turning OFF all relays
{
digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
digitalWrite(relay3, HIGH);
digitalWrite(relay4, HIGH);
}
void switchallon() //Function for turning ON all relays
{
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
digitalWrite(relay3, LOW);
digitalWrite(relay4, LOW);
}
Comments
Post a Comment