Académique Documents
Professionnel Documents
Culture Documents
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
LCD
BUZZER DISPLAY
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.
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
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.
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.
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.
• 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
• XTAL1
Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
• XTAL2
• 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
Special function registers are the areas of memory that control specific
functionality of the 89c52 microcontroller.
a) Accumulator (0E0h)
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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
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
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.
21
CHAPTER-3
REGULATED POWER SUPPLY
3.1 Description:
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
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
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.
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
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.
• 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)
• Discharge (Pin 7)
• Vcc (Pin 8)
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.
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
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.
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:
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.
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.
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
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
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.
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.
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
“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++);
}
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