You are on page 1of 50

A

Project report

On

Home Automation Using Arduino And PIR Sensor

Submitted in partial fulfillment of the

Requirements for the award of degree of

BACHELOR OF TECHNOLOGY
In
ELECTRONICS AND COMMUNICATION ENGINEERING
By

M.V.N.D.S.VAMSHI (166F1A0443) T. PRASANNA (166F1A0460)

K. SRINIKA (166F1A0433) P. RAKESH (166F1A0450)

Under the guidance of

Mr. P. ANIL KUMAR M.Tech


Asst. Professor

SUBMITTED TO
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

PALLAVI ENGINEERING COLLEGE


(Formerly NAGOLE INSTITUTE OF TECHNOLOGY & SCIENCE)
(Approved by AICTE- New Delhi & Affiliated to JNTUH, HYDERABAD)
Kuntloor (V), Hayathnagar (M), Hyderabad, R.R.Dist– 501 505.
(2016-2020)
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
PALLAVI ENGINEERING COLLEGE
(Formerly NAGOLE INSTITUTE OF TECHNOLOGY & SCIENCE)
(Approved by AICTE- New Delhi & Affiliated to JNTUH, HYDERABAD)
Kuntloor (V), Hayathnagar (M), Hyderabad, R.R.Dist– 501 505.

CERTIFICATE
This is to certify that the Project report entitled “HOME AUTOMATION
USING ARDUINO AND PIR SENSOR” That is being submitted by
M. V. N. D. S. VAMSHI (166F1A0443), T. PRASANNA (166F1A0460),
K. SRINIKA (166F1A0433), P. RAKESH (166F1A0450). In partial fulfillment of
the requirements for the award of BACHELOR OF TECHNOLOGY to
Jawaharlal Nehru Technological University, Hyderabad. is a record of bonafide
work carried out by our Guidance and Supervision. The results embodied in this
work have not been submitted to any other University or Institute for the award of
any degree or diploma .

GUIDE HEAD OF THE DEPARTMENT


Mr. P. ANIL KUMAR M.Tech Dr. A. SIRAJUDEEN M.E., Ph.D
Asst. Professor Professor

Viva Voice held on:

EXTERNAL EXAMINER PRINCIPAL


ACKNOWLEDGEMENT

The satisfaction and euphoria that accompanies the successful completion of


any task would be incomplete without the mention of the people who made it
possible and whose encouragement and guidance have crowned our efforts with
success.

First we would like to thank our project guide Mr. P. ANIL KUMAR,
Asst. Professor. In Department of E.C.E., for his inspiration, adroit guidance and
constructive criticism for completion of my degree.

We would like to convey our special thanks to the project In-charge


Mr. D. RUPA KUMAR, Asst. Professor in Department of E.C.E., for his valuable
guidance and suggestions in analyzing and testing throughout the period, till the end
of this work completion.

Also we would like to express our sincere gratitude to Dr.A. SIRAJUDEEN,


Professor. Head of Department in Electronics & Communication Engineering during
the progress of the project work, for his timely suggestions and help in spite of his
busy schedule.

Our acknowledgments extended to Principal of PALLAVI ENGINEERING


COLLEGE, For their consistent help and encouragement to complete the project
work.

We are very much thankful to our beloved management members for their
help in providing good facilities in our college.

M.V.N.D.S.VAMSHI (166F1A0443)

T. PRASANNA (166F1A0460)

K. SRINIKA (166F1A0433)

P. RAKESH (166F1A0450)
ABSTRACT

This paper reports on a system that can save electricity. Many times, we leave
the room and hall without switching off lights and fans, thus electricity is waste. In
this work, we have presented a system in which energy will be saved based on the
number of people entering or leaving out of the room. If there is no person in the
room, then light and fan will be switched OFF. On the other hand, as soon as any
person enters the room, light and fan will be switched ON.

The main components used in this system are Arduino Uno, PIR sensor and
Relay Module. Out of these components, the operation of system mainly depends on
PIR sensor which helps in detecting human presence. Experimental results show that
at least 50% of power can be saved by using the proposed system. Simultaneously we
can vary the speed of the fan sensing the room temperature. The more temperature the
more speed of the fan. A smoke sensor module is used for detecting any smoke within
the room and provides safety by alarming the audio device.
CONTENTS
Page No.
LIST OF CONTENTS I

LIST OF FIGURES III

LIST OF TABLES IV

GLOSSARY V

1 INTRODUCTION 1

1.1 Introduction 1

2 LITERATURE SURVEY 4

2.1 Literature review 4

2.2 Existing systems 5

2.3 Proposed system 6

2.4 Objective 7

2.5 Theory of the project 7

2.6 Required components 7

2.7 Arduino nano 7

2.8 PIR sensor 10

2.9 Relay module 11

2.10 LED(Light Emitting Diode) 18

2.11 Breadboard 22

2.12 Power supply 23

2.13 Resistor 23

3 DESIGN AND IMPLEMENTATION 25

3.1 Block diagram 25

3.2 Circuit diagram 25

3.3 Circuit description 26

3.4 Flow chart 26

I
3.5 Working 27

4 RESULT AND ANALYSIS 28

4.1 Result 28

4.2 Image of the project 28

4.3 Output Serial monitor 29

5 SOFTWARE TOOLS 30

5.1 Arduino IDE(1.8.9) 30

5.2 Details on IDE 30

5.3 Libraries 31

5.4 Program structure 32

5.5 Selecting a board 32

5.6 Serial monitor 34

❖ Advantages,Disadvantages & Applications 35


❖ Future scope 36
❖ Conclusion 37
❖ References 38
❖ Appendix-A 40

II
LIST OF FIGURES
Figure No Name of the figure Page No.
2.1 Description of Arduino nano 8

2.2 Arduino pin layout ` 10

2.3 PIR sensor 11

2.4 Working of PIR sensor 12

2.5 Connection to PIR sensor 13

2.6 Testing of PIR 13

2.7 Reading PIR sensor 14

2.8 Relay module 15

2.9 Working of Relay module 16

2.10 Relay module principle 17

2.11 LED 19

2.12 Working of LED 20

2.13 LED symbol 21

2.14 Breadboard 22

2.15 Connection to breadboard 23

2.16 Resistor symbol 24

3.1 Block diagram 25

3.2 Circuit diagram 26

3.3 Flow chart 27

4.1 Image of the project 28

4.2 Serial monitor 29

5.1 Selection of Arduino board 33

5.2 Selection of ports 33

III
LIST OF TABLES
Table No Name of the table Page No.
1.1 Required intensity of light of various environments 2

2.1 Summary of Literature survey 5

2.2 Arduino nano specifications 8

IV
GLOSSARY
ACRONYM DESCRIPTION
PLC Programmable Logic Controller

LED Light Emitting Diode

PWM Pulse Width Modulation

SPI Serial Peripheral Interface

PIR Passive Infrared sensor

TTL Transistor-Transistor Logic

IR Infrared Radiation

IDE Integrated Development Environment

GSM Global System for Mobile

TFT Thin Film Transistor

LDR Light Dependent Resistor

V
Home Automation Using Arduino and PIR Sensor

CHAPTER-1

INTRODUCTION
1.1 INTRODUCTION
Scientific inventions have made this world worth living. They have provided
us comforts and luxuries. Technology has become an important and necessary part of
our lives. In the last few years, there is tremendous advancement in technology. So,
human life becomes more dependent on these technologies. The invention of
Electricity is one of the greatest of all its inventions. Electricity has become an
indispensable part of human life. Electricity is considered as the soul or the life
without which the entire world remains dead and dormant. To provide more comforts
to human there is a technology called as Home Automation. When there is control of
all household amenities and appliances together with the use of technology then it is
termed as Home Automation. As non-renewable sources are decreasing day by day,
there is need of conservation of energy. Electricity is the most important to all the
activities of modern society. Hence, wise use of non-renewable energy sources must.
Home Automation gives energy efficient room by observing and controlling different
devices. Now a days, the issues related to energy become main problem. In this
modern world people are in a hurry and hence forget to turn OFF the lights and fans.
Power saving has become a necessary thing in our day-to-day life. Many
conventional power saving methods such as using electrical devices which consumes
very less energy or cutting off the entire power supply for a scheduled time for a
particular area are not efficient and there will be a lot of discomforts to the users and
cost may also increase to use a low power electrical device. Buildings are responsible
for up to 40% of energy usage. Most part of this energy is used mainly for maintaining
good lighting such that the workers feel comfortable. Nowadays the newly constructed
modernized or automated buildings may have lighting system to improve the comfort
of occupants and to save energy. However, there are a greater number of old
buildings, which contains the traditional lighting system. To reduce the energy
consumption in those types of buildings and to help the owners of that building in
terms of saving electricity bill an intelligent and an effective method is to discuss in
this paper. Because of advancement in Sensor technology a very cheap and portable
methods to measure our surroundings are available.

Dept of ECE, PEC Page 1


Home Automation Using Arduino and PIR Sensor

The amount of light required to for a good environment to work comfortably


in various areas are shown in table 1 which is recommended by CIBSE lighting
guides.

TYPE OF PLACE AND INTENSITY REQUIRED


WORK

Filling office wok 300lux

General office work 500lux

Painting 750lux

Classrooms 300lux

Classrooms for evening class 500lux

Auditorium 500lux

Assembly(Industry) 1000lux

Table-1.1: Required intensity of light for various environments


Recently, man’s work and life are increasingly tight with the rapid growth in
communications and information technology.In this paper we have studied various
techniques for implementing classroom automation such as arduino,raspberry pi, Bluetooth
connectivity. The informationized society has changed human beings way of life as well as
challenged the traditional residence. Followed by the rapid economic expansion, living
standard keeps raising up day by day that people have a higher requirement for dwelling
functions. The intellectualized society brings diversified information where safe, economic,
comfortable and convenient life has become the ideal for every modern family.It is will know
that the concept of smart home has focused the attention of researchers, lifestyle practitioners,
and consumers to be directed forward the usage of the recent technology. Considerable
efforts have been made to the development of remote control systems for home automation.
Human beings are wasting too much of electrical energy by not turning off the lights,
fans and many other electrical appliances when they are not using it. To overcome this
problem we have developed a device that can be fitted anywhere in offices or homes. As the
device will detect the presence of Human and automatically turn on and off the device. To
detect the presence of human we are using PIR Sensor. PIR consist of IR sensors and IR

Dept of ECE, PEC Page 2


Home Automation Using Arduino and PIR Sensor

sensors are used to the heat of the human body and it will turn on the electrical appliances.
Arduino mini pro is used to control the PIR sensor and electrical appliances. Relay modules
are used to control the electrical appliances.
In such a situation, this project which is a part of ho saves electricity. On the basis of
human presence in a particular area of the room, the electrical appliances can be switched
ON or OFF automatically. This is the main advantage of this system.

Dept of ECE, PEC Page 3


Home Automation Using Arduino and PIR Sensor

CHAPTER-2
LITERATURE SURVEY
2.1 LITERATURE REVIEW
Literature survey is the study of already established systems and collection of
information which helps in doing new tasks.
Vibhuti
A system which operates with control of relays and with the use of WAGO
PLC (Programmable Logic Controller) and Arduino Uno. Switching operation of
devices such as tube light, fan, AC, etc. can be operated spontaneously by using PIR
sensor and on the basis of environmental conditions. In real-time implementation,
automatic control is done by sensor data and manual control is done by android
application.But, difficulty in this paper is the controlling and monitoring of devices
done by WAGO PL and Arduino Uno both. These operations can be done by using
only Arduino Uno.
Maslekar
A proposed a smart lighting system in which Raspberry Pi has used.
Raspberry Pi is monitoring lights and fans simultaneously. In the absence of person
room lights and fans will automatically turns OFF. Energy is preserved by using this
smart lighting system. The experimental results of this system have shown that 50%
energy is conserved. But the difficulty is Raspberry Pi is more expensive than
Arduino Uno.
Automatic Lighting and Control System for Classroom in which electrical
light is controlled by Bluetooth, PIR sensor and relay. To switch ON or OFF the light
Bluetooth module is connected to Arduino Uno which sends voice command from
Arduino Uno by using the mobile android application. The experimental results have
shown the 50% energy is conserved. But this paper can be implemented by removing
the Bluetooth module as well.
In the disquisitions speak about automatic room light system by using visitor
counters operation. Depending upon the human presence, the room lights ON or OFF.
There is no need of manual operation for switching. The PIR sensor is used to the
human presence which is at the entrance of room. As visitor counter is used, there is
increment in the counter when a person enters into the room and this leads to turn ON

Dept of ECE, PEC Page 4


Home Automation Using Arduino and PIR Sensor

the room light which is controlled by micro controller program. If a person exits the
room, the counter decremented and this leads to turn OFF the lights. When all persons
left the room then only lights in the room switched OFF. The difficulty in this system
is that the door of room should not allow more than one person at a time.
Vahid
A proposed system whose control is dependant on Arduino micro
controller,network communications and Mod bus industrial protocol. Arduino
Ethernet shield and a wireless router device is used to build the network
communication. The specific Android application is used to load the Mod bus
program into mobile or Windows software named "mypro" and on Arduino board,
Arduino code loaded through USB (Universal Serial Bus) cable. There is inter-
connection between Arduino Ethernet Shield and mobile through Ethernet cable and
router. By connecting to the router, users can control and monitor the appliances
easily.The Table 2 summarizes the available methods in Literature survey.

S.NO TITLE TECHNOLOGY USED

1 Implementation of smart classroom WAGO PLC and Arduino Uno


using WAGO PLC

2 Smart lighting system using Raspberry pi


Raspberry pi

3 Automatic Room Light controller Section display Automatic Room Light


with Visitor Counter controller section LCD Display

4 Automatic Lighting and Control PIR sensor, relay and Bluetooth


System for Classroom module

5 Low-cost Home Automation Using Communication Protocol, Arduino Uno


Arduino and Mod bus Protocol

Table 2.1: Summary of Literature Survey


2.2 EXISTING SYSTEMS
This section describes about most commonly used lighting control system
used in buildings. Since this method is going to use wireless sensor network it is
mandatory to know the operation of existing lighting control system. It can be decided

Dept of ECE, PEC Page 5


Home Automation Using Arduino and PIR Sensor

that energy loss is occurred with a lighting system when the lighting system
illuminates a light which is an area which is not being used currently at that particular
time or when it illuminates a light even though sufficient lighting is available to work.
The most commonly used lighting systems are explained below.

● A Switch operated manually


In this method, a user has to switch ON and OFF the required lights. Since the
user can switch on and off the lights as per their preferences, there is a chance of
keeping the lights in ON state even though it was not needed during that time. This
approach may first checks whether any occupants are there in the room or not. If
anybody is there in that room then it senses the radiation using sensor and it will not
switch ON the light otherwise it switches OFF the light.

● Disadvantages of the system


Disadvantages and challenges in using LEDs. LEDs are currently more
expensive, price per lumen, on an initial capital cost basis, than more conventional
lighting technologies. The most common design of a heat sink is a metal device with
many fins, which conducts the heat away from the LED.
2.3 PROPOSED SYSTEM
On the other hand, the energy resources like petroleum, coal, natural gas,
uranium and propane are called non -renewable resources, because their supplies are
limited. Many environmental effects and day-by-day depleting energy resources warn
us to save energy by using automatic room controller an Energy efficient lighting
systems. Nowadays the wastage of electricity has become a routine thing for us, and
the problem has become frequent at homes, schools, and colleges and even in
industries. Sometimes we notice fans and lights keep on working even in the absence
of people. This often happens in homes, offices and public places due to utter
negligence of the inmates.

● Advantages of the system


It is easy to integrate with lighting system such as automatic lighting system. It
is used for energy consumption or energy management by automatic control of
brightness level in mobile phones and auto ON/OFF of street lights based on ambient
light intensity. LDR (i.e. Photo-resistor) based light sensors are available in different
shapes and sizes. Light sensors need small voltage and power for its operation. Photo-

Dept of ECE, PEC Page 6


Home Automation Using Arduino and PIR Sensor

resistors are lower in cost, bi-directional and offer moderate response time. Photo-
diodes offer quick response time, lower in cost and provide digital output. Photo-
transistors are very fast and provide immediate output compared to photo-
resistors.Photo-transistors generate high current compared to photo-diodes.
2.4 OBJECTIVE
● To study the design procedure of automatic room light control.
● Study different electrical parts and elements.
● Study about Arduino uno.
● Study Arduino programming language.
● To control lighting system ON/OFF.
2.5 THEORY OF THE PROJECT
To implement the desired project,our target is to arrange all the required
components and modules as per the circuit diagram and practical functioning status
observation of components.The required components and description are as follows-
2.6 REQUIRED COMPONENTS
● Arduino UNO
● PIR(Passive Infra-red) sensor
● Relay module
● Breadboard
● LED
● Power supply
● Connecting wires
If you do not have a relay module use the following components:
● 5V Relay
● 2N2222 (or BC547) NPN Transistor
● 1N4007 PN Junction Diode
● 1KΩ Resistor (1/4 Watt).
2.7 ARDUINO NANO
The Arduino Nano is a small, complete, and breadboard-friendly board based
on the ATmega328 (Arduino Nano 3.0) or ATmega168 (Arduino Nano 2.x). It has
more or less the same functionality of the Arduino Duemilanove, but in a different
package.

Dept of ECE, PEC Page 7


Home Automation Using Arduino and PIR Sensor

Figure.2.1 Description of Arduino nano


2.7.1 SPECIFICATIONS
The below table shows the specifications of the arduino nano.

component Specification

Micro Controller Atmel ATmega168 or ATmega328

operating voltage(logic level) 5V

Input voltage(recommended) 7-12V

Input voltage(limits) 6-20V

Digital I/O pins 14 (of which 6 provide PWM output)

Analog Input Pins 8

DC Current per I/O Pin 40mA

Flash Memory 16 KB (ATmega168) or 32 KB (ATmega328) of which


2 KB used by boot loader.

SRAM 1 KB (ATmega168) or 2 KB (ATmega328)

Dept of ECE, PEC Page 8


Home Automation Using Arduino and PIR Sensor

EEPROM 512 bytes (ATmega168) or 1 KB (ATmega328)

Clock speed 16MHZ

Table.2.2: Arduino nano specifications


2.7.2 POWER
The Arduino Nano can be powered via the Mini-B USB connection, 6-20V
unregulated external power supply (pin 30), or 5V regulated external power supply
(pin 27). The power source is automatically selected to the highest voltage source.
The FTDI FT232RL chip on the Nano is only powered if the board is being
powered over USB. As a result, when running on external (non-USB) power, the 3.3V
output (which is supplied by the FTDI chip) is not available and the RX and TX LEDs
will flicker if digital pins 0 or 1 are high.
2.7.3 INPUT AND OUTPUT
Each of the 14 digital pins on the Nano can be used as an input or output,
using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts.
Each pin can provide or receive a maximum of 40 mA and has an internal pull-up
resistor (disconnected by default) of 20-50 kOhms. In addition, some pins have
specialized functions:
● Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL
serial data. These pins are connected to the corresponding pins of the FTDI
USB-to-TTL Serial chip.
● External Interrupts: 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value.
● PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the
analogWrite() function.
● SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support
SPI communication, which, although provided by the underlying hardware, is
not currently included in the Arduino language.
● LED: 13. There is a built-in LED connected to digital pin 13. When the pin
is HIGH value, the LED is on, when the pin is LOW, it's off.
● Reset. Bring this line LOW to reset the micro controller. Typically used to
add a reset button to shields which block the one on the board.

Dept of ECE, PEC Page 9


Home Automation Using Arduino and PIR Sensor

2.7.4 COMMUNICATION
The Arduino Nano has a number of facilities for communicating with a
computer, another Arduino, or other microcontrollers. The ATmega168 and
ATmega328 provide UART TTL (5V) serial communication, which is available on
digital pins 0 (RX) and 1 (TX). An FTDI FT232RL on the board channels this serial
communication over USB and the FTDI drivers (included with the Arduino software)
provide a virtual com port to software on the computer. The Arduino software
includes a serial monitor which allows simple textual data to be sent to and from the
Arduino board. The RX and TX LEDs on the board will flash when data is being
transmitted via the FTDI chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).

Figure.2.2: Arduino pin layout


2.7.5 Applications
● Embedded Systems.
● Automation.
● Robotics.
● Control Systems.
2.8 PIR SENSOR
All objects and living things emits infrared rays above absolute zero
temperature. This infrared rays are not visible to human beings by naked eyes, but this

Dept of ECE, PEC Page 10


Home Automation Using Arduino and PIR Sensor

radiation can be detected by electronic devices designed for such a purpose. PIR
sensors are called passive devices as they do not emit any energy to detect the
presence of objects.PIRs are basically made of a pyroelectric sensor which can detect
levels of infrared radiation. Everything emits some low-level radiation, and the hotter
something is, the more radiation is emitted. The sensor in a motion detector is actually
split in two halves. The reason for that is that we are looking to detect motion (change)
not average IR levels. The two halves are wired up so that they cancel each other out.
If one half sees more or less IR radiation than the other, the output will swing high or
low.

Figure.2.3: PIR sensor


PIR sensors allow you to sense motion, almost always used to detect whether a
human has moved in or out of the sensors range. They are small, inexpensive, low-
power, easy to use and don't wear out. For that reason they are commonly found in
appliances and gadgets used in homes or businesses.
2.8.1 FEATURES
● Complete with PIR, Motion Detection.
● Dual Element Sensor with Low Noise and High Sensitivity.
● Supply Voltage – 5V.
● Delay Time Adjustable.
● Standard TTL Output.
● Efficient than microwave sensors.

Dept of ECE, PEC Page 11


Home Automation Using Arduino and PIR Sensor

2.8.2 WORKING OF PIR SENSOR


PIR sensors are more complicated than many of the other sensors because
there are multiple variables that affect the sensors input and output. The PIR sensor
itself has two slots in it, each slot is made of a special material that is sensitive to IR.
The lens used here is not really doing much and so we see that the two slots can 'see'
out past some distance. When the sensor is idle, both slots detect the same amount of
IR, the ambient amount radiated from the room or walls or outdoors. When a warm
body like a human or animal passes by, it first intercepts one half of the PIR sensor,
which causes a positive differential change between the two halves. When the warm
body leaves the sensing area, the reverse happens, whereby the sensor generates a
negative differential change.

Figure.2.4: Working of PIR sensor


2.8.1 CONNECTING TO A PIR SENSOR
Most PIR modules have a 3-pin connection at the side or bottom. The pin out
may vary between modules so triple check the pin out! It's often silk screened on right
next to the connection. One pin will be ground, another will be signal and the final
one will be power. Power is usually 3-5VDC input but may be as high as 12V.
Sometimes larger modules don't have direct output and instead just operate a relay in
which case there is ground, power and the two switch connections.

Dept of ECE, PEC Page 12


Home Automation Using Arduino and PIR Sensor

Figure.2.5: connection to PIR sensor


2.8.2 TESTING A PIR SENSOR
Now when the PIR detects motion, the output pin will go "high" to 3.3V and
light up the LED. Once you have the breadboard wired up, insert the batteries and
wait 30-60 seconds for the PIR to 'stabilize'. During that time the LED may blink a
little. Wait until the LED is off and then move around in front of it, waving a hand,
etc, to see the LED light up.

Figure.2.6: Testing of PIR


2.8.3 READING PIR SENSOR
Connecting PIR sensors to a microcontroller is really simple. The PIR acts as a
digital output, it can be high voltage or low voltage, so all you need to do is listen for
the pin to flip high (detected) or low (not detected) by listening on a digital input on

Dept of ECE, PEC Page 13


Home Automation Using Arduino and PIR Sensor

your Arduino. Power the PIR with 5V and connect ground to ground. Then connect
the output to a digital pin.

Figure.2.7: Reading PIR sensor


2.8.4 ADVANTAGES
● Detects motion reliably in indoors as well as in day or dark.
● It consumes less energy (0.8W to 1.0W) compare to microwave sensor.
● They are cheaper compared to microwave sensors.
● They are good for electrical applications used in smaller and compact
premises.
2.8.5 APPLICATIONS
● This can be used in museums to protect the valuable things.
● This can also be used as an automatic door bell circuit that rings the bell when
human is detected.
● This can be used in defence applications to detect humans in war field.
2.9 RELAY MODULE
A relay is usually an electro-mechanical device that actuated by an electrical
current. The current flowing in one circuit causes the opening or closing of another
circuit. Relays are like remote control switches, and are used in many applications
because of their relative simplicity, example circuit using a relay to power a 120v load
long life, and proven high reliability. Relays used in a wide variety of applications
throughout industry, such as in telephone exchanges, digital computers and
automation systems.

Dept of ECE, PEC Page 14


Home Automation Using Arduino and PIR Sensor

Figure.2.8: Relay module


2.9.1 FEATURES
● Good in safety. In power system and high voltage system, the lower current
can control the higher one.
● 1-channel high voltage system output, meeting the needs of single channel
control.
● Wide range of controllable voltage.
● Being able to control high load current, which can reach 240V, 10A with a
normally-open (NO) contact and a normally-closed (NC) contacts.
2.9.2 PIN DESCRIPTION
INPUT: It has a 1×3 pin header for connecting power (5V and 0V), and for
controlling the relay. The pins are marked on the PCB:
● GND – Connect 0V to this pin.
● SIG – Controls this relay, active Low. Relay will turn on when this input
goes below about 2.0V.
● VCC – Connect 5V to this pin. Is used to power the optocouplers.
OUTPUT:VCC – Connect 5V to this pin. Is used to power the optocouplers.
● COM- Common pin.
● NC- Normally Closed, in which case NC is connected with COM when INT1
is set low and disconnected when INT1 is high.

Dept of ECE, PEC Page 15


Home Automation Using Arduino and PIR Sensor

● NO- Normally Open, in which case NO is disconnected with COM1 when


INT1 is set low and connected when INT1 is high.

Figure.2.9: Working of Relay module

2.9.3 WORKING There are 5 parts in every relay:


● Electromagnet – It consists of an iron core wounded by a coil of wires.
When electricity is passed through, it becomes magnetic. Therefore, it is called
as electromagnet.
● Armature – The movable magnetic strip is known as armature. When
current flows through them, the coil is it energized thus producing a magnetic
field which is used to make or break the normally open (N/O) or normally
close (N/C) points. And the armature can be moved with direct current (DC)
as well as alternating current (AC).
● Spring – When no currents flow through the coil on the electromagnet, the
spring pulls the armature away so the circuit cannot be completed.
● Set of electrical contacts – There are two contact points:

-Normally open – connected when the relay is activated, and disconnected


when it is inactive.
-Normally close – not connected when the relay is activated, and connected
when it is inactive.

Dept of ECE, PEC Page 16


Home Automation Using Arduino and PIR Sensor

● Molded frame – Relays are covered with plastic for protection.


2.9.4 PRINCIPLE

Figure.2.10: Relay module principle

The diagram shows an inner section diagram of a relay. An iron core is


surrounded by a control coil. As shown, the power source is given to the
electromagnet through a control switch and through contacts to the load. When
current starts flowing through the control coil, the electromagnet starts energizing and
thus intensifies the magnetic field. Thus the upper contact arm starts to be attracted to
the lower fixed arm and thus closes the contacts causing a short circuit for the power
to the load. On the other hand, if the relay was already de-energized when the contacts
were closed, then the contact move oppositely and make an open circuit.
As soon as the coil current is off, the movable armature will be returned by a
force back to its initial position. This force will be almost equal to half the strength of
the magnetic force. This force is mainly provided by two factors. They are the spring
and also gravity.
Relays are mainly made for two basic operations. One is low voltage
application and the other is high voltage. For low voltage applications, more

Dept of ECE, PEC Page 17


Home Automation Using Arduino and PIR Sensor

preference will be given to reduce the noise of the whole circuit. For high voltage
applications, they are mainly designed to reduce a phenomenon called arcing.
2.9.5 RELAY APPLICATIONS
Relays are used to protect the electrical system and to minimize the damage to
the equipment connected in the system due to over currents/voltages. The relay is
used for the purpose of protection of the equipment connected to it. These are used to
control the high voltage circuit with low voltage signal in applications audio
amplifiers and some types of modems.
These are used to control a high current circuit by a low current signal in the
applications like starter solenoid in automobile. These can detect and isolate the faults
that occurred in power transmission and distribution system. Typical application areas
of the relays include
● Lighting control systems
● Telecommunication
● Industrial process controllers
● Traffic control
● Motor drives control
● Protection systems of electrical power system
● Computer interfaces
● Automotive
● Home appliances
2.10 LED(Light Emitting Diode)
Light Emitting Diodes (LEDs) are the most widely used semiconductor diodes
among all the different types of semiconductor diodes available today. Light emitting
diodes emit either visible light or invisible infrared light when forward biased. The
LEDs which emit invisible infrared light are used for remote controls. Light Emitting
Diode (LED) is an optical semiconductor device that emits light when a voltage is
applied. In other words, LED is an optical semiconductor device that converts
electrical energy into light energy.

Dept of ECE, PEC Page 18


Home Automation Using Arduino and PIR Sensor

Figure.2.11: LED
2.10.1 LAYERS OF LED
A Light Emitting Diode (LED) consists of three layers: p-type semiconductor
and n-type semiconductor and depletion layer. The p-type semiconductor and the n-
type semiconductor are separated by a depletion region or depletion layer.

● P-type semiconductor
When trivalent impurities are added to the intrinsic or pure semiconductor, a p-
type semiconductor is formed. In p-type semiconductor, holes are the majority charge
carriers and free electrons are the minority charge carriers. Thus, holes carry most of
the electric current in p-type semiconductor.

● N-type semiconductor
When pentavalent impurities are added to the intrinsic semiconductor, an n-
type semiconductor is formed. In this, free electrons are the majority charge carriers
and holes are the minority charge carriers. Thus, free electrons carry most of the
electric current in n-type.

● Depletion layer or region


Depletion region is a region present between the p-type and n-type-
semiconductor where no mobile charge carriers (free electrons and holes) are present.
This region acts as a barrier to the electric current. It opposes the flow of electrons
from n-type-semiconductor and flow of holes from p-type semiconductor.
To overcome the barrier of depletion layer, we need to apply voltage which is
greater than the barrier potential of depletion layer. If the applied voltage is greater
than the barrier potential of the depletion layer, the electric current starts flowing.

Dept of ECE, PEC Page 19


Home Automation Using Arduino and PIR Sensor

2.10.2 WORKING OF LED


Light Emitting Diode (LED) works only in forward bias condition. When
Light Emitting Diode (LED) is forward biased, the free electrons from n-side and
holes from p-side are pushed towards the junction.

Figure.2.12: Working of LED


When free electrons reach the junction or depletion region, some of the free
electrons recombine with the holes in the positive ions. We know that positive ions
have less number of electrons than protons. Therefore, they are ready to accept
electrons. Thus, free electrons recombine with holes in the depletion region. In the
similar way, holes from p-side recombine with electrons in the depletion region.
Because of the recombination of free electrons and holes in the depletion
region, the width of the depletion region decreases. As a result, more charge carriers
will cross the p-n junction. Some of the charge carriers from p-side and n-side will
cross the p-n junction before they recombine in the depletion region. For example,
some free electrons from n-type- semiconductor cross the p-n junction and
recombines with holes in p-type semiconductor. In the similar way, holes from p-type
semiconductor cross the p-n junction and recombines with free electrons in the n-type
-semiconductor.

Dept of ECE, PEC Page 20


Home Automation Using Arduino and PIR Sensor

Because of the recombination of free electrons and holes in the depletion


region, the width of the depletion region decreases. As a result, more charge carriers
will cross the p-n junction. Some of the charge carriers from p-side and n-side will
cross the p-n junction before they recombine in the depletion region. For example,
some free electrons from n-type -semiconductor cross the p-n junction and
recombines with holes in p-type semiconductor. In the similar way, holes from p-type
semiconductor cross the p-n junction and recombines with free electrons in the n-type
-semiconductor.
2.10.3 LED SYMBOL
The symbol of LED is similar to the normal p-n junction diode except that it
contains arrows pointing away from the diode indicating that light is being emitted by
the diode.

Figure.2.13: LED symbol


LEDs are available in different colors. The most common colors of LEDs are
orange, yellow, green and red. The schematic symbol of LED does not represent the
color of light. The schematic symbol same for all colors of LEDs. Hence, it is not
possible to identify the color of LED by seeing its symbol.
2.10.4 ADVANTAGES OF LED
● The brightness of light emitted by LED is depends on the current flowing
through the LED. Hence, the brightness of LED can be easily controlled by
varying the current. This makes possible to operate LED displays under
different ambient lighting conditions.
● Light emitting diodes consume low energy.
● LEDs are very cheap and readily available.
● LEDs are light in weight.
● Smaller size.
● LEDs have longer lifetime.
● LEDs operates very fast. They can be turned on and off in very less time.

Dept of ECE, PEC Page 21


Home Automation Using Arduino and PIR Sensor

2.11 BREADBOARD
A breadboard is a circuit board that is used to make temporary circuits. It is a
device having electronics and test circuit designs. The electronic elements inside the
electronic circuits can be interchanged by inserting the terminals and leads into holes
and later connecting it with the help of appropriate wires. The device has stripes of
metal below the board that connects the holes placed on the top of the board. The
connections of the breadboard are mostly temporary and the elements can further be
reassembled and reused without any damage. Breadboards are generally used in
electrical engineering. Engineers make use of breadboards in order to test different
products made by them. Using breadboard is the most efficient way of testing and
also they are cost effective. They can be reused again and again for the purpose of
testing. Today, starting from tiny analog, digital circuits to big complicated CPU’s
everything can be tested with the help of this.

Figure.2.14: Breadboard
Breadboards earlier were made of copper wires or terminal strips. These days
it is made up of white plastic and is a breadboard that can be plugged. Breadboards
are solderless and they are made of two kinds of strips i.e. terminal and bus strips.
Terminal strips help in holding the electronic elements while the bus strip is used to
power electric power to all the electronic components.
2.11.1 CONNECTIONS ON BREADBOARD
Breadboards have many tiny sockets (called 'holes') arranged on a 0.1" grid.
The leads of most components can be pushed straight into the holes. ICs are inserted
across the central gap with their notch or dot to the left. Wire links can be made with
single-core plastic coated wire of 0.6mm diameter (the standard size). Stranded wire
is not suitable because it will crumple when pushed into a hole and it may damage the
board if strands break off.
The diagram shows how the breadboard holes are connected.

Dept of ECE, PEC Page 22


Home Automation Using Arduino and PIR Sensor

Figure.2.15: Connection to breadboard


The top and bottom rows are linked horizontally all the way across. The power
supply is connected to these rows, + at the top and 0V (zero volts) at the bottom. I
suggest using the upper row of the bottom pair for 0V, then you can use the lower row
for the negative supply with circuits requiring a dual supply (e.g. +9V, 0V, -9V).
2.12 POWER SUPPLY
For making dc supply current,we use transformer of 230V/10A.This type of
transformer provide center tap for neutral point(0V). Power supply with neutral point
is obtained. The 5V power supply is to connect the PIC16F676 microcontroller and
the peripheral items and 220V power supply is connected to the Triac, and AC lamp.
2.13 RESISTOR
The property of a circuit that opposes current is called RESISTANCE.
Electrical components that are manufactured with this property in mind are called
RESISTORS. These electronic devices are commonly used to reduce the power or
current in an electronic device and to develop a working voltage by dividing up the
Source Voltage (Vt). Perhaps the most common to mobile electronics installers is that
of reducing the output of a speaker in an audio system.
Resistors operate on the principle that energy can be neither created nor
destroyed, only changed from one state to another. In the case of the resistor, voltage
is reduced by converting electrical energy into heat or thermal energy. All resistors
generate heat as a product of their function. A resistor is made of a material that has a
specific amount of resistance to current flow. By selecting the correct amount of
desired resistance in a circuit the installer can control the amount of output that passes
through the resistor to the electronic components.

Dept of ECE, PEC Page 23


Home Automation Using Arduino and PIR Sensor

Figure.2.16: Resistor symbol


2.13.1 UNIT OF MEASURE
Resistors are selected for the amount of resistance they posses. This value is
measured in Ohm’s (Ω). The amount of resistance can range from just a fraction of an
Ohm (Ω) to millions of Ohm’s. Ω The Omega symbol is used to illustrate the amount
of resistance in Ohm’s. Resistors are also rated for the amount of Wattage they can
handle or in other words, how much heat they can dissipate.
2.13.2 RESISTOR TYPES
There are two general categories of resistors that you may use as an installer,
they are FIXED and VARIABLE resistors.
● FIXED RESISTORS
These types of resistors are common to circuits where a constant amount of
resistance is desired. A fixed amount of resistance and power handling are identified
on the outer case of the resistor. These types of resistors come in many forms but the
most common to the mobile electronics industry are either carbon, or high wattage
wire wound resistors. The latter being used for applications where a great deal of
energy must be dissipated as heat.
● VARIABLE RESISTORS
Variable resistors are used when a selectable control is needed (volume
control) or the value for a fixed resistance is in doubt when designing a circuit.
Variable resistors give the electrical circuit adjustability by providing the user with
the ability to change the amount of resistance.
2.13.3 PROPERTIES
● Low Temperature Coefficient of Resistance (TCR)
● Frequency dependency.
● Insulation of the wires.
● Protection against influences from the environment.
● Electrical resistivity of the material.

● Maximum allowed voltage.

Dept of ECE, PEC Page 24


Home Automation Using Arduino and PIR Sensor

CHAPTER-3
DESIGN AND IMPLEMENTATION
3.1 BLOCK DIAGRAM
Here we present the block diagram and circuit diagram,also given the circuit
description or working principle of the circuit diagram.

Figure.3.1 Block diagram


The Arduino PRO mini board contains ATmega328 microcontroller, It is a 8-
bit microcontroller, which is used to control the system. The block diagram of the
system is shown in Figure 4.1. PIR sensor detects the presence of a human in the area
and send signal to Arduino PRO Mini, arduino will turn on the lights, fans or
electrical appliances, after every 40 seconds arduino check the output of the sensor
and if the output is high then it will not switch off the electrical appliances and if the
output is low then it will turn off the electrical appliances. The device repeats this
pattern continuously.Range of the PIR sensor is nearly 6 meters.
3.2 CIRCUIT DIAGRAM
The following image shows the circuit diagram of the project implemented
using Arduino UNO, PIR Sensor and Relay Module.

Dept of ECE, PEC Page 25


Home Automation Using Arduino and PIR Sensor

Figure.3.2: Circuit diagram


3.3 CIRCUIT DESCRIPTION
PIR Sensor’s Data OUT Pin is connected to Arduino’s Digital I/O Pin 4. An LED is
connected to pin 2 of Arduino to indicate whether the light is turned ON or OFF.
The IN1 pin of the Relay Module is connected to Pin 3 of Arduino. A bulb is
connected to mains supply through relay. One terminal of the bulb is connected to one
wire of the mains supply. The other terminal of the bulb is connected to the NO
(Normally Open) contact of the Relay Module.

3.4 FLOWCHART
The following figure describes the flowchart of the home automation using
arduino and PIR sensor. Firstly, PIR sensor starts detecting whether any person is
there in the surrounding areas. When the person is detected then lights will be ON
otherwise lights will be switched OFF.

Dept of ECE, PEC Page 26


Home Automation Using Arduino and PIR Sensor

Figure.3.3: Flow chart


3.5 WORKING
Home Automation using Arduino and PIR Sensor is a simple project, where
the lights in the room will automatically turn on upon detecting a human motion and
stay turned on until the person has left or there is no motion.
Initially, when there is no human movement, the PIR Sensor doesn’t detect
any person and its OUT pin stays LOW. As the person enters the room, the change in
infrared radiation in the room is detected by the PIR Sensor.
As a result, the output of the PIR Sensor becomes HIGH. Since the Data OUT
of the PIR Sensor is connected to Digital Pin 8 of Arduino, whenever it becomes
HIGH, Arduino will activate the relay by making the relay pin LOW (as the relay
module is an active LOW module).This will turn the Light ON. The light stays turned
ON as long as there is a movement in front of the sensor.
If the person leaves the room, the IR Radiation will become stable (there will
be no change) and hence, the Data OUT of the PIR Sensor will become LOW. This in
turn will make the Arduino to turn OFF the relay (make the relay pin HIGH) and the
room light will be turned OFF.

Dept of ECE, PEC Page 27


Home Automation Using Arduino and PIR Sensor

CHAPTER-4
RESULT & ANALYSIS
4.1 RESULT
In this project designing of hardware circuit is successfully done.The hardware
design and software dumping is successfully completed.
4.2 IMAGE OF THE PROJECT

Figure.4.1: Image of the project

Dept of ECE, PEC Page 28


Home Automation Using Arduino and PIR Sensor

4.3 OUTPUT IN SERIAL MONITOR


In the serial monitor if any person enters into the room, PIR sensor senses
then it shows the output as 1(ON) and if the person leaves the room then it shows
output as 0(OFF).

Figure.4.2: Serial Monitor


In this project, when a person enters the room, then the PIR sensor detects any
person and then it sends input to the Arduino and in the serial monitor we can see the
output as ‘1’ and then Arduino will send this to relay module. By using relay module,
we can switch ON the light automatically.
In the other scenario, when the person leaves the room, then after ten seconds
the light will automatically turns OFF and this can be used in home automation
purpose.
The output of the PIR Sensor goes HIGH as the person enters the room. PIR
Sensor detects the Infrared (IR) radiation in the room. The Digital pin 8 of Arduino
Uno is used to connect the Data OUT pin of PIR Sensor. When this becomes HIGH,
the activation of relay takes place by Arduino Uno. So that relay pin is in the LOW
mode; because relay is an active LOW device. Now, the lights will turn ON. This
light maintains its state as ON as far as there is motion in the room.
If the person exits the room or takes a nap, the motion in front of sensor stops
and there will be no changes in the IR radiations. Therefore, Data OUT pin of PIR
sensor will be in LOW mode. This leads to turn OFF the relay. So, relay now is in the
HIGH mode. Hence, room light will be turned OFF.

Dept of ECE, PEC Page 29


Home Automation Using Arduino and PIR Sensor

CHAPTER-5
SOFTWARE TOOLS
5.1 ARDUINO IDE(1.8.9)
IDE stands for “Integrated Development Environment” :it is an official
software introduced by Arduino.cc, that is mainly used for editing, compiling and
uploading the code in the Arduino Device. Almost all Arduino modules are
compatible with this software that is an open source and is readily available to install
and start compiling the code on the go.
Arduino IDE is an open source software that is mainly used for writing and
compiling the code into the Arduino Module. It is an official Arduino software,
making code compilation too easy that even a common person with no prior technical
knowledge can get their feet wet with the learning process. It is easily available for
operating systems like MAC, Windows, Linux and runs on the Java Platform that
comes with inbuilt functions and commands that play a vital role for debugging,
editing and compiling the code in the environment. A range of Arduino modules
available including Arduino Uno, Arduino Mega, Arduino Leonardo, Arduino Micro
and many more. Each of them contains a microcontroller on the board that is
actually programmed and accepts the information in the form of code. The main code,
also known as a sketch, created on the IDE platform will ultimately generate a Hex
File which is then transferred and uploaded into the controller on the board.
The IDE environment mainly contains two basic parts: Editor and Compiler
where former is used for writing the required code and later is used for compiling
and uploading the code into the given Arduino Module. This environment supports
both C and C++ languages.
5.2 DETAILS ON IDE
The IDE environment mainly distributed into three sections:
● Menu bar
● Text Editor
● Output Plane

Dept of ECE, PEC Page 30


Home Automation Using Arduino and PIR Sensor

The Menu bar comes with five different options


● File: You can open a new window for writing the code or open an existing
one.
● Edit: Used for copying and pasting the code with further modification for
font.
● Help: In case you are feeling skeptical about software, complete help is
available from getting started to troubleshooting.
5.3 LIBRARIES
Libraries are very useful for adding extra functionality into the arduino
module. There is a list of libraries you can add by clicking the sketch button in the
menu bar and going to include library.

5.3.1 STANDARD LIBRARIES


● EEPROM - reading and writing to permanent storage.
● Ethernet - for connecting to the internet using the Arduino Ethernet Shield,
Arduino Ethernet Shield 2 and Arduino Leonardo ETH
● Firmata - for communicating with applications on the computer using a
standard serial protocol.
● GSM - for connecting to a GSM/GPRS network with the GSM shield.
● Liquid Crystal - for controlling liquid crystal displays (LCDs).

● SD - for reading and writing SD cards.

● Servo - for controlling servo motors.

● SPI - for communicating with devices using the Serial Peripheral Interface
(SPI) Bus.
● Software Serial - for serial communication on any digital pins. Version 1.0
and later of Arduino incorporate Mikal Hart's NewSoft Serial library as
Software Serial.
● Stepper - for controlling stepper motors.

● TFT - for drawing text , images, and shapes on the Arduino TFT screen.

● WiFi - for connecting to the internet using the Arduino WiFi shield.

Dept of ECE, PEC Page 31


Home Automation Using Arduino and PIR Sensor

● Wire - Two Wire Interface (TWI/I2C) for sending and receiving data over a
net of devices or sensors.
5.4 PROGRAM STRUCTURE
● variables: Whenever you’re using Arduino, you need to declare global
variables and instances to be used later on. In a nutshell, a variable allows you
to name and store a value to be used in the future. For example, you would
store data acquired from a sensor in order to use it later. To declare a variable
you simply define its type, name and initial value.
● Instances: In software programming, a class is a collection of functions and
variables that are kept together in one place. Each class has a special function
known as a constructor, which is used to create an instance of the class. In
order to use the functions of the class, we need to declare an instance for it.
● Setup(): Every Arduino sketch must have a setup function. This function
defines the initial state of the Arduino upon boot and runs only once.Here
we’ll define the following:
1.Pin functionality using the pinMode function
2.Initial state of pins
3. Initialize classes
4.Initialize variables
5.Code logic
● Loop() The loop function is also a must for every Arduino sketch and
executes once setup() is complete. It is the main function and as its name hints,
it runs in a loop over and over again. The loop describes the main logic of
your circuit.
5.5 SELECTING A BOARD
In order to upload the sketch, we need to select the relevant board we are
using and the ports for that operating system. As we click the Tools on the Menu, it
will open like the figure below.

Dept of ECE, PEC Page 32


Home Automation Using Arduino and PIR Sensor

Figure.5.1: Selection of Arduino board


Just we go to the “Board” section and select the board we would like to
work on. Similarly, COM1, COM2, COM4, COM5, COM7 or higher are reserved for
the serial and USB board. we can look for the USB serial device in the port section of
the Windows Device Manager.
Following figure shows the COM4 that we have used for my project, indicating the
Arduino Uno with COM4 port at the right-side bottom corner of the screen.

Figure.5.2: Selection of ports

Dept of ECE, PEC Page 33


Home Automation Using Arduino and PIR Sensor

After correct selection of both Board and Serial Port, click the verify and then
upload button appearing in the upper left corner of the six button section or you
can go to the Sketch section and press verify/compile and then upload. The sketch
is written in the text editor and is then saved with the file extension .ino. It is
important to note that the recent Arduino Modules will reset automatically as you
compile and press the upload button the IDE software, however, older version may
require the physical reset on the board. As we upload the code, TX and RX LEDs will
blink on the board, indicating the desired program is running successfully.
5.6 SERIAL MONITOR
It is a separate pop-up window that acts as a separate terminal that
communicates by receiving and sending Serial Data. See the icon on the far right of
the image above. Serial Data is sent over a single wire and consists of a series of 1's
and 0's sent over the wire. Data can be sent in both directions.

Dept of ECE, PEC Page 34


Home Automation Using Arduino and PIR Sensor

ADVANTAGES,DISADVANTAGES & APPLICATIONS


Advantages
● Our system will control the switch ON/OFF automatically.
● No need of manpower for maintenance.
● Energy efficient.
● Faster response.
● Low cost.
Disadvantages
● Wireless system can be unreliable.
Applications
● Garage Lights
● Bathroom Lights
● Hand Dryers
● Security Lights

Dept of ECE, PEC Page 35


Home Automation Using Arduino and PIR Sensor

FUTURE SCOPE
In our system we are taking decision based on Human presence but we can
also interface LDR (Light Dependent Resistor) Sensor and Temperature sensor for
better working of the system. This system can be also interfaced with the Bluetooth
module so we can control the whole system from the mobile itself. Applications of
our device are listed below
1. It can be used in college and schools (Turn of lights and fans when no one is there)
2. It can be used for home security purpose also we can fit at the main door of the
house.

Dept of ECE, PEC Page 36


Home Automation Using Arduino and PIR Sensor

CONCLUSION
It is not an easy task to design this system as PIR sensor is generally used
for the motion detection. We have done coding in such a way that little movement of
the human is detected by the sensor. We have put some time delay and adjusted the
sampling period for the sensor output for the precise detection.
In this digital world, Technology is very advanced and we prefer things
to be done automatically without any human efforts. This project also helps to reduce
human efforts. In addition, it is very useful to conserve resources. It is very useful in
Schools, hospitals, malls, offices, auditoriums.

Dept of ECE, PEC Page 37


Home Automation Using Arduino and PIR Sensor

REFERENCES
● Subitha M.B “Microcontroller based tracking system for the detection of
Human presence in critical Areas” vol.2,Issue 4, IJEDR 2014 .
● Saravana Kumar K , Priscilla P, Germiya K Jose , Balagopal G , “Human
Detection Robot using PIR Sensors”,International Journal of Science,
Engineering and Technology Research (IJSETR) Volume 4, Issue 3, March
2015
● Jaeseok Yun and Sang-Shin Lee, “Human Movement Detection and
Identification Using Pyroelectric Infrared Sensors” Sensors 2014
● K Sravani, Md Parvez Ahmed, N Chandra Sekhar, G Sirisha, V Prasad,
“Human Motion Detection Using Passive Infra-Red Sensor”, International
Journal of Research in Computer Applications & Information Technology,
Volume2, Issue 2, March April, 2014.

● K. Sravani and e. al., "Human Motion Detection Using Passive Infrared


Sensor," International journal of research in computer appliances and
technology, pp. 28-32, 2014.

● Dey, S., Roy, A., & Das, S. (2016). Home automation using Internet of Thing.
2016 IEEE 7th Annual Ubiquitous Computing, Electronics & Mobile
Communication Conference (UEMCON).
● Jerabandi, M., & Kodabagi, M. M. (2017). A review on home automation
system. 2017 International Conference On Smart Technologies For Smart
Nation (SmartTechCon)
● Goyal, R., & Arya, L. (2017). Home automation and intelligent light control
system using microcontroller. 2017 International Conference on Computing,
Communication and Automation (ICCCA).
● Urfaliglu, O., Soyer, E. B., Toreyin, B. U., & Cetin, A. E. (2008). PIR-sensor
based human motion event classification. 2008 IEEE 16th Signal Processing,
Communication and Applications Conference.
● Sukmana, H. T., Farisi, M. G., & Khairani, D. (2015). Prototype utilization of
PIR motion sensor for real time surveillance system and web-enabled lamp
automation. 2015 IEEE Asia Pacific Conference on Wireless and Mobile
(APWiMob).

Dept of ECE, PEC Page 38


Home Automation Using Arduino and PIR Sensor

● Arduino Home Automation Projects by Marco Schwartz


● Smart Home Automation Essential Guides - the Complete Series by Gerard
O'Driscoll.
● Home Automation Basics by Thomas Leonik
● Getting Started with Arduino by Massimo Banzi.
● Home Security System Using PIR Sensor and MQ-2 Sensor by Nur Ayu
Zainuddin.

Dept of ECE, PEC Page 39


Home Automation Using Arduino and PIR Sensor

Appendix-A

⚫ SOURCE CODE

int pir=4;

int led=2;

int relay=3;

int val;

unsigned long int t1;

void setup() {

pinMode(pir,INPUT);

pinMode(led,OUTPUT);

pinMode(relay,OUTPUT);

Serial.begin(9600);

void loop() {

val=digitalRead(pir);

Serial.print(val);

Serial.print(" ");

if(val==1)

t1=millis()+10000;

Serial.print(t1);

Dept of ECE, PEC Page 40


Home Automation Using Arduino and PIR Sensor

Serial.print(" ");

Serial.println(millis());

if(millis()<t1)

digitalWrite(led,1);

digitalWrite(relay,0);

else

digitalWrite(led,0);

digitalWrite(relay,1);

Dept of ECE, PEC Page 41

You might also like