Smart Phone Controlled Home Automation Using Arduino

Automation is the essence of today’s world. Automation can make our life easy and secure. There are many ways to obtain automation. Automation can be achieved by Wi-Fi, IR, GSM, Bluetooth and many other technologies.

Smart Phone Controlled Home Automation Using Arduino

Previously we have covered many types of Home automations using different technologies like:

In this project we are to going to wirelessly Control Home Appliances using Bluetooth and Arduino. We will show here that how to control electric appliances by simply sending data from Android Smart phone to Arduino.

Required Components:

  • Arduino Mega (any model)
  • Android Phone
  • HC05 Bluetooth Modules
  • Bluetooth terminal App
  • L293D IC
  • Two 6V relays
  • Two bulbs
  • Breadboards
  • 12 v,1A Adapter
  • 16×2 LCD

Circuit Diagram:

Circuit diagram of this Bluetooth controlled Home Automation is simple and connections can be made easily. LCD, Bluetooth Module HC05 and L293D Driver IC are connected to Arduino.

Two Relays are connected to L293D to operate two AC appliances. Relay has total five pins, in which two pins (around the COM pin) are connected to L293D and GND. And COM (common) Pin is connected to AC mains Live terminal and NO (Normally Open) pin of Relay is connected to one terminal of the Bulb. Other terminal of the bulb is connected to Neutral of AC mains. Check here the working of Relay.

L293D driver IC is generally used to increase the current. The Vcc2 or VS pin of L293D should be connected to VIN pin (input voltage pin or Vcc) of Arduino. Input 1 and Input 2 pins of IC are connected to 10 and 11 pin of Arduino and output pins are connected to relays pins.

Working Explanation:

First we need to download and install the Bluetooth Terminal App in our Android Phone from the Play Store and then pair it with Bluetooth Module HC05 like we normally pair two Bluetooth Devices. Further check this article Configuring Bluetooth Terminal App for Arduino.

Now we have Bluetooth Terminal App installed in our Android phone through which we can send data to Bluetooth Module HC05. HC05 Bluetooth Module is connected to Arduino Mega to serially receive the data sent by Bluetooth terminal App through Android Smart Phone. A 16×2 LCD is used to display the On and Off status of Electronic Appliances. And L293D IC is used to drive two Relay which are directly connected to two Bulbs. 12v Adapter is used to power the Arduino and the circuit.

Whenever we send data by Android phone, Arduino checks for the character sent and puts appropriate pins high or low according to Code. These pins control the relays which in turns control the Appliances. The operation of our project is as follows:

  • If we send ‘a’ through Bluetooth Terminal App then Bulb1 will be On and Bulb2 will be off.
  • If we send ‘b’ through Bluetooth Terminal App then Bulb2 will be On and Bulb1 will be off.
  • If we send ‘c’ through Bluetooth Terminal App then both the bulbs will be switched On.
  • If we send ‘d’ through Bluetooth Terminal App then both the bulbs will be switched Off. character ‘d’ can be used to switch off individual bulbs too.

You can learn here more about Arduino relay control. Check out the complete operation in Demonstration Video at the end.

Smart Phone Controlled Home Automation Using Arduino schematic

Programming Explanation:

Program for this Project is very simple and can be easily understandable.

Include LiquidCrystal.h header file in your Arduino Code, it is necessary for working of LCD.

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

Configure pin 11 and 10 as output pins of Arduino as below in void setup() function and use Serial.begin(9600) for communication between Arduino and Android phone via Bluetooth Module HC05.

void setup() {
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT);
  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.print("**AUTOMATION**");
}

In void loop() function, check for the presence of any serial data and put that data in a variable char c.

void loop() {
  if (Serial.available() > 0)
  { 
    char c = Serial.read();
    if (c == 'a')
    {
     Serial.print("in a code");
     ..... .......
     ....... ......

Then compare that serial data (char c) with character ‘a’ ,’b’, ’c’, ’d’, which is sent by Android Smart Phone by user. After comparing, Arduino will switch on or off the Appliances according to our various conditions in our Code. You can alter the code according to your requirement. Check the full code below.

Read more: Smart Phone Controlled Home Automation Using Arduino


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

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

Scroll to Top