You are on page 1of 57

A

Project Report
on
Home Automation Using Arduino
submitted as partial fulfilment for the award of
BACHELOR OF TECHNOLOGY
DEGREE
SESSION 2022-23
in
Mechanical Engineering
By
Divya Aggarwal (1900290210058)
Deepanshu Garg (1900290400050)
Kushagr Krishnatr (1900290310076)
Kunal Mittal (1900290310074)

Under the supervision of


Mr. Sachin Kumar Tyagi and Dr. Gaurav Sharma

KIET Group of Institutions, Ghaziabad


Affiliated to
Dr. A.P.J. Abdul Kalam Technical University, Lucknow
(Formerly UPTU)
May, 2023
DECLARATION

We hereby declare that this submission is our own work and that, to the best of our
knowledge and belief, it contains no material previously published or written by
another person nor material which to a substantial extent has been accepted for the
award of any other degree or diploma of the university or other institute of higher
learning, except where due acknowledgment has been made in the text.

Signature
Name: Divya Aggarwal
Roll No: 1900290210058
No: 9821013771

Signature
Name: Deepanshu Garg
Roll No: 1900290400050
No: 9528475745

Signature
Name: Kushagr Krishnatr
Roll No: 1900290310076
No: 8979241554

Signature
Name: Kunal Mittal
Roll No: 1900290310074
No: 8126990175
CERTIFICATE

This is to certify that Project Report entitled "Home Automation using Arduino" which
is submitted by “Divya Aggarwal, Deepanshu Garg, Kushagr Krishnatr, Kunal Mittal”
in partial fulfillment of the requirement for the award of degree B. Tech. in Department
of Electronics & Communication Engineering of Dr. A.P.J. Abdul Kalam Technical
University, Lucknow is a record of the candidates own work carried out by them under
my supervision. The matter embodied in this report is original and has not been
submitted for the award of any other degree.

DATE: 31/03/2023 Mr. Sachin Kumar Tyagi


(Asst. Professor ECE Department)

Dr. Gaurav Sharma

Dr. Gaurav Sharma


(Asst. Professor ECE Department)
ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B. Tech Project undertaken
during B. Tech. Final Year. We owe special debt of gratitude to Mr. Sachin Kumar Tyagi
(Asst. Professor), Department of Electronics & Communication Engineering, KIET Group
of Institutions, Ghaziabad, for his constant support and guidance throughout the course of
our work. His sincerity, thoroughness and perseverance have been a constant source of
inspiration for us. It is only his cognizant efforts that our endeavors have seen light of the
day.

We also take the opportunity to acknowledge the contribution of Dr. Vibhav Kumar Sachan,
HoD, Electronics and Communication Engineering Department, KIET Group of
Institutions, Ghaziabad, for his full support and assistance during the development of the
project. We also do not like to miss the opportunity to acknowledge the contribution of all
the faculty members of the department for their kind assistance and cooperation during the
development of our project. Last but not the least, we acknowledge our friends for their
contribution in the completion of the project.

Date: 31/03/2023

Signature
Name: Divya Aggarwal
Roll No: 1900290210058

Signature
Name: Deepanshu Garg
Roll No: 1900290400050

Signature
Name: Kushagr Krishnatr
Roll No: 1900290310076

Signature
Name: Kunal Mittal
Roll No: 1900290310074

i
ABSTRACT

Automation is advancing quickly throughout the world. Humans have less time to perform any
tasks, thus automation is a quick approach to make any machine or device work as we want it to.
The goal of this system is to create a smart home using Arduino and Bluetooth. Now, it is difficult
for the user to approach standard wall switches because they are dispersed across the house. The
elderly or those with physical limitations find it even harder to do so.
With smartphones, a remote-controlled home automation system offers the most cutting-edge
solution. At the receiver end, a Bluetooth module is attached to the Arduino board, and at the
transmitter end, a mobile phone's GUI application transmits ON/OFF signals to the receiver,
where loads are linked. A simple and dependable technology is provided by a home automation
system with an Android app. The Smart Home system uses an Arduino Uno to manage household
items including fans, bulbs, air conditioners, and TVs.
The system primarily focuses on using an Android phone to monitor and control smart homes,
as well as to provide a secure smart home when occupants are not there. The goal of this system
is to operate household appliances in a smart home with user-friendly, affordable, and straight
forward installation.

ii
TABLE OF CONTENTS Page no.

DECLARATION……………………………………………………………………………………………………………… ii
CERTIFICATE………………………………………………………………………………………………………………… iii
ACKNOWLEDGEMENTS……………………………………………………………………………………………….. i
ABSTRACT……………………………………………………………………………………………………………………. ii
LIST OF FIGURES…………………………………………………………………………………………………………... v
LIST OF TABLES……………………………………………………………………………………………………………… vi
LIST OF ABBREVIATIONS………………………………………………………………………………………………... vii

CHAPTER 1 (INTRODUCTION)…………………………………………………………………………………………. 1
1.1 Introduction…………………………………………………………………………………………………………….. 1
1.2 Project Description…………………………………………………………………………………………………… 2

CHAPTER 2 (LITERATURE REVIEW)………………………………………………………………………………….. 3


2.1 WORKING…………………………………………………………………………………………………………………. 3
2.2 COMPONENTS………………………………………………………………………………………………………….. 5
2.2.1 ARDUINO………………………………………………………………………………………………………….. 5
2.2.2 BLUETOOTH HC-05……………………………………………………………………………………………. 12
2.2.3 RELAY MODULE…………………………………………………………………………………………………. 14
2.2.4 LED……………………………………………………………………………………………………………………. 28
2.2.5 POWER SUPPLY…………………………………………………………………………………………………. 29
2.3 BLOCK DIAGRAM………………………………………………………………………………………………………. 31
2.4 CIRCUIT DIAGRAM……………………………………………………………………………………………………. 32
2.5 APPLICATIONS………………………………………………………………………………………………………….. 32

CHAPTER 3 (PROPOSED METHODOLOGY)……………………………………………………………………… 33


3.1 PROGRAMMING CODE……………………………………………………………………………………………. 33
3.2 ORGANIZATION OF SYSTEM…………………………………………………………………………………….. 35
3.3 IMPLEMENTATION AND TESTING…………………………………………………………………………….. 37
3.3.1 IMPLEMENTATION………………………………………………………………………………………….. 37

iii
3.3.2 TESTING…………………………………………………………………………………………………………. 39
3.3.2.1 Normal Mode Testing Scenarios………………………………………………………… 40
3.3.2.2 SWITCHING OUT DEVICE 1………………………………………………………………… 40
3.3.2.3 SECURITY MODE TESTING SCENERIOS……………………………………………….. 41
3.3.2.4 INTRUSION ALERT………………………………………………………………………………. 41

CHAPTER 4 (RESULT AND DISCUSSION)………………………………………………………………………….. 43

CHAPTER 5 (CONCLUSIONS AND FUTURE SCOPE)…………………………………………………………… 44


5.1 CONCLUSION……………………………………………………………………………………………………………. 44
5.2 FUTURE SCOPE…………………………………………………………………………………………………………. 45

REFERENCES…………………………………………………………………………………………………………………… 46

iv
LIST OF FIGURES

Figure No. Description Page No.


1 Bluetooth Controller (keys) 3
2 Bluetooth Controller (loads) 4
3 Arduino Board 5
4 Hardware 6
5 Arduino Uno R2 7
6 Programming Tools 8
7 Board (pins) 10
8 Relay 14
9 Channel Relay 23
10 Circuit Diagram1 24
11 Circuit Diagram2 24
12 Circuit Diagram3 25
13 Schematic 26
14 LED 28
15 Adapter 29
16 Block Diagram 31
17 Circuit Diagram4 32
18 Client Side Block Diagram 36
19 Test Device (on/off) 41
20 Security Alert 42

v
LIST OF TABLES

Table No. Description Page No.


1 Void Loop 38

vi
LIST OF ABBREVIATIONS

LED: Light Emitting Diode


LGPL: Lesser General Public License
GPL: General Public License
USB: Universal Serial Bus
IDE: Integrated Development Environment
TTL: Transistor Transistor Logic
FTDI: Future Technology Devices International Ltd.
AVR: Alf & Vegard’s RISC Processor
ICSP: In-Circuit Serial Programming
AFH: Adaptive Frequency Hopping
SPP: Serial Port Protocol
PLC: Programmable Logic Controller

vii
CHAPTER 1
INTRODUCTION

1.1 INTRODUCTION
We are living in 21st century where automation of any form i.e. home or industrial plays an

important role in human life. When it comes to industrial automation, the concept is applied to
large machines or robots which helps in increasing the efficiency in terms of production, energy
and time.

Home automation on the other hand involves automating the household environment. This is
possible because of the smartphones and internet that we are widely using. Home automation can
be again divided in to just controlling the appliances using a smartphone from a remote location
and another type filled with sensors and actuators which controls the lighting, temperature, door
locks, electronic gadgets, electrical appliances etc. using a “Smart” system.

In this project, we will design a simple home automation project using simple components using
which different electrical appliances can switched on or off. The project is based on Arduino and
we have used Arduino UNO for the project.

The home automation system uses an Arduino Uno with a Bluetooth module to operate
equipment including fans, bulbs, air conditioners, and automated door locks. The paper's primary
focus is on using an Android phone to monitor and control smart homes and to provide security-
based smart homes while residents are not there.

Arduino is a piece of hardware that connects a computer to a project model so that it may be
controlled using the appropriate Arduino code. Arduino is a microcontroller that functions
similarly to the human brain in that it analyses input before applying logical and mathematical
operations to it. The Bluetooth module that receives information from the user is attached to
Arduino. Relay, which is connected to Arduino as well, gets data from the latter and functions as
a switch. Bluetooth technology enables short-range wireless radio communications that are
essential for generating intelligence and controllability.

A degree of computerized or automatic control over some electrical and electronic equipment in
a building is known as home automation.

1
1.2 PROJECT DESCRIPTION

Nowadays, we have remote controls for our television sets and other electronic systems, which
have made our lives real easy. Have you ever wondered about home automation which would
give the facility of controlling tube lights, fans and other electrical appliances at home using a
remote control? Off-course, Yes! But, are the available options cost-effective? If the answer is
NO we have found a solution to it.

We have come up with a new system called Arduino based home automation using Bluetooth.
This system is super-cost effective and can give the user, the ability to control any electronic
device without even spending for a remote control. This project helps the user to control all the
electronic devices using his/her smartphone. Time is a very valuable thing. Everybody wants to
save time as much as they can. New technologies are being introduced to save our time. To save
people’s time we are introducing Home Automation system using Bluetooth.

With the help of this system you can control your home appliances from your mobile phone. You
can turn on/off your home appliances within the range of Bluetooth. The Arduino project began
in 2003 as a course for students at the Interaction Design Institute Ivrea in Ivrea, Italy, with the
goal of giving amateurs and experts alike a simple and affordable way to build gadgets that use
sensors and actuators to interact with their surroundings. Simple robots, thermostats, and motion
detectors are typical examples of such objects aimed for beginning enthusiasts.

2
CHAPTER 2

LITERATURE REVIEW

2.1 WORKING

A simple home automation project using Arduino UNO, Bluetooth module and a Smartphone.
The aim of this project is to control different home appliances using a Smartphone. The working
of the project is explained here.

When the power is turned on, the connection LED on the Bluetooth module starts blinking. We
need to start the “Bluetooth Controller” app in our Smartphone and get connected to the
Bluetooth module. If the pairing is successful, the LED becomes stable.

Now, in the app, we need to set different keys for different loads and their corresponding value
that must be transmitted when that key is pressed. The following image shows a set of keys to
control 4 loads and an additional key to turn off all the loads.

Then we are ready to control the loads. When a key is pressed in the Smartphone, the Bluetooth
module receives the corresponding data and intern transmits that data to Arduino.

Figure 1: Bluetooth Controller (keys)

3
Figure 2: Bluetooth Controller (loads)

For example, if we press “LOAD 2 ON”, then the data received by the Bluetooth module is “2”.

This data i.e. “2” is transmitted to Arduino. Arduino then compares the received data with the
data written in the sketch and accordingly turns on the load 2. The similar action can be
applicable to other keys and loads.

Using this type of connection, we can control i.e. turn on or off different home electrical
appliances using our smartphones.

4
2.2 COMPONENTS

2.2.1 ARDUINO

Arduino is an open source computer hardware and software company, project, and user
community that designs and manufactures single-board microcontrollers and microcontroller
kits for building digital devices and interactive objects that can sense and control objects in the
physical world. The project's products are distributed as open-source hardware and software,
which are licensed under the GNU Lesser General Public License (LGPL) or the GNU General
Public License (GPL), permitting the manufacture of Arduino boards and software distribution
by anyone. Arduino boards are available commercially preassembled form, or as do-it-yourself
(DIY) kits.

Figure 3: Arduino Board

Arduino board designs use a variety of microprocessors and controllers. The boards are
equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to
various expansion boards (shields) and other circuits. The boards feature serial communications
interfaces, including Universal Serial Bus (USB) on some models, which are also used for
loading programs from personal computers. The microcontrollers are typically programmed
using a dialect of features from the programming languages C and C++. In addition to with their
environment using sensors and actuators. Common examples of such devices intended for
beginner hobbyists include simple robots, thermostats, and motion detectors.

5
HARDWARE

Arduino is open-source hardware. The hardware reference designs are distributed under a
Creative Commons Attribution Share-Alike 2.5 license and are available on the Arduino
website. Layout and production files for some versions of the hardware are also available. The
source code for the IDE is released under the GNU General Public License, version 2.
Nevertheless, an official Bill of Materials of Arduino boards has never been released by
Arduino staff.

Although the hardware and software designs are freely available under copy left licenses, the
developers have requested the name Arduino to be exclusive to the official product and not be
used for derived works without permission. The official policy document on use of the Arduino
name emphasizes that the project is open to incorporating work by others into the official
product. Several Arduino-compatible products commercially released have avoided the project
name by using various names ending in -duino.

Figure 4: Hardware

ATmega8 microcontroller chip (black, lower right); the 14 digital I/O pins are at the top, the 6
analog input pins at the lower right, and the power connector at An early Arduino board with
an RS-232 serial interface (upper left) and an Atmel the lower left.

6
Most Arduino boards consist of an Atmel 8-bit AVR microcontroller (ATmega8, ATmega168,
ATmega328, ATmega1280, ATmega2560) with varying amounts of flash memory, pins, and
features. The 32-bit Arduino Due, based on the Atmel SAM3X8E was introduced in 2012. The
boards use single or double-row pins or female headers that facilitate connections for
programming and incorporation into other circuits.

These may connect with add-on modules termed shields. Multiple and possibly stacked shields
may be individually addressable via an I²C serial bus. Most boards include a 5 V linear regulator
and a 16 MHz crystal oscillator or ceramic resonator. Some designs, such as the LilyPad, run at
8 MHz and dispense with the on board voltage regulator due to specific form-factor restrictions.

Arduino microcontrollers are pre-programmed with a boot loader that simplifies uploading of
programs to the on-chip flash memory. The default boot loader of the Arduino UNO is the option
boot loader. Boards are loaded with program code via a serial connection to another computer.
Some serial Arduino boards contain a level shifter circuit to convert between RS-232 logic levels
and transistor–transistor logic(TTL) level signals. Current Arduino boards are programmed via
Universal Serial Bus (USB), implemented using USB-to-serial adapter chips such as the FTDI
FT232.

Some boards, such as later-model Uno boards, substitute the FTDI chip with a separate AVR chip
containing USB-to-serial firmware, which is reprogrammable via its own ICSP header. Other
variants, such as the Arduino Mini and the unofficial Boarding, use a detachable USB-to-serial
adapter board or cable, Bluetooth or other methods. When used with traditional microcontroller
tools, instead of the Arduino IDE, standard AVR in-system programming (ISP) programming is
used.

Figure 5: Arduino Uno R2

7
An official Arduino Uno R2 with descriptions of the I/O locations.

The Arduino board exposes most of the microcontroller's I/O pins for use by other circuits. The
Diecimila, Duemilanove, and current Uno provide 14 digital I/O pins, six of which can produce
pulse-width modulated signals, and six analog inputs, which can also be used as six digital I/O
pins. These pins are on the top of the board, via female 0.1-inch (2.54 mm) headers. Several plug-
in application shields are also commercially available. The Arduino Nano, and Arduino-
compatible Bare Bones Board and Boarding boards may provide male header pins on the
underside of the board that can plug into solder less breadboards.

Many Arduino-compatible and Arduino-derived boards exist. Some are functionally equivalent
to an Arduino and can be used interchangeably. Many enhance the basic Arduino by adding
output drivers, often for use in school-level education, to simplify making buggies and small
robots. Others are electrically equivalent but change the form factor, sometimes retaining
compatibility with shields, sometimes not. Some variants use different processors, of varying
compatibility.

SOFTWARE AND PROGRAMMING TOOLS

Figure 6: Programming Tool

8
A program for Arduino may be written in any programming language with compilers that
produce binary machine code for the target processor. Atmel provides a development
environment for their microcontrollers, AVR Studio and the newer Atmel Studio.

The Arduino project provides the Arduino integrated development environment (IDE), which is
a cross-platform application written in the programming language Java. It originated from the
IDE for the languages Processing and Wiring. It includes a code editor with features such as text
cutting and pasting, searching and replacing text, automatic indenting, brace matching, and
syntax highlighting, and provides simple one-click mechanisms to compile and upload programs
to an Arduino board. It also contains a message area, a text console, a toolbar with buttons for
common functions and a hierarchy of operation menus.

Writing code and uploading it to the board while offline is simple with the Arduino Software
(IDE). For those with a bad or nonexistent internet connection, we advise it. Any Arduino board
can be used with this software.

The Arduino IDE is now available in two different versions: 1.x.x and 2.x. The IDE 2.x is a
brand-new major update that outperforms the IDE 1.x.x in terms of speed and power. It also has
more sophisticated capabilities to aid users in their coding and debugging in addition to a more
contemporary editor and a responsive UI.

Programs written with the IDE for Arduino is called a sketch. Sketches are saved on the
development computer as text files with the file extension .ino. Arduino Software (IDE) pre-1.0
saved sketches with the extension .pde

The Arduino IDE supports the languages C and C++ using special rules of code structuring. The
Arduino IDE supplies a software library from the Wiring project, which provides many common
input and output procedures. User-written code only requires two basic functions, for starting the
sketch and the main program loop, that are compiled and linked with a program stub main() into
an executable cyclic executive program with the GNU tool chain, also included with the IDE
distribution. The Arduino IDE employs the program avrdude to convert the executable code into
a text file in hexadecimal encoding that is loaded into the Arduino board by a loader program in
the board's firmware.

The open-source nature of the Arduino project has facilitated the publication of many free
software libraries that other developers use to augment their projects.

9
PROGRAM STRUCTURE

Figure 7: Board (pins)

Power LED (red) and User LED (green) attached to Pin 13 on an Arduino compatible board.

A minimal Arduino C/C++ program consist of only two functions:

∑setup(): This function is called once when a sketch starts after power-up or reset. It is used to
initialize variables, input and output pin modes, and other libraries needed in the sketch.

∑loop(): After setup() has been called, function loop() is executed repeatedly in the main
program. It controls the board until the board is powered off or is reset.

Most Arduino boards contain a light-emitting diode (LED) and a load resistor connected between
pin 13 and ground, which is a convenient feature for many tests and program functions. A typical
program for a beginning Arduino programmer blinks a LED repeatedly.

10
#define LED_PIN 13 // Pin number attached to LED.

void setup() {

pin Mode(LED_PIN, OUTPUT); // Configure pin 13 to be a digital output.

void loop() {

digitalWrite(LED_PIN, HIGH); // Turn on the LED.

delay(1000); // Wait 1 second (1000 milliseconds).

digitalWrite(LED_PIN, LOW); // Turn off the LED.

delay(1000); // Wait 1 second.

This program uses the functions pinMode(), digitalWrite(), and delay(), which are provided by
the internal libraries included in the IDE environment. The program is usually loaded in the
Arduino by the manufacturer.

Application:

∑ Arduboy, a handheld game console based on Arduino.

∑ Arduino Motion Control Rig.

∑ Arduinome, a MIDI controller device that mimics the Monome.

∑ ArduinoPhone, a do-it-yourself cellphone.

∑ Ardupilot, drone software and hardware.

∑ ArduSat, a cubesat based on Arduino.

∑ Automatic titration system based on Arduino and stepper motor.

11
2.2.2 BLUETOOTH HC-05

HC-05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for
transparent wireless serial connection setup. The HC-05 Bluetooth Module can be used in a
Master or Slave configuration, making it a great solution for wireless communication. This serial
port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate) 3Mbps
Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Blue core 04-
External single chip Bluetooth system with CMOS technology and with AFH (Adaptive
Frequency Hopping Feature).

HC‐05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module, designed for
transparent wireless serial connection setup. The HC-05 Bluetooth Module can be used in a
Master or Slave configuration, making it a great solution for wireless communication. This serial
port Bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate)3Mbps
Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Blue core 04‐
External single chip Bluetooth system with CMOS technology and with AFH (Adaptive
Frequency Hopping Feature).

Bluetooth Module HC-05 the Bluetooth module HC-05 is a MASTER/SLAVE module. By


default the factory setting is SLAVE. The Role of the module (Master or Slave) can be configured
only by AT COMMANDS. The slave modules cannot initiate a connection to another Bluetooth
device, but can accept connections. Master module can initiate a connection to other devices.
The user can use it simply for a serial port replacement to establish connection between MCU
and GPS, PC to your embedded project, etc.

Hardware Features

∑ Typical -80dBm sensitivity.

∑ Up to +4dBm RF transmits power. ∑ 3.3 to 5 V I/O.

∑ PIO (Programmable Input/Output) control.

∑ UART interface with programmable baud rate.

∑ With integrated antenna.

∑ With edge connector.

12
Pin Description:
The HC-05 Bluetooth Module has 6pins. They are as follows:

ENABLE:
When enable is pulled LOW, the module is disabled which means the module will not turn on
and it fails to communicate. When enable is left open or connected to 3.3V, the module is enabled
i.e. the module remains on and communication also takes place.

Vcc:
Supply Voltage 3.3V to 5V

GND:
Ground pin

TXD & RXD:


These two pins acts as an UART interface for communication

STATE:
It acts as a status indicator. When the module is not connected to / paired with any other Bluetooth
device, signal goes Low. At this low state, the led flashes continuously which denotes that the
module is not paired with other device.

When this module is connected to/paired with any other Bluetooth device, the signal goes high.
At this high state, the led blinks with a constant delay say for example 2s delay which indicates
that the module is paired.

BUTTON SWITCH:

This is used to switch the module into AT command mode. To enable AT command mode, press
the button switch for a second. With the help of AT commands, the user can change the
parameters of this module but only when the module is not paired with any other BT device.

If the module is connected to any other Bluetooth device, it starts to communicate with that
device and fails to work in AT command mode.

13
2.2.3 RELAY MODULE

The module is uses SRD relay module to control high-voltage electrical devices. (Maximum
250V).It can be used in interactive projects and can also be used to control the lighting, electrical
and other equipment.

It can be controlled directly by a wide range of microcontrollers and can be controlled through
the digital IO port, such as solenoid valves, lamps, motors and other high current or high voltage
devices.

Figure 8: Relay

A relay is an electrically operated switch. Many relays use an electromagnet to mechanically


operate a switch, but other operating principles are also used, such as solid-state relays. Relays
are used where it is necessary to control a circuit by a separate low-power signal, or where several
circuits must be controlled by one signal. The first relays were used in long distance telegraph
circuits as amplifiers: they repeated the signal coming in from one circuit and re-transmitted it
on another circuit.

Relays were used extensively in telephone exchanges and early computers to perform logical
operations. A type of relay that can handle the high power required to directly control an electric
motor or other loads is called a contactor. Solid-state relays control power circuits with no
moving parts, instead using a semiconductor device to perform switching.

Relays with calibrated operating characteristics and sometimes multiple operating coils are used
to protect electrical circuits from overload or faults; in modern electric power systems these
functions are performed by digital instruments still called "protective relays". Magnetic latching

14
relays require one pulse of coil power to move their contacts in one direction, and another,
redirected pulse to move them back. Repeated pulses from the same input have no effect.

Magnetic latching relays are useful in applications where interrupted power should not be able
to transition the contacts. Magnetic latching relays can have either single or dual coils. On a
single coil device, the relay will operate in one direction when power is applied with one polarity,
and will reset when the polarity is reversed. On a dual coil device, when polarized voltage is
applied to the reset coil the contacts will transition. AC controlled magnetic latch relays have
single coils that employ steering diodes to differentiate between operate and reset commands.

A type of relay that can handle the high power required to directly control an electric motor or
other loads is called a contactor. Solid-state relays control power circuits with no moving parts,
instead using a semiconductor device to perform switching. Relays with calibrated operating
characteristics and sometimes multiple operating coils are used to protect electrical circuits from
overload or faults; in modern electric power systems these functions are performed by digital
instruments still called "protective relays".

The Arduino Relay module allows a wide range of microcontroller such as Arduino, AVR, PIC,
ARM with digital outputs to control larger loads and devices like AC or DC Motors,
electromagnets, solenoids, and incandescent light bulbs. This module is designed to be integrated
with 2 relays that it is capable of control 2 relays. The relay shield use one QIANJI JQC-3F high-
quality relay with rated load 7A/240VAC,10A/125VAC,10A/28VDC.The relay output state is
individually indicated by a light-emitting diode.

TYPES:

1) Coaxial relay

Where radio transmitters and receivers share one antenna, often a coaxial relay is used as a TR
(transmit-receive) relay, which switches the antenna from the receiver to the transmitter. This
protects the receiver from the high power of the transmitter. Such relays are often used in
transceivers which combine transmitter and receiver in one unit.

The relay contacts are designed not to reflect any radio frequency power back toward the source,
and to provide very high isolation between receiver and transmitter terminals. The characteristic

15
impedance of the relay is matched to the transmission line impedance of the system, for example,
50 ohms.

2) Contactor

A contactor is a heavy-duty relay with higher current ratings, used for switching electric motors
and lighting loads. Continuous current ratings for common contactors range from 10 amps to
several hundred amps. High-current contacts are made with alloys containing silver. The
unavoidable arcing causes the contacts to oxidize; however, silver oxide is still a good conductor.
Contactors with overload protection devices are often used to start motors.

3) Force-guided contacts relay

A 'force-guided contacts relay' has relay contacts that are mechanically linked together, so that
when the relay coil is energized or de-energized, all of the linked contacts move together. If one
set of contacts in the relay becomes immobilized, no other contact of the same relay will be able
to move. The function of force-guided contacts is to enable the safety circuit to check the status
of the relay.

Force-guided contacts are also known as "positive-guided contacts", "captive contacts", "locked
contacts", "mechanically linked contacts", or "safety relays". These safety relays have to follow
design rules and manufacturing rules that are defined in one main machinery standard EN 50205
: Relays with forcibly guided (mechanically linked) contacts. These rules for the safety design
are the one that are defined in type B standards such as EN 13849-2 as Basic safety principles
and Well-tried safety principles for machinery that applies to all machines.

Force-guided contacts by themselves cannot guarantee that all contacts are in the same state,
however they do guarantee, subject to no gross mechanical fault, that no contacts are in opposite
states. Otherwise, a relay with several normally open (NO) contacts may stick when energized,
with some contacts closed and others still slightly open, due to mechanical tolerances. Similarly,
a relay with several normally closed (NC) contacts may stick to the un-energized position, so
that when energized, the circuit through one set of contacts is broken, with a marginal gap, while
the other remains closed.

By introducing both NO and NC contacts, or more commonly, changeover contacts, on the same
relay, it then becomes possible to guarantee that if any NC contact is closed, all NO contacts are
open, and conversely, if any NO contact is closed, all NC contacts are open. It is not possible to
reliably ensure that any particular contact is closed, except by potentially intrusive and safety-

16
degrading sensing of its circuit conditions, however in safety systems it is usually the NO state
that is most important, and as explained above, this is reliably verifiable by detecting the closure
of a contact of opposite sense.

Force-guided contact relays are made with different main contact sets, either NO, NC or
changeover, and one or more auxiliary contact sets, often of reduced current or voltage rating,
used for the monitoring system. Contacts may be all NO, all NC, changeover, or a mixture of
these, for the monitoring contacts, so that the safety system designer can select the correct.

4) Latching relay

A latching relay (also called "impulse", "bi-stable", "keep", or "stay" relays) maintains either
contact position indefinitely without power applied to the coil. The advantage is that one coil
consumes power only for an instant while the relay is being switched, and the relay contacts
retain this setting across a power outage.

A latching relay allows remote control of building lighting without the hum that may be produced
from a continuously (AC) energized coil. In one mechanism, two opposing coils with an over-
center spring or permanent magnet hold the contacts in position after the coil is de-energized.

A pulse to one coil turns the relay on and a pulse to the opposite coil turns the relay off. This
type is widely used where control is from simple switches or single-ended outputs of a control
system, and such relays are found in avionics and numerous industrial applications. Another
latching type has a remnant core that retains the contacts in the operated position by the remnant
magnetism in the core.

This type requires a current pulse of opposite polarity to release the contacts. A variation uses a
permanent magnet that produces part of the force required to close the contact; the coil supplies
sufficient force to move the contact open or closed by aiding or opposing the field of the
permanent magnet. A polarity controlled relay needs changeover switches or an H bridge drive
circuit to control it.

The relay may be less expensive than other types, but this is partly offset by the increased costs
in the external circuit. In another type, a ratchet relay has a ratchet mechanism that holds the
contacts closed after the coil is momentarily energized. A second impulse, in the same or a
separate coil, releases the contacts. This type may be found in certain cars, for headlamp dipping
and other functions where alternating operation on each switch actuation is needed. A stepping
relay is a specialized kind of multi-way latching relay designed for early automatic telephone
exchanges. 22 An earth leakage circuit breaker includes a specialized latching relay.

17
Very early computers often stored bits in a magnetically latching relay, such as ferreed or the
later rem reed in the 1ESS switch. Some early computers used ordinary relays as a kind of latch,

they store bits in ordinary wire spring relays or reed relays by feeding an output wire back as an
input, resulting in a feedback loop or sequential circuit.

Such an electrically latching relay requires continuous power to maintain state, unlike
magnetically latching relays or mechanically ratcheting relays. In computer memories, latching
relays and other relays were replaced by delay line memory, which in turn was replaced by a
series of ever-faster and ever-smaller memory technologies.

5) Machine tool relay

A machine tool relay is a type standardized for industrial control of machine tools, transfer
machines, and other sequential control. They are characterized by a large number of contacts
(sometimes extendable in the field) which are easily converted from normally open to normally
closed status, easily replaceable coils, and a form factor that allows compactly installing many
relays in a control panel.

Although such relays once were the backbone of automation in such industries as automobile
assembly, the programmable logic controller (PLC) mostly displaced the machine tool relay from
sequential control applications. A relay allows circuits to be switched by electrical equipment:
for example, a timer circuit with a relay could switch power at a preset time.

For many years relays were the standard method of controlling industrial electronic systems. A
number of relays could be used together to carry out complex functions (relay logic). The
principle of relay logic is based on relays which energize and de-energize associated contacts.
Relay logic is the predecessor of ladder logic, which is commonly used in programmable logic
controllers. 23

6) Mercury relay

A mercury relay is a relay that uses mercury as the switching element. They are used where
contact erosion would be a problem for conventional relay contacts. Owing to environmental
considerations about significant amount of mercury used and modern alternatives, they are now
comparatively uncommon.

18
7) Mercury-wetted relay

A mercury-wetted reed relay is a form of reed relay in which the contacts are wetted with
mercury. Such relays are used to switch low-voltage signals (one volt or less) where the mercury
reduces the contact resistance and associated voltage drop, for low-current signals where surface
contamination may make for a poor contact, or for high-speed applications where the mercury
eliminates contact bounce.

Mercury wetted relays are position-sensitive and must be mounted according to the
manufacturer's specifications to work properly. Because of the toxicity and expense of liquid
mercury, these relays are now rarely used. The mercury-wetted relay has one particular
advantage, in that the contact closure appears to be virtually instantaneous, as the mercury
globules on each contact coalesce.

The current rise time through the contacts is generally considered to be a few picoseconds,
however in a practical circuit it will be limited by the inductance of the contacts and wiring. It
was quite common, before the restrictions on the use of mercury, to use a mercury-wetted relay
in the laboratory as a convenient means of generating fast rise time pulses, however although the
rise time may be picoseconds, the exact timing of the event is, like all other types of relay, subject
to considerable jitter, possibly milliseconds, due to mechanical imperfections.

The same coalescence process causes another effect, which is a nuisance in some applications.
The contact resistance is not stable immediately after contact closure, and drifts, mostly
downwards, for several seconds after closure, the change perhaps being 0.5 ohm.

8) Multi-voltage relays

24 Multi-voltage relays are devices designed to work for wide voltage ranges such as 24 to 240
VAC and VDC and wide frequency ranges such as 0 to 300 Hz. They are indicated for use in
installations that do not have stable supply voltages.

9) Overload protection relay

Electric motors need overcurrent protection to prevent damage from over-loading the motor, or
to protect against short circuits in connecting cables or internal faults in the motor windings. The
overload sensing devices are a form of heat operated relay where a coil heats a bimetallic strip,
or where a solder pot melts, releasing a spring to operate auxiliary contacts.
19
These auxiliary contacts are in series with the coil. If the overload senses excess current in the
load, the coil is de-energized. This thermal protection operates relatively slowly allowing the
motor to draw higher starting currents before the protection relay will trip. Where the overload
relay is exposed to the same ambient temperature as the motor, a useful though crude
compensation for motor ambient temperature is provided.

The other common overload protection system uses an electromagnet coil in series with the motor
circuit that directly operates contacts. This is similar to a control relay but requires a rather high
fault current to operate the contacts. To prevent short over current spikes from causing nuisance
triggering the armature movement is damped with a dashpot. The thermal and magnetic overload
detections are typically used together in a motor protection relay.

Electronic overload protection relays measure motor current and can estimate motor winding
temperature using a "thermal model" of the motor armature system that can be set to provide
more accurate motor protection. Some motor protection relays include temperature detector
inputs for direct measurement from a thermocouple or resistance thermometer sensor embedded
in the winding.

10) Polarized relay

A polarized relay places the armature between the poles of a permanent magnet to increase
sensitivity. Polarized relays were used in middle 20th Century telephone exchanges to detect
faint pulses and correct telegraphic distortion.

11) Reed relay

A reed relay is a reed switch enclosed in a solenoid. The switch has a set of contacts inside an
evacuated or inert gas-filled glass tube which protects the contacts against atmospheric corrosion;
the contacts are made of magnetic material that makes them move under the influence of the field
of the enclosing solenoid or an external magnet. Reed relays can switch faster than larger relays
and require very little power from the control circuit.

However, they have relatively low switching current and voltage ratings. Though rare, the reeds
can become magnetized over time, which makes them stick "on", even when no current is
present; changing the orientation of the reeds the switch with respect to the solenoid's magnetic
field can resolve this problem.

20
12) Safety relays

Safety relays are devices which generally implement safety functions. In the event of a hazard,
the task of such a safety function is to use appropriate measures to reduce the existing risk to an
acceptable level.

13) Solid-state contactor

A solid-state contactor is a heavy-duty solid state relay, including the necessary heat sink, used
where frequent on-off cycles are required, such as with electric heaters, small electric motors,
and lighting loads. There are no moving parts to wear out and there is no contact bounce due to
vibration. They are activated by AC control signals or DC control signals from programmable
logic controllers (PLCs), PCs, transistor-transistor logic (TTL) sources, or other microprocessor
and microcontroller controls.

14) Solid-state relay

A solid-state relay (SSR) is a solid state electronic component that provides a function similar to
an electromechanical relay but does not have any moving components, increasing long-term
reliability. A solid-state relay uses a thyristor, TRIAC or other solid-state switching device,
activated by the control signal, to switch the controlled load, instead of a solenoid. An opto-
coupler (a light-emitting diode (LED) coupled with a photo transistor) can be used to isolate
control and controlled circuits.

15) Static relay

A static relay consists of electronic circuitry to emulate all those characteristics which are
achieved by moving parts in an electro-magnetic relay.

16) Time delay relay

Timing relays are arranged for an intentional delay in operating their contacts. A very short (a
fraction of a second) delay would use a copper disk between the armature and moving blade
assembly. Current flowing in the disk maintains magnetic field for a short time, lengthening
release time. For a slightly longer (up to a minute) delay, a dashpot is used.

21
A dashpot is a piston filled with fluid that is allowed to escape slowly; both air-filled and oil-
filled dashpots are used. The time period can be varied by increasing or decreasing the flow rate.
For longer time periods, a mechanical clockwork timer is installed. Relays may be arranged for
a fixed timing period, or may be field adjustable, or remotely set from a control panel.

Modern microprocessor-based timing relays provide precision timing over a great range. Some
relays are constructed with a kind of "shock absorber" mechanism attached to the armature which
prevents immediate, full motion when the coil is either energized or de-energised. This addition
gives the relay the property of time-delay actuation. Time-delay relays can be constructed to
delay armature motion on coil energisation, de-energisation, or both.

Time-delay relay contacts must be specified not only as either normally open or normally closed,
but whether the delay operates in the direction of closing or in the direction of opening. The
following is a description of the four basic types of time-delay relay contacts. First we have the
normally open, timed-closed (NOTC) contact. This type of contact is normally open when the
coil is unpowered (de-energized).

The contact is closed by the application of power to the relay coil, but only after the coil has been
continuously powered for the specified amount of time. In other words, the direction of the
contact's motion (either to close or to open) is identical to a regular NO contact, but there is a
delay in closing direction. Because the delay occurs in the direction of coil energisation, this type
of contact is alternatively known as a normally open, on-delay.

17) Vacuum relay

A sensitive relay having its contacts mounted in a highly evacuated glass housing, to permit
handling radio-frequency voltages as high as 20,000 volts without flashover between contacts
even though contact spacing is but a few hundredths of an inch when open. Pole and throw[edit]
Since relays are switches, the terminology applied to switches is also applied to relays; a relay
switches one or more poles, each of whose contacts can be thrown by energizing the coil.

RELAY H152S MODULE

22
OVERVIEW

Relays are used to regulate high-voltage electronic equipment. A relay is essentially a switch that
uses an electromagnet to operate electrically. A low voltage, such as 5 volts from a
microcontroller, activates the electromagnet, which draws a contact to create or disrupt a high
voltage circuit.

Figure 9: CHANNEL RELAY

The HL-52S 2 channel relay module, which has 2 relays with ratings of 10A @ 250 and 125 V
AC& 10A @ 30 and 28 V DC, will be used as a model for this Arduino relay. The center pin of
the high voltage output connector is the common pin, and as can be seen from the markings,
the other two pins are for normally open and normally closed connections, respectively.

These two groups of pins are located on the module's opposite side. The first one has 4 pins: 2
input pins (In1 and In2), a Ground pin, and a VCC pin for charging the module. The JD Vcc
and Vcc pins are separated by a jumper in the second group of pins' three pins. In a setup like
this, the relay's electromagnet receives power directly from the Arduino Board, putting the
microcontroller in danger of harm if the relay experiences any problems.

Circuit Diagram

Let's look at the relay module's circuit schematics in this configuration for a better
comprehension. Therefore, it is clear that the 5 volts from our microcontroller, which are

23
connected to the Vcc pin for relay activation through the Opto-coupler IC, are also connected to
the JD Vcc pin for relay magnetic power. Therefore, in this instance, there is no separation
between the microcontroller and the relay.

Figure 10: Circuit Diagram 1

Remove the jumper and connect a different power source for the electromagnet to the JD Vcc
and Ground pins in order to isolate the microcontroller from the relay. In this configuration, the
microcontroller simply uses the Opto-coupler IC's LED light to trigger the relay rather than
having any physical connection.

Figure 11: Circuit Diagram 2

24
From these circuit schematics, there is one more item to take note of. The module's input ports
operate in an opposite manner. As we can see, the relay will turn on when the input pin is LOW
because that will allow current to travel from the VCC to the low or ground input pin,
illuminating the LED and turning on the relay. Since there won't be any current flowing when
the input port is HIGH, neither the LED nor the relay will turn on.

Figure 12: Circuit Diagram 3

Let's look at the circuit schematic first. As previously mentioned, the electromagnet connected
to the JD Vcc and the Ground pin will receive its electricity from a separate 5V adapter.

The module's Vcc port will be connected to the Arduino's 5V pin, and pin number 7 will be
connected to the relay's input pin In1 is used to operate. We now require a power plug, a socket,
and a cable with two conductors for the HIGH VOLTAGE portion. One of the two wires will
be severed and attached to the module output connector's common and usually open pins.
Therefore, with this configuration, when we engage the relay, the high voltage circuit will be
closed and functional.

This is how the cable was manufactured. I consequently purchased a plug, a socket, and a wire.
I then connected them to the usually open connection pins of the relay module after carefully
cutting the cable and one of the wires, as shown in the image below. Additionally, attach the
cable's extremities to the plug and the plug.

25
Figure 13: Schematic

Application:-
Relays are used wherever it is necessary to control a high power or high voltage circuit with a
low power circuit, especially when galvanic isolation is desirable.

The first application of relays was in long telegraph lines, where the weak signal received at an
intermediate station could control a contact, regenerating the signal for further transmission.

High-voltage or high-current devices can be controlled with small, low voltage wiring and pilots
switches. Operators can be isolated from the high voltage circuit.

Low power devices such as microprocessors can drive relays to control electrical loads beyond
their direct drive capability. In an automobile, a starter relay allows the high current of the
cranking motor to be controlled with small wiring and contacts in the ignition key.

Electromechanical switching systems including Strowger and Crossbar telephone exchanges


made extensive use of relays in ancillary control circuits.

The Relay Automatic Telephone Company also manufactured telephone exchanges based solely
on relay switching techniques designed by Gotthilf Ansgarius Betulander. The first public relay
based telephone exchange in the UK was installed in Fleetwood on 15 July 1922 and remained
in service until 1959.

The use of relays for the logical control of complex switching systems like telephone exchanges
was studied by Claude Shannon, who formalized the application of Boolean algebra to relay
circuit design in A Symbolic Analysis of Relay and Switching Circuits. Relays can perform the
basic operations of Boolean combinatorial logic.

26
For example, the Boolean AND function is realized by connecting normally open relay contacts
in series, the OR function by connecting 30 normally open contacts in parallel. Inversion of a
logical input can be done with a normally closed contact.

Relays were used for control of automated systems for machine tools and production lines. The
Ladder programming language is often used for designing relay logic networks.

Early electro-mechanical computers such as the ARRA, Harvard Mark II, Zuse Z2, and Zuse Z3
used relays for logic and working registers. However, electronic devices proved faster and easier
to use.

Because relays are much more resistant than semiconductors to nuclear radiation, they are widely
used in safety-critical logic, such as the control panels of radioactive waste-handling machinery.

Electromechanical protective relays are used to detect overload and other faults on electrical lines
by opening and closing circuit breakers.

2.2.4 LED

A light-emitting diode (LED) is a semiconductor light source that emits light when current flows
through it. Electrons in the semiconductor recombine with electron holes, releasing energy in the
form of photons. The color of the light (corresponding to the energy of the photons) is determined
by the energy required for electrons to cross the band gap of the semiconductor.[5] White light is
obtained by using multiple semiconductors or a layer of light-emitting phosphor on the
semiconductor device.

Appearing as practical electronic components in 1962, the earliest LEDs emitted low-intensity
infrared light. Infrared LEDs are used in remote-control circuits, such as those used with a wide
variety of consumer electronics. The first visible-light LEDs were of low intensity and limited to
red.

Modern LEDs are available across the visible, ultraviolet, and infrared wavelengths, with high
light output.

Early LEDs were often used as indicator lamps, replacing small incandescent bulbs, and in seven-
segment displays. Recent developments have produced high-output white light LEDs suitable for
room and outdoor area lighting.

27
LEDs have led to new displays and sensors, while their high switching rates are useful in
advanced communications technology.

Figure 14: LED

28
LEDs have many advantages over incandescent light sources, including lower energy
consumption, longer lifetime, improved physical robustness, smaller size, and faster switching.
LEDs are used in applications as diverse as aviation lighting, automotive headlamps, advertising,
general lighting, traffic signals, camera flashes, lighted wallpaper, plant growing light and
medical devices.

Unlike a laser, the color of light emitted from an LED is neither coherent nor monochromatic,
but the spectrum is narrow with respect to human vision, and functionally monochromatic.

2.2.5 POWER SUPPLY

9 VOLT ADAPTER

An AC adapter, AC/DC adapter, or AC/DC converter is a type of external power supply, often
enclosed in a case similar to an AC plug. Other common names include plug pack, plug-in
adapter, adapter block, domestic mains adapter, line power adapter, wall wart, power brick, and
power adapter. Adapters for battery-powered equipment may be described as chargers or
rechargers (see also battery charger).

AC adapters are used with electrical devices that require power but do not contain internal
components to derive the required voltage and power from mains power. The internal circuitry
of an external power supply is very similar to the design that would be used for a built-in or
internal supply.

External power supplies are used both with equipment with no other source of power and with
battery-powered equipment, where the supply, when plugged in, can sometimes charge the
battery in addition to powering the equipment.

Figure 15: Adapter

29
Use of an external power supply allows portability of equipment powered either by mains or
battery without the added bulk of internal power components, and makes it unnecessary to
produce equipment for use only with a specified power source; the same device can be powered
from 120 VAC or 230 VAC mains, vehicle or aircraft battery by using a different adapter.

Another advantage of these designs can be increased safety; as the hazardous 120 or 240 volt
mains power is transformed to a lower safer voltage at the wall outlet, and the appliance which
is handled by the user is powered by this lower voltage.

12 VOLT BATTERY

A battery converts chemical energy into electrical energy by a chemical reaction. Usually all the
chemicals are kept inside the battery. It is used in a circuit to power other components. A battery
produces direct current (DC) electricity (electricity that flows in one direction, and does not
switch back and forth).

Using the electricity from an outlet in a building is cheaper and more efficient, but a battery can
provide electricity in areas that do not have electric power distribution. It is also useful for things
that move, such as electric vehicles and mobile phones.

To increase voltage or storage capacity, you can connect multiple 12-volt batteries either in series
or parallel. For instance, if you wire two 12 volt batteries in series, your system will be 24 volts.
The same 12 - volt system will still exist if you connect these identical 12 - volt batteries in
parallel, but it will be able to run the same gadget for twice as long as a single 12-volt battery
can.

There are now two main types of 12-volt rechargeable storage batteries in use: lead-acid and
lithium - ion.

Lithium - ion technology is more recent than lead-acid batteries, which have been in use for a
long time. Lead - acid batteries come in a variety of varieties: flooded lead - acid battery, sealed
VRLA, AGM 12V battery, gel 12V battery.

30
2.3 BLOCK DIAGRAM

Figure 16: Block Diagram

2.4 CIRCUIT DIAGRAM

Figure 17: Circuit Diagram 4

31
2.5 APPLICATIONS

1. Everything is automated so it is easy to use.


2. It is control by mobile application so no extra training is required.
3. We can change controlling system as our requirement.
4. It works on Arduino based system so we can easily understand how it works.
5. It saves our time.
6. Every home appliance can control by one android application.
7. Easy installation and user friendly.
8. We are using solar system for using renewable energy.
9. Lighting control allows to control wall switches, blinds and lamps.
10. Smart appliances and security system.
In this project we used LDR Street light for the energy conservation.

32
CHAPTER 3

PROPOSED METHODOLOGY

3.1 PROGRAMMING CODE

byte val;

void setup()

Serial.begin(9600);

pinMode(2, OUTPUT);

pinMode(3, OUTPUT);

pinMode(4, OUTPUT);

pinMode(5, OUTPUT);

pinMode(6, OUTPUT);

pinMode(7, OUTPUT);

void loop()

int a=0;

if(Serial.available())

val=Serial.read();

Serial.println(int(val));

33
if(int(val)==97)

digitalWrite(2,HIGH);

else if (int(val)==98)

digitalWrite(2,LOW);

if(int(val)==99)

digitalWrite(3,HIGH);

else if(int(val)==100)

digitalWrite(3,LOW);

if(int(val)==101)

digitalWrite(4,HIGH);

else if(int(val)==102)

digitalWrite(4,LOW);

if(int(val)==103)

digitalWrite(5,HIGH);

else if(int(val)==104)

digitalWrite(5,LOW);

if(int(val)==105)

digitalWrite(6,HIGH);

else if(int(val)==106)

digitalWrite(6,LOW);

if(int(val)==107)

digitalWrite(7,HIGH);

else if(int(val)==108)

digitalWrite(7,LOW);

34
3.2 ORANIZATION OF THE SYSTEM
The principles guiding the system's creation and evolution are described, along with the basic
organization of the system as manifested in its constituent parts, their interactions with one
another, and the environment.
The home system and the client side user interface make up the two major components of the
system architecture for the home automation system.

HARDWARE SIDE
The PCB, to which the GPRS module and all other sensors, devices, and parts are connected, is
the first part of the home system. The microcontroller receives all instructions sent by the user
and processes them through the GPRS module. Through a SIM, it is linked to the internet.
It is also possible to link wirelessly to the sensors. It can be put into practice using an RF
transceiver. On a smaller scale, however, all of the components with the exception of one are
wired to the circuit.

Client Side User Interface

By logging into a website that can be viewed on any internet browser, the client can access the
home system. After the request has been handled, the client receives a response. The customer
can go to http://www.iotdemoo.herokuapp.com, select the proper mode, and issue various
commands in accordance.
The Arduino UNO board, a SIM800 module, various sensors, devices, a power source, and other
components make up the main circuit.
Below is a short description of each component. They fall generally into two categories: client
side and hardware side.

Hardware Side

All the electrical appliances need power to operate. Either 5V or 12V DC are required by the
modules. To convert the 230V AC into DC, a power supply is used. The prototype makes use of
a fan and two bulbs. Relays are used to link them. The sensors include: PIR sensor, gas sensor
and a temperature sensor. There is also a buzzer.
The microcontroller handles all the commands given by the user and ensures that they are
executed. It communicates with users via a website. The SIM800 module is used to create the
internet connection.

35
CLIENT SIDE
It's built on the Django platform. Views.py, urls.py, models.py, and templates are some of the
various files that are utilized.

Figure 18: Client Side Block Diagram

36
3.3 IMPLEMENTATION AND TESTING

3.3.1 Implementation
The code is divided into three major files: models.py, urls.py, and views.py. The templates folder,
which also includes all the html files, is where the web page's design is located.

models.py
The only reliable source of knowledge about the data is a model. Each model attribute
corresponds to a particular data area. The attributes used in this endeavor are the sensor readings
and the status of the devices (d1, d2, and d3). (temp, gas, pir).

views.py
Simply put, a Python function that accepts a Web request and provides a Web response is known
as a view function, or view for short. This file transmits a specific web page in response after
verifying the model's parameters. The file's operations include:
• Home automation status: This shows the web page's sensor readings and the status of the
devices.

• The functions home light on (request) and home light off (request) take the request and change
the device state on the website to red for off and green for on.

• Fan speed (request): This method evaluates the request and outputs the fan speed from 1 to 5
in accordance.

• Home next (request): This method replies to the project's hardware side code with a string
containing the status of all devices.

• Normal mode (request) and security mode (request): The request URL is checked for the mode,
and the appropriate page is returned in response.

urls.py
The basic mapping between URL patterns (simple regular expressions) and Python functions is
contained in this file, which is written entirely in Python. (the views). This file is crucial in
determining which Python code to execute whenever a user seeks a page from the website.
Django iterates sequentially through each file's URL patterns before stopping at the first one that
corresponds to the requested URL.

37
Templates
All of the project's HTML and CSS-coded web page templates can be found in this folder. Pages
that are included are:
 The login screen is displayed in login.html.
 invalid_login.html: Shows the screen when the login information is incorrect.
 normal_mode.html: Shows the page in normal mode.
 The security mode screen is displayed in security_mode.html.
 home_autoreload.html: Reloads the page at predetermined intervals so that any
modifications, if any, can be seen.

HARDWARE SIDE CODE


This section provides descriptions of every function used in the hardware code for house
automation. The variables used for the buzzer, LCD, devices, sensors, and GPRS module are first
defined. Next, the pin number for each device is stated. Two tasks are built into each code for the
Arduino. void setup() and void loop are then (). A single call to the setup method is made.
Repetition of the loop function occurs. According to use, additional functions are introduced.

void setup( )
The output/input option is selected for the pins. Through digital Write, the devices are written
with the default off state. The GPRS module is started, as well as the website link.

VOID LOOP ( )

Different commands are issued to the devices in accordance with the data received from the
url. Six bits make up the info sent by the URL. The state of device 1 is represented by the first
bit. The state of device 2 is represented by the second bit. The fan rank is represented by the
third bit. The fourth is the fan setting, which can be either automatic or manual. The fifth
operates in a similar manner in light mode (automatic/manual).

Table 1: Void Loop

Bit No. Bit Value = 0 Bit Value = 1


1 Device 1 OFF Device 1 ON
2 Device 2 OFF Device 2 ON
3 Fan OFF Fan ON
4 Automatic Mode Fan Manual Mode Fan
5 Automatic Mode Bulb Manual Mode Bulb
6 Normal Mode Security mode

38
Description of String Sent by the URL

The status of the appliances is altered as a result of reading these bits from the string. The
relevant variables are updated along with the sensor data.

void SubmitHttpRequest( )

To connect to the website for home automation, this function utilizes a variety of AT commands.
Prior to initializing the SIM800 module in GPRS mode, it first determines the intensity of the
connected sim's signal. The service supplier determines the APN. After that, the mode is altered
to http, and a http session is started. The URL is provided, and then the connection is made.

void send_data_url( )

This method uses AT commands to send the sensor data collected to the URL.

void ShowSerialData( )

Using this function, the responses or returned numbers from the AT commands are shown on
the serial monitor.

void ShowSerialData1( )

The text transmitted by the URL is read, put into an array, and then shown on the serial monitor.

3.3.2TESTING

A string is used to communicate instructions and hardware status between the website and the
hardware. The website sends back the string: "*d1 d2 speed auto_fan auto_light mode#."

Here, the HTTP ACTION shows whether the connection to the web website was successful or
unsuccessful.

39
3.3.2.1 Normal Mode Testing Scenarios

The mode character is replaced with 0 in every line in this mode. As a result, all subsequent
actions are carried out in the default manner.

3.3.2.2 switching out device 1

Device 1 is represented by a 1 in the string received in this instance, indicating that the indication
to turn on Device 1 has been received. Consequently, that activity is carried out.

TEST DEVICE 1

Figure 19: Test Device (on/off)

DEVICE 1 ON

40
3.3.2.3 Security Mode Testing Scenarios

The mode character is replaced with 1 in every line in this mode. As a result, the security mode
is used for all the activities that follow.

3.3.2.4 Intrusion Alert

The website displays an alert sign in the security mode whenever the sensor finds an intrusion.

TEST SECURITY MODE

Figure 20: Security Alert

DISPLAY ALERT ON INTRUSION DETECTION

41
CHAPTER 4
RESULTS AND DISCUSSION

The proposed plan states that the final outcome of this research will result in the creation of home
automation. By this project, an automation system has been developed that makes it simple to
operate household appliances including fans, lights, tube lights, air conditioners, and bulbs,
among others. This project's goal is to provide us with a smart automated and affordable project,
among other things. We have also covered information about the Arduino Uno, Bluetooth
controller, and relay module in this essay. Moreover, information regarding their work is
provided. The benefit of home automation has also been explored in addition to its component.
The system is simple to use and secure against intrusion from any user or outsider. The main goal
of this project is to create a home automation system utilizing an Arduino board with Bluetooth
that can be operated remotely by any smartphone running the Android operating system. Houses
are becoming smarter as technology advances.

42
CHAPTER 5
CONCLUSIONS AND FUTURE SCOPE

5.1 CONCLUSIONS

The system as the name indicates, ‘Home automation’ makes the system more flexible and
provides attractive user interface compared to other home automation systems. In this system we
integrate mobile devices into home automation systems. A novel architecture for a home
automation system is proposed using the relatively new communication technologies. The system
consists of mainly three components is a BLUETOOTH module, Arduino microcontroller and
relay circuits.

WIFI is used as the communication channel between android phone and the Arduino
microcontroller. We hide the complexity of the notions involved in the home automation system
by including them into a simple, but comprehensive set of related concepts. This simplification
is needed to fit as much of the functionality on the limited space offered by a mobile device’s
display.

This paper proposes a low cost, secure, ubiquitously accessible, auto-configurable, remotely
controlled solution. The approach discussed in the paper is novel and has achieved the target to
control home appliances remotely using the Wi-Fi technology to connect system parts, satisfying
user needs and requirements.

Wi-Fi technology capable solution has proved to be controlled remotely, provide home security
and is cost effective as compared to the previously existing systems. Hence we can conclude that
the required goals and objectives of home automation system have been achieved. The system
design and architecture were discussed, and prototype presents the basic level of home appliance
control and remote monitoring has been implemented.

Finally, the proposed system is better from the scalability and flexibility point of view than the
commercially available home automation systems the operation of the home automation system
is described. Future technology that minimizes human labours could be used, according to study.
We created a certain kind of device that is small in size, inexpensive, has greater capacity, a long
lifespan, and more distant signal receivers.

43
This method enhances human lifestyle while saving electricity. The devices at home can be
accessed and managed using a smart phone with built-in Wi-Fi connectivity. Mobile cellular
networks like 3G or 4G can be utilized to access the system in the absence of a Wi-Fi connection.
Additionally, the system makes advantage of the Google speech recognition engine, eliminating
the requirement for an external voice recognition module.

5.2 FUTURE SCOPE

Integration of smart home devices- Smart devices are so pervasive and well-liked that they are
quickly taking over our life. Controlling smart devices installed in houses is made simple by
gadgets like smart Homes (like Google Home, Amazon Echo, and Apple Home Pod). Better
home appliance development-Everyday household items that we have used for years are
becoming smarter and giving their consumers greater benefits.

More control, environmental customization, and efficiency- The new smart gadgets are
improving centralized control and environmental modification like never before. Home
automation is a rapidly developing area of technology that makes homes safer and more
comfortable places to live. Users can virtually operate and monitor a variety of home elements,
including lighting, entertainment systems, security, climate control, etc.

25

44
CHAPTER 6
REFERENCES

1. Ajah, G, David, N, Abioye, A, Web Based Security System, Sch. J. Eng. Tech, 1(3):112-
116, 2013.

2. Kumar, M., Shimi, S. L. (2015), “Voice recognition-based home automation system for
paralyzed people”, Inter. J. of Adv. Res. inElect. and Comm. Eng., Volume 4, Issue 10,pp.
2508–2515.

3. N.David, A.Chima, A.Ugochukwu and E.Obinna,"Design of a home automation


system using Arduino",International journal of Scientific & Engineering
Research, Vol. 6, pp.795-801, june-2015.

4. Anandan, R, Karthik, B, Kumar, K, WIRELESS HOME AND INDUSTRIAL


AUTOMATION SECURITY SYSTEM USING GSM, JGRCS, Volume 4, No. 4, 126-
132,2013.

5. A.Elshafee, K. A. Hamed (2012), “Design and implementation of a Wi-Fi based home


automation system”, World Acad. of Sci.,Eng.and Tech., Volume 68, pp. 2177–2183.

6. Mahmood, S M, Abdulsattar, M, Firas, A Y; Home Automation Management with


WLAN(802.11g) and RF Remote Control, Raf. J. of Comp. & Math’s, 6(1), 2009.

7. Home Automation & Wiring (1 ed.). New York: McGraw-Hill/TAB Electronics. 1999-
03- 31. ISBN 9780070246744.

8. M.Van Der Werff, X. Gui and W.L. Xu, “A Mobile based Home Automation System,
Applications and Systems”, 2005, 2nd International Conference on Mobile Technology,
Guangzhou, pp.5.

9. Mahesh.N.Jivani, “GSM Based Home Automation System Using App-Inventor for


Android Mobile Phone”, 2014, International Journal of Advanced Research in Electrical,
Electronics and Instrumentation Engineering, Vol. 3(9), pp. 12121-12128.

10. S.R.Bharanialankar, C.S.Manikanda Babu, “Intelligent HomeApliance Status Intimation


Control and System Using GSM”, 2014, International Journal of Advanced Research in
Computer Science and Software Engineering, Vol. 4(4), pp.554 – 556.

11. Armando Roy Delgado, Rich Picking, Vic Grout, “Remote-Controlled Home Automation
Systems with Different Network Technologies”, Centre for Applied Internet Research,
University of Wales, UK.

12. Home Automation System via Bluetooth Home Network”, 2003, SICE Annual
Conference, Fukui, Vol. 3, pp. 2824 – 2829.

13. Eddie M C Wong, “A Phone Based Remote Controller for Home and Office Automation”,
1994, IEEE Transactions on Consumer Electronics, Vol. 40(1), pp. 28-34.

14. H. Brooke Stauffer “Smart Enabling System for Home automation”, 1991, IEEE
Transactions on Consumer Electronics, Vol. 37(2) , pp. 29-35.

45
15. Baki Koyuncu, “PC Remote Control of Appliances by Using Telephone Lines”, 1995,
IEEE Transactions on Consumer Electronics, Vol. 41(1), pp. 201-209.

16. Baris Yuksekkaya, A. Alper Kayalar, M. Bilgehan Tosun, M. Kaan Ozcan, and Ali Ziya
Alkar “AGSM, Internet and Speech Controlled Wireless Interactive Home Automation
System”, 2006, IEEETransactions on Consumer Electronics, Vol. 52(3), pp. 837 – 843.

17. Rozita Teymourzadeh,Salah Addin Ahmed,Kok Wai Chan and Mok Vee Hoong , “Smart
GSM Based Home Automation System”, 2013, IEEE Conference on Systems, Process
& Control,Kuala Lumpur, Malaysia.

18. Arnab Waheed Ahmad, Naeem Jan, Asaeed Iqbal, Chankil Lee, Ansan Korea,
“Implementation of ZigBee- GSM based Home Security Monitoring and Remote Control
System”, 2011, IEEE Symposium on Circuits and Systems (MWSCAS), Seoul, pp. 1-4.

19. R.Piyare,M.Tazil, “ Bluetooth Based Home Automation System Using Cell Phone”, 2011
,IEEE 15th International Symposium on Consumer Electronics, Singapore, pp. 192 - 195.

20. Ersue, M.; Romascanu, D.; Schoenwaelder, J.; Sehgal, A. (4 July 2014).
"Management of Networks with Constrained Devices: Use Cases". IETF
Internet Draft.

46

You might also like