In this blog, we will cover home automation and for this, we are using Arduino Board.
Technology is changing day by day. Have you noticed that the technology that was there in 2000 has now become past and in today's world using such technology has become part of a joke! Home automation is also a part of those latest technologies. In this blog, we are going to discuss home automation and for this, we are using Arduino Board.
Basic Walkthrough
As you know that market demand is changing, everyone wants everything in their hands. They do not want to waste their energy on things that can be automated. And if we see, that's right, why should we waste our time and energy on things that can be automated? So, let's get ready in today's blog, we are designing a device that can fit in the palm of your hand and can be used to control almost all the devices available in your room. So, let's get started.
Hey, wait, actually, I forgot to tell you that, in this blog, I'm not going to tell you each and everything. But yes, whatever I will tell you in this blog can help you in designing your home automation system.
To design Home Automation Using Arduino, You Will Need The Following Things:
- Hardware Part
- Software Part
You are ready!! Pack Your Bags We are about to start exploring self-designed home automation systems! But hold on, as I said we are going on a quest, we must have a plan, okay! So what do you want to get out of your backpack first? no idea!! Don't worry let me help you. As we are designing a home automation system, the first thing that will come into the picture is a door. And to secure the door you will need a door lock sensor, GSM module, Arduino and a keyboard. so what are you waiting for? Take those things out and get ready.
Door System Automation
So, why the door? Don't you want to open the apartment door as soon as you walk into your apartment? This is the first thing we should automate but how can we do it? There are two ways to accomplish this task, the first is by simply texting your system that you are home. And another option is by manually entering the password.
In the first method, the SIM800l module mounted on the Arduino board will receive a text message from the user and then the message will be verified by the Arduino and if the Arduino board finds the message valid it will unlock the door.
Talking about the second task, you have to mount the keypad outside the door and when the user inputs the passkey with the help of the keypad, the program stored in the Arduino will verify that passkey and if the passkey is correct, Arduino will open the door Otherwise it will turn on the burglar alarm. Following are two sample Arduino codes, you can use them to cross off the first post of our quest.
Use Of Relay Module In Home automation
Up to this point, we have automated the door system, now, what do you think the next thing could be that you can automate? Yes, that's right !! Lights, and coolers of your home. But before we go ahead, I warn you, it can be very dangerous if you do not take the necessary precautions. And I know that you are smart enough to take care of these kinds of things.
Okay, but there is an obstacle in our path, up to this point, we were working with DC, but now we are going to deal with 230V AC. So how is it possible to control AC devices using a DC powered Arduino? The answer to this question is a relay module. The relay module is an electro-mechanical device that is used to turn on high voltage applications with the help of low power devices. On top of this, relay equipment is cheaper for such applications than other alternative options. If you want to learn more about the relay module I request you to check this blog.
Use of HC-05 Bluetooth Technolgy In Home Automation
Okay, we've got a relay module that will trigger AC devices, but as we are designing home automation, what is it that will fit in the palm of our hand? That is your smartphone. The smartphone has Bluetooth connectivity, you can use this technology to communicate with your Arduino. If you wonder how! Then I request you to check out this blog of mine. It is very simple, in this you have to establish communication between Arduino and Smartphone and once you use the code mentioned in the HC-05 blog, everything will be under the control of your fingers.
Apart from these things you can also use the PIR sensor to detect movement and depending on the input you get from the sensor, you can either turn on the light or turn it off.
Code for PIR sensor
int relay = 11;
int sensor = 8;
int led = 13;
void setup()
{
pinMode(relay, OUTPUT);
pinMode(sensor, INPUT);
pinMode(led, OUTPUT);
digitalWrite(relay,LOW);
digitalWrite(sensor,LOW);
digitalWrite(led,LOW);
while(millis()<13000)
{
digitalWrite(led,HIGH);
delay(50);
digitalWrite(led,LOW);
delay(50);
}
digitalWrite(led,HIGH);
}
void loop()
{
if(digitalRead(sensor)==HIGH)
{
digitalWrite(relay,HIGH);
delay(3000);
digitalWrite(relay,LOW);
while(digitalRead(sensor)==HIGH);
}
}
// This is a sample code please modify it as per your requirement
Online Home automation
Up to this point, what we talked about was a part of offline automation, what additional things might you need if you wanted to take it online? The first thing you will need is a cloud server, now, you might be thinking that it will cost you a lot of money. But don't worry there are many free and secure servers are available in the market that you can use to make your home automation system online. Blink Server is one of them.
Next, you will need internet connectivity and for this purpose, you can use the ESP WI-FI module. The WI-FI module will be connected to the home router and provide Internet connectivity to your Arduino board. Once you have everything ready in your hand, you will have to install the Blink application on your smartphone, after which, based on user input, the app will send the data to the cloud and the cloud will communicate with the Arduino via the API that you used in your Arduino code. And that is that you are ready to control your home appliances remotely.
Conclusion
In this blog, I have tried to cover all the basic things related to home automation technology if you want me to write more on home automation then please let me know in the comment section.