You are on page 1of 25

INTRIDUCTION:

The purpose of this project is to provide a home & office power & security

system . This system facilitates the house owners to monitor their home

remotely from any where in the world. This system comprises of a Micro-

controller and combination of analogue & digital IC based monitoring

system along with PIR (Passive Infrared) based presence of human beings

(thieves). Whenever an un-authorized entry is done, this system sends SMS

alerts to the house owner or Police automatically.

This system can be mounted at any place/room that needs to be

monitored. For example the house owner can mount this sensor at one of the

corners of the room so that it can cover the entire room area. Whenever a

human being enters inside the room, this system senses the Infrared rays

emitted from the human body. This sensor output is given to the Micro-

controller for further processing. Micro-controller takes necessary action like

sending SMS based alarm messages to the pre-programmed phone numbers.

This system works good both at day and night (dark light) timing. The

phone numbers to which this should be called can be preprogrammed.

The Major building blocks of this project are:

Microcontroller mother board with regulated power supply


PIR Sensor for Human detection:

A Passive Infra-Red sensor (PIR sensor) is an electronic device that

measures infrared (IR) light radiating from objects in its field of view. PIR

sensors are often used in the construction of PIR-based motion detectors (see

below). Apparent motion is detected when an infrared source with one

temperature, such as a human, passes in front of an infrared source with

another temperature, such as a wall. [1] All objects emit what is known as

black body radiation. It is usually infrared radiation that is invisible to the

human eye but can be detected by electronic devices designed for such a

purpose.
PASSIVE INFRARED SENSOR

The term passive in this instance means that the PIR device does not emit

an infrared beam but merely passively accepts incoming infrared radiation.

Contents [hide]  1 Design  2 PIR-based motion detector  3 PIR-based

remote thermometer [edit] Design Infrared radiation enters through the front

of the sensor, known as the sensor face. At the core of a PIR sensor is a solid

state sensor or set of sensors, made from an approximately 1/4 inch square

of natural or artificial pyroelectric materials, usually in the form of a thin

film, out of gallium nitride (GaN), caesium nitrate (CsNO 3 ), polyvinyl

fluorides, derivatives of phenylpyrazine, and cobalt phthalocyanine. (See

pyroelectric crystals.) Lithium tantalate (LiTaO 3 ) is a crystal exhibiting

both piezoelectric and pyroelectric properties. The sensor is often

manufactured as part of an integrated circuit and may consist of one (1), two

(2) or four (4) 'pixels' of equal areas of the pyroelectric material. Pairs of the

sensor pixels may be wired as opposite inputs to a differential amplifier. In

such a configuration, the PIR measurements cancel each other so that the

average temperature of the field of view is removed from the electrical

signal; an increase of IR energy across the entire sensor is self-cancelling

and will not trigger the device. This allows the device to resist false

indications of change in the event of being exposed to flashes of light or

field- wide illumination. (Continuous bright light could still saturate the

sensor materials and render the sensor unable to register further

information.) At the same time, this differential arrangement minimizes


common-mode interference, allowing the device to resist triggering due to

nearby electric fields. However, a differential pair of sensorscannot measure

temperature in that configuration and therefore this configuration is

specialized for motion detectors, see below. [edit] PIR-based motion

detector Cylindrical facet lens in front of PIR sensor. Each facet (rectangle)

is a Fresnel lens In a PIR-based motion detector (usually called a PID, for

Passive Infrared Detector), the PIR sensor is typically mounted on a printed

circuit board containing the necessary electronics required to interpret the

signals from the pyroelectric sensor chip. The complete assembly is

contained within a housing mounted in a location where the sensor can view

the area to be monitored. Infrared energy is able to reach the pyroelectric

sensor through the window because the plastic used is transparent to infrared

radiation (but only translucent to visible light). This plastic sheet also

prevents the intrusion of dust and/or insects from obscuring the sensor's field

of view, and in the case of insects, from generating false alarms. A few

mechanisms have been used to focus the distant infrared energy onto the

sensor surface. The window may have multiple Fresnel lenses molded into

it. Multi-Fresnel lens type of PID Typical residential and/or commercial PID

with multi-Fresnel lens cover. PID front cover only with point light source

behind to show individual lenses. PID with front cover removed showing

location of pyroelectric sensor (green arrow). Alternatively, some PIDs are

manufactured with internal plastic, segmented parabolic mirrors to focus the


infrared energy. Where mirrors are used, the plastic window cover has no

Fresnel lenses molded into it. This filtering window may be used to limit the

wavelengths to 8-14 micrometers which is closest to the infrared radiation

emitted by humans (9.4 micrometers being the strongest). Segmented mirror

type of PIDcannot measure temperature in that configuration and therefore

this configuration is specialized for motion detectors, see below. [edit] PIR-

based motion detector Cylindrical facet lens in front of PIR sensor. Each

facet (rectangle) is a Fresnel lens In a PIR-based motion detector (usually

called a PID, for Passive Infrared Detector), the PIR sensor is typically

mounted on a printed circuit board containing the necessary electronics

required to interpret the signals from the pyroelectric sensor chip. The

complete assembly is contained within a housing mounted in a location

where the sensor can view the area to be monitored. Infrared energy is able

to reach the pyroelectric sensor through the window because the plastic used

is transparent to infrared radiation (but only translucent to visible light). This

plastic sheet also prevents the intrusion of dust and/or insects from

obscuring the sensor's field of view, and in the case of insects, from

generating false alarms. A few mechanisms have been used to focus the

distant infrared energy onto the sensor surface. The window may have

multiple Fresnel lenses molded into it. Multi-Fresnel lens type of PID

Typical residential and/or commercial PID with multi-Fresnel lens cover.

PID front cover only with point light source behind to show individual
lenses. PID with front cover removed showing location of pyroelectric

sensor (green arrow).

Alternatively, some PIDs are manufactured with internal plastic, segmented

parabolic mirrors to focus the infrared energy. Where mirrors are used, the

plastic window cover has no Fresnel lenses molded into it. This filtering

window may be used to limit the wavelengths to 8-14 micrometers which is

closest to the infrared radiation emitted by humans (9.4 micrometers being

the strongest). Segmented mirror type of PID cannot measure temperature in

that configuration and therefore this configuration is specialized for motion

detectors, see below. [edit] PIR-based motion detector Cylindrical facet lens

in front of PIR sensor. Each facet (rectangle) is a Fresnel lens In a PIR-based

motion detector (usually called a PID, for Passive Infrared Detector), the

PIR sensor is typically mounted on a printed circuit board containing the

necessary electronics required to interpret the signals from the pyroelectric

sensor chip. The complete assembly is contained within a housing mounted

in a location where the sensor can view the area to be monitored. Infrared

energy is able to reach the pyroelectric sensor through the window because

the plastic used is transparent to infrared radiation (but only translucent to

visible light). This plastic sheet also prevents the intrusion of dust and/or

insects from obscuring the sensor's field of view, and in the case of insects,

from generating false alarms. A few mechanisms have been used to focus

the distant infrared energy onto the sensor surface. The window may have

multiple Fresnel lenses molded into it. Multi-Fresnel lens type of PID
Typical residential and/or commercial PID with multi-Fresnel lens cover.

PID front cover only with point light source behind to show individual

lenses. PID with front cover removed showing location of pyroelectric

sensor (green arrow). Alternatively, some PIDs are manufactured with

internal plastic, segmented parabolic mirrors to focus the infrared energy.

Where mirrors are used, the plastic window cover has no Fresnel lenses

molded into it. This filtering window may be used to limit the wavelengths

to 8-14 micrometers which is closest to the infrared radiation emitted by

humans (9.4 micrometers being the strongest). Segmented mirror type of

PIDenergy), the air blowing on the plastic window cover could change the

plastic's temperature enough to, once again, fool the electronics. PIDs come

in many configurations for a wide variety of applications. The most common

used in home security systems has numerous Fresnel lenses or mirror

segments and has an effective range of about thirty feet. Some larger PIDs

are made with single segment mirrors and can sense changes in infrared

energy over one hundred feet away from the PID. There are also PIDs

designed with reversible orientation mirrors which allow either broad

coverage (110° wide) or very narrow 'curtain' coverage. PIDs can have more

than one internal sensing element so that, with the appropriate electronics

and Fresnel lens, it can detect direction. Left to right, right to left, up or

down and provide an appropriate output signal. [edit] PIR-based remote

thermometer Designs have been implemented in which a PIR circuit

measures the temperature of a remote object. [2] In such a circuit, a non-


differential PIR output is used. The output signal is evaluated according to a

calibration for the IR spectrum of a specific type of matter to be observed.

By this means, relatively accurate and precise temperature measurements

may be obtained remotely. Without calibration to the type of material being

observed, a PIR thermometer device is able to measure changes in IR

emission which correspond directly to temperature changes, but the actual

temperature values cannot be calculated.

POWER SUPPLY
The circuit diagram below represents a typical use of a voltage regulator.

The LM7805 can reliably deliver 1


amp at a constant voltage.
Working:-

The transformer drops the 240 volt 'mains' voltage to 8.5 volts.
The diode 'bridge' rectifies the 8.5 volts AC from the output side of the
power transformer into DC. The 2500uF capacitor helps to maintain a
constant input into the regulator.

As a general guide this capacitor should be rated at a minimum


of 1000uF for each amp of current drawn and at least TWICE the
input voltage. The 0.1uF capacitor eliminates any high frequency
pulses that could otherwise interfere with the operation of the
regulator.

Voltage regulators are very robust. They can withstand over-


current draw due to short circuits and also over-heating. In both
cases the regulator will shut down before damage occurs. The only
way to destroy a regulator is to apply reverse voltage to its input.

Reverse polarity destroys the regulator almost instantly. To


avoid this possibility you should always use diode protection of the
power supply. This is especially important when using nine volt
battery supplies as it is common for people to 'test' the battery by
connecting it one way and then the other. Even this short 'test' could
destroy the regulator if a protection diode is not used.

All of the interfaces described on this site have protection


diodes connected into the power supply circuit to prevent damage
due to incorrect polarity power supply
WORKING:

When any movement is detected the output of the PIR sensor is

gives the 3.3V output. The output of the PIR sensor is compared by the

operational amplifier acts as a comparator

LM358 consists of two voltage comparators, U1A and U1B. Both of

them are fed with two different reference voltages through potentiometers

VR1 and VR2. The IR signal transmitted by the human is sensed by a PIR-

sensing module, and compared with two different threshold voltages through

the two comparators. The output through wires 6 and 7 is made available at

the header. The header also supplies voltages for comparators and IR

modules.

Normally, a line-sensing module utilized only one the comparators for

white-line detection. You may use both of them to work at different lighting

conditions, without putting much effort or additional components.


RELAY :

An electromagnetic relay is basically a switch operated by


magnetic force. This magnetic force is generated by flow of current
through a coil in the relay. The relay opens or closes a circuit when
current through the coil is started or stopped.

The basic working principle of relay.


As can be normally has two separate circuits. One circuit
which contains the relay is called “Switching circuit”. This circuit
drives the relay to switch on/off another circuit which is known as
“Switched circuit”.
Let us see how this circuit works. Initially when the on/off
switch S1 in the relay circuit is open, there is no current through this
circuit. In this position the electro-magnet in the relay will not energize
and the relay contact will stay in off possition. In this position current
will not flow in the load circuit and the bulb in this circuit will remain
off.
When the switch S1 in the relay circuit is closed, the
current will flow through the coil and the electro-magnet will pull the
relay armature down. This will close the relay contact to the on
position.
The connection of ammature to the on position will start the
flow of current in the load circuit and the bulb in this circuit will start
glow.
10V
+V
3 2 1
12VSPDT
Construction of Relay
A relay basically consistor of four parts.
* an electro-magnet made of a coil and a magnetic circuit,
* a movable armature
* a set of contacts and
* a frame to mount all these components.
On top of this core/coil assembly, an armature attached to a
“return spring” is located, this “return spring” keeps the armature in
tension by pulling it downward. This downward pull of armature by the
spring makes “ armature contact arm” to touch a terminal known as
“top contact”.

When current flows through the relay coil, the coil is


energized and when the force of attraction of electromagnet generated
in the coil is sufficient to overcome the opposition of the tension of
“return spring”, the armature and the “armature contact arm” to touch
another terminal known as “bottom contact”.

Controlling a circuit with the relay is shown in detail in the


figure. As you can in this figure, the relay circuit has no direct electrical
connection with the circuit being controlled.

Current in the relay circuit will energize the electromagnet


of the relay and pull the armature down from the “top contact” to the

“bottom contact”. When the armature contact arm touches the “bottom
contact”, the circuit being driven by the relay becomes complete, and
the current start to flow from the pole to the “bottom contact” and into
the circuit. This will glow the lamp in our example circuit.

When the relay circuit is de-energized by switching off the


switch and cutting supply to the relay, the electro-magnet will loose its
magnetism. This will make the return spring to pull the armature, once
again, back to the “top contact” position.

This movement of armature will also remove the “


armature contact arm” from the “bottom contact” and open the lamp
circuit, which in turn will turn off the lamp.
In a relay the armature is not allowed to touch the core of
coil, as this may make the armature to stick to the core because of
remnant magnetism in the core. As small gap is left between the
armature and the core, when the “armature contact arm” touches the
“bottom contact”.

Sometimes a small rivet of non-magnetic material such as


brass is fixed on top of core, so that the armature does not touch the
core.

Relays in Circuit
Let us now see how a relay is represented in a circuit.
figure shown a double pole relay with its internal constructions and pin
configuration. The contact on which the movable armature of relay
normally reset is commonly known as N/C [normally closed or
normally connected] contact.

The other contact to which the magnetized coil pulls the


armature is known as O/C [Orderly Connected] or N/O [Normally
Open] contact.
The N/C/ contact is called “Normally Closed} or
“Normally Connected” contact, because in normal condition, when the
relay is off, the armature is connected to this contact.

The other contact which stays open in normal condition,


when there is no current through the relay, is called N/O “Normally
Open” contact. This contact is also called O/C “Orderly Connected”
contact, because this contact is connected when the relay receives an
order to connected it. The order to connect/close this contact is given
by giving supply to realy coil.

In a relay the armature is mormally connected to the N/C


contact. By providing supply to the relay circuit, this connection of
armature is changed to the O/C contact to complete the circuit being
driven by the relay.
When the supply to the relay is stoped, the armature will return back to
the N/C connection, this will once again open the circuit being driven
by the relay and stop flow of current in the load circuit.

Block Diagram

Control
Power supply section
Logic
12v DC&05v DC Relay
Drive Relay-1
CIRC- Power
PIR (Tx) UIT Supply
Sensor
Rx
Precautions

1) Frist check all component as per the circuit.


2) Check transistor.
3) Pay proper attention to the polarity of capacitors and diodes while assembling.
4) While mounting transistor be sure that you have connected collector, emitter and base
properly.
5) Clean PCB after soldering so those components do not short.
6) Remember the anode and cathode of diode before fitting.
7) Remember to check dry soldering and short circuit.
8) IC should be mounted on IC base.
9) Take care in wiring the circuit to avid loose connection.
10) Check for print short after soldering.
11) Please use resistance of the exact value as given in the circuit.
12) Check primary and secondary winding of the transformer before connecting.
13) The insulation of the wire inside the modes should be of good quality.
 Some applications are

Rest rooms (Toilets) ,

Kitchen,

Store rooms,

hall ways,

Staircase ,

foyers (Entrance way) ,

Corridor,

driveways,

garden areas and

car parks.
DEVICE OVERVIEW
• PIC16F876A
• PIC16F877A
PIC16F873A/876A devices are available only in 28-pin packages, while
PIC16F874A/877A devices are available in 40-pin and 44-pin packages. All devices in
the PIC16F87XA family share common architecture with the following differences:
• The PIC16F873A and PIC16F874A have one-half of the total on-chip memory of the
PIC16F876A and PIC16F877A
• The 28-pin devices have three I/O ports, while the 40/44-pin devices have five • The
28-pin devices have fourteen interrupts, while the 40/44-pin devices have fifteen
• The 28-pin devices have five A/D input channels, while the 40/44-pin devices have
eight
• The Parallel Slave Port is implemented only on the 40/44-pin devices The available
features are summarized in Table 1-1. Block diagrams of the PIC16F873A/876A and
PIC16F874A/877A devices are provided in Figure 1-1 and Figure 1-2, respectively. The
pinouts for these device families are listed in Table 1-2 and Table 1-3. Additional
information may be found in the PICmicro® Mid-Range Reference Manual (DS33023),
which may be obtained from your local Microchip Sales Representative This document
contains device specific information about the following devices:
• PIC16F873A
• PIC16F874A
or downloaded from the Microchip web site. The Reference Manual should be
considered a complementary document to this data sheet and is highly recommended
reading for a better understanding of the device architecture and operation of the
peripheral modules.

2.0 MEMORY ORGANIZATION :


There are three memory blocks in each of the PIC16F87XA devices. The
program memory and data memory have separate buses so that concurrent
access can occur and is detailed in this section.

“Data EEPROM and Flash Program Memory”.


Additional information on device memory may be found in the PICmicro® Mid-
Range MCU Family Reference Manual (DS33023).
Program Memory Organization
The PIC16F87XA devices have a 13-bit program counter capable of addressing
an 8K word x 14 bit program memory space. The PIC16F876A/877A devices
have 8K words x 14 bits of Flash program memory, while PIC16F873A/874A
devices have 4K words x 14 bits. Accessing a location above the physically
implemented address will cause a wraparound.
The Reset vector is at 0000h and the interrupt vector is at 0004h.
2.2 Data Memory Organization
The data memory is partitioned into multiple banks which contain the General
Purpose Registers and the Special Function Registers. Bits RP1 (Status<6>) and
RP0 (Status<5>) are the bank select bits.
Each bank extends up to 7Fh (128 bytes). The lower locations of each bank are
reserved for the Special Function Registers. Above the Special Function
Registers are General Purpose Registers, implemented as static RAM. All
implemented banks contain Special Function Registers. Some frequently used
Special Function Registers from one bank may be mirrored in another bank for
code reduction and quicker access.
2.2.1 GENERAL PURPOSE REGISTER FILE

The register file can be accessed either directly, or indirectly, through the File
Select Register (FSR).

RP1: RP0 Bank


00 0
01 1
10 2
11 3

2.2.2.1 Status Register


The Status register contains the arithmetic status of the ALU, the Reset status and the
bank select bits for data memory. The Status register can be the destination for any
instruction, as with any other register. If the Status register is the destination for an
instruction that affects the Z, DC or C bits, then the write to these three bits is disabled.
These bits are set or cleared according to the device logic. Furthermore, the TO and PD
bits are not writable, therefore, the result of an instruction with the Status register as
destination may be different than intende
For example, CLRF STATUS, will clear the upper three bits and set the Z bit. This leaves
the Status register as 000u u1uu (where u = unchanged). It is recommended, therefore,
that only BCF, BSF, SWAPF and MOVWF instructions are used to alter the Status
register because these instructions do not affect
the Z, C or DC bits from the Status register. For other instructions not affecting any
status bits, see
Section 15.0 “Instruction Set Summary”.
Note: The C and DC bits operate as a borrow and digit borrow bit, respectively, in
subtraction.
See the SUBLW and SUBWF instructions for examples.

bit 7 IRP: Register Bank Select bit (used for indirect addressing)
1 = Bank 2, 3 (100h-1FFh)
0 = Bank 0, 1 (00h-FFh)
bit 6-5 RP1:RP0: Register Bank Select bits (used for direct addressing)
11 = Bank 3 (180h-1FFh)
10 = Bank 2 (100h-17Fh)
01 = Bank 1 (80h-FFh)
00 = Bank 0 (00h-7Fh)
Each bank is 128 bytes.
bit 4 TO: Time-out bit
1 = After power-up, CLRWDT instruction or SLEEP instruction
0 = A WDT time-out occurred
bit 3 PD: Power-down bit
1 = After power-up or by the CLRWDT instruction
0 = By execution of the SLEEP instruction
bit 2 Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1 DC: Digit carry/borrow bit (ADDWF, ADDLW,SUBLW,SUBWF instructions)
(for borrow, the polarity is reversed)
1 = A carry-out from the 4th low order bit of the result occurred
0 = No carry-out from the 4th low order bit of the result
bit 0 C: Carry/borrow bit (ADDWF, ADDLW,SUBLW,SUBWF instructions)
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred
Note: For borrow, the polarity is reversed. A subtraction is executed by adding the two’s
complement of the second operand. For rotate (RRF, RLF) instructions, this bit is
loaded with either the high, or low order bit of the source register.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
CONTENTS
 INTRIDUCTION
 PIR SNNSER FOR HUMAN DETECTION
 PASSIVE INFRARED SENSOR

 POWER SUPPLY

 WORKING

 RELAY

 THE BASIC WORKING PRINCIPLE OF RELAY

 CONSTRUCTION OF RELAY

 RELAY IN CIRCUIT

 BLOK DIAGRAM

 PRECAUTIONS

 SOME APPLICATIOM ARE

 DEVICE OVERVIEW

 MEMORY ORGANIGATIONS

 Data EEPROM and Flash Program Memory

 PROGRAM MEMORY ORGANIGATIONS

 DATA MEMORY ORGANIGATIONS

 GENERAL PURPOSE REGISTER FILE

 STATUS REGISTER

 INSTRUCTION SET SUMMERY

You might also like