anshu documentation

Upload: nithinjohnjacob

Post on 05-Apr-2018

240 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Anshu Documentation

    1/52

    1

    .

    EMBEDDED BASED SECURITY SYSTEM USING IR

    SENSORS

    A

    Dissertation

    Submitted in the Partial Fulfillment of the

    Academic Requirements

    for the Award of the Degree of

    BACHELOR OF TECHNOLOGY

    IN

    ELECTRONICS AND COMMUNICATION ENGINEERING

    By

    C.ANSHUKA : 08RH1A0405

    G.DIVYA : 08RH1A0417

    P.SANDHAYA : 08RH1A0453

    Under the Esteemed guidance of

    MRS.H.SHANTHIASST.PROFESSOR

    Department of Electronics and Communication Engineering

    MALLA REDDY ENGINEERING COLLEGE FOR WOMEN

    MAISAMMAGUDA, DHULAPALLY, SECUNDERABAD

    (Approved by AICTE, Affiliated to JNTUH )

    2011-12

  • 8/2/2019 Anshu Documentation

    2/52

    2

    A MINI PROJECT REPORT

    ON

    EMBEDDED BASED SECURITY SYSTEM USING IR

    SENSORS

    A

    Dissertation

    Submitted in the Partial Fulfillment of the

    Academic Requirements

    for the Award of the Degree of

    BACHELOR OF TECHNOLOGYIN

    ELECTRONICS AND COMMUNICATION ENGINEERING

    By

    C.ANSHUKA :08RH1A0405

    G.DIVYA :08RH1A0417P.SANDHAYA :08RH1A0453

    Under the Esteemed guidance of

    MRS.H.SHANTHIASST.PROFESSOR

    Department of Electronics and Communication Engineering

    MALLA REDDY ENGINEERING COLLEGE FOR WOMEN

    MAISAMMAGUDA, DHULAPALLY, SECUNDERABAD

    (Approved by AICTE, Affiliated to JNTUH )

    2011-12

  • 8/2/2019 Anshu Documentation

    3/52

    3

    MALLA REDDY ENGINEERING COLLEGE FOR

    WOMEN(SPONSERED BY MALLA REDDY EDUCATIONAL SOCIETY)

    Affiliated to JNTU, Hyderabad

    Maisammaguda, Dhulapally (post via Hakimpet),

    Secunderabad-500014

    CertificateThis is to certify that this is the bonafide record of the Mini project titled Embedded based

    security system using IR sensors submitted by

    C.ANSHUKA - 08RH1A0405G.DIVYA - 08RH1A0417P. SANDHYA - 08RH1A0453

    Of final year B.tech, in the partial fulfillment of the requirements for the degree of

    Bachelor of Technology in Electronics and Communication Engineering during the year

    2011-2012. The results embodied in this Mini project report have not been submitted to

    any other university or institute for the award of any degree or diploma.

    INTERNAL GUIDE HEAD OF DEPARTMENT

    Mrs. H.Shanthi B.Chinranjeevi

    EXTERNAL EXAMINER

  • 8/2/2019 Anshu Documentation

    4/52

    4

  • 8/2/2019 Anshu Documentation

    5/52

    5

    ACKNOWLEDGEMENT

    We feel ourselves honoured and privileged to place our warm salutation to our college

    Malla Reddy Engineering College for Women and department of Electronics and

    Communication Engineering which gave us the opportunity to have expertise in

    engineering and profound technical knowledge.

    We would like to convey thanks to our internal project guide Mrs.H.SHANTI for

    his/her regular guidance and constant encouragement and we are extremely grateful to

    him/her for his/her valuable suggestions and unflinching co-operation throughout project

    work.

    We would also like to thank our Project co-coordinators Mrs.N.NEERAJA for their

    kind encouragement and overall guidance in viewing this program a good asset. With

    profound gratitude,

    we express our heartiest thanks to Mr.B.CHIRANJEEVI , Head of the Department ,ECE

    for encouraging us in every aspect of our project.

    We wish to convey gratitude to our Principal Dr.Y.Madhavee Latha, for providing

    us with the environment and means to enrich our skills and motivating us in our endeavor and

    helping us realize our full potential.

    With regards and gratitude

    C.ANSHUKA

    G.DIVYA

    P.SANDHYA

  • 8/2/2019 Anshu Documentation

    6/52

    6

    DECLARATION

    We hereby declare that the project entitled SECURITY SYSTEM USING IR SENSORS

    submitted to Malla Reddy Engineering College for Women, affiliated to Jawaharlal

    Nehru Technological University, Hyderabad for the award of the Degree of Bachelor of

    Technology in Electronics and Communication is a result of original research work done

    by us.

    It is further declared that the project report or any part thereof has not been previously

    submitted to any University or Institute for the award of degree or diploma.

    C.ANSHUKA(08RH1A0405)

    G.DIVYA(08RH1A0417)

    P.SANDHYA(08RH1A0453)

  • 8/2/2019 Anshu Documentation

    7/52

    7

    ABSTRACT

    In our daily life security one of the main concerned is when any one enters in

    the restricted area the security systems automatically alarms. This can be implemented in

    houses, offices, museums , we can achieve the project through IR transmitter and IR receiver.

    The signal is transmitted from IR transmitter and this signal drives receiver circuit when any

    obstacle occur in between IR transmitter and receiver then it signals the microcontroller and

    the alarm automatically buzzers controlling these are all the things can controlled through

    software written in 89S52 controller.

    Generation of the IR rays is done using 555 timer and IR led. In this

    construct the 555 timers is in a stable mode at output which is connected at the IR led. From

    this circuit we can get the IR rays continuously. These IR rays can detect from TSOP 1738

    receiver.

    We are using 89S52 microcontroller one of the powerful micro-controller for

    commercial purpose. We are using the one of the powerful tool to developing the software

    for this project.

    HARDWARE COMPONENTS:

    1. 89S52 MICROCONTROLLER.

    2. IR RECEIVERS (TSOP 1356/1738).

    3. IR TRANSMITTERS.

    4. 555 TIMER.

    5. BUZZER

  • 8/2/2019 Anshu Documentation

    8/52

  • 8/2/2019 Anshu Documentation

    9/52

    9

    CHAPTER 3 BUZZER AND LCD INTERFACING WITH CIRCUITRY 22

    3.1) TRASNISTOR DRIVER 22

    3.1.1) FEATURES 22

    3.1.2) DESCRIPTION 22

    3.1.3) LIMITING VALUES 23

    3.2) LIQUID CRYSTAL DISPLAY 24

    3.2.1) LCD CONNECTION 25

    3.2.2) LCD INITIALISATION 25

    3.3) LIGHT EMITTING DIODE(LED) 26

    3.3.1) PHYSICAL FUNCTION OF LED 26

    3.4) ULN 2003 DRIVER 27

    3.4.1) FEATURES 28

    3.5) IR SENSORS 28

    3.5.1) FEATURES 29

    3.6) BUZZER 29

    3.7) 555 TIMER 30

    CHAPTER 4 IMPLEMENTAION 31

    4.1) ALGORITHM 32

    4.2) FLOW CHART 33

    4.3) CIRCUIT DIAGRAM 34

    4.4) SOFTWARE DEVELOPMENT 35

    4.4.1) INTRODUCTION 35

    4.4. 2) TOOLS USED 35

    4.4.3) WORKING WITH Keil 36

    4.5) WORKING PROCEDURE 43

    4.6) PROGRAM 45

    CHAPTER 5 RESULT 48CHAPTER 6 CONCLUSION 49

    BIBLIOGRAPHY 50

    APPENDIX 51

  • 8/2/2019 Anshu Documentation

    10/52

    10

    LIST OF FIGURES

    Page Nos

    1. Fig2.1 BLOCK DIAGRAM 14

    2. Fig2.2 PIN DIAGRAM 17

    3. Fig2.3 OSCILLATOR AND TIMING CIRCUIT 18

    4. Fig2.4 BLOCK DIAGRAM OF POWER SUPPLY 20

    5. Fig3.1 SIMPLIFIED OUTLINE(T0-92)SYMBOL 22

    6. Fig3.2 CONNECT OF MICROCONTROLLER WITH BUZZER 23

    7. Fig3.6 LCD SYMBOL 248. Fig3.7 LED SYMBOL 26

    9. Fig3.8 ULN PIN CONNECTION 27

    10. Fig3.9 ULN BLOCK DIAGRAM 27

    11.Fig3.10 IR SENSOR 28

    12.Fig3.11 PIEZO ELECTRIC BUZZER CIRCUIT 29

    13.Fig3.12 TYPES OF BUZZER 29

    14.Fig3.13 555 TIMER 30

    15.Fig4.1 FLOW CHART 33

    16.Fig4 CIRCUIT DIAGRAM 34

    17.Fig5 KEIL SOFTWARE INTERNAL STAGES 35

    LIST OF ABBREVATIONS

    1. LEDLight Emitting Diode

    2. ULNUpper Level Negligible

    3. RAMRandom Access Memory

    4. ROMRead Only Memory

    5. I/OInput Output

    6. UARTUniversal Asynchronous Receiver and Transmitter

  • 8/2/2019 Anshu Documentation

    11/52

    11

    CHAPTER-1

    INTRODUCTION1.1OVERVIEW:

    The project mainly deals with the embedded based security system using ir sensors. The

    system is designed with the help of microcontroller which is the heart of the project and

    is interfaced to the liquid crystal display (LCD) which displays the result instantenously.

    we can achieve the project through IR transmitter and IR receiver. When any obstacle

    occur in between IR transmitter and IR receiver then the signal is transmitted from IR

    transmitter and this signal drives receiver circuit it signals the microcontroller and the

    alarm automatically buzzers , these are all the things can controlled through software

    written in 89C52 controller. A simple program is written and dumped in the micro

    controller to accept the interrupts and identify the object inorder to provide security .

    These IR rays can detect from TSOP 1738 receiver.

    These all can be implemented by using keil software used in embedded C.All the

    components are connected by using hardware components such as 89s52

    microcontroller,555 timer ,IR transmitter and receiver and buzzer these all are combined

    to form the security system.

    1.2STATEMENT OF THE PROBLEM:

    Nowadays, security system becomes the best solution to overcome House

    Intrusion problem when user is not in house. As we know, there are many

    types of security system which is too expensive and difficult to use. For

    that reason, an effective security system at low cost is built where user can

    also program the security system by their own. This project is focusing on

    developing a IR senors security system with an infrared detector which is

    controlled by Microcontroller89s52.

  • 8/2/2019 Anshu Documentation

    12/52

    12

    1.3 OBJECTIVE OF THE STUDY:

    The objective of this project is to build a security system using microcontroller AT89S52

    based on infrared detection.This can be implemented in museums,offices,large buildings .

    The main objective is to provide the security in the restricted area , this can be implemented

    by using security systemthat is when some one enters into the restricted area the

    management will cometo know about the person is entering so this can be possible by

    ringing a sound through alaram and so that the security can be alert. This can be achieved

    through the microcontroller using AT89S5.

    1.4 LITERATURE REVIEW:

    IR sensors are mainly used in security systems [4]. It is typically positioned near exterior

    doorways or windows of a building to monitor the area around it. Since sensors are so

    flexible and have so many uses, it offers feelings of protection and security for the average

    homeowner as well as commercial organizations [4].

    An electronic IR sensors is a device used to detect any physical movement in a given areaand transforms motion into an electric signal. It consist of sensor that electrically connected

    to other devices such as security system, lighting, audio alarms, and other applications. IR

    sensors are used in a wide variety of applications and as a result, many different types of

    infrared sensors are available including the motion sensor.

    Infrared sensors are widely known in the arts of intrusion detection and in fire or smoke

    detection. It is a device that often used in automatic light switches and security systems

    to turn on a light or to activate some other form of alarm or warning indicator when

    person enters a monitored area [4]. The infrared sensors have basically two forms: active

    and passive. [4]

  • 8/2/2019 Anshu Documentation

    13/52

    13

    1.5 ORGANISATION OF THESIS:

    Chapter 1 explains the background of security system , the project objective,

    the project scope, and the literature review of ir sensors for security system. The concepts ofir detector are the major element as a guide for the development of the security system.

    Chapter 2 explains the systems contain microcontroller its introduction and features and the

    necessity of the microcontroller.A brief explanation of pin diagram and oscillator and

    clock.differnt types of memories such as code memory and internal RAM . The power supply

    involves transformer,rectifier,smoothing,regulator..

    Chapter 3 explains briefly about the components used such as buzzer and lcd interfacing

    circuit,its features .led .lcd,ir sensor,buzzer,555timer.

    Chapter 4 represents the algorithm, and flow chart and schematic diagram. And also

    discusses about the software used and the program which is written in the microcontroller

    and also explains about the working procedure and the code used in the microcontroller.

    Chapter5 discusses about the result and represent the kit.Chapter6 represents the applications and advantages of the project and at last concludes with

    conclusion and the future scope of the system and bibliography.

  • 8/2/2019 Anshu Documentation

    14/52

    14

    CHAPTER-2

    DESCRIPTION OF HARDWARE COMPONENTS

    2.1 BLOCK DIAGRAM:

    .

    2.2 INTRODUCTION TO AT89S52

    The system requirements and control specifications clearly rule out the use of 16, 32 or

    64 bit micro controllers or microprocessors. Systems using these may be earlier to implement

    due to large number of internal features. They are also faster and more reliable but, the above

    application is satisfactorily served by 8-bit micro controller. Using an inexpensive 8-bit

    Microcontroller will doom the 32-bit product failure in any competitive market place.

    Coming to the question of why to use 89S52 of all the 8-bit Microcontroller available in the

    market the main answer would be because it has 8kB Flash and 256 bytes of data RAM32 I/O

    lines, three 16-bit timer/counters, a Eight-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 Flash programmemory supports both parallel programming and in Serial In-System Programming (ISP).

    IR

    TRANSMITTTERAT89C52

    IR RECIEVER

    ULN

    2803

    ALARAM

  • 8/2/2019 Anshu Documentation

    15/52

    15

    The 89S52 is also In-Application Programmable (IAP), allowing the Flash program memory

    to be reconfigured even while the application is running.

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

    AT89S52 is a powerful microcomputer which provides a highly flexible and cost effective

    solution to many embedded control applications.

    2.3 FEATURES

    Compatible with MCS-51 Products

    8K Bytes of In-System Programmable (ISP) Flash Memory

    Endurance: 1000 Write/Erase Cycles

    4.0V to 5.5V Operating Range

    Fully Static Operation: 0 Hz to 33 MHz

    Three-level Program Memory Lock

    256 x 8-bit Internal RAM

    32 Programmable I/O Lines

    Three 16-bit Timer/Counters

    Eight Interrupt Sources

    Full Duplex UART Serial Channel

    Low-power Idle and Power-down Modes

    Interrupt Recovery from Power-down Mode

    Watchdog Timer

    Dual Data Pointer

    -Power-off Flag

    2.4NECESSITY OF MICROCONTROLLERS:

    Microprocessors brought the concept of programmable devices and made many

    applications of intelligent equipment. Most applications, which do not need large amount of

    data and program memory, tended to be costly.

    The microprocessor system had to satisfy the data and program requirements so,

    sufficient RAM and ROM are used to satisfy most applications .The peripheral control

    equipment also had to be satisfied. Therefore, almost all-peripheral chips were used in the

    design. Because of these additional peripherals cost will be comparatively high.

  • 8/2/2019 Anshu Documentation

    16/52

    16

    An example:

    8085 chip needs:

    An Address latch for separating address from multiplex address and data.32-KB RAM

    and 32-KB ROM to be able to satisfy most applications. As also Timer / Counter, Parallel

    programmable port, Serial port, and Interrupt controller are needed for its efficient

    applications.

    In comparison a typical Micro controller 8051 chip has all that the 8051 board has

    except a reduced memory as follows.

    4K bytes of ROM as compared to 32-KB, 128 Bytes of RAM as compared to 32-KB.

    Bulky:

    On comparing a board full of chips (Microprocessors) with one chip with all

    components in it (Microcontroller).

    Debugging:

    Lots of Microprocessor circuitry and program to debug. In Micro controller there is

    no Microprocessor circuitry to debug.

    Slower Development time: As we have observed Microprocessors need a lot of debugging at

    board level and at program level, where as, Micro controller do not have the excessive

    circuitry and the built-in peripheral chips are easier to program for operation.

    So peripheral devices like Timer/Counter, Parallel programmable port, Serial

    Communication Port, Interrupt controller and so on, which were most often used were

    integrated with the Microprocessor to present the Micro controller .RAM and ROM also were

    integrated in the same chip. The ROM size was anything from 256 bytes to 32Kb or more.

    RAM was optimized to minimum of 64 bytes to 256 bytes or more.

    Microprocessor has following instructions to perform:

    1. Reading instructions or data from program memory ROM.

    2. Interpreting the instruction and executing it.

    3. Microprocessor Program is a collection of instructions stored in a Nonvolatile memory.

    4. Read Data from I/O device

    5. Process the input read, as per the instructions read in program memory.

    6. Read or write data to Data memory.7. Write data to I/O device and output the result of processing to O/P device.

  • 8/2/2019 Anshu Documentation

    17/52

    17

    2.5 PIN DIAGRAM

    FIG-2 PIN DIAGRAM OF 89S52 IC

  • 8/2/2019 Anshu Documentation

    18/52

    18

    2.6 PIN DESCRIPTION

    Pin Description

    VCC: Supply voltage.

    GND: Ground.

    Port 0

    Port 0 is an 8-bit open drain bi-directional I/O port. When 1s are written to port 0 pins, the pins

    can be used as high- impedance inputs. Port 0 can also be configured to be the multiplexed low-

    order address/data bus during accesses to external pro-gram and data memory.

    Port2

    Port2isan8-bitbi-directionalI/Oportwithinternalpullups. The. When1sarewrittentoPort2pins,theyarepulledhighby theinternalpullupsand canbeusedasinputs.

    RST

    Resetinput.Ahighonthispinfortwomachinecycleswhile theoscillatorisrunningresetsthe

    device.

    The 8052 Oscillator and Clock:

    The heart of the 8051 circuitry that generates the clock pulses by which all the

    internal all internal operations are synchronized. Pins XTAL1 And XTAL2 is provided for

    connecting a resonant network to form an oscillator. Typically a quartz crystal and capacitors

    are employed. The crystal frequency is the basic internal clock frequency of the

    microcontroller. The manufacturers make 8051 designs that run at specific minimum and

    maximum frequencies typically 1 to 16 MHz.

  • 8/2/2019 Anshu Documentation

    19/52

    19

    Fig-4 Oscillator and timing circuit

    2.7 MEMORIES

    The 8052 have three general types of memory. They are on-chip memory, external

    Code memory and external Ram. On-Chip memory refers to physically existing memory on

    the micro controller itself. External code memory is the code memory that resides off chip.

    This is often in the form of an external EPROM. External RAM is the Ram that resides off

    chip. This often is in the form of standard static RAM or flash RAM.

    a) CODE MEMORY

    Code memory is the memory that holds the actual 8052 programs that is to be run.

    This memory is limited to 64K. Code memory may be found on-chip or off-chip. It is

    possible to have 8K of code memory on-chip and 60K off chip memory simultaneously. If

    only off-chip memory is available then there can be 64K of off chip ROM. This is controlled

    by pin provided as EA

  • 8/2/2019 Anshu Documentation

    20/52

    20

    b) INTERNAL RAM

    The 8052 have a bank of 256 bytes of internal RAM. The internal RAM is found on-

    chip. So it is the fastest Ram available. And also it is most flexible in terms of reading and

    writing. Internal Ram is volatile, so when 8051 is reset, this memory is cleared. 256 bytes of

    internal memory are subdivided. The first 32 bytes are divided into 4 register banks. Each

    bank contains 8 registers. Internal RAM also contains 256 bits, which are addressed from 20h

    to 2Fh. These bits are bit addressed i.e. each individual bit of a byte can be addressed by the

    user. They are numbered 00h to FFh. The user may make use of these variables with

    commands such as SETB and CLR.

    2.8 POWER SUPPLY

    There are many types of power supply. Most are designed to convert high voltage

    AC mains electricity to a suitable low voltage supply for electronics circuits and other

    devices. A power supply can by broken down into a series of blocks, each of which performs

    a particular function. For example a 5V regulated supply can be shown as below

    Fig 2.1: Block Diagram of a Regulated Power Supply System

    Similarly, 12v regulated supply can also be produced by suitable selection of

    the individual elements.There are different components used such as

  • 8/2/2019 Anshu Documentation

    21/52

    21

    2.8.1Transformer:

    A transformer steps down high voltage AC mains to low voltage AC. Here we

    are using a center-tap transformer whose output will be sinusoidal with 36volts peak

    to peak value

    2.8.2 Rectifier:

    A rectifier converts AC to DC, but the DC output is varying. There are several

    types of rectifiers; here we use a bridge rectifier.

    2.8.3 Smoothing:

    The smoothing block smoothes the DC from varying greatly to asmall ripple and the ripple voltage is defined as the deviation of the load voltage from

    its DC value.

    2.8.4 Regulator:

    Regulator eliminates ripple by setting DC output to a fixed voltage. Voltage

    regulator ICs are available with fixed (typically 5V, 12V and 15V) or variable output

    voltages. Negative voltage regulators are also available

  • 8/2/2019 Anshu Documentation

    22/52

    22

    CHAPTER 3

    BUZZER AND LCD INTERFACING WITH CIRCUITRY

    3.1 Transistor Driver Circuit

    The transistor used in this project to drive the buzzer is BC547. The features of this transistor

    are discussed in the next topics.

    3.1.1Features

    Low current (max. 100 mA)

    Low voltage (max. 65 V)

    Applications

    General purpose switching and amplification.

    3.1.2 Description

    PNP transistor in a TO-92; SOT54 plastic package.

    Figure 1 Simplified outline (TO-92;SOT 54) and symbol

  • 8/2/2019 Anshu Documentation

    23/52

    23

    3.1.3 Limiting Values

    In accordance with the Absolute Maximum Rating System (IEC 134).

    Digital systems and microcontroller pins lack sufficient current to drive the circuits likebuzzer circuits and relay circuits. While these circuits need around 10milli amps to be

    energized, the microcontrollers pin can provide a maximum of 1-2milli amps current. For

    this reason, a driver such as a power transistor is placed in between the microcontroller and

    the buzzer.

    Figure 2 Connection of Micro Controller with Buzzer

    The operation of this circuit is as follows:

    The input to the base of the transistor is applied from the microcontroller port pin P1.0. The

    transistor will be switched on when the base to emitter voltage is greater than 0.7V (cut-in

    voltage). Thus when the voltage applied to the pin P1.0 is high i.e., P1.0=1 (>0.7V), the

    transistor will be switched on and thus the buzzer will be activated and produces a loud noise.

    When the voltage at the pin P1.0 is low i.e., P1.0=0 (

  • 8/2/2019 Anshu Documentation

    24/52

    24

    3.2 LIQUID CRYSTAL DISPLAY

    LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs

    (seven segment LEDs or other multi segment LEDs) because of the following reasons:

    1. The declining prices of LCDs.

    2. The ability to display numbers, characters and graphics. This is in contrast to LEDs,

    which are limited to numbers and few characters.

    3. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of

    the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to

    keep displaying the data.

    4. Ease of programming for characters and graphics.

    These components are specialized for being used with the microcontrollers, which means

    that they cannot be activated by standard IC circuits. They are used for writing different

    messages on a miniature LCD.

    Figure 3 LCD Display

    A model described here is for its low price and great possibilities most frequently used in

    practice. It is based on the HD44780 microcontroller (Hitachi) and can display messages intwo lines with 16 characters each. It displays all the alphabets, Greek letters, punctuation

    marks, mathematical symbols etc. In addition, it is possible to display symbols that user

    makes up on its own. Automatic shifting message on display (shift left and right), appearance

    of the pointer, backlight etc. are considered as useful characteristics.

  • 8/2/2019 Anshu Documentation

    25/52

    25

    3.2.1 LCD Connection

    Depending on how many lines are used for connection to the microcontroller, there are 8-bit

    and 4-bit LCD modes. The appropriate mode is determined at the beginning of the process in

    a phase called initialization. In the first case, the data are transferred through outpu ts D0-

    D7 as it has been already explained. In case of 4-bit LED mode, for the sake of saving

    valuable I/O pins of the microcontroller, there are only 4 higher bits (D4-D7) used for

    communication, while other may be left unconnected.

    Consequently, each data is sent to LCD in two steps: four higher bits are sent first (that

    normally would be sent through lines D4-D7), four lower bits are sent afterwards. With the

    help of initialization, LCD will correctly connect and interpret each data received. Besides,

    with regards to the fact that data are rarely read from LCD (data mainly are transferred from

    microcontroller to LCD) one more I/O pin may be saved by simple connecting R/W pin to the

    Ground

    3.2.2 LCD Initialization

    Once the power supply is turned on, LCD is automatically cleared. This process lasts for

    approximately 15mS. After that, display is ready to operate. The mode of operating is set by

    default. This means that:

    1. Display is cleared

    2. Mode

    DL = 1 Communication through 8-bit interface

    N = 0 Messages are displayed in one line

    F = 0 Character font 5 x 8 dots

    3. Display/Cursor on/off

    D = 0 Display off

    U = 0 Cursor off

    B = 0 Cursor blink off

    4. Character entry

    ID = 1 Addresses on display are automatically incremented by 1 S = 0 Display shift off

  • 8/2/2019 Anshu Documentation

    26/52

    26

    3.3 LIGHT-EMITTING DIODE (LED)

    A light-emitting diode, usually called an LED, is a semiconductor diode that emits

    incoherent narrow-spectrum light when electrically biased in the forward direction of the p-njunction, as in the common LED circuit. This effect is a form ofelectroluminescence.

    A LED is usually a small area light source, often with extra optics added to the chip

    that shapes its radiation pattern. Leds are often used as small indicator lights on electronic

    devices and increasingly in higher power applications such as flashlights and area lighting.

    The color of the emitted light depends on the composition and condition of the semi

    conducting material used, and can be infrared,visible, or ultraviolet. LEDs can also be used

    as a regular household light source. Besides lighting, interesting applications include

    sterilization of water and disinfection of devices.

    3.3.1 Physical function of LED

    Like a normal diode, the LED consists of a chip of semi conducting material

    impregnated, or doped, with impurities to create a p-n junction. As in other diodes, current

    flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse

    direction. Charge carriers electrons and holes flow into the junction from electrodes with

    different voltages. When an electron meets a hole, it falls into a lower energy level, and

    releases energy in the form of a photon.

    Fig 3.3.1 LED

    http://en.wikipedia.org/wiki/Semiconductorhttp://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Coherence_%28physics%29http://en.wikipedia.org/wiki/Lighthttp://en.wikipedia.org/wiki/Voltage_biashttp://en.wikipedia.org/wiki/P-n_junctionhttp://en.wikipedia.org/wiki/P-n_junctionhttp://en.wikipedia.org/wiki/LED_circuithttp://en.wikipedia.org/wiki/Electroluminescencehttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Infraredhttp://en.wikipedia.org/wiki/Visible_spectrumhttp://en.wikipedia.org/wiki/Ultraviolethttp://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Doping_%28semiconductor%29http://en.wikipedia.org/wiki/P-n_junctionhttp://en.wikipedia.org/wiki/Anodehttp://en.wikipedia.org/wiki/Cathodehttp://en.wikipedia.org/wiki/Electrodehttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Energy_levelhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Photonhttp://en.wikipedia.org/wiki/Photonhttp://en.wikipedia.org/wiki/Energyhttp://en.wikipedia.org/wiki/Energy_levelhttp://en.wikipedia.org/wiki/Voltagehttp://en.wikipedia.org/wiki/Electrodehttp://en.wikipedia.org/wiki/Cathodehttp://en.wikipedia.org/wiki/Anodehttp://en.wikipedia.org/wiki/P-n_junctionhttp://en.wikipedia.org/wiki/Doping_%28semiconductor%29http://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Ultraviolethttp://en.wikipedia.org/wiki/Visible_spectrumhttp://en.wikipedia.org/wiki/Infraredhttp://en.wikipedia.org/wiki/Colorhttp://en.wikipedia.org/wiki/Electroluminescencehttp://en.wikipedia.org/wiki/LED_circuithttp://en.wikipedia.org/wiki/P-n_junctionhttp://en.wikipedia.org/wiki/P-n_junctionhttp://en.wikipedia.org/wiki/Voltage_biashttp://en.wikipedia.org/wiki/Lighthttp://en.wikipedia.org/wiki/Coherence_%28physics%29http://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Semiconductor
  • 8/2/2019 Anshu Documentation

    27/52

    27

    3.4 ULN 2003 DRIVER:

    ULN is mainly suited for interfacing between low-level circuits and multiple

    peripheral power loads. The series ULN20XX high voltage, high current darlington arraysfeature continuous load current ratings. The driving circuitry in- turn decodes the coding and

    conveys the necessary data to the timer.

  • 8/2/2019 Anshu Documentation

    28/52

    28

    3.4.1) Features of ULN 2003

    Seven Darlington per package.

    Output current 500ma per driver (600ma peak).

    Output voltage 50v.

    Integrated suppression diodes for inductive loads.

    Outputs can be paralleled for high current TTL/CMOS/DTL compatible inputs.

    Inputs pinned opposite outputs to simplify layout.

    Transient protected outputs.

    Dual In-Line plastic package or small-Outline IC package.

    3.5 IR SENSOR

    IR sensor consists of two sensors. The first sensor presented is infrared based ,while the

    second one uses a red LED and photocell. The infrared based sensor emits the infrared rays

    and the second sensor detects the rays which are reflected from the obstacle. A line sensor in

    its simplest form is a sensor capable of detecting a contrast between adjacent surfaces, such

    as difference in color, roughness, or magnetic properties ,for example. The simplest would

    be detecting a difference in color, for example black and white surfaces. Using simple opto

    electronics, such as infrared photo-transistors, color contrast can easily be detected. Infrared

    emitter/detectors or photo-transistors are in expensive and are easy to interface to

    a microcontroller. The theory of operation is simple and for brevity, only the basics will be

    considered.

  • 8/2/2019 Anshu Documentation

    29/52

    29

    3.5.1 FEATURES:

    High reliability

    Light weight

    Low cost

    Long detection range

    Small size

    Wide spectral response

    3.6 BUZZER

    The Piezoelectric sound components introduced herein operate on an innovative principle

    utilizing natural oscillation of piezoelectric elements.

    These buzzers are of feredin light weight compact sizes from the smallest diameter of 2mm

    to large Piezoelectric sounders.

    Today piezoelectric sound components are used in many ways such as home appliances, OA

    equipment, Audio equipment telephones etc.

    And they are widely applied for example in alarms, speakers, telephone ringers, receivers,

    beep sounds etc.

    A buzzer or beeper is an audio signaling device, which may

    be mechanical, electromechanical, or piezoelectric

    Typical uses of buzzers and beepers include alarm devices, timers and confirmation of

    user input such as a mouse click or keystroke.

    http://en.wikipedia.org/wiki/Soundhttp://en.wikipedia.org/wiki/Machinehttp://en.wikipedia.org/wiki/Electromechanicshttp://en.wikipedia.org/wiki/Piezoelectricityhttp://en.wikipedia.org/wiki/Alarm_deviceshttp://en.wikipedia.org/wiki/Alarm_deviceshttp://en.wikipedia.org/wiki/Timerhttp://en.wikipedia.org/wiki/Timerhttp://en.wikipedia.org/wiki/Alarm_deviceshttp://en.wikipedia.org/wiki/Piezoelectricityhttp://en.wikipedia.org/wiki/Electromechanicshttp://en.wikipedia.org/wiki/Machinehttp://en.wikipedia.org/wiki/Sound
  • 8/2/2019 Anshu Documentation

    30/52

    30

    PIEZOELECTRIC BUZZER CIRCUIT

    PIEZO ELECTRIC BUZZER TYPES OF BUZZER

  • 8/2/2019 Anshu Documentation

    31/52

    31

    3.7 555 TIMER IC:

    The 555 timer IC is an integrated circuit (chip) used in a variety of timer, pulse generationand oscillator applications. The 555 can be used to provide time delays, as an oscillator, andas a flip-flop element

    http://en.wikipedia.org/wiki/Integrated_circuithttp://en.wikipedia.org/wiki/Timerhttp://en.wikipedia.org/wiki/Electronic_oscillatorhttp://en.wikipedia.org/wiki/Oscillatorhttp://en.wikipedia.org/wiki/Flip-flop_elementhttp://en.wikipedia.org/wiki/Flip-flop_elementhttp://en.wikipedia.org/wiki/Flip-flop_elementhttp://en.wikipedia.org/wiki/Oscillatorhttp://en.wikipedia.org/wiki/Electronic_oscillatorhttp://en.wikipedia.org/wiki/Timerhttp://en.wikipedia.org/wiki/Integrated_circuit
  • 8/2/2019 Anshu Documentation

    32/52

    32

    CHAPTER 4

    IMPLEMENTATION

    4.1 ALGORITHM:

    Algorithm is defined as process of implementing the entire process in steps.

    The following are the steps which occur during the process of Embedded based security

    system using ir sensors with instant results.

    1. Start the procedure.

    2. Reset all ports so that errors do not occur.

    3.Initially the microcontroller will be initialized at the beginning of the system.

    4.Initialisation of the IR module happens when both IR transmitter and IR receiver placed

    within the distance so that the object can enter into that area.

    5.Initialisation of the 555 timer happens in order to generate the rays using IR leds and the

    555timer acts in the stable mode at the output .

    6.The buzzer is used to produce the sound when any obstacle occurs.

    7.When the obstacle occurs between the ir transmitter and ir receiver then automatically the

    signal passes from microcontroller to the buzzer to beep the sound8. If no obstacle occurs therefore no signal takes place and there will be no sound

    9.If any obstacle occurs the lcd will displays the message inorder to indicate the object.

    10. At last when the interrupt occurs then results will be displayed at that point of time

    instantaneously.

    In this way the procedure is followed security is maintained and the results are

    displayed at that point time.

    The above steps are showed as flow chart below

  • 8/2/2019 Anshu Documentation

    33/52

    33

    4.2 FLOW CHART

    Start

    Initialization of microcontroller

    Initialization of IR module

    Initialization of 555 timer

    Buzzer

    If any object

    detected Buzzer

    Stop

    yes

    no

  • 8/2/2019 Anshu Documentation

    34/52

    34

    4.3 CIRCUITS DIAGRAMS

  • 8/2/2019 Anshu Documentation

    35/52

    35

    4.4 SOFTWARE DEVELOPMENT

    4.4.1 INTRODUCTION:

    In this chapter the software used and the language in which the program code is

    defined is mentioned and the program code dumping tools are explained. The chapter also

    documents the development of the program for the application. This program has been

    termed as Source code. Before we look at the source code we define the two header files

    that we have used in the code.

    4.4.2 TOOLS USED:

    Figure 5.1 Keil Software- internal stages

    Keil development tools for the 8051 Microcontroller Architecture support every

    level of software developer from the professional applications

  • 8/2/2019 Anshu Documentation

    36/52

    36

    4.4.3 WORKING WITH KEIL

    1. Click on the Keil uVision Icon on Desktop

    2. The following fig will appear

    3. Click on the Project menu from the title bar

    4. Then Click on New Project

  • 8/2/2019 Anshu Documentation

    37/52

    37

    5. Save the Project by typing suitable project name with no extension in u r own folder sited ineither C:\ or D:\

    6. Then Click on Save button above.

    7. Select the component for u r project. i.e. Atmel

    8. Click on the + Symbol beside of Atmel

    9. Select AT89C51 as shown below

  • 8/2/2019 Anshu Documentation

    38/52

    38

    10. Then Click on OK

    11. The Following fig will appear

    12. Then Click either YES or NOmostly NO

    13. Now your project is ready to USE

    14. Now double click on the Target1, you would get another option Source group 1 as shown

    in next page.

  • 8/2/2019 Anshu Documentation

    39/52

    39

    15. Click on the file option from menu bar and select new

    16. The next screen will be as shown in next page, and just maximize it by double clicking on its

    blue boarder.

  • 8/2/2019 Anshu Documentation

    40/52

    40

    17. Now start writing program in either in C or ASM

    18. For a program written in Assembly, then save it with extension . asm and for C based

    program save it with extension .C

    19. Now right click on Source group 1 and click on Add files to Group Source

  • 8/2/2019 Anshu Documentation

    41/52

    41

    20. Now you will get another window, on which by default C files will appear.

    21. Now select as per your file extension given while saving the file

    22. Click only one time on option ADD

    23. Now Press function key F7 to compile. Any error will appear if so happen.

  • 8/2/2019 Anshu Documentation

    42/52

    42

    24. If the file contains no error, then press Control+F5 simultaneously.

    25. The new window is as follows

    26. Then Click OK

    27. Now Click on the Peripherals from menu bar, and check your required port as shown in fig

    below

  • 8/2/2019 Anshu Documentation

    43/52

    43

    28. Drag the port a side and click in the program file.

    29. Now keep Pressing function key F11 slowly and observe.

    30. You are running your program successfully

  • 8/2/2019 Anshu Documentation

    44/52

    44

    4.5 WORKING PROCEDURE:

    Embedded based security system using IR sensors with 89C51 microcontroller is an

    exclusive project that can provide a highly secure component.

    The microcontroller controls the system by using all peripherals such as timer , IR

    leds and ULN driver and also buzzer.

    The important element in this system is both ir transmitter and ir receiver . the

    transmitter transmits the ir rays using timer and the reciecver receives the signal when any

    obstacle occurs .therfore as the interrupt occurs the signal is received to the microcontroller .

    The microcontroller using the sensors it can detect the object and can identify the object and

    automatically the alarm will produce some sound by using buzzer . these all are controlledthrough the microcontroller and by all these components are fetched in one board called as kit

    With the usage of the components hardware the design of the kit and software design is

    done through the embedded c language and programming is written through embedded

    language and it is written in such a way that the system will perform to provide security and

    can implement the kit at immediate real time and so it is used as real time purpose and the

    program which is written in the software is dumped into the microcontroller and it controls

    the system according to the instructions given into it.

  • 8/2/2019 Anshu Documentation

    45/52

    45

    4.6 PROGRAM

    #include

    sbit ir=P0^0;

    sbit buzzer=P0^7;stepmotor();

    delay(unsigned int);

    main()

    {

    //unsigned char i;

    buzzer=1;

    while(1)

    {

    if(ir==0)

    {

    buzzer=0;

    stepmotor();

    buzzer=1;

    }

    else

    {

    buzzer=1;

    }

    }

    }

    unsigned char i,j;

    for(i=1;i

  • 8/2/2019 Anshu Documentation

    46/52

    46

    delay(10);

    P0=0X22;

    delay(10);

    P0=0X44;

    delay(10);

    P0=0X88;delay(10);

    P0=0X11;

    delay(10);

    P0=0X22;

    delay(10);

    P0=0X44;

    delay(10);

    P0=0X88;

    delay(10);

    P0=0X11;

    delay(10);P0=0X22;

    delay(10);

    P0=0X44;

    delay(10);

    P0=0X88;

    delay(10);

    P0=0X11;

    delay(10);

    P0=0X22;

    delay(10);

    P0=0X44;

    delay(10);

    P0=0X88;

    delay(10);

    P0=0X11;

    delay(10);

    P0=0X22;

    delay(10);

    P0=0X44;

    delay(10);

    P0=0X88;delay(10);

    P0=0X44;

    delay(10);

    P0=0X22;

    delay(10);

    P0=0X11;

    delay(10);

    P0=0X88;

    delay(10);

    P0=0X44;

    delay(10);P0=0X22;

  • 8/2/2019 Anshu Documentation

    47/52

    47

    delay(10);

    P0=0X11;

    delay(10);

    P0=0X88;

    delay(10);

    P0=0X44;delay(10);

    P0=0X22;

    delay(10);

    P0=0X11;

    delay(10);

    P0=0X88;

    delay(10);

    P0=0X44;

    delay(10);

    P0=0X22;

    delay(10);P0=0X11;

    delay(10);

    P0=0X88;

    delay(10);

    P0=0X44;

    delay(10);

    P0=0X22;

    delay(10);

    P0=0X11;

    delay(10);

    P0=0X88;

    delay(10);

    P0=0X44;

    delay(10);

    P0=0X22;

    delay(10);

    P0=0X11;

    delay(10);

    }

    delay(unsigned int time)

    {

    unsigned int i,j;

    for(i=0;i

  • 8/2/2019 Anshu Documentation

    48/52

    48

    CHAPTER 5

    RESULT

    The embedded based security system using ir sensors results to provide security to the system

    are concerned in order to require for the development in the real time applications.

    The power supply is maintained to generate 5v by using stepdown transformer and the

    microcontroller will receives the power and it will control the ir transmitter and ir receiver by

    and also it displays the message on lcd as shown in figure.

    When any obstacle occurs in between ir transmitter and ir receiver the alaram automatically

    alarms so that the security can be alert . This simple technique is possible by using the kit

    through hardware and software design.

  • 8/2/2019 Anshu Documentation

    49/52

    49

    CHAPTER 6

    CONCLUSION

    APPLICATIONS

    Prevention from un authorized access

    Burglar alarm system

    Obstacle detection

    Home and industrial automation

    Infrared remote control units with high power requirements

    Infrared source for optical counters and card readers Museums

    Military purposes

    ADVANTAGES:

    Tested and proved in conditions of industrial production plants

    Modern technology, high security

    Possibility of interconnection with other safety applications, camera systems

    Offer and installation exactly chosen according to its suitability for each application

    CONCLUSION:

    The project SECURITY SYSTEM USING IR SENSORS has been successfully

    designed and tested. Integrating features of all the hardware components used have developed

    it. Presence of every module has been reasoned out and placed carefully thus contributing to

    the best working of the unit. Secondly, using highly advanced ICs and with the help of

    growing technology the project has been successfully implemented.

    FUTURE SCOPE:

    This project has IR transmitter and receiver system, IR sensor interfaced to

    micro controller. Micro controller is programmed in such a way that it can be

    easily analysed .This project can be extended by using wireless technology like

    Zigbee and by interfacing it with PC.

  • 8/2/2019 Anshu Documentation

    50/52

    50

    BIBILOGRAPHY

    .1. "The 8051 Microcontroller Architecture, Programming & Applications"

    By Kenneth J Ayala. , IEEE Conference, 12-14 April 2007,

    2. "Power Electronics by M D Singh and K B Khanchandan IEEE Conference

    on Power Electronics, 2005

    3."The 8051 Microcontroller & Embedded Systems" by Mohammed Ali Mazidi

    and Janice Gillispie Mazidi,

    4.. "Linear Integrated Circuits by D Roy Choudary & Shail Jain

    5. "Electrical Machines by S K Bhattacharya

    6. "Electrical Machines II by B L Thereja

  • 8/2/2019 Anshu Documentation

    51/52

    51

    APPENDIX

    The main aim of this project is to provide security . The system is designed with the help of

    microcontroller which is the heart of the project and is interfaced to the liquid crystal display

    (LCD) which displays the result instantenously. Access control system is one system that isused for security purpose in many organisations .

    Many modern electronic systems including personal computers, PDAs ,cell

    phones,Network routers, smart cards, and networked sensors to name a few need to access ,

    store,manipulate, or communicate sensitive information, making security a serious concern in

    their design embedded systems, which account for a wide range of products from the

    electronics,semiconductor, telecomunicationds, and networking industries .

    Electronic security systems protecting estate are suitable complementary security

    measures to industrial television systems CCTV . The electronic security systems can ensure

    the security in all the categories including outdoor and indoor surveillance , systems of entry

    control systems , electronic fire fighting and for estate and buildings . The security can be

    achevied by using IR transmitter and IR receiver . when any obstacle comes in between both

    transmitter and receiver the alaram automatically buzzers the beep . These are all the things

    can controlled through software written in 89S52 controller. Ir rays are generated using 555

    timer and led transmitter. We are using 89S52 microcontroller one of the powerful micro -

    controller for commercial purpose. We are using the one of the powerful tool to developing

    the software for this project.

    Many modern electronic systems---including personal computers, PDAs, cell phones,

    network routers, smart cards, and networked sensors to name a few---need to access, store,

    manipulate, or communicate sensitive information, making security a serious concern in their

    design Embedded systems, which account for a wide range of products from the electronics,

    semiconductor, telecommunications, and networking industries, face some of the mostdemanding security concerns---on the one hand, they are often highly resource constrained,

    while on the other hand, they frequently need to operate in physically insecure

    environments.Security has been the subject of intensive research in the context of general-

    purpose computing and communications systems.The challenges unique to embedded

    systems require new approaches to security covering all aspects of embedded system design

    from architecture to implementation. Security processing, which refers to the computations

    that must be performed in a system for the purpose of security, can easily overwhelm the

    computational capabilities of processors in both low- and high-end embedded systems.

    The aim of the project is to provide a security system that can monitor a the obstacle

    by using sensors. The main design principles used in designing the security system with IRsensors they are flexible and easily enhanced for future use. In system the main problem is to

    protect the user area from unauthorized access. The indoor and outdoor problems can be

    overcome by using sensors .Power consumption is the major factor in that can be

    implemented by using this system, for the purpose IR sensor is used. Security problems may

    arrive due to absence of man power in the required places.

  • 8/2/2019 Anshu Documentation

    52/52

    A security system policy is a set of rules that apply to activities for the computer and A

    security policy is a set of rules that apply to activities for the computer and communications

    resources that belong to an organization. These rules include areas such as physical security,

    personnel security, administrative security, and network security.communications resources

    that belong to an organization. These rules include areas such as physical security, personnel

    security, administrative security, and network security.When you have a security system, it will work to deter burglars from entering your

    home, which means that it is also minimizing your chances of losing your possessions.

    Losing your things can be traumatic and expensive. The alarm system will sound if an

    intruder tries to get in and most times will scare them off. If it doesn't then help will be on the

    way immediately which means that they won't have much time to take hardly anything.

    Most of the alarms these days have a way that you can hook up your smoke alarms to

    them. That way if a fire is detected, the alarm will sound alerting you to the danger. It will

    also alert the security company to the danger so they can call for help for you. This could

    save your family's lives.