Vous êtes sur la page 1sur 49

CHAPTER-1

INTRODUCTION
The title HOME SECURITY SYSTEM tells us that this system provides
security to homes. In past we saw many home security systems like burglar alarm,
safety locks etc. But our project is very different from past projects. Because in past a
security system means it provides security only at the door or at entrance. But using
our project we can heal the home security problems upto a maximum extent.
1.1 Methodology
This project consists of seven major blocks. They are
1)Power supply 2)Microcontroller 3)IR sensor 4)Smoke sensor 5)PIR sensor
6)Buzzer 7) LCD display
1) Power supply:
Since we are using electronic components which only work on DC we should
supply DC power to them. So we convert 220V a.c to required amount of DC power.
It converts a.c to DC using following sequence. Transformer to rectifier circuit to
filter to regulator. The output of regulator is DC. Here we are using two regulators
(7805, 7812) due to our requirement. LEDs indicate the supply of power.
2) Micro controller:
We are using 8052 micro controller in this project. Micro controller is the control
unit of the project. All the devices are connected to the micro controller. Its function is
to receive the signal from sensors and transmit the appropriate signal to the buzzer
and LCD display. For example, when smoke is detected by smoke sensor the signal is
sent to micro controller and it sends signal to buzzer and respective message is
displayed in LCD screen.
3) IR sensor:
It consists of two blocks. They are 1) IR transmitter 2) IR Receiver.
IR transmitter always transmits IR waves and those waves are received by IR
receiver. To generate continuous IR waves we need oscillator. But here we used 555
Timer because of its adjustable duty cycle. We used astable multivibrator operation to
generate continuous signals. The output is given to IR LED. The IR LED generates IR
waves.
IR receiver we used is TSOP1356. The PIN diode in receiver detects IR waves
from transmitter. When an obstacle is there the PIN diode suffers change in resistance

1
and respective signal is sent to micro controller. It sends signal to buzzer and
respective message is displayed in LCD screen.
It is generally placed at the doors or windows.

POWER
SUPPLY FIRE SENSOR

IR AT 89S52 PIR SENSOR


RECEIVER
CONTROLLER

LCD
BUZZER DISPLAY

Figure 1.1 Block diagram

2
Figure 1.2 Project Layout

3
4) Smoke sensor:
As name indicates it detects any smoke or fire in the house. There are two types
of smoke sensors. We are using ionization type of sensors. Ionization detectors have
an ionization chamber and a source of ionizing radiation .The source of ionizing
radiation is a minute quantity of americium-241 (perhaps 1/5000th of a gram), which
is a source of alpha particles (helium nuclei).When smoke enters the ionization
chamber, the smoke particles attach to the ions and neutralize them, so they do not
reach the plate. The drop in current between the plates triggers the signal and sends to
micro controller. It sends signal to buzzer and respective message is displayed in LCD
screen.
It is generally placed at fire prone areas like kitchen.
5) PIR sensor:
It is very interesting and important block in the project. The word PIR means
passive infrared radiation. It senses every human being in its range and its range is
usually 20 feet radially. In domestic conditions, most of the rooms are approximately
or less than 20feet.So we can place it in store rooms or insecure places. When any
person is detected in its vicinity sends signal to micro controller. It sends signal to
buzzer and respective message is displayed in LCD screen.
It is generally placed in bed rooms and near safety lockers.
6) Buzzer:
It is an output device of the system. When any interruption is occurred in any
sensor, the micro controller triggers the buzzer.
7) LCD Display:
It is another output device of the system. We used 2X16 LCD display. As and
when an interruption occurs it displays the type and location of interruption with the
help of micro controller.

1.2 Organization of work:

Chapter 2 deals with the microcontroller 89S52 and its pin description.
Chapter 3 deals with the power supply of project.
Chapter 4 deals with the IR sensor circuit and its operation.
Chapter 5 deals with PIR sensor and its operation.
Chapter 6 deals with smoke sensor and its operation with specifications.
4
Chapter 7 deals with LCD display and its pin description.
Chapter 8 deals with flow chart, source code of the project.
Chapter 9 covers conclusion and future scope.

5
CHAPTER-2
MICROCONTROLLER

2.1 A Brief History of 8051


In 1981, Intel Corporation introduced an 8 bit microcontroller called 8051. This
microcontroller had 128 bytes of RAM, 4K bytes of chip ROM, two timers, one serial
port, and four ports all on a single chip. At the time it was also referred as “A
SYSTEM ON A CHIP”

The 8051 is an 8-bit processor meaning that the CPU can work only on 8
bits data at a time. Data larger than 8 bits has to be broken into 8 bits pieces to be
processed by the CPU. The 8051 has a total of four I\O ports each 8 bit wide.

There are many versions of 8051 with different speeds and amount of on-chip
ROM and they are all compatible with the original 8051. This means that if you write
a program for one it will run on any of them.

The 8051 is an original member of the 8051 family. There are two other
members in the 8051 family of microcontrollers. They are 8052 and 8031. All the
three microcontrollers will have the same internal architecture, but they differ in the
following aspects.
• 8031 has 128 bytes of RAM, two timers and 6 interrupts.
• 89S51 has 4KB ROM, 128 bytes of RAM, two timers and 6
interrupts.
• 89S52 has 8KB ROM, 128 bytes of RAM, three timers and 8
interrupts.
Of the three microcontrollers, 89S51 is the most preferable. Microcontroller
supports both serial and parallel communication.

In the concerned project 89S52 microcontroller is used. Here microcontroller


used is AT89S52, which is manufactured by ATMEL laboratories.
2.2 Description of 89C52 Microcontroller

6
The AT89S52 provides the following standard features: 8Kbytes of Flash, 256
bytes of RAM, 32 I/O lines, three 16-bit timer/counters, six-vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In
addition, the AT89S52 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt
system to continue functioning. The Power down Mode saves the RAM contents but
freezes the oscillator, disabling all other chip functions until the next hardware reset.

By combining a versatile 8-bit CPU with Flash on a monolithic chip, the


AT89S52 is a powerful microcomputer which provides a highly flexible and cost
effective solution to many embedded control applications.

Features of Microcontroller (89S52)

• Compatible with MCS-51 Products


• 8 Kbytes of In-System Reprogrammable Flash Memory
• Endurance: 1,000 Write/Erase Cycles
• Fully Static Operation: 0 Hz to 24 MHz
• Three-Level Program Memory Lock
• 256 x 8-Bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-Bit Timer/Counters
• Eight vector two level Interrupt Sources
• Programmable Serial Channel
• Low Power Idle and Power Down Modes
In addition, the AT89S52 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes.

The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial
port and interrupt system to continue functioning. The Power down Mode saves the
RAM contents but freezes the oscillator disabling all other chip functions until the
next hardware reset.

7
Figure 2.1 Block Diagram Of 89S52

8
2.3 Pin Configurations

9
10
Figure 2.2 Pin Diagram of 89S52

11
Pin Description

• VCC

Pin 40 provides Supply voltage to the chip. The voltage source is +5v

• GND.

Pin 20 is the grounded

• Port 0

Port 0 is an 8-bit open drain bidirectional I/O port from pin 32 to 39. As an
output port each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the
pins can be used as high-impedance inputs. Port 0 may also be configured to be the
multiplexed low-order address/data bus during accesses to external program and data
memory. In this mode P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming, and outputs the
code bytes during program verification. External pull-ups are required during program
verification.

• Port 1

Port 1 is an 8-bit bidirectional I/O port with internal pull-ups from pin 1 to 8.
The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to
Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As
inputs, Port 1 pins that are externally being pulled low will source current (IIL)
because of the internal pull-ups.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external
count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively,
as shown in following table.
Port 1 also receives the low-order address bytes during Flash programming
and program verification.

12
Table 2.1 Special features of port1
• Port 2

Port 2 is an 8-bit bidirectional I/O port with internal pull-ups from pin 21 to
28. The Port 2 output buffers can sink / source four TTL inputs. When 1s are written
to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs.
As inputs, Port 2 pins that are externally being pulled low will source current (IIL)
because of the internal pull-ups.

Port 2 emits the high-order address byte during fetches from external program
memory and during accesses to external data memory that uses 16-bit addresses
(MOVX @ DPTR). In this application it uses strong internal pull-ups when emitting
1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI),
Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the
high-order address bits and some control signals during Flash programming and
verification.
• Port 3

Port 3 is an 8-bit bidirectional I/O port with internal pull-ups from pin 10 to 17.
The Port 3 output buffers can sink / source four TTL inputs. When 1s are written to
Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As
inputs, Port 3 pins that are externally being pulled low will source current (IIL)
because of the pull-ups.
Port 3 also serves the functions of various special features of the AT89C52 as
listed below:

13
Table 2.2 Special Features of port3

Port 3 also receives some control signals for Flash programming and
programming verification.

• RST

Pin 9 is the Reset input. It is active high. Upon applying a high pulse to this
pin, the microcontroller will reset and terminate all activities. A high on this pin for
two machine cycles while the oscillator is running resets the device.

• ALE/PROG

Address Latch is an output pin and is active high. Address Latch Enable output
pulse for latching the low byte of the address during accesses to external memory.
This pin is also the program pulse input (PROG) during Flash programming. In
normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and
may be used for external timing or clocking purposes.
Note, however, that one ALE pulse is skipped during each access to external Data
Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location
8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction.
Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if
the microcontroller is in external execution mode.

14
• PSEN

Program Store Enable is the read strobe to external program memory. When
the AT89S52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each
access to external data memory.

• EA/VPP

External Access Enable EA must be strapped to GND in order to enable the


device to fetch code from external program memory locations starting at 0000H up to
FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched
on reset. EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming
when 12-volt programming is selected.

• XTAL1

Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
• XTAL2

Output from the inverting oscillator amplifier.

• Oscillator Characteristics

XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on chip oscillator, as shown in Figure
5.3. Either a quartz crystal or ceramic resonator may be used. To drive the device
from an external clock source, XTAL2 should be left unconnected while XTAL1 is
driven as shown in Figure 2.3

15
Figure 2.3 crystal connections

2.6 Special function registers:

Special function registers are the areas of memory that control specific
functionality of the 89c52 microcontroller.

a) Accumulator (0E0h)

As its name suggests, it is used to accumulate the results of large no. of


instructions. It can hold 8 bit values.

b) B register (oFoh)

The B register is very similar to accumulator. It may hold 8-bit value. The B
register is only used by MUL AB and DIV AB instructions. In MUL AB the higher
byte of the products gets stored in B register. In DIV AB the quotient gets stored in B
with the remainder in A.

c) Stack pointer (081h)

The stack pointer holds 8-bit value. This is used to indicate where the next value
to be removed from the stack should be taken from. When a value is to be pushed on

16
to the stack, the 8052 first store the value of SP and then store the value at the
resulting memory location. When a value is to be popped from the stack, the 8052
returns the value from the memory location indicated by SP and then decrements the
value of SP.

d) Data pointer (Data pointer low/high, address 82/83h)

The SFRs DPL and DPH work together to represent a 16-bit value called the
data pointer. The data pointer is used in operations regarding external RAM and some
instructions code memory. It is a 16-bit SFR and also an addressable SFR.

e) Program counter

The program counter is a 16 bit register, which contains the 2 byte address,
which tells the next instruction to execute to be found in memory. When the 8052 is
initialized PC starts at 0000h and is incremented each time an instruction is executes.
It is not addressable SFR.

f) PCON (power control, 87h)

The power control SFR is used to control the 8052’s power control modes.
Certain operation modes of the 8052 allow the 8052 to go into a type of “sleep mode”
which consumes low power.

SMOD ---- --- ---- GF1 GF0 PD IDL

g)TCON(Timer control, 88h)

The timer mode control SFR is used to configure and modify the way in which
the 8052’s two timers operate. This SFR controls whether each of the two timers is
running or stopped and contains a flag to indicate that each timer has overflowed.
Additionally, some non-timer related bits are located in TCON SER. These bits are
used to configure the way in which the external interrupt flags are activated, which are
set when an external interrupt occur.
17
TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0

h)TMOD(Timer Mode,89h)

The timer mode SFR is used to configure the mode of operation of each of the
two timers. Using this SR your program may configure each timer to be a 16-bit
timer, or 13 bit timer, 8-bit auto reload timer, or two separate timers. Additionally you
may configure the timers to only count when an external pin is activated or to count
“events” that are indicated on an external pin.

‌ ‌
Gate C/ T M1 M0 Gate C/ T M1 M0

TIMER1 TIMER0

i) T0 (Timer 0 low/ high, address 8A/ 8C h)


These two SFRs together represent timer 0. Their exact behavior depends on
how the timer is configured in the TMOD SFR; however, these timers always count
up. What is configurable is how and when they increment value.

j) T1 (Timer 1 low/ high, address 8B/ 8D h)

18
These two SFRs together represent timer 1. Their exact behavior depends on
how the timer is configured in the TMOD SFR; however, these timers always count
up. What is configurable is how and when they increment in value.

k) P0 (Port 0, address 80h, bit addressable)

This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 0 is first written on P0 register. For
e.g., bit 0 of port 0 is pin P0.0, bit 7 is pin P0.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.

l) P1(Port 1, address 90h, bit addressable)

This is port 1 latch. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 1 is first written on P1 register. For
e.g., bit 0 of port 1 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.

m) P2 (Port 2, address 0A0h, bit addressable)

This is port 2 latch. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 2 is first written on P2 register. For
e.g., bit 0 of port 2 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.

n) P3 (Port 3, address 0B0h, bit addressable)

This is port 3 latch. Each bit of this SFR corresponds to one of the pins on a
micro controller. Any data to be outputted to port 3 is first written on P3 register. For
e.g., bit 0 of port 3 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of this
19
SFR will send a high level on the corresponding I/O pin whereas a value of 0 will
bring it to low level.

o) IE (Interrupt Enable, 0A8h)

The interrupt enable SFR is used to enable and disable specific interrupts. The
low 7 bits of the SFR are used to enable/disable the specific interrupts, where the
MSB bit is used to enable or disable all the interrupts. Thus, if the high bit of IE 0 all
interrupts are disabled regardless of whether an individual interrupt is enabled by
setting a lower bit.

___
EA ET2 ES ET1 EX1 ET0 EX0

p) IP (Interrupt Priority, 0B8h)

The interrupt priority SFR is used to specify the relative priority of each
interrupt. On 8052, an interrupt may be either low or high priority. An interrupt may
interrupt interrupts. For e.g., if we configure all interrupts as low priority other than
serial interrupt. The serial interrupt always interrupts the system; even if another
interrupt is currently executing no other interrupt will be able to interrupt the serial
interrupt routine since the serial interrupt routine has the highest priority.

___ ___
PT2 PS PT1 PX1 PT0 PX0

q)PSW (Program Status Word, 0D0h)

20
The Program Status Word is used to store a number of important bits that
are set and cleared by 8052 instructions. The PSW SFR contains the carry flag, the
auxiliary carry flag, the parity flag and the overflow flag. Additionally, it also
contains the register bank select flags, which are used to select, which of the “R”
register banks currently in use.

CY AC F0 RS1 RS0 OV ---- P

r) SBUF (Serial Buffer, 99h)

SBUF is used to hold data in serial communication. It is physically two


registers. One is writing only and is used to hold data to be transmitted out of 8052 via
TXD. The other is read only and holds received data from external sources via RXD.
Both mutually exclusive registers use address 99h.

21
CHAPTER-3
REGULATED POWER SUPPLY

3.1 Description:

A variable regulated power supply, also called a variable bench power


supply, is one where you can continuously adjust the output voltage to your
requirements. Varying the output of the power supply is the recommended way to test
a project after having double checked parts placement against circuit drawings and the
parts placement guide. This type of regulation is ideal for having a simple variable
bench power supply. Actually this is quite important because one of the first projects a
hobbyist should undertake is the construction of a variable regulated power supply.
While a dedicated supply is quite handy e.g. 5V or 12V, it's much handier to have a
variable supply on hand, especially for testing. Most digital logic circuits and
processors need a 5 volt power supply. To use these parts we need to build a regulated
5 volt source. A bridge rectifier D1 to D4 rectifies the ac from the transformer
secondary, which may also be a block rectifier such as WO4 or even four individual
diodes such as 1N4004 types. .
The principal advantage of a bridge rectifier is you do not need a centre tap on
the secondary of the transformer. A further but significant advantage is that the ripple
frequency at the output is twice the line frequency (i.e. 50 Hz or 60 Hz) and makes
filtering somewhat easier.
As a design example consider we wanted a small unregulated bench supply for
our projects. Here we will go for a voltage of about 12 - 13V at a maximum output
current (IL) of 500ma (0.5A). Maximum ripple will be 2.5% and load regulation is
5%.
Now the RMS secondary voltage (primary is whatever is consistent with your
area) for our power transformer T1 must be our desired output Vo PLUS the voltage
drops across D2 and D4 (2 * 0.7V) divided by 1.414.

22
This means that Vsec = [13V + 1.4V] / 1.414 which equals about 10.2V. Depending
on the VA rating of your transformer, the secondary voltage will vary considerably in
accordance with the applied load. The secondary voltage on a transformer advertised
as say 20VA will be much greater if the secondary is only lightly loaded.
If we accept the 2.5% ripple as adequate for our purposes then at 13V this
becomes 13 * 0.025 = 0.325 Vrms. The peak to peak value is 2.828 times this value.
Vrip = 0.325V X 2.828 = 0.92 V and this value is required to calculate the value of
C1. Also required for this calculation is the time interval for charging pulses. If you
are on a 60Hz system it it 1/ (2 * 60) = 0.008333 which is 8.33 milliseconds. For a
50Hz system it is 0.01 sec or 10 milliseconds.
Remember the tolerance of the type of capacitor used here is very loose. The
important thing to be aware of is the voltage rating should be at least 13V X 1.414 or
18.33. Here you would use at least the standard 25V or higher (absolutely not
16V).With our rectifier diodes or bridge they should have a PIV rating of 2.828 times
the Vsec or at least 29V. Don't search for this rating because it doesn't exist. Use the
next highest standard or even higher. The current rating should be at least twice the
load current maximum i.e. 2 X 0.5A or 1A. A good type to use would be 1N4004,
1N4006 or 1N4008 types.
These are rated 1 Amp at 400PIV, 600PIV and 1000PIV respectively. Always
be on the lookout for the higher voltage ones when they are on special.

23
Figure 3.1.1 Block Diagram of power supply

Figure 3.1.2 Circuit Diagram of power supply

3.2 Basic Power Supply Circuit:


Usually you start with an unregulated power supply ranging from 9 volts to 24
volts DC (A 12 volt power supply is included with the Beginner Kit and the
Microcontroller Beginner Kit.). To make a 5 volt power supply, we use a LM7805
voltage regulator IC .

24
Figure 3.2 IC Voltage Regulator

The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin,
connect the negative lead to the Common pin and then when you turn on the power,
you get a 5 volt supply from the Output pin.

Circuit Features:

Brief description of operation: Gives out well regulated +5V output, output
current capability of 100 mA

• Circuit protection: Built-in overheating protection shuts down output when regulator
IC gets too hot
• Circuit complexity: Very simple and easy to build
• Circuit performance: Very stable +5V output voltage, reliable operation
• Design testing: Based on datasheet example circuit, I have used this circuit
successfully as part of many electronics projects
• Applications: Part of electronics devices, small laboratory power supply
• Power supply voltage: Unregulated DC 8-18V power supply
• Power supply current: Needed output current + 5 mA
• Component costs: Few dollars for the electronics components + the input transformer
cost

25
CHAPTER-4
INFRARED SENSOR

4.1 INFRARED LIGHT EMITTING DIODE


TSAL 6200 is a high efficiency infrared light emitting diode in GaAlAs on
GaAs technology modeled in clear, blue-grey tinted plastic packages.
Transmitter should consume as little power as possible, and should be strong
as possible to achieve an acceptable control distance.
Many chips are designed to be as IR transmitters. Nowadays very low power
microcontrollers are used in IR transmitters for the simple reason that they are more
flexible in their use.
SPECIFICATIONS:
Material : GaAs(Gallium Arsenide)
Lens color : Tinted
Viewing Angle: 30˚
Operating voltage: 5V
FEATURES:
• Extra high radiant power and radiant intensity and high reliability
• Low forward voltage
• Suitable for high pulse current operation
• Peak wavelength = 940nm
• Good spectral matching to Si photo detectors

APPLICATIONS:
• IR remote control units with high power requirements
• Free air transmission systems
• Infrared source for optical counters and readers
• IR source for smoke detector
4.2 IR RECEIVER
Description

26
Many different receiver circuits exist in the market. The most important
selection criteria are the modulation frequency used and the availability in your
region.

Figure 4.1 IR Receiver (TSOP 1356)


The TSOP13XX- series are miniaturized receivers for infrared remote control
systems. PIN diode and preamplifier are assembled on lead frame, the epoxy package
is designed as IR filter. The demodulated output signal can directly be decoded by a
microprocessor. It is standard IR remote control receiver series, supporting all major
transmission codes.
4.2.1 Electrical and Optical Characteristics
(Tamb = 25 °C, unless otherwise specified)
Parameter Test condition Symbol Value Unit
Supply Voltage (Pin 2) (Vs) = (- 0.3 to +6.0V)
Supply Current (Pin 2) (Is) = 5 mA
Output Voltage (Pin 3) (Vo) = (- 0.3 to +6.0V)
Output Current (Pin 3) (Io) = 5 mA
Junction Temperature (Tj) = 100 °C
Storage Temperature Range (Tstg) = ( - 25 to + 85 °C)
Operating Temperature Range (Tamb) = ( - 25 to + 85 °C)
Power Consumption (Tamb ≤85 °C) (Ptot) = 50 mW
Transmission Distance Ev = 0, IF = 0.4 A d= 3.5 m

27
Figure 4.2 Block diagram of TSOP 1356
In the picture above you can see a typical block diagram of an IR receiver. The
received IR signal is picked up by the IR detection diode on the left side of the
diagram.
This signal is amplified and limited by the first two stages. The limiter acts as an AGC
circuits to get a constant pulse level, regardless of the distance to the hand set.

As you can see only the AC signal is sent to the Band Pass Filter. The B.P.F is
tuned to the modulation of the handset unit. Common frequencies range from 30 kHz
to 60 kHz in consumer electronics. The next stage is control circuit (detector,
integrator and comparator). The purpose of these three blocks is to detect the presence
of the modulation frequency. If the modulation frequency is present, the output of the
comparator will be pulled low.

All these blocks are integrated into a single electronic component. There are
many different manufactures of these components on the market. And most devices
are available in several versions each of which are tuned to a particular modulation
frequency.

The amplifier is set to a very high gain. Therefore the system tends to start
oscillating very easily. Placing a large capacitor of at least 22µF close to the
receiver’s power connections is mandatory to decouple of 330 Ω in series with the
power supply to further decouple the power supply from the rest of the circuit.

FEATURES:
• Phone detector and preamplifier in one package

28
• Internal filter for PCM frequency
• TTL and CMOS compatibility
• Output active is low
• High immunity against ambient light
• Continuous data transmission possible

4.3 555 TIMER


A 555 timer IC is most versatile and highly reliable linear IC. It is used for
generating accurate time delay or oscillations. SIGNETICS Corporation first
introduces the device SE\NE 555. This device is available as 8 pin metal can, 8 pin
mini DIP. The SE 555 is designed for the operating temperature range from -55˚C to
+125˚C while the NE 555 operates on a range from 0˚C to 70˚C. The NE 555 timer
operates on +5v to +18v power supply. It has adjustable duty cycle from micro
seconds to hours. It has highly current output. It can source or sink 200mA. It is
compatible with both TTL and CMOS logic circuits.

4.3.1 FUNCTIONAL BLOCK DIAGRAM OF 555 TIMER

The block diagram of 555 timer is shown in figure5.7 It consists of two


comparators resistive divider network flip-flop and a discharge transistor. The upper
comparator has a threshold input and a control input. The control voltage is 2/3 VCC.
Whenever the threshold voltage exceeds the control the high output from the
comparator will set the flip-flop. The collector of the discharge transistor is goes to
pin number 7. When this pin is connected to an external timing capacitor, high Q
output from the flip-flop will saturate the transistor and discharge the capacitor. When
Q is low transistor opens and the capacitor will charge.

The complementary signal of the flip-flop is taken as output of the 555 (pin no
3). The reset pin prevents the flip-flop from working. Hence in most applications reset
pin is connected to supply voltage.

29
The lower comparator is connected trigger input and a fixed voltage 1/3 VCC.
When the trigger voltage is slightly less than 1/3 VCC the comparator output goes
high and reset the flip-flop. Pin no1 is known as ground the supply pin 8.

Figure 4.3.1 Block Diagram of 555 Timer

Figure 4.3.2 Pin Diagram of 555 Timer

4.3.2 PIN DIAGRAM DESCRIPTION

• Ground (Pin 1)

30
This pin is connected directly to ground.

• Trigger (Pin 2)

This pin is the input to the lower comparator and is used to set the latch, which
in turn causes the output to go high.

• Output (Pin 3)

Output high is about 1.7V less than supply. Output high is capable of Isource
up to 200mA while output low is capable of Isink up to 200mA.

• Reset (Pin 4)

This is used to reset the latch and return the output to a low state. The reset is
an overriding function. When not used, connect to V+.

• Control (Pin 5)

Allows access to the 2/3V+ voltage divider point when the 555 timer is used in
voltage control mode. When not used connect to ground through a 0.01 µF capacitor.

• Threshold (Pin 6)

This is an input to the upper comparator.

• Discharge (Pin 7)

This is the open collector to T1.

• Vcc (Pin 8)

This connects to supply. It operates at 3V - 16V DC

4.3.3 ASTABLE MULTIVIBRATOR USING 555 TIMER


The 555 timer is connected is astable mode is shown in figure . The astable
multivibrator has two quasi stable states. Initially when the output is high i.e. Q is low
Q' is high, the capacitor C starts charging towards VCC through R1 and R2 with time
constant (R1+R2)C. However as soon as voltage across the capacitor equals to 2/3
VCC, comparator1 triggers the flip-flop and the output switches to low i.e. Q is high
and Q' is low. Because of this transistor acts as short circuit which results the
capacitor starts discharging through R2 and discharge transistor Q1. When the voltage

31
across equals 1/3Vcc comparator2 output resets the flip-flop and output goes high,
again the above cycle repeats.

The time during which the capacitor charges from 1/3Vcc to 2/3Vcc is equal
to the time the output is high and is given by
TC = 0.69 (RA+RB)C
Similarly, the time period during the capacitor discharges from 2/3Vcc to
1/3Vcc is equal to the time output is low and is given by
Td = 0.69RB*C
Thus the total time period is given by
T = TC +Td = 0.69(RA+2RB)C
Thus the astable multivibrator generates the asymmetric square wave with
frequency of oscillations and is given by
f = 1/T = 1.49/(RA+2RB)C
And the duty cycle is given by
D = (RA+RB)/(R1+2RB)

32
Figure 4.3.3 555 Timer in Astable operation

By varying any resistor and capacitor values, time period, frequency and duty
cycle adjusted to any desired value.

General considerations with using a 555 timer:

Most devices will operate down to as low as 3V DC supply voltage. However


correct supply filtering and bypassing is critical, a capacitor between .01 µF to 10 µF
(depending upon the application) should be placed as close as possible to the 555
timer supply pin. Owing to internal design considerations the 555 timer can generate
large current spikes on the supply line. While the 555 timer will operate up to about 1
MHz it is generally recommended it not be used beyond 500 KHz owing to
temperature stability considerations. Owing to low leakage capacitor considerations
limit, maximum timing periods to no more than 30 minutes.

FEATURES:
• High current drive capability
• Adjustable duty cycle
• Timing from microseconds to hours
• Turn off time less than 2 microseconds

33
CHAPTER-5
PIR SENSOR

More advanced security systems include passive infrared (PIR) motion


detectors. The "motion sensing" feature on most lights (and security systems) is a
passive system that detects infrared energy. These sensors are therefore known as PIR
(passive infrared) detectors or pyro electric sensors.

The PIR Sensor detects motion up to 20 feet away by using a Fresnel lens and
infrared-sensitive element to detect changing patterns of passive infrared emitted by
objects in its vicinity. Inexpensive and easy to use, it's ideal for alarm systems,
motion-activated lighting and robotics applications.

All objects emit 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. The term passive in this instance means that the PIR device does not emit
an infrared beam but merely passively accepts incoming infrared radiation .
The devices themselves are simple electronic components not unlike a photo
sensor. You have probably noticed that your light is sensitive to motion, but not to a
person who is standing still. That's because the electronics package attached to the
sensor is looking for a fairly rapid change in the amount of infrared energy it is
seeing. When a person walks by, the amount of infrared energy in the field of view
changes rapidly and is easily detected. You do not want the sensor detecting slower
changes, like the sidewalk cooling off at night.

Design:

34
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 (CsNO3),
polyvinyl fluorides, derivatives of phenylpyrazine, and cobalt phthalocyanine.
Lithium tantalate (LiTaO3) is a crystal exhibiting both piezoelectric and pyroelectric
properties.

Figure 5.1 PIR SENSOR

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 sensors cannot measure temperature in that
configuration and therefore this configuration is specialized for motion detectors

Features:

35
• Detection range up to 20ft
• Single bit output
• Small size makes it easy to conceal
• Compatible with many microcontrollers
• Low current draw, less than 100µA

Application Ideas:

• Alarm Systems
• Halloween Props
• Motion-activated lighting

Key Specifications:

• Power requirements: 3.3 to 5 VDC


• Communication: Binary output
• Dimensions: 0.96 x 1.27 in (24.3 x 32.2 mm)
• Operating temp range: +32 to +158 °F (0 to +70 °C)

36
CHAPTER-6
SMOKE SENSOR

There are two main types of smoke detectors: ionization detectors and photoelectric
detectors. A smoke alarm uses one or both methods, sometimes plus a heat detector,
to warn of a fire. The devices may be powered by a 9-volt battery, lithium battery, or
120-volt house wiring.

Figure 6.1 Smoke sensor

Ionization Detectors
Ionization detectors have an ionization chamber and a source of ionizing radiation.
The source of ionizing radiation is a minute quantity of americium-241 (perhaps
1/5000th of a gram), which is a source of alpha particles (helium nuclei). The
ionization chamber consists of two plates separated by about a centimeter. The battery
applies a voltage to the plates, charging one plate positive and the other plate
negative. Alpha particles constantly released by the americium knock electrons off of
the atoms in the air, ionizing the oxygen and nitrogen atoms in the chamber. The
positively-charged oxygen and nitrogen atoms are attracted to the negative plate and

37
the electrons are attracted to the positive plate, generating a small, continuous electric
current. When smoke enters the ionization chamber, the smoke particles attach to the
ions and neutralize them, so they do not reach the plate. The drop in current between
the plates triggers the alarm.

Which Method is Better?


Both ionization and photoelectric detectors are effective smoke sensors. Both types of
smoke detectors must pass the same test to be certified as UL smoke detectors.
Ionization detectors respond more quickly to flaming fires with smaller combustion
particles; photoelectric detectors respond more quickly to smoldering fires. In either
type of detector, steam or high humidity can lead to condensation on the circuit board
and sensor, causing the alarm to sound. Ionization detectors are less expensive than
photoelectric detectors, but some users purposely disable them because they are more
likely to sound an alarm from normal cooking due to their sensitivity to minute smoke
particles. However, ionization detectors have a degree of built-in security not inherent
to photoelectric detectors. When the battery starts to fail in an ionization detector, the
ion current falls and the alarm sounds, warning that it is time to change the battery
before the detector becomes ineffective. Back-up batteries may be used for
photoelectric detectors.

FEATURES
• High sensitivity to LPG, natural gas , town gas
• Small sensitivity to alcohol, smoke.
• Fast response.
• Stable and long life
• Simple drive circuit

APPLICATION
They are used in gas leakage detecting equipments in family and industry, are
suitable for detecting of LPG, natural gas, town gas, avoid the noise of alcohol and
cooking fumes and cigarette smoke.

38
SPECIFICATIONS

A. Standard work condition


Symbol Parameter name Technical condition Remarks
Vc Circuit voltage 5V±0.1 AC OR DC
VH Heating voltage 5V±0.1 ACOR DC

PL Load resistance 20KΩ


RH Heater resistance 31±10% Room Temperature
PH Heating less than 800mw
consumption

Table 6.1 Standard work condition

B. Environment condition
Symbol Parameter name Technical condition Remarks
Tao Using Temperature -10℃-50℃
Tas Storage Temperature -20℃-70℃
RH Related humidity less than 95%Rh
O2 Oxygen 21%(standard minimum value is
concentration condition)Oxygen over 2%
concentration can
affect sensitivity

Table 6.2 Environment condition

39
CHAPTER-7
LCD
7.1 Description

To send any of the commands from given table to the LCD, make pin RS
=0.For data, make RS=1.then send a high to low pulse to the E pin to enable the
internal latch of the LCD. As shown in figure for LCD connections.

Figure 7.1 LCD Interfacing with 89S52

7.2 Pin Connection

Pin number Symbol Level I/O Function


1 DB7 0/1 I/O Data bus line 7 (MSB)
2 DB6 0/1 I/O Data bus line 6
3 DB5 0/1 I/O Data bus line 5
4 DB4 0/1 I/O Data bus line 4
5 DB3 0/1 I/O Data bus line 3
6 DB2 0/1 I/O Data bus line 2
7 DB1 0/1 I/O Data bus line 1
8 DB0 0/1 I/O Data bus line 0 (LSB)

40
Pin number Symbol Level I/O Function
Enable signal row 0 & 1
9 E1 1, 1->0 I
(1stcontroller)
0=Write to LCD module
10 R/W 0/1 I
1 = Read from LCD module
0= Instruction input
11 RS 0/1 I
1 = Data input
12 Vee - - Contrast adjust
13 Vss - - Power supply (GND)
14 Vcc - - Power supply (+5V)
Enable signal row 2 & 3
15 E2 1, 1->0 I
(2ndcontroller)
16 n.c.

Table 7.1 Pin description of LCD display

CHAPTER-8
FLOWCHART
START

INTIALIZATION OF LCD
DISPLAY DISPLAY
DISPLAY
IF 41 “SOMEBODY
“SMOKE
IF
IF
SMOKE==
PIR==1 AT DOOR”
DETECTED”
IR==1
1
DISPLAY “WELCOME” ON LCD DISPLAY ON
ONLCD
LCD
BUZZER=0
BUZZER=0 DISPLAY
DISPLAY
END
BUZZER=1
IR RECEIVER=0
PIR SENSOR=0
SMOKE=0

DISPLAY “ADVANCE-SECURITY” ON LCD


DISPLAY

DISPLAY
“MAIN DOOR
OPENED” ON
LCD
DISPLAY

CODE:
#include<reg51.h>
sfr ldata=0x90;//port 1
sbit rs=P2^5;
42
sbit rw=P2^6;
sbit en=P2^7;
sbit IR=P2^0;
sbit PIR=P2^1;
sbit SMOKE=P2^2;
sbit buzzer =P0^7;
lcdcmd(unsigned char);
lcddelay(unsigned int);
lcddata1();
lcddata2();
lcddata3();
main()
{
device=0;
sound=0;
lcdcmd(0x38);
lcdcmd(0x0E);
lcdcmd(0x01);
lcdcmd(0x80);
lcddata1();

while(1)
{
if(IR==0)
{
lcddata2();
buzzer=1; }

if(PIR==1)
{
lcddata3();
buzzer=1;
}
43
if(SMOKE==1)
{
lcddata4();
buzzer=1;
}

else

else
{
device=0;

lcddata3();

} } }
lcddelay(unsigned int k)
{
int i,j;
for (i=0;i<=k;i++)
for (j=0;j<=1275;j++);
}

lcdcmd(unsigned char value)


{
ldata=value;
rs=0;
rw=0;
en=1;
lcddelay(1);
en=0;
return; }
44
lcddata1()
{
unsigned char s;
unsigned char temp[16]="ADVANCE- HOME SECURITY";

for(s=0;s<16;s++)
{
ldata=temp[s];
rs=1;
rw=0;
en=1;
lcddelay(1);
en=0;
} }

lcddata2()
{
unsigned char s;
unsigned char temp[16]="MAIN DOOR OPENED";

for(s=0;s<16;s++)
{
ldata=temp[s];
rs=1;
rw=0;
en=1;
lcddelay(1);
en=0;
}}

lcddata3()
{
unsigned char s;
45
unsigned char temp[16]="SOMEBODY AT DOOR ";

for(s=0;s<16;s++)
{
ldata=temp[s];
rs=1;
rw=0;
en=1;
lcddelay(1);
en=0;
}
}

lcddata4()
{
unsigned char s;
unsigned char temp[16]="SMOKE DETECTED";

for(s=0;s<16;s++)
{
ldata=temp[s];
rs=1;
rw=0;
en=1;
lcddelay(1);
en=0;
}}
lcddata5()
{
unsigned char s;
unsigned char temp[16]="WEL COME";

for(s=0;s<16;s++)
{
46
ldata=temp[s];
rs=1;
rw=0;
en=1;
lcddelay(1);
en=0;
}}

CHAPTER-9
9.1 CONCLUSION
In this project work “HOME SECURITY SYSTEM” results are found
satisfactorily. The developed system is very much useful in domestic as well as in
industries
47
9.2 FUTURE SCOPE

This system is a rapidly growing field and there are new and improved
strategies popping up all the time. For the most part these systems are all built around
the same basic structure, a central box that monitors several detectors and perimeter
guards and sounds an alarm when any of them are triggered.
This system is best for guiding the perimeter of a house or a business
center the points where an intruder would enter the building. In this system IR sensor
is used to detect the intrusion. Similarly the vibration and temperature sensors
recognize vibration disturbances and accidental fires respectively.
This project provides an efficient and economical security system. This
system finds applications in industries, banks and homes.
Incorporating the features discussed below can further enhance the system
• This system can detect intrusion only at discrete points. This system
detection feature can be extended to scanning a complete area. Thus the intrusion into
the building can be detected with much more efficiently.
• The redialing feature can also be incorporated such that if the call is not put
forward the first time, the auto dialer will dial the same number until the call is
successfully completed.
• A pre-recorded voice message can delivered to the owner notifying him
about the intrusion into the premises.
• The addition of the above discussed advancements certainly builds this
project into a much flexible and reliable security system.

REFERENCES
[1] Muhammad Ali Mazidi -The 8051 Microcontroller and Embedded Systems 2nd
edition, PEARSON EDUCATION, 2008
[2] Daniel W Lewis Fundamentals Of Embedded Software
[3] www.howsstuffworks.com

48
[4] www.alldatasheets.com
[5] www.electronicsforu.com
[6] www.knowledgebase.com
[7] www.8051 projectsinfo.com
[8] Datasheets of Microcontroller AT89C52
[9] Datasheets of 555 timer

49

Vous aimerez peut-être aussi