Вы находитесь на странице: 1из 52

CHAPTER-1

INTRODUCTION

1.1 INTERNET OF THINGS:


Introduction The Internet of Things (IOT) is the network of physical objects—
devices, vehicles, buildings and other items—embedded with electronics, software,
sensors, and network connectivity that enables these objects to collect and exchange
data. The IOT allows objects to be sensed and controlled remotely across existing
network infrastructure, creating opportunities for more direct integration of the
physical world into computer-based systems, and resulting in improved efficiency,
accuracy and economic benefit; when IOT is augmented with sensors and actuators,
the technology becomes an instance of the more general class of cyber-physical
systems, which also encompasses technologies such as smart grids, smart homes,
intelligent transportation and smart cities. Each thing is uniquely identifiable through
its.

Embedded computing system but is able to interoperate within the existing Internet
infrastructure. Experts estimate that the IOT will consist of almost 50 billion objects
by 2020.

Fig 1.1 Characteristics of IOT

1.2 Overview of Applications According to Gartner, Inc. (a technology research


and advisory corporation), there will be nearly 26 billion devices on the Internet of

1
Things by 2020. ABI Research estimates that more than 30 billion devices will be
wirelessly connected to the Internet of Things by 2020. As per a recent survey and
study done by Pew Research Internet Project, a large majority of the technology
experts and engaged Internet users who responded—83 percent—agreed with the
notion that the Internet/Cloud of Things, embedded and wearable computing (and the
corresponding dynamic system [40]) will have widespread and beneficial effects by

2025.

Fig 1.2 Over view of Applications

As such, it is clear that the IOT will consist of a very large number of devices being
connected to the Internet. In an active move to accommodate new and emerging
technological innovation, the UK Government, in their 2015 budget, allocated
£40,000,000 towards research into the Internet of Things. The British Chancellor of
the Exchequer George Osborne , posited that the Internet of Things is the next stage
of the information revolution and referenced the inter-connectivity of everything from
urban transport to medical devices to household appliances.

2
Fig 1.2 Environmental monitoring applications

1.2 b)Environmental monitoring Environmental monitoring applications of the IOT


typically use sensors to assist in environmental protection by monitoring air or water
quality, atmospheric or soil conditions, and can even include areas like monitoring the
movements of wildlife and their habitats.

1.2.1 Infrastructure management Monitoring and controlling operations of urban and


rural infrastructures like bridges, railway tracks, on- and offshore- wind-farms is a key
application of the IOT.[66] The IOT infrastructure can be used for monitoring any
events or changes in structural conditions that can compromise safety and increase
risk.

1.2.2 Manufacturing Network control and management of manufacturing equipment,


asset and situation management, or manufacturing process control bring the IOT
within the realm on industrial applications and smart manufacturing as well.

1.2.3 Energy management Integration of sensing and actuation systems, connected to


the Internet, is likely to optimize energy consumption as a whole.[49] It is expected
that IOT devices will be integrated into all forms of energy consuming devices
(switches, power outlets, bulbs, televisions, etc.) and be able to communicate with the
utility supply company in order to effectively balance power generation and energy
usage.
1.2.4 Medical and healthcare systems IOT devices can be used to enable remote
health monitoring and emergency notification systems. These health monitoring
devices can range from blood pressure and heart rate monitors to advanced devices

3
capable of monitoring specialized implants, such as pacemakers or advanced hearing
aids.

1.2.5 Building and home automation IOT devices can be used to monitor and control
the mechanical, electrical and electronic systems used in various types of buildings
(e.g., public and private, industrial, institutions, or residential)[49] in home
automation and building automation system.
1.2.6 Transportation The IOT can assist in integration of communications, control,
and information processing across various transportation systems.

1.2.7 Conclusion The pervasiveness of embedded processing is already happening


everywhere round us. At home, appliances as mundane as your basic toaster now
come with an embedded MCU that not only sets the darkness of the piece of toast to
your preference, but also adds functional safety to the device. Your refrigerator has
started talking to you and keeping track of what you put in it. There are energy-aware
HVAC systems that can now generate a report on the activity in your house and 4
recommend ways to reduce your energy consumption. The electrification of vehicles
has already started happening, and in just a few years from now, each car will contain
>50 percent more electronics than it did just five years ago. The cars of the future will
indeed be able to drive themselves. Similar changes are also happening in other
aspects of our lives … in factories, transportation, school systems, stadiums and other
public venues. Embedded processing is everywhere. Connecting those smart devices
(nodes) to the web has also started happening, although at a slower rate. The pieces of
the technology puzzle are coming together to accommodate the Internet of Things
sooner than most people expect. Just as the Internet phenomenon happened not so
long ago and caught like a wildfire, the Internet of Things will touch every aspect of
our lives in less than a decade.

4
Fig 1.3 Applications of IOT

1.3.1 Background for the Internet of Things The most vital part of achieving IOT is
communication, because in order to interconnect different devices they must be able
to communicate. All other properties, such as sensing , Manoeuvring , being able to
capture, store, and process data are unnecessary; unless your device specifically
requires one of these properties. However, the ability to communicate is essential
when labeling a device as an IOT device. How this communication is performed is
less important, since the actual physical and link layer communication within IOT can
be realized in many ways. Case C in Figure 1—1 shows that devices are not always
required to communicate through a communication network. For example, if two
devices are close to each other it might be simpler to directly communicate via for
example radio using technologies such as Bluetooth or ZigBee (protocols which both
enable direct communication). In contrast, in Case A in Figure 1—1 a device might
communicate via a gateway using one protocol (such a IPv6 over Low power
Wireless Personal Area Networks (6LoWPAN)) and then the gateway could
communicate using another protocol (e.g. IPv4) over a communication network such
as the Internet. Case B in Figure 1—1 illustrates two devices which are directly
communicating with one another without requiring a gateway where both devices are
directly connected to the communication network and thus are able to communicate
even if they are located in different places. A physical thing can be mapped into the
information world via one or more virtual things, while virtual things do not
necessarily need to be associated with any physical thing and can exist independently

5
of any physical existence. For example, a physical thing might execute multiple
applications and thereby have multiple identities in the virtual world. Similarly a
virtual thing might also have many identities in the virtual world. For example, a
virtual thing could be a video (file) on a USB-drive. Such a file might have multiple
file names that refer to it and it might even have multiple instances (copies),
potentially these “copies” might have different encodings, resolutions, etc. How does
one differentiate an IOT device from any other device? Table 1—1 states some
fundamental characteristics for IOT. These characteristics may provide a clearer
picture of the actual differences between IOT’s and other devices [11] . Table 1—1:
Characteristics of the Internet of Things Interconnectivity is the basic characteristic
for IOT since the whole concept is built upon the idea of being able to interconnect
everything (despite the traffic going through different networks). Things related
services resolves around devices being constrained by its CPU performance, memory,
and power which limits what a device can do, when it can do it, and how often it can
do it. To provide semantic consistency a physical thing reporting temperatures at
some intervals may be mapped to a virtual thing that tries to estimate the temperature
between measurements and thus may report a different temperate value than the
physical value. When the next measurement arrives the virtual device may or may not
update its estimate in order to maintain consistency with the physical thing. In Table
1—1 the biggest challenge will be supporting heterogeneity because there are a lot of
different protocols in use. Interacting with multiple devices through multiple networks
will be challenging from both security and technical perspectives, because the
protocols may differ depending upon whether the device is communicating through
one interface or another (e.g., wide area cellular radio, Ethernet, or Wi-Fi). Therefore,
there are some requirements relevant for IOT, such as security and privacy protection.
If everything is connected, then multiple security threats will arise causing
confidentiality, integrity, availability, and authenticity to become more important –
especially because there will be more data and services available.

6
CHAPTER-2

LITERATURE REVIEW
Design and Implementation of Security for Smart Home and Industries based on GSM
technology was discussed Govinda et al.(2014) that provides two methods to
implement home security using IOT. One is using web cameras such that whenever
there is any motion detected by the camera. It sounds an alarm and sends a alarm and
sends a mail to the owner. This method of detecting intrusion is quite good , albeit
somewhat expensive due to the cost of the cameras involved in the process. The
cameras needs to be of good quality which means it should have a wide range and
the picture quality should be high enough to detect movement. Also if you go for
movable cameras such as dome cameras they will cost more than the fixed ones, SMS
based system using GSM was Proposed by Karri and Daniel (2005) propose to use
internet services to send messages or alert to the house owner instead of conventional
SMS. Jaya shri and Arvind(2013) have implemented a finger print based
authentication system to unlock a door. This system helps users by only allowing the
users whose finger print are authorized by the owner of the house. This system can
also be used to monitor who all have used the sensor to gained entry into the house.
This system is coupled with a few more home protection features such as gas lekage
and fire accidents. Although a good system, finger print sensors are expensive and
complex (as they need increased sensor resolution) to integrate into an IOT setup.
Some experts also argue that only relying on a fingerprint sensor is not wise as it is
relatively easy to lift someone’s fingerprint and replicate them. Which is why it is
always advised to use fingerprint scanners in a two factor authentication systems
where an additional layer of security is available in the form of PIN. Passcode, voice
recognition. Etc. Some researchers proposed an idea of robust IOT home and
industrial security system where a fault in of one component in the system does not
lead the failure of the whole system. The idea of using multiple devices which may or
may not directly compatible with each other but can be made to work in such a way
that they can replace an existing component of the system in case of fault. In tandem
to this, the model has the ability to use overlap between various devices which would
result in preserving energy thus making the model more efficient. An example

7
provided of the said model would use temperature sensor, WiFi module and a door
sensor to replace a faculty camera , The authors are successful in an effort to
demonstrate the given example. However such systems are useful for people with
energy efficiency in mind and for those who need a degree of robustness with their
security systems and are wiling to expend more money than usual .Laser rays and
LDR sensor are used to detect intrusion using their movement was proposed in 2016.
The way the system works is that a laser is focused towards a LDR sensor and the
movement that the contact of laser to LDR sensor breaks , the alarm connected to the
sensor goes off alerting the neighbours and sends a SMS to the owner. This system
solves the problem of covering the places which are out of range from the fixed
cameras but faces the same difficulties which are faced with the systems consisting of
GSM modules to send messages, which is that delivery of message is dependent on
network coverage. Also due to nature of ;lasers being a straight beam, it can ber
avoided by intruders who know about the system and are capable of doping the lasers,
rendering the whole system useless, A novel way to design an electronic lock lock
using Morse code and IOT technology. The authors claim that this as an original idea
which have been not tried of the before and is the first of its kind. This system uses
LED’s as an encrypting medium to send signals. To make it possible for more
accessible to general public. The led in smart phones has been used. On the receiver’s
side is a photo resistive resistor as well as micro controller such as node MCU and
arduino which has the ability of decrypt the optical signal after receiving then from
the LED ,which experimented in the real time and it has proved to work under
different with all functions working as they were intended to. The IOT system
developed here works very well and can be used by anyone and is very convenient
due the use of mobile phones as LED , which also makes it a cost expensive
alternative. Anitha et al (2016) proposed an home automation system using artificial
intelligence and also proposed a model for cyber security systems.

8
CHAPTER-3

DESCRIPTION OF BLOCK DIAGRAM , HARDWARE

COMPONENTS AND SOFTWARE DESCRIPTION

3.1 BLOCK DIAGRAM:

The block diagram of IOT based Home Security system is shown in the below
figure

3.1.1 Components

The figure below consists of the following sections:

 Power supply
 Node MCU
 Buzzer
 LED’s
 Wi-Fi/Hotspot
Power Supply
 Blink app
 PIR sensor

.
PIR sensor
Node MCU BUZZER
ESP8266
RED LED
(WI-FI)

GREEN LED

BLYNK
APP

Fig 3.1 Block diagram of Industrial and Home security system

9
3.2 Working:

First the power supply is given to the module i.e Node MCU using an
adapter. Which supplies power to other components through voltage regulator . As
soon as the power is given it passes through a voltage regulator which regulates the
applied input voltage to 3.3volts . The Node MCU consists of a inbuilt WIFI module
and it is activated and connected to the internet . All the other components are
connected to the Node MCU gets activated . In ideal state the green LED will be
always ON and the red LED will be in OFF state. The PIR (passive infrared) sensor
contains two important materials present one is the pyroelectric crystal which can
detect the heat signature from a living organism and the other is Fresnel lens which
wideness the range of the sensor . This PIR sensor can detect the intrusion of an any
person . As soon as it detects the any person it will send a notification to the BLYNK
app which is install on the users device. And it will activate the buzzer and the red
LED . And we can secure our home by activating the emergency lock from the mobile
app itself .

3.3 NODEMCU:
The Node MCU is an open-source firmware and development kit that helps
you to Prototype your IOT product within a few Lua script lines. The ESP8266 is the
name of a micro controller designed by Espressif Systems.

This module comes with a built in USB connector and a rich assortment of pin-
outs. With a micro USB cable, you can connect Node MCU dev kit to your laptop and
flash it without any trouble, just like Arduino. It is also immediately breadboard
friendly.

Features of Node MCU:


 Open-source
 Interactive
 Programmable
 Low cost
 Simple
 Smart
 WI-FI enabled

10
Fig 3.3 pin definition

Designator Parameter

C1,C4,C6 100nF (104) ±10% 16V

C2 100uF(107) ±10% 6.3V Case B 3528

C3,C5,C8 10uF(106) ±20% 10V

C7 10uF(106) ±10% 25V

D1 SOD-123 40V,1A,VF=0.45V@1A

1.6x0.8x0.6 Iv= 35~65mcd @IF=5mA


LED1
ESD:1000V

11
12KΩ (1202) ±1% 0.0625W [50V TYP] [100V
R1,R2,R3,R4,R5,R7,R8
MAX] T.C.R ±100

470Ω (4700) ±1% 0.0625W [50V TYP] [100V


R6,R9,R11,R12
MAX] T.C.R ±100

0Ω (0R00) ±1% 0.0625W [50V TYP] [100V


R10(Do not install)
MAX] T.C.R ±100

220kΩ (2203) ±1% 0.0625W [50V TYP] [100V


R13
MAX] T.C.R ±100

100kΩ (1003) ±1% 0.0625W [50V TYP] [100V


R14
MAX] T.C.R ±100

3.4 WI-FI MODULE (ESP8266):


INTRODUCTION:
The ESP8266 is a low cost MCU with built in Wi-Fi. It can be paired with
another host microcontroller, like an Arduino, to provide Wi-Fi networking capability
for a basic IoT development platform. Additionally, the ESP8266 can be used as a
stand-alone MCU, as it includes a 32-bit 80 MHz processor, 16 GPIO pins (4 PWM
enabled) and a built in Analog-to-Digital converter, SPI and I2C interfaces and more.

12
Fig 3.4.1 ESP8266 – ESP-12E version

The MCU has a n operating voltage of 2.5V – 3.6V and average operating current of
80 ma

An open source, full development board around ESP8266 has been designed by the
Node MCU team that includes additional USB to Serial UART adapter, a micro USB
port for programming and a 3.3v regulator. The Node MCU board comes ready out-
of-the-box for you to connect to your computer, install USB drivers, and start writing
programs that connect to your Wi-Fi network! All of that at an average price of about
$4 USD on eBay.

ESP8266 is the most popular and low cost Wi-Fi SoC with TCP/IP stack and a
low power 32 bit microcontroller manufactured by Espressif, a Shanghai based
Chinese manufacturer. Nowadays IoT (Internet of Things) is an emerging field. This
is the one of the most popular and low cost solution for connecting ‘Things’ to
internet via Wi-Fi.

13
Fig 3.4.2 ESP8266 – Wi-Fi SoC
ESP8266 belongs to Espressif System’s Smart Connectivity Platform (ESCP)
which is a set of high performance, high integration wireless SoC (System on Chip)
intended for power and space constrained mobile platform designers. It is a self-
contained Wi-Fi networking solution, which means that we can store and run the
application in it without the aid of any external processors. We can also integrate it
with another application processor if required by using SPI/SDIO or I2C/UART
interface.

3.5 BLYNK APP:


Configuring Blynk App:
After the user installs the Blynk app on the smartphone, an account has to be
created in the app to access its services. The first time the app is opened, it will ask to
either sign in or create an account. Create an account and add a new project to get
started as given in figure 1.Each project has its own authentication code which is used
by the code to communicate with that particular model as provided in figure 2. To
interface with our components, we need to add widgets to our model. To add widgets
press „+” to add to the model. The app provides a neat interface to add all the required
widgets and setting them up according to the code as shown in figure 3. The Blynk
needs to be running in the background for the user to get real time notifications.

14
15
3.6 PIR SENSOR

3.6.1 Introduction

Infrared radiation is the portion of electromagnetic spectrum having


wavelengths longer than visible light wavelengths, but smaller than microwaves, i.e.,
the region roughly from 0.75µm to 1000 µm is the infrared region. Infrared waves are
invisible to human eyes. The wavelength region of 0.75µm to 3 µm is called near
infrared, the region from 3 µm to 6 µm is called mid infrared and the region higher
than 6 µm is called far infrared. (The demarcations are not rigid; regions are defined
differently by many). Infrared is light that has a wavelength longer than visible red
light. The ranges of infrared include near infrared, mid infrared and far infrared,
spanning wavelengths from about 710 nanometers (near infrared) to 100 micrometers
(far infrared).All objects emit light according to their temperature--this is called
"black body radiation." The hotter the object, the shorter wavelength of light it emits.
The Earth emits infrared light at a peak of about nine to 10 micrometers--and so do
warm-blooded animals like humans. This light can be used to detect motion or
warmth. Piezoelectric passive infrared (PIR) sensors are widely used in daily life.
They are a key component in motion detection and can be used for security systems,
automatic doors, or automatic light control. They are commonly used to detect
humans. For example, when someone is detected in a specified area an alarm may be
triggered or a specific room may be lit. Another common use is with regard to pets,
for example, cat flaps.

Everything on earth has infrared (IR) energy. The IR energy of an object depends on
different parameters such as its temperature, colour, and texture. This energy is not
visible with the human eye, but PIR sensors can detect it.

Passive IR sensors are the opposite of active IR sensors that emit energy, such as
ultrasound, light, or microwaves. Active sensors are able to detect a change in the
environment when the reflected emitted signal is disturbed. Active sensors consume
more energy than passive sensors.

16
When a communication is to be established, that too wirelessly, with a remote device,
we typically employ optical radiations or radio waves or sometimes, acoustic waves
(for underwater applications). These three types of wireless communications
basically differ in their frequencies. All frequencies starting from frequency bands
like LF, HF, VHF, UHF and so on, extending up to microwaves and millimeter waves
are referred to as radio waves. Acoustic waves use ultrasonic portion of frequency
spectrum. Optical Radiations use visible and infrared portion of the spectrum.

Infrared radiation is the portion of electromagnetic spectrum having wavelengths


longer than visible light wavelengths, but smaller than microwaves, i.e., the region
from 0.75µm to 1000 µm is the infrared region. Infrared waves are invisible to human
eyes. The wavelength region of 0.75µm to 3 µm is called near infrared, the region
from 3 µm to 6 µm is called mid infrared and the region higher than 6 µm is called far
infrared.

Fig 3.6.1 infrared range

17
Infrared radiations have been widely utilized in various electronic gadgets and
sensors. Right from the TV remotes to the sophisticated devices like Night Vision
equipments use Infrared waves for different applications.

Subsequent sections will discuss one of the applications of Infrared waves- for
Passive Infrared (PIR) sensors.

3.6.2 Physics Behind IR Sensors

There are different types of IR sensors working in various regions of the IR


spectrum but the governing physics behind all of them are the three laws:

Planck’s radiation law

Every object at a temperature T not equal to 0 K emits radiation. Infrared radiant


energy is determined by the temperature and surface condition of an object. Human’s
eyes cannot detect differences in infrared energy because they are primarily sensitive
to visible light energy from 400 to 700 nm. Our eyes are not sensitive to the infrared
energy (3.0 - 14?m).

Stephan Boltzmann Law

The total energy emitted at all wavelengths by a black body is related to the absolute
temperature as

Wb = s T4

where, Wb : total energy emitted

s: constant = 5.67 X 10-8 m-2K-4

T : Temperature of the object

18
Wein’s Displacement Law

Wein’s Law tells that objects of different temperature emit spectra that peak
at different wavelengths. It provides the wavelength for maximum spectral radiant
emittance for a given temperature.

The relationship between the true temperature of the black body and its peak spectral
existance or dominant wavelength is described by this law

The world is not full of black bodies; rather it comprises of selectively radiating
bodies like rocks, water, etc. and the relationship between the two is given by
emissivity (e).

Emissivity depends on object colour, surface roughness, moisture content, degree of


compaction, field of view, viewing angle & wavelength

What Is PIR Sensor ?

Infrared sensors can be classified as active infrared sensors and passive


infrared sensors. Both of them use the same infrared rays and same underlying
physics. However, the only difference between the two is that, active infrared sensors
employ infrared source (an active element) in addition to infrared detector.

19
Active infrared sensors operate by transmitting energy from either a light
emitting diode (LED) or a laser diode. An LED is used for a non-imaging active IR
detector, and a laser diode is used for an imaging active IR detector. In both types of
these, the LED or laser diode illuminates the target, and the reflected energy is
focused onto a detector consisting of a pixel or an array of pixels. Photoelectric cells,
Photodiode or phototransistors are generally used as detectors.

Contrary to Active Infrared sensors, Passive Infrared sensors do not contain any
source of infrared radiation, they simply detect IR radiations. They totally rely on the
three governing laws explained earlier.

A passive infrared system detects energy emitted by objects in the field of view and
may use signal-processing algorithms to extract the desired information. It does not
emit any energy of its own for the purposes of detection.

Humans at normal body temperature radiate quite strongly in the infrared region at a
wavelength around 10 µm. Passive infrared sensors convert the infrared signal to
current or voltage. Accordingly, they are used to detect presence, occupancy, and
count.

Primarily used for intrusion detection, passive infrared sensor as used as a


special purpose radiometer which detects the heat emitted by the body of an intruder.
It offers high probability of detection within a defined area even without responding
to anything else. Its presence is hard to detect which is not the case with active
infrared sensors, ultrasonic detectors and the like.

Passive Infra-Red Sensors were originally being used for military and scientific
applications. Nowadays they can be seen in a wide range of commercial products for
automatic light control, safety, cost-savings, etc. Almost any region where people
occasionally walk or move through and need not be continuously lit, could be
benefitted from the installation of a PIR sensor. Some examples are hallways, foyers,
paths, driveways, garden areas and car parkings.

3.6.3 Passive Infrared Sensors:

20
How Do They Work ?

Fig 3.6.3 working of PIR sensor

PIR sensor is made of ceramic material that generates surface charge when
exposed to infrared radiations. As the amount of radiation increases, the surface
charge generated increases. A FET is used to buffer this signal. As the sensor is
sensitive to a wide range of radiations, a filter is used which limits the infrared rays
falling on the sensor to 8um-14um range. Thus the output of an IR sensor is a function
of infrared radiation. But since the output is affected by vibration, radio interference,
sunlight, etc. as well, dual sensing elements are used. Both sensors are connected out
of phase such that any excitation common to both gets cancelled out.

The field of view of these sensors is the area or zone which it sees or where
changes in the infra-red radiation can be sensed or detected. Typically, to enhance the
range and field of view, the field of view is divided into number of zones (both
vertically as well as horizontally) with the help of Fresnel Lens.; a Fresnel lens is a
plano convex lens that is collapsed on itself to form a flat lens which retains its optical
properties, but is thinner and has lesser absorption losses.

21
Fig 3.6.4 Plano convex and Fresnel

Fig 3.6.5 A typical construction of a PIR sensor

Multi Element Fresnel Lens focuses the infra-red radiation emitted by an


infrared source onto the PIR detector. After the light falls upon the PIR sensor, an
electrical signal corresponding to the varying amount of infra red radiations is
generated which is amplified/ processed and in turn may energize a relay.

All PIR sensors detect changes in infra-red radiation; infrared radiations in the
form of heat emitted by the bodies including human beings, pets, vehicles, etc. Bigger
is the body, more is the infra-red radiation and it becomes easier for the PIR sensor to
detect them.

In most of the applications, passive infrared sensors look for the change in the
environment. The sensors are sensitive to changes in infrared energy rather than

22
absolute levels. The sensor first sets up equilibrium with the background conditions. If
the state equilibrium is disturbed due to some intrusion or by some other mechanism,
it perceives it as a change. This change is fundamental to the operation of PIR
sensors.

Fig 3.6.6 PIR Patten

By dividing the region into a number of zones, numbers of separated zones are
created. A person while walking through the area will appear in one zone, then
disappear and then reappear in the next zone and so on. By doing so, he modulates the
reference equilibrium conditions; the process is referred to as chopping. The signal
produced is proportional to the temperature difference between the intruder and the
background.

23
Fig 3.6.7 PIR human detection

When a person enters into a particular zone, infra-red level in that zone increases.
The increase in the infra-red energy level is detected. The dual elements are excited
one after another; resultant output is a positive signal followed by negative signal. In
this way, movement of a person is the field of view of the sensor can be detected.
However, if the person moves within a zone, it is not possible to detect the changes.

3.7 Passive Infrared Detectors: Classification

Passive Infrared detectors primarily are of two types: Thermal & Quantum. In
the PIR sensors used for human/pets detection for automatic lighting systems,
intrusion detection, etc. thermal type- Piezoelectric based PIR sensors are used. For
the sake of completeness, other types of PIR detectors are explained below.

Thermal PIRs

24
Thermal type has no wavelength dependence. They use the infrared energy as heat
and their photosensitivity is independent of wavelength. Thermal detectors don’t
require cooling but have disadvantages that response time is slow & detection time is
low.

Types of thermal type IR detectors are

 Thermocouple-Thermopile

Thermocouple uses See beck effect, one of the thermoelectric effects and is a
detector that converts temperature into an electrical signal. The junction of dissimilar
metals generates a voltage potential, which is directly proportional to the temperature.
This junction can be made into multiple junctions to improve sensitivity. Such a
configuration is called a thermopile. Thus, a thermopile is nothing but a junction of
thermocouples connected in series.

Fig 3.7.1 thermocouple-thermopile

The active or ‘Hot’ junctions are blackened to efficiently absorb radiation. The
reference or ‘Cold’ junctions are maintained at the ambient temperature of the
detector. The absorption of radiation by the blackened area causes a rise in
temperature in the ‘hot’ junctions as compared to the ‘cold’ junctions of the

25
thermopile. This difference in temperature between the active junction and a reference
junction kept at a fixed temperature produces an electric potential which is directly
proportional to the differential temperature created.

Fig 3.7.2 piezoelectric sensor

These detectors has a relatively slow response time, but offers the advantages of
DC stability, requiring no bias, and responding to all wavelengths.

 Bolometer

A bolometer is a simple thermal or total power detector. A bolometer changes


resistance when incident infrared radiation interacts with the detector. Therefore,
sensing material used for bolometers should have very high temperature coefficient of
resistance; superconductor is an ideal candidate for sensing temperature in a
bolometer. Typically, thermally sensitive semiconductor is made of a sintered metal
oxide material. It has a high temperature coefficient of resistance.

It consists of two main elements: a sensitive thermometer and a high cross


section absorber. The absorber is connected by a weak thermal link to a heat sink (at
temperature T0). Incoming energy falls upon the absorber. Incoming energy is
converted to heat in the absorber. Temperature of the absorber changes depending

26
upon the changes in the power of incoming energy. Bolometer works by measuring
this change in temperature.

Fig 3.9 Piezoelectric working block diagram

 Piezoelectric detector

Fig 3.7.3 Piezoelectric detector

Piezoelectric detectors use PZT having piezoelectric effect, a high resistor and a
low noise FET, hermetically sealed in a package. Piezoelectric materials are crystals,
such as lithium tantalite, which exhibit spontaneous polarization, or a concentrated
electric charge that is temperature dependent.PZT is spontaneously polarized in dark
state. As infrared radiation strikes the detector surface, the change in temperature
causes a current to flow. This results in change of polarization state which is reflected
in terms of voltage change at the output.

This detector exhibits good sensitivity and good response to a wide range of
wavelengths, and does not require cooling of the detector.

27
While thermopiles are proportional to incident radiations, piezoelectric detectors
are proportional to rate of change of incident radiation. Thus, piezoelectric detectors
are AC coupled devices. Also, piezoelectric detectors have very high impedance and
hence require a buffer.

 Quantum type PIRs

Quantum type offer higher detection performance and a faster response speed
although their photosensitivity is wavelength dependant. Quantum type detectors
require cooling for accurate measurements (except for those in near IR region).

 Intrinsic type
 Photoconductive

Photoconductive type of IR detectors makes use of photoconductive effect. This


effect causes change in resistance when IR radiation falls upon detecting elements.

Examples are PbS, PbSe, MCT(HgCdTe)

Band gap of PbS, PbSe have negative temperature coefficient and hence their
spectral response characteristics shift to long wavelength region when cooled.
However, bandgap of HgCdTe depends upon the composition and therefore, spectral
response characteristics can be tailored to suit the requirements.

 Photovoltaic

Photoconductive type of IR detectors makes use of photovoltaic effect. Incident


IR light cause increase in voltage output of these detectors.

Examples are InGaAs PIN photodiodes, InAs, InSb

 Extrinsic type

Various types of detectors like Ge:Au, Ge:Hg, Ge:Cu, Ge:Zn, Si:Ga, Si:As and
are used depending upon the required application- spectral response,
D*(Photosensitivity per unit area of the detector), etc.

28
3.8 Applications Of PIR Sensors

Applications of passive infrared sensors are quite wide.

Thermopiles based passive infrared sensors are used for non-contact temperature
measurements such as automobile climate control, occupancy sensing, process
temperature monitoring, household appliances, gas analysis, hazard control including
flame and explosion detection, etc.

Piezoelectric based PIR Sensors are quite common as motion sensing,


automatic light control, house security, etc at various places like entrance, basements,
toilets, corridors.

Quantum types of infrared detectors are used for high performance imaging
applications. Bolometer are also employed in some of the applications.

PIR sensors are widely used and require op-amps to amplify and filter the signal
they generate which is noisy and small in amplitude. Op-amps or comparators can be
used to compare the amplified signal with threshold voltages before it goes into the
I/O of a microcontroller (i.e. there is no need for an analog-to-digital converter).

STMicroelectronics provides nanopower op-amps and comparators for portable


applications. STMicroelectronics can also provide op-amps and comparators with a
bigger bandwidth, a higher output current, a wider Vcc range, or even op-amps that
are automotive grade compliant. The wide STMicroelectronics portfolio meets all
needs.

29
Fig 3.8 Arduino interface with PIR sensor

3.9 POWER SUPPLY CIRCUIT:


As in below figure this circuit is an approach to obtain both 12V and 5V DC
power supply. The circuit uses two ICs 7812(IC1) and 7805 (IC2) for obtaining the
required voltages. The AC mains voltage will be stepped down by the transformer
T1, rectified by filtered by capacitor C1 to obtain a steady DC level .The IC1
regulates this voltage to bridge B1 and obtain a steady 12V DC. The output of the IC1
will be regulated by the IC2 to obtain a steady 5V DC at its output. In this way both
12V and 5V DC are obtained. Such a circuit is very useful in cases when we need two
DC voltages for the operation of a circuit.
The LM78XX series of three terminal positive regulators are available in the TO-220
package and with several fixed output voltages, making them useful in a wide range
of applications. Each type employs internal current limiting, thermal shut down and
safe operating area protection, making it essentially indestructible. If adequate heat
sinking is provided, they can deliver over 1A output current. Although designed
primarily as fixed voltage regulators, these devices can be used with external
components to obtain adjustable voltages and currents.
The power supply section is the section which provide +5V for the components
to work. IC LM7805 is used for providing a constant power of +5V.

30
The ac voltage, typically 220V, is connected to a transformer, which steps down that
ac voltage down to the level of the desired dc output. A diode rectifier then provides a
full-wave rectified voltage that is initially filtered by a simple capacitor filter to
produce a dc voltage. This resulting dc voltage usually has some ripple or ac voltage
variation.
A regulator circuit removes the ripples and also retains the same dc value even if the
input dc voltage varies, or the load connected to the output dc voltage changes. This
voltage regulation is usually obtained using one of the popular voltage regulator IC
units.

Fig.3.9 Block Diagram Of Power Supply

Transformer:
Transformers convert AC electricity from one voltage to another with little
loss of power. Transformers work only with AC and this is one of the reasons why
mains electricity is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most
power supplies use a step-down transformer to reduce the dangerously high mains
voltage (230V in India) to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There
is no electrical connection between the two coils; instead they are linked by an
alternating magnetic field created in the soft-iron core of the transformer.
Transformers waste very little power so the power out is (almost) equal to the power
in. Note that as voltage is stepped down current is stepped up.
The transformer will step down the power supply voltage (0-230V) to (0- 6V) level.
Then the secondary of the potential transformer will be connected to the bridge

31
rectifier, which is constructed with the help of PN junction diodes. The advantages of
using bridge rectifier are it will give peak voltage output as DC.
Rectifier
There are several ways of connecting diodes to make a rectifier to convert AC
to DC. The bridge rectifier is the most important and it produces full-wave varying
DC. A full-wave rectifier can also be made from just two diodes if a centre-tap
transformer is used, but this method is rarely used now that diodes are cheaper. A
single diode can be used as a rectifier but it only uses the positive (+) parts of the AC
wave to produce half-wave varying DC
Bridge Rectifier
When four diodes are connected as shown in figure, the circuit is called as
bridge rectifier. The input to the circuit is applied to the diagonally opposite corners
of the network, and the output is taken from the remaining two corners. Let us assume
that the transformer is working properly and there is a positive potential, at point A
and a negative potential at point B. the positive potential at point A will forward bias
D3 and reverse bias D4.

Fig. Bridge Rectifier

The negative potential at point B will forward bias D1 and reverse D2. At this
time D3 and D1 are forward biased and will allow current flow to pass through them;
D4 and D2 are reverse biased and will block current flow.
One advantage of a bridge rectifier over a conventional full-wave rectifier is
that with a given transformer the bridge rectifier produces a voltage output that is
nearly twice that of the conventional full-wave circuit.

32
i. The main advantage of this bridge circuit is that it does not require a special centre
tapped transformer, thereby reducing its size and cost.
ii. The single secondary winding is connected to one side of the diode bridge network
and the load to the other side as shown below.
. The result is iii still a pulsating direct current but with double the frequency.

Fig 3.9 Output Waveform Of DC

3.9.2 Smoothing
Smoothing is performed by a large value electrolytic capacitor connected
across the DC supply to act as a reservoir, supplying current to the output when the
varying DC voltage from the rectifier is falling. The capacitor charges quickly near
the peak of the varying DC, and then discharges as it supplies current to the output.

Voltage Regulators
Voltage regulators comprise a class of widely used y 5, 12 and 15V) or
variable output voltages. They are also rated by the maximum current they can pass.
Negative voltage regulators are available, mainly for use in dual supplies. Most
regulators include some automatic protection from excessive current ('overload
protection') and overheating ('thermal protection').
Many of the fixed voltage regulator ICs has 3 leads and look like power
transistors, such as the 7805 +5V 1Amp regulator. They include a hole for attaching a
heat sink if necessary.

33
Fig. Regulator

Fig 3.9 Circuit Diagram Of Fig. Power supply


3.10 PIEZO-BUZZER:
A buzzer or beeper is an audio signaling device, which may be mechanical,
electromechanical, or piezoelectric. Typical uses of buzzers and beepers include
alarms, timers and confirmation of user input such as a mouse click or keystroke. A
piezoelectric element may be driven by an oscillating electronic circuit or other audio
signal source, driven with a piezoelectric audio amplifier. Sounds commonly used to
indicate that a button has been pressed are a click, a ring or a beep.
It most commonly consists of a number of switches or sensors connected to a
control unit that determines if and which button was pushed or a preset time has
lapsed, and usually illuminates a light on the appropriate button or control panel, and
sounds a warning in the form of a continuous or intermittent buzzing or beeping
sound. Initially this device was based on an electromechanical system which was
identical to an electric bell without the metal gong (which makes the ringing noise).
Often these units were anchored to a wall or ceiling and used the ceiling or wall as a
sounding board. Another implementation with some AC-connected devices was to
implement a circuit to make the AC current into a noise loud enough to drive a
loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is more
popular to use a ceramic-based piezoelectric sounder like a Sonalert which makes a

34
high-pitched tone. Usually these were hooked up to "driver" circuits which varied the
pitch of the sound or pulsed the sound on and off.

Fig 3.10 Piezo buzzer

In game shows it is also known as a "lockout system," because when one


person signals ("buzzes in"), all others are locked out from signalling. Several game
shows have large buzzer buttons which are identified as "plungers".

Fig 3.10 a)Plungers

35
The word "buzzer" comes from the rasping noise that buzzers made when they
were electromechanical devices, operated from stepped-down AC line voltage at 50 or
60 cycles. Other sounds commonly used to indicate that a button has been pressed are
a ring or a beep. Some systems, such as the one used on jeopardy!, make no noise at
all instead usin light.

Fig 3.1.0 b) Structure of buzzer

Fig 3.10 c) Ceramic wafer


Specifications:
Rated Voltage:
A piezo buzzer is driven by square waves (V p-p).Operating Voltage: For
normal operating. But it is not guaranteed to make the minimum SPL under the rated

36
voltage.
Consumption Current:
The current is stably consumed under the regular operation. However, it
normally takes three times of current at the moment of starting to work.
Capacitance:
A piezo buzzer can make higher SPL with higher capacitance, but it
consumes more electricity.
Sound Output:
The sound output is measured by decibel meter. Applying rated voltage and
square waves, and the distance of 10 cm.
Rated Frequency:
A buzzer can make sound on any frequencies, but we suggest that the highest
and the most stable SPL come from the rated frequency.
Operating Temp.:
Keep working well between -30℃ and +70℃.

3.11 LIGHT EMITTING DIODE(LED):

A light-emitting diode (LED) is a two-lead semiconductor light source. It


is a p–n junction diode that emits light when activated.[5] When a suitable current is
applied to the leads,[6][7] electrons are able to recombine with electron holes within the
device, releasing energy in the form of photons. This effect is called
electroluminescence, and the color of the light (corresponding to the energy of the
photon) is determined by the energy band gap of the semiconductor. LEDs are
typically small (less than 1 mm2) and integrated optical components may be used to
shape the radiation pattern.Appearing as practical electronic components in 1962, the
earliest LEDs emitted low-intensity infrared light.[9] Infrared LEDs are still frequently
used as transmitting elements in remote-control circuits, such as those in remote
controls for 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 very high brightness. Early LEDs were
often used as indicator lamps for electronic devices, replacing small incandescent

37
bulbs. They were soon packaged into numeric readouts in the form of seven-segment
displays and were commonly seen in digital clocks. Recent developments have
produced LEDs suitable for environmental and task lighting. LEDs have led to new
displays and sensors, while their high switching rates are useful in advanced
communications technology.

LEDs have many advantages over incandescent light sources, including lower
energy consumption, longer lifetime, improved physical robustness, smaller size, and
faster switching. Light-emitting diodes are used in applications as diverse as aviation
lighting, automotive headlamps, advertising, general lighting, traffic signals, camera
flashes, lighted wallpaper and medical devices.[10] They are also significantly more
energy efficient and, arguably, have fewer environmental concerns linked to their
disposal.[11][12]

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 for
most purposes the light from a simple diode element can be regarded as functionally
monochromatic

The LED consists of a chip of semiconducting material doped with impurities to


create a p-n junction. As in other diodes, current flows easily from the p-side, or
anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers—
electrons and holes—flow into the junction from electrodes with different voltages.
When an electron meets a hole, it falls into a lower energy level and releases energy
in the form of a photon.

The wavelength of the light emitted, and thus its color, depends on the band gap
energy of the materials forming the p-n junction. In silicon or germanium diodes, the
electrons and holes usually recombine by a non-radiative transition, which produces
no optical emission, because these are indirect band gap materials. The materials used
for the LED have a direct band gap with energies corresponding to near-infrared,
visible, or near-ultraviolet light.

38
LED development began with infrared and red devices made with gallium
arsenide. Advances in materials science have enabled making devices with ever-
shorter wavelengths, emitting light in a variety of colors.

Fig 3.11 Description of LED

LEDs are usually built on an n-type substrate, with an electrode attached to the
p-type layer deposited on its surface. P-type substrates, while less common, occur as
well. Many commercial LEDs, especially GaN/InGaN, also use sapphire substrate.

Efficiency and operational parameters

Typical indicator LEDs are designed to operate with no more than 30–60
milliwatts (mW) of electrical power. Around 1999, Philips Lumileds introduced
power LEDs capable of continuous use at one watt. These LEDs used much larger
semiconductor die sizes to handle the large power inputs. Also, the semiconductor
dies were mounted onto metal slugs to allow for greater heat dissipation from the
LED die.

39
One of the key advantages of LED-based lighting sources is high luminous
efficacy. White LEDs quickly matched and overtook the efficacy of standard
incandescent lighting systems. In 2002, Lumileds made five-watt LEDs available with
luminous efficacy of 18–22 lumens per watt (lm/W). For comparison, a conventional
incandescent light bulb of 60–100 watts emits around 15 lm/W, and standard
fluorescent lights emit up to 100 lm/W.

As of 2012, Philips had achieved the following efficacies for each color.[79] The
efficiency values show the physics – light power out per electrical power in. The
lumen-per-watt efficacy value includes characteristics of the human eye and is
derived using the luminosity function.

Wavelength range Typical efficiency Typical efficacy


Color
(nm) coefficient (lm/W)

Red 620 < λ < 645 0.39 72

Red-
610 < λ < 620 0.29 98
orange

Green 520 < λ < 550 0.15 93

Cyan 490 < λ < 520 0.26 75

Blue 460 < λ < 490 0.35 37

In September 2003, a new type of blue LED was demonstrated by Cree. This
produced a commercially packaged white light giving 65 lm/W at 20 mA, becoming
the brightest white LED commercially available at the time, and more than four times
as efficient as standard incandescents. In 2006, they demonstrated a prototype with a
record white LED luminous efficacy of 131 lm/W at 20 mA. Nichia Corporation has
developed a white LED with luminous efficacy of 150 lm/W at a forward current of
20 mA.[80] Cree's XLamp XM-L LEDs, commercially available in 2011, produce
100 lm/W at their full power of 10 W, and up to 160 lm/W at around 2 W input
power. In 2012, Cree announced a white LED giving 254 lm/W,[81] and 303 lm/W in

40
March 2014.[82] Practical general lighting needs high-power LEDs, of one watt or
more. Typical operating currents for such devices begin at 350 mA.

These efficiencies are for the light-emitting diode only, held at low temperature
in a lab. Since LEDs installed in real fixtures operate at higher temperature and with
driver losses, real-world efficiencies are much lower. United States Department of
Energy (DOE) testing of commercial LED lamps designed to replace incandescent
lamps or CFLs showed that average efficacy was still about 46 lm/W in 2009 (tested
performance ranged from 17 lm/W to 79 lm/W).

3.12 Jumper Wires:

A Jump wire is (also known as jumper, jumper wire ,jumper cable,


DuPont wire-named for one manufacturer of them) is an electrical wire.
Or group of them in cable ,with a connector or pin at each end. Which is
normally used to interconnect the components of a bread board or other
prototype or test circuit ,internally or with other equipment or with out
soldering.

3.13 SOFTWARE DESCRIPTION

Arduino IDE Software:


In thise we will get know of the process of installation of Arduino IDE and
connecting Arduino uno to Arduino IDE.
Step 1
First we must have our Arduino board (we can choose our favorite board) and
a USB cable. In case we use Adriana UNO, Arduino Duemilanove, Nano, Arduino
Mega 2560, or Diecimila, we will need a standard USB cable (A plug to B plug), t In
case we use Arduino Nano, we will need an A to Mini-B cable..

41
Step 2 − Download Arduino IDE Software. We can get different versions of Arduino
IDE from the Download page on the Arduino Official website. We must select wer
software, which is compatible with wer operating system (Windows, IOS, or Linux).
After wear file download is complete, unzip the file.

Step 3 − Power up our board.


The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically draw
power from either, the USB connection to the computer or an external power supply.
If we are using an Arduino Diecimila, we have to make sure that the board is
configured to draw power from the USB connection. The power source is selected
with a jumper, a small piece of plastic that fits onto two of the three pins between the
USB and power jacks.
Check that it is on the two pins closest to the USB port.
Connect the Arduino board to wer computer using the USB cable. The green power
LED
(labeled PWR) should glow.
Step 4 − Launch Arduino IDE.

42
After our Arduino IDE software is downloaded, we need to unzip the folder. Inside
the folder, we can find the application icon with an infinity label (application.exe).
Double click the icon to start the IDE.
Step 5 − Open our first project.
Once the software starts, we have two options
* Create a new project

* Open an existing project example.


To create a new project, select File → New.
To open an existing project example, select File → Example → Basics → Blink.
Here, we are selecting just one of the examples with the name Blink. It turns the LED
on and off with some time delay. We can select any other example from the list.
Step 6 − Select our Arduino board.

43
To avoid any error while uploading wear program to the board, we must select the
correct Arduino board name, which matches with the board connected to wer
computer.
Go to Tools → Board and select wear board.
Here, we have selected Arduino Uno board according to our tutorial, but we must
select
the name matching the board that we are using.

Step 7 − Select wer serial port.

44
Select the serial device of the Arduino board. Go to Tools → Serial Port menu. This is
likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware
serial ports). To find out, we can disconnect wer Arduino board and re-open the
menu, the entry that disappears should be of the Arduino board. Reconnect the board
and select that serial port.
Step 8 − Upload the program to wer board.
Before explaining how we can upload our program to the board, we must demonstrate
the function of each symbol appearing in the Arduino IDE toolbar.

45
A − Used to check if there is any compilation error.

B − Used to upload a program to the Arduino board.


C − Shortcut used to create a new sketch.
D − Used to directly open one of the example sketch.
E − Used to save wer sketch.
F − Serial monitor used to receive serial data from the board and send the serial data
to the board. Now, simply click the "Upload" button in the environment. Wait a few
seconds; we will see the RX and TX LEDs on the board, flashing. If the upload is
successful, the message
"Done uploading" will appear in the status bar.
Note − If we have an Arduino Mini, NG, or other board, we need to press the reset
button
physically on the board, immediately before clicking the upload button on the
Arduino Software.

46
4. ADVANTAGES AND APPLICATIONS AND RESULT

ANALYSIS

4.1 ADVANTAGES:

 Home and Industries is more secured than any typical home security systems.
 Home and Industries using IOT is more reliable
 Allow remote access from anywhere in the world.
 Notification will be directly received to the mobile if there are any intruders.
 Reduces the crime rate.
 In case of emergency we can activate the emergency from app itself.
 Easy to install.
 Easy to use.
 Very cost effective.

4.2 APPLICTIONS

This security system can be used in many areas like

 Educational institutes.
 Medical shops.
 Hospitals.
 Super markets.
 Factories.

47
4.3 RESULT:

The home and industrial security system as per our requirements is designed and
verified.

48
CHAPTER-5

CONCLUSION AND FUTURE SCOPE

5.1 CONCLUSION:

The sensor placed on the door informs the home owner as soon as the door is
opened by sending a push notification. The user will get this notification irrespective
of whether the phone is locked or unlocked or even if any other app is opened at the
moment. This was the main objective of the project ,which is the user feels safe and
not worry about any intrusion or break-ins when he is away from home and industry.
This setup also be used in commercial offices where some areas are restricted for
certain personnel, such a system will immediately inform the administrator of any
unauthorized personnel trying to access such an area. Therefore the extensibility and
applicability of such a system is only limited only by the imagination. Another
important component of this project is the connectivity between the ESP8266(WIFI
module) and the BLYNK server.

The system successfully connected to the BLYNK server using the authentication
token and the BLYNK libraries. As a result, we are able to get the notification on our
smart phones as soon as there was any change in the status of the reed module sensor.
Also the additional ability to control the alarm remotely is very beneficial and can be
very useful in some unfrozen circumstances. It was also observed that the BLYNK
app worked smoothly and carried out all communication between the hardware and
the app very accurately.

5.2 FUTURE SCOPE:

The developed system can also be used to in industrial and commercial


applications such as offices, warehouses and other areas where some areas are
reserved for authorized personnel only or other places where safety and precautions
are of primary concerns such as internet server room of a big MNC from where
corporate data can be stolen. The system can also be easily upgraded to add extra

49
safely features such as cameras, motion detection sensors. Etc. for increased safety.
The system can also further be developed by adding an RFID scanner so that the
authorized users need only carry a RFID or NFC tag with them on their person. The
RFID scanner will work by scanning the tag wirelessly and if the user is authorized to
the entry , the alarm system will be disabled for some times so that the user can enter.

6. BIBLIOGRAPHY

1. www.Arduino.cc

2. www.wikipedia.com

3. www.ladyada.net

4. www.programworld.com

5. www.atmel.com

6. www.avrbeginners.net

50
7. Appendix

SOURCE CODE
define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

// You should get Auth Token in the Blynk App.


// Go to the Project Settings (nut icon).

char auth[] = "K15kJUwZywsP-AF7CENuPFbqQjMqFfqN";

// Your WiFi credentials.


char ssid[] = "Bharath";
char pass[] = "bharath1";

SimpleTimer timer;

// This function sends Arduino's up time every second to Virtual Pin (5).
// In the app, Widget's reading frequency should be set to PUSH. This means
// that you define how often to send data to Blynk App.
void sendSensor()
{
int pir = analogRead(A0);
Blynk.virtualWrite(V1,pir);
if(pir > 600)
{
Blynk.notify("Security System Breached");
analogWrite(D4,255);
analogWrite(D2,255);
analogWrite(D6,0);
delay(3000);
analogWrite(D4,0);
analogWrite(D2,0);
analogWrite(D6,255);
}
else
{
analogWrite(D4,0);
analogWrite(D2,0);
analogWrite(D6,255);
}
}

51
void setup()
{

pinMode(A0,INPUT);
Serial.begin(9600); // See the connection status in Serial Monitor
Blynk.begin(auth, ssid, pass);

// Setup a function to be called every second

52

Вам также может понравиться