door locking system with 1 master password & 3 user passwords

Upload: lifeofengineer

Post on 05-Apr-2018

236 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    1/88

    1

    Door Security System (3 user & 1 master password)

    INTRODUCTION

    The main and very basic need of security was fulfilled by using themechanical or electrical locks which are very heavy and designed for

    only one key. Therefore a large number of locks of required for locking a

    large industries there are many keys for different locks (i.e. a very

    tedious task to arrange these keys). These locks are not so much

    protective and could be broken by using some mechanical tools. All

    these problems could be solved if we use electronic locking system in

    place of these electrical & mechanical locks. There are also some more

    features are available in these electronic locking system The electronicsecurity system are very light, flexible, reprogrammable, lower cost,

    more accurate, highly secure and required less power. In this way due to

    the introduction of the electronic security system the security need and

    fulfilled to a great extent and we could protect a whole industry or

    company very easily and rapidly. The main objective of this project is to

    make an electronic device by which we could give access to the

    authenticated persons in the sophisticated area of an organization or a

    company with a very simple operability. We could also generate

    codeword for different expensive equipment so that they could be made

    protective and only the person who has the complete knowledge to

    operate that machine or equipment is authenticated to operate. One

    more advantage to use this security system is that we could easily

    change the codeword according to the situation or security conditions

    and easily get the information about the attempts of hacking or hackers.

    This device is fully automated so that we dont need to monitor the

    process. Basically the device would generate five passwords in which

    there would be one master code and other four will be sub code wecould distribute these code to different persons who are permitted to get

    access. These persons would be able to get access by using their code

    and if a person leaks his code then he could easily be detected and his

    code could be change with the help of master code. In this way this

    device is a much protected electronic device in which the number of

    codes can be increased according to the need which would be

    reprogrammable. Here we can also lock different expensive machines or

    equipment by giving the sub codes so that only those persons having

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    2/88

    2

    Door Security System (3 user & 1 master password)

    the knowledge of the operability of the equipment had given these codes

    so that any other person cant damage the machine.

    BRIEF DESCRIPTION OF ASSOCIATED TECHNOLOGY:-

    This project is basically a microcontroller based device which operates

    according to the data saved into the EEPROM and run the program in

    microcontroller. The hardware used in this project is as follows: MCU

    89S8253, EEPROM, Relay driver, LEDs, LCD Module, Power supply,

    Buzzer and Speaker etc. The main or central processing unit of this

    project is 89C51 it consists of the following features i.e. This is basically

    a 40 pin to 44 pin MCU depending upon its packaging it is available in

    three types of packages PDIP(Plastic dual in line Package-40pin),

    TQFP/PQFP(Thin Plastic Gull Wing Quad Flatpack-44pin) and

    PLCC(Plastic J-Leaded Chip Carrier-44pin). It has a 4K Bytes of In-

    System Reprogrammable Flash Memory which has a capacity of 1,000

    Write/Erase Cycles. Fully Static operation from 0Hz to 24MHz and it has

    also three-level Program Memory Lock. The internal RAM of this MCU is

    128*8 bit and externally it could operate 64MB memory devices. It

    consists of a two quartz crystal timer or oscillator of 16 Bit and 6 interrupt

    sources therefore the programming of microcontroller is done withserially inserting the data. This microcontroller is cheap and also cost-

    effective because it could be operated into two low power consuming

    modes i.e. Low Power Idle & Power Down Modes. In case of Idle Mode

    the CPU puts itself to sleep while all the on-chip peripherals remain

    active. While in Power down Mode the oscillator is stopped, and the

    instruction that invokes power down is the last executed instruction. This

    MCU is given the industry standard MCS-51TM instruction set and

    pinout. The device is manufactured using Atmels high densitynonvolatile memory technology and uses high performance CMOS

    transistors. Some other requirements of this microcontroller are:

    Operating temperature range -55 C to + 125C and storage

    temperature range -65 C to + 150C, Voltage at any pin with respect to

    ground -1.0V to +7.0V and the maximum operating voltage 6.6V. The

    DC output current of 15.0mA. The external clock driver used to drive this

    MCU should have oscillation frequency of 0-24MHz, clock period of

    41.5ns, High Time and Low time 15ns each and Rise & Fall Time 20ns

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    3/88

    3

    Door Security System (3 user & 1 master password)

    each. The operating voltage of this microcontroller is given through a DC

    power supply of 12V.

    PATH OF IMPLIMENTATION:-

    Block Diagram:

    Brief Description: The system comprises a small electronic unit with a

    numeric keypad, which is fixed outside the entry door to control a

    solenoid-operated lock. When an authorized person enterspredetermined number (password) via the keypad, the relay operated for

    a limited time to unlatch the solenoid-operated lock so the door can be

    pushed/pulled open. At the end of preset delay, the relay reenergizes

    and the door gets locked again. If the entered password is correct the

    unit opens the door. When the code has been incorrectly entered four

    times in a row, the code lock will switch to alarm mode and operate an

    alarm relay. Alarm relay are turned off after entering a valid User Access

    Code. This function thwarts any attempt by hackers to quickly try a

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    4/88

    4

    Door Security System (3 user & 1 master password)

    large number of codes in a sequence. The secret code can be changed

    any time after entering the current code (Master code).

    There will be three unique passwords for three users. This enables thatany person of the family can open the door with his own password even

    if other is not available. There is a facility that each user can change

    his/her password when required. After all this there is master password

    available with designer which in case can be used to open when user

    forget their password. The person knowing the master password can tell

    the user password at present by opening the system.

    WORKING

    Access control is a system which enables an authority to control

    access to areas and resources in a given physical facility or computer-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    5/88

    5

    Door Security System (3 user & 1 master password)

    based information system. An access control system, within the field

    of physical security, is generally seen as the second layer in the security

    of a physical structure.

    Access control is, in reality, an everyday phenomenon. A lock on

    a car door is essentially a form of access control. A PIN system at a

    bank is another means of access control. Bouncers standing in front of

    a night club are perhaps a more primitive mode of access control (given

    the evident lack of information technology involved). The possession of

    access control is of prime importance when persons seek to secure

    important, confidential, or sensitive information and equipment.

    Item control or electronic key management is an area within(and possibly integrated with) an access control system which concerns

    the managing of possession and location of small assets or physical.

    DESCRIPTION:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    6/88

    6

    Door Security System (3 user & 1 master password)

    BlockDiagram:

    Working in brief:- There is a switch matrix interfaced with the

    controller .When a particular sequence is pressed then micro controller

    decodes it allows the door to be opened through the relay driver and

    relay. If the sequence is pressed wrong then buzzer will blow.

    Key Components:- The major components of this project are:

    Switch matrix

    Microcontroller

    Relay driver

    Relay

    Buzzer

    The microcontroller used here is a common 8 bit Atmel microcontroller

    AT89s8253.It is a low-power, high-performance CMOS 8-bitmicrocontroller with12K bytes of In-System Programmable (ISP) Flash

    program memory

    and 2K bytes of

    EEPROM data

    memory. It has 32

    programmable input

    output lines

    Northern India Engineering college

    SWITCH

    MATRIX AS

    KEYPAD

    MICRO-

    CONTROLLERRELAY DRIVER

    RELAYBUZZER

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    7/88

    7

    Door Security System (3 user & 1 master password)

    Programmable (ISP) Flash program memory and 2K bytes of EEPROM

    data memory have been provided. It has 32 programmable input output

    lines.

    Features:-

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

    SPI Serial Interface for Program Downloading Endurance: 10,000 Write/Erase Cycles

    2K Bytes EEPROM Data Memory

    Endurance: 100,000 Write/Erase Cycles

    2.7V to 5.5V Operating Range

    Fully Static Operation: 0 Hz to 24 MHz (in x1 and x2 Modes)

    Three-level Program Memory Lock

    256 x 8-bit Internal RAM

    32 Programmable I/O Lines

    Three 16-bit Timer/Counters

    Nine Interrupt Sources

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    8/88

    8

    Door Security System (3 user & 1 master password)

    Enhanced UART Serial Port with Framing Error Detection and

    Automatic Address Recognition

    Enhanced SPI (Double Write/Read Buffered) Serial Interface

    Programmable Watchdog Timer

    Relay driver:-

    ULN2803 is a current driver IC which drives the relay. The eight

    NPN Darlington connected transistors in this family of arrays are ideally

    suited for interfacing between low logic level digital circuitry (such as

    TTL, CMOS or PMOS/NMOS) and the higher current/voltage

    requirements of lamps, relays, printer hammers or other similar loads for

    a broad range of computer, industrial, and consumer applications. All

    devices feature opencollector outputs and freewheeling clamp diodes

    for transient Suppression. The ULN2803 is designed to be compatible

    with standard TTL families while the ULN2804 is optimized for 6 to 15

    volt high level CMOS or PMOS.

    Relay:-

    A relay is an electrically operated switch. Many relays use an

    electromagnet to operate a switching mechanism mechanically, butother operating principles are also used. Relays are used where it is

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    9/88

    9

    Door Security System (3 user & 1 master password)

    necessary to control a circuit by a low-power signal (with complete

    electrical isolation between control and controlled circuits), or where

    several circuits must be controlled by one sign. Here, relay is used to

    switch on the devices.

    BUZZER SYSTEM:-

    A system consisting signaling devices, a console, and a reset

    button to notify in the form of sound happening of some incidence. THE

    buzzer used here is piezo buzzer controlled by micro controller

    signaling.

    EMBEDDED SYSTEM

    The embedded system is a combination of computer hardware,software, additional electrical & mechanical parts. A computer is used in

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    10/88

    10

    Door Security System (3 user & 1 master password)

    such devices primarily as a means to simplify the system design and to

    provide flexibility.

    Often the user of the device is not even aware that a computer ispresent.

    Electronic devices that incorporate a computer (usually a

    microprocessor) is within their implementation.

    These are Real-time system process events. These events occur on

    external inputs and cause other events to occur as outputs. Minimizing

    response time is usually a primary objective, or otherwise the entire

    system may fail to operate properly. Therefore embedded systems

    employ the use of a RTOS (Real-Time Operating System). Its an

    operating system with the necessary features to support a Real-Time

    System.

    Real-Time System:-

    It is a system where correctness depends not only on the correctness of

    the logical result of the computation, but also on the result delivery time.

    It responds in a timely, predictable way to unpredictable external stimuliarrivals. The real Time Systems can be further divided into two types:

    Soft Real-Time System: Compute output response as fast as

    possible, but no specific deadlines that must be met.

    Hard Real-Time System: Output response must be computed by

    specified deadline or system.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    11/88

    11

    Door Security System (3 user & 1 master password)

    APPLICATION OF EMBEDDED SYSTEMS:-

    Consumer electronics

    Telecommunication

    Automobile

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    12/88

    12

    Door Security System (3 user & 1 master password)

    Medical instrumentation

    Industrial control equipment

    Defense

    Communication satellite

    Data communication

    Internet appliances

    MICROCONTROLLER

    A microcontroller is a computer-on-a-chip, or, if you prefer, a single-chip

    computer. Micro suggests that the device is small, and controller tells

    you that the device might be used to control objects, processes, or

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    13/88

    13

    Door Security System (3 user & 1 master password)

    events. Another term to describe a microcontroller is embedded

    controller, because the microcontroller and its support circuits are often

    built into, or embedded in, the devices they control.

    You can find microcontrollers in all kinds of things these days. Any

    device that measures, stores, controls, calculates, or displays

    information is a candidate for putting a microcontroller inside. The

    largest single use for microcontrollers is in automobilesjust about

    every car manufactured today includes at least one microcontroller for

    engine control, and often more to control additional systems in the car.

    In desktop computers, you can find microcontrollers inside keyboards,

    modems, printers, and other peripherals. In test equipment,microcontrollers make it easy to add features such as the ability to store

    measurements, to create and store user routines, and to display

    messages and waveforms. Consumer products that use microcontrollers

    include cameras, video recorders, compact-disk players, and ovens. And

    these are just a few examples.

    Microcontroller Basics:-

    A microcontroller is similar to the microprocessor inside a personal

    computer. Examples of microprocessors include Intels 8086, Motorolas

    68000, and Zilogs Z80. Both microprocessors and microcontrollers

    contain a central processing unit, or CPU. The CPU executes

    instructions that perform the basic logic, math, and data-moving

    functions of a computer. To make a complete microprocessor requires

    memory for storing data and programs and input/output(I/O) interfaces

    for connecting external devices like keyboards and displays. In contrast,

    a microcontroller is a single-chip computer because it contains memoryand I/O interfaces in addition to the CPU. Because the amount of

    memory and interfaces that can fit on a single chip is limited,

    microcontrollers tend to be used in smaller systems that require little

    more than the microcontroller and a few support components. Examples

    of popular microcontrollers are Intels 8052 (including the 8052-BASIC,

    which is the focus of this book), Motorolas 68HC11, and Zilogs Z8.

    Microcontroller History:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    14/88

    14

    Door Security System (3 user & 1 master password)

    To understand how microcontrollers fit into the always-expanding world

    of computers, we need to look back to the roots of micro computing.

    In its January 1975 issue, Popular Electronics magazine featured anarticle describing the Altair 8800 computer, which was the first

    microcomputer that hobbyists could build and program themselves. The

    basic Altair included no keyboard, video display, disk drives, or other

    elements we now think of as essential elements of a personal computer.

    Its 8080 microprocessor was programmed by flipping toggle switches on

    the front panel. Standard RAM was 256 bytes and a kit version cost

    $397 ($498 assembled). A breakthrough in the Altairs usability occurred

    when a small company called Microsoft offered a version of the BASICprogramming language for it. Of course, the computer world has

    changed a lot since the introduction of the Altair. Microsoft has become

    an enormous software publisher, and a typical personal computer now

    includes a keyboard, video display, disk drives, and Megabytes of RAM.

    Whats more, theres no longer any need to build a personal computer

    from scratch, since mass production has drastically lowered the price of

    assembled systems. At most, building a personal computer now involves

    only installing assembled boards and other major components in an

    enclosure. A personal computer like Apples Macintosh or IBMs PC is a

    general-purpose machine, since you can use it for many applications

    word processing, spreadsheets, computer-aided design, and morejust

    by loading the appropriate software from disk into memory. Interfaces to

    personal computers are for the most part standard ones like those to

    video displays, keyboards, and printers.

    But along with cheap, powerful, and versatile personal computers has

    developed a new interest in small, customized computers for specificuses. Each of these small computers is dedicated to one task, or a set of

    closely related tasks. Adding computer power to a device can enable it

    to do more, small display, a keypad or switches, sensors, relays, motors,

    and so on. or do it faster, better, or more cheaply. For example,

    automobile engine controllers have helped to reduce harmful exhaust

    emissions. And microcontrollers inside computer modems have made it

    easy to add features and abilities beyond the basic computer-to-phone-

    line interface. In addition to their use in mass-produced products likethese, its also become feasible to design computer power into one-of-a-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    15/88

    15

    Door Security System (3 user & 1 master password)

    kind projects, such as an environmental controller for a scientific study or

    an intelligent test fixture that ensures that a product meets its

    specifications before its shipped to a customer. At the core of many of

    these specialized computers is a microcontroller. The computersprogram is typically stored permanently in semiconductor memory such

    as ROM or EPROM. The interfaces between the microcontroller and the

    outside world vary with the application, and may include a

    These small, special-purpose computers are sometimes called single-

    board computers, or SBCs. The term can be misleading, however, since

    the computer doesnt have to be on a single circuit board, and many

    types of computer systems, such as laptop and notebook computers, arenow manufactured on a single board.

    AT89S8253 microcontroller :-

    The microcontroller development effort resulted in the 8051 architecture,

    which was first introduced in 1980 and has gone on to be arguably the

    most popular micro controller architecture available. The 8051 is a very

    complete microcontroller with a large amount of built in control store

    (ROM &EPROM) and RAM, enhanced I/O ports, and the ability to

    access external memory. The maximum clock frequency with an 8051

    micro controller can execute instructions is 20MHZ.Microcontroller is a

    true computer on chip. The design incorporates all of the features found

    in a microprocessor: CPU, ALU, PC, SP and registers. It also has the

    other features needed to, make complete computer: ROM, RAM, parallel

    I/O, serial I/O, counters and a clock circuit. The

    89C51/89C52/89C54/89C58 contains a non-volatile FLASH program

    memory that is parallel programmable. For devices that are serialprogrammable(In-System Programmable (ISP) and In-Application

    Programmable (IAP) with a boot loader)All three families are Single-Chip

    8-bit Microcontrollers manufactured in advanced CMOS process and are

    Derivatives of the 80C51 microcontroller family. All the devices have the

    same instruction set as the 80C51.

    FEATURES:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    16/88

    16

    Door Security System (3 user & 1 master password)

    8K Bytes of In-System Reprogrammable Flash Memory

    Endurance: 1,000 Write/Erase Cycles

    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

    Programmable Serial Channel

    DESCRIPTION:-

    The AT89S8253 is a low power, high performance CMOS 8-bit micro

    computer with 8K bytes of flash programmable and erasable read only

    memory(PEROM).The device is manufactured using Atmels high

    density nonvolatile memory technology and is compatible with the

    industry standard 80c51 and 80C52 instruction set and pin out.

    The on-chip flash allows the program memory to be reprogrammed

    insystem or by a conventional nonvolatile memory programmer. Bycombining a versatile 8-bit CPU with flash on a monolithic chip, the

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    17/88

    17

    Door Security System (3 user & 1 master password)

    Atmel AT89s8253 is a powerful microcomputer which provides a highly

    flexible and cost effective solution to many embedded control

    applications. The main advantages of 89s8253 over 8051 are:-

    Software Compatibility

    Program Compatibility

    Rewritability

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    18/88

    18

    Door Security System (3 user & 1 master password)

    89S8253 PROCESSOR ARCHITECTURE:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    19/88

    19

    Door Security System (3 user & 1 master password)

    A rchitecture contains the following :-

    8 bit CPU with registers A and B

    16 bit program counter(PC) and data pointer(DPTR)

    8 bit program status word(PSW)

    8 bit stack pointer

    Internal ROM of 0(8031) to 4K(8051)

    Internal RAM of 128 Bytes

    4 register banks 00-1f

    16 bytes(bit addressable) 20-2f

    80 bytes of general purpose data memory 30-7f

    32 I/O pins arranged as four 8 bit ports (P0 P3)

    2 16-bit timer/counters: T0 and T1

    Full duplex serial data receiver/transmitter: SBUF

    Control registers: TCON, TMOD, SCON, PCON, IPand IE

    2 external and 3 internal interrupt sources

    Oscillator and clock circuits

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    20/88

    20

    Door Security System (3 user & 1 master password)

    Pin Diagram of the 40 Pin DIP package of the 89S8253:-

    DESCRIPTION:-

    VCC:-

    Pin no.40 is used for the supply to the microcontroller..

    GND:-

    Ground.

    RST:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    21/88

    21

    Door Security System (3 user & 1 master password)

    This is pin no.9, used to reset the device by keeping it high for 2

    machine cycles. The microcontroller should be reset at the time of

    starting.

    Oscillator:-

    Pins XTAL1 and XTAL2 are used for connecting a quartz crystal for the

    internal oscillator.

    Crystal Frequency-10 MHz

    External Access (EA):-

    The 8051 family members, all come with on-chip ROM to store the

    program. In such case, EA pin is connected to Vcc. To indicate that the

    code is stored in external ROM, EA pin must be connected to ground.

    PSEN:-

    PSEN stands for Program Store Enable. This is an output pin and isconnected to OE pin of ROM

    Port 0:-

    Port 0 is an 8-bit open drain bi-directional I/O 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 can also be configured to be the

    multiplexed lower order address/data bus during accesses to external

    program and data memory. In this mode, P0 has internal pull-ups. Port 0also 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 and Port 2:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    22/88

    22

    Door Security System (3 user & 1 master password)

    Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port1

    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 willsource 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.

    Port 3:-

    It has internal pull-ups and can sink/source 4 TTL inputs. Port 3

    occupies a total of 8 pins, pins 10 through 17. It can be used as input or

    output. Port 3 has additional function of providing some extremely signal

    as interrupts.

    ALE/PROG:-

    Address Latch Enable is an output pulse for latching the low byte of the

    address (on its falling edge) during accesses to external memory. This

    pin is also the program pulse input (PROG) during Flash programming.

    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

    locking purposes. Note, however, that one ALE pulse is skipped during

    each access to external data memory.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    23/88

    23

    Door Security System (3 user & 1 master password)

    PSEN:-

    Program Store Enable. PSEN is the read strobe to external program

    memory (active low). When the AT89S8253 is executing code fromexternal 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 isprogrammed, 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.

    PCB (PRINTED CIRCUIT BOARD)

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    24/88

    24

    Door Security System (3 user & 1 master password)

    A printed circuit board, or PCB, is used to mechanically support and

    electrically connect electronic components using conductive pathways,

    tracks or traces etched from copper sheets laminated onto a non-

    conductive substrate. It is also referred to as printed wiring board (PWB)or etched wiring board. A PCB populated with electronic components is

    a printed circuit assembly (PCA), also known as a printed circuit board

    assembly (PCBA).

    PCBs are inexpensive, and can be highly reliable. They require much

    more layout effort and higher initial cost than either wire-wrapped or

    point-to-point constructed circuits, but are much cheaper and faster for

    high-volume production. Much of the electronics industry's PCB design,assembly, and quality control needs are set by standards that are

    published by the IPC organization.

    POWER SUPPLY:-

    There is 5V supply voltage required for this project. An ac 9-0-9 V mains

    transformer is connected via a mains lead. The transistor is voltage

    regulator IC. It regulates 4.8V dc (approx).

    Working: - The working is quite clear. It is describe in following steps.

    Step down transformer convert 220V AC into 4.8V AC

    It convert AC voltage into pulsating DC voltage

    The filter stage uses a shunt capacitor to filter out ripples from

    pulsating DC

    The regulator stage gives a regulated output of a fixed voltage.

    The circuit runs on a power supply of 5V DC. A transformer 9-0-9V is

    used to step down the ac mains voltage from 230V, to 9V AC. The

    combination of transformer & diode converts this AC voltage into a

    pulsating DC voltage, which is filtered by using an electrolytic capacitor

    of rating 1000F, 25V. The IC BC547b provides a regulated power

    supply of 5V DC. The 5V DC supply drives and the ICs in the circuit.

    Northern India Engineering college

    http://en.wikipedia.org/wiki/Electronic_componenthttp://en.wikipedia.org/wiki/Conductor_(material)http://en.wikipedia.org/wiki/Signal_tracehttp://en.wikipedia.org/wiki/Industrial_etchinghttp://en.wikipedia.org/wiki/Laminatedhttp://en.wikipedia.org/wiki/Wire_wraphttp://en.wikipedia.org/wiki/Point-to-point_constructionhttp://en.wikipedia.org/wiki/IPC_(electronics)http://en.wikipedia.org/wiki/Electronic_componenthttp://en.wikipedia.org/wiki/Conductor_(material)http://en.wikipedia.org/wiki/Signal_tracehttp://en.wikipedia.org/wiki/Industrial_etchinghttp://en.wikipedia.org/wiki/Laminatedhttp://en.wikipedia.org/wiki/Wire_wraphttp://en.wikipedia.org/wiki/Point-to-point_constructionhttp://en.wikipedia.org/wiki/IPC_(electronics)
  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    25/88

    25

    Door Security System (3 user & 1 master password)

    PCB-DESIGNING:-

    PCB Designing includes the following steps:-

    Fig : PCB Designing process

    PROCESSING :-

    Northern India Engineering college

    PROCESSING

    CLEANSING

    PRINTING

    ETCHING

    DRILLING

    SOLDERING

    MASKING

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    26/88

    26

    Door Security System (3 user & 1 master password)

    The layout of a PCB has to incorporate all the information on the board

    before one can go on to the artwork preparation. This means that a

    concept that clearly defines all the details of the circuit and partly also of

    the final equipment, is a prerequisite before the actual layout can start.The detail circuit diagram is very important for the layout designer and

    he must also be familiar with the design concept and with the philosophy

    behind the equipment. The General Considerations are-

    a-) Layout scale:- Depending on the accuracy required, artwork should

    be produced at a 1:1 or 2:1 or even 4:1 scale. The layout is best

    prepared on the same scale as the artwork. This prevents all the

    problems which might be caused by redrawing of layout to the artwork

    scale.

    b-) Grid system or Graph Paper: - It is commonly accepted practice to

    use these for designing.

    c-) Board types:-There are two side of a PCB board Component side

    & Solder side. Depending on these board are classified as-

    Single-sided Boards:- These are used where costs

    have to be kept at a minimum & a particular Circuit can beaccommodated on such board. To jump over conductor tracks,

    components have to be utilized. If this is not feasible,

    jumper wires are used. (Jumper wires should be less otherwise

    double-sided PCB should be considered.

    Double-sided Boards:- These are made with or

    without plated through holes. Plated through holes are fairly

    expensive.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    27/88

    27

    Door Security System (3 user & 1 master password)

    CLEANING:-

    The cleaning of the copper surface prior to resist application is an

    essential step for any type of PCB process using etches or plating resist.

    After scrubbing with the abrasive, a water rinse will remove most of the

    remaining slurry.

    Fig :Cleaning process

    ETCHING:-

    Northern India Engineering college

    Scrubbing

    Water Rinse

    Wet Brushing

    Acid dip

    Final Rinse

    Drying

    Pumice/ Acid Slurry

    Tap Water

    Tap Water

    Hydrochloric Acid-HCl

    De-ionized Water

    Oven or Blowing of air.

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    28/88

    28

    Door Security System (3 user & 1 master password)

    It is of utmost importance to choose a suitable Etchant Systems.Number

    of factors play a major role in it. There are many factors to be considered

    Etching speed

    Copper solving capacity

    Etchant price

    Pollution character

    Operation characteristics of different etchants:-

    Factor

    Etchant

    Corrosive

    -ness

    Neutralization

    disposition

    problem

    Toxicity Required

    ventilation

    Operation

    cost

    FeCl3 High Medium Low Low Medium

    CuCl2 High Low Medium Medium Low

    Chromic

    acid

    High High High High High

    Alkaline

    ammonia

    High Medium Medium High High

    Table : Characteristics of different etchants

    We have used FeCl3 (Conc. 120 g/litre 0.1 M) for etching.

    Reactions Involved:-

    FeCl3 + 3H 2O Fe(OH) 3 + 3HCl (Free acid attack to

    copper)

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    29/88

    29

    Door Security System (3 user & 1 master password)

    FeCl3 + Cu FeCl2 + CuCl

    FeCl3 + CuCl FeCl2 + CuCl2

    CuCl2 + Cu 2CuCl

    DRILLING:-

    The importance of hole drilling into PCBs has further gone with electronic

    component miniaturization and its need for smaller holes diameters

    (diameters less than half the board thickness) and higher package density.

    The following hole diameter tolerances have been generally accepted

    wherever no other specifications are mentioned.

    Hole Diameter (D) 3 mm + / 0.1 mm

    Drill bits are made up of high-speed steel (HSS), Glass epoxy material,

    Tungsten Carbide.

    SOLDERING:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    30/88

    30

    Door Security System (3 user & 1 master password)

    Flux should be removed after Soldering. It is done through washing by 0.51

    % HCl followed by Neutralization in dilute alkali to remove corrosive flux.Non-

    corrosive is removed by Iso-Propanal.

    MASKING:-

    It is done for the protection of conductor track from Oxidation.

    Designing of PCB Layout:-

    A PCB layout is required to place components on the PCB so that the

    component area can be minimized and the components can be placed in an

    efficient manner. The components can be placed in two ways, either

    manually or by software. The manual procedure is quiet cumbersome and is

    very inefficient. The other method is by the use of computer software. This

    method is advantageous as it saves time and valuable copper area. There

    are various softwares available for this purpose like-

    Express PCB

    Pad2pad

    Protel PCB

    PCB design e.t.c.

    Many of them are loaded with auto routing and auto placement facility. Thesoftware that we have used here is EXPRESS PCB. This software has a

    good interface, easy editing options and a wide range of components.

    Express P.C.B. :-

    Express PCB is a very easy to use Windows application for laying

    out printed circuit boards. There are two parts to Express PCB, Express

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    31/88

    31

    Door Security System (3 user & 1 master password)

    SCH for drawing schematics and Express PCB for designing circuit

    boards. We downloaded the software from the website

    www.expresspcb.com.

    There are lots of functions available in the software. This software

    is free of cast and also it is very easy to use. The different layers of the

    PCB can be viewed by just a click of a button on the interface. And we

    easily get its print on paper which is utilized for further processing. We

    can design single sided PCB as well as Double Sided PCB with this

    Software.

    TESTING

    After assembling the circuit components on the PCB and soldering

    them according to the layout, testing is the next step to be taken. Testing

    includes measurement of the parameters such as current, voltage, clock

    frequency and comparing them with the standard values provided with

    the circuit. Any sort of deviation from the actual values should be

    measured and corrected accordingly. This part is known as

    troubleshooting.

    Northern India Engineering college

    http://www.expresspcb.com/http://www.expresspcb.com/
  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    32/88

    32

    Door Security System (3 user & 1 master password)

    Testing forms a very necessary part of any project. Without testing

    a project work never culminates. It is only after testing that one can

    guarantee the successful ending of the project. It is only through this

    step by which one can determine the faults and also come to knowabout the changes to be introduced.

    DIODES

    A diode is a device having two terminals and a low resistance to

    electrical current in one direction and a high resistance in the other

    direction. Diode is a two-element device which passes a signal in one

    direction only. They are used most commonly to convert AC to DC,

    because they pass the positive part of the wave, and block the negative

    part of the AC signal, or, if they are reversed, they pass only the

    negative part and not the positive part. Here we used only two types of

    diode:

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    33/88

    33

    Door Security System (3 user & 1 master password)

    1) Zener Diode

    2) 1N4007

    1) ZENER DIODE:-

    A Zener diode is a type of diode that permits current in the forward

    direction like a normal diode, but also in the reverse direction if the

    voltage is larger than the breakdown voltage known as "Zener knee

    voltage" or "Zener voltage". The device was named after Clarence

    Zener, who discovered this electrical property. The Zener effect asembodied in the zener diode has many applications for control and

    regulation.

    Northern India Engineering college

    http://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Breakdown_voltagehttp://en.wikipedia.org/wiki/Clarence_Zenerhttp://en.wikipedia.org/wiki/Clarence_Zenerhttp://hyperphysics.phy-astr.gsu.edu/Hbase/solids/zener.html#c1http://hyperphysics.phy-astr.gsu.edu/Hbase/solids/zener.html#c3http://en.wikipedia.org/wiki/Diodehttp://en.wikipedia.org/wiki/Electric_currenthttp://en.wikipedia.org/wiki/Breakdown_voltagehttp://en.wikipedia.org/wiki/Clarence_Zenerhttp://en.wikipedia.org/wiki/Clarence_Zenerhttp://hyperphysics.phy-astr.gsu.edu/Hbase/solids/zener.html#c1http://hyperphysics.phy-astr.gsu.edu/Hbase/solids/zener.html#c3
  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    34/88

    34

    Door Security System (3 user & 1 master password)

    Fig 4.10: Characteristic graph of Zener Diode

    The Zener diode is operated in reverse bias mode (positive on its

    cathode). It relies on the reverse breakdown voltage occurring at a

    specified value. This value is printed on it.

    APPLICATIONS:-

    1. As a reference source, where the voltage across it is compared with

    another voltage.

    2. As a voltage regulator, smoothing out any voltages variations

    occurring in the supply voltage across the load.

    2) RECTIFICATION DIODE [1N4007]:-

    The stripe stamped on one end of the diode shows indicates the polarity

    of the diode. The stripe shows the cathode side. The top two devices

    shown in the picture are diodes used for rectification. They are made to

    handle relatively high currents. The device on top can handle as high as

    6A, and the one below it can safely handle up to 1A.However, it is best

    used at about 70% of its rating because this current value is a maximum

    rating. The third device from the top (red color) has a part number of

    1S1588. This diode is used for switching, because it can switch on and

    off at very high speed. However, the maximum current it can handle is

    120 mA. This makes it well suited to use within digital circuits. The

    maximum reverse voltage (reverse bias) this diode can handle is 30V.

    The device at the bottom of the picture is a voltage regulation diode with

    a rating of 6V. When this type of diode is reverse biased, it will resist

    changes in voltage. If the input voltage is increased, the output voltagewill not change. (Or any change will be an insignificant amount.) While

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    35/88

    35

    Door Security System (3 user & 1 master password)

    the output voltage does not increase with an increase in input voltage,

    the output current will.

    This requires some thought for a protection circuit so that too muchcurrent does not flow. The rated current limit for the device is 30 mA.

    Generally, a 3-terminal voltage regulator is used for the stabilization of a

    power supply. Therefore, this diode is typically used to protect the circuit

    from momentary voltage spikes. 3 terminal regulators use voltage

    regulation diodes inside.

    FEATURES:-

    Low forward voltage drop.

    Diffused Junction.

    AT89S8253 (8-bit Microcontroller with 12 KbyteFlash)

    Features:-

    Compatible with MCS51 Products

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

    SPI Serial Interface for Program Downloading

    Endurance: 10,000 Write/Erase Cycles

    2K Bytes EEPROM Data Memory

    Endurance: 100,000 Write/Erase Cycles

    64-byte User Signature Array

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    36/88

    36

    Door Security System (3 user & 1 master password)

    2.7V to 5.5V Operating Range

    Fully Static Operation: 0 Hz to 24 MHz (in x1 and x2 Modes)

    Three-level Program Memory Lock

    256 x 8-bit Internal RAM

    32 Programmable I/O Lines

    Three 16-bit Timer/Counters

    Nine Interrupt Sources

    Enhanced UART Serial Port with Framing Error Detection and

    Automatic Address Recognition

    Enhanced SPI (Double Write/Read Buffered) Serial Interface

    Low-power Idle and Power-down Modes

    Interrupt Recovery from Power-down Mode

    Programmable Watchdog Timer

    Dual Data Pointer

    Power-off Flag

    Flexible ISP Programming (Byte and Page Modes)

    Page Mode: 64 Bytes/Page for Code Memory, 32 Bytes/Page for

    Data Memory

    Four-level Enhanced Interrupt Controller

    Programmable and Fuseable x2 Clock Option

    Internal Power-on Reset

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    37/88

    37

    Door Security System (3 user & 1 master password)

    42-pin PDIP Package Option for Reduced EMC Emission

    Green (Pb/Halide-free) Packaging Option

    1. Description :-

    The AT89S8253 is a low-power, high-performance CMOS 8-bit

    microcontroller with 12K bytes of In-System Programmable (ISP) Flash

    program memory and 2K bytes of EEPROM data memory. The device is

    manufactured using Atmels high-density non- volatile memory

    technology and is compatible with the industry-standard MCS-

    51instruction set and pinout. The on-chip downloadable Flash allows the

    program memory to be reprogrammed in-system through an SPI serial

    interface or by a conventional nonvolatile memory programmer. By

    combining a versatile 8-bit CPU with downloadable Flash on amonolithic chip, the Atmel AT89S8253 is a powerful microcontroller

    which provides a highly-flexible and cost-effective solution to many

    embedded control applications.

    The AT89S8253 provides the following standard features: 12K bytes of

    In-System Programmable Flash, 2K bytes of EEPROM, 256 bytes of

    RAM, 32 I/O lines, programmable watchdog timer, two data pointers,

    three 16-bit timer/counters, a six-vector, four-level interrupt architecture,a full duplex serial port, on-chip oscillator, and clock circuitry. In addition,

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    38/88

    38

    Door Security System (3 user & 1 master password)

    the AT89S8253 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 external interrupt or hardware

    reset.

    The on-board Flash/EEPROM is accessible through the SPI serial

    interface. Holding RESET active forces the SPI bus into a serial

    programming interface and allows the program memory to be written to

    or read from, unless one or more lock bits have been activated.

    2. Pin Configurations :-

    2.1 40P6 40-lead PDIP

    2.2 44A 44-lead TQFP

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    39/88

    39

    Door Security System (3 user & 1 master password)

    2.3 44J 44-lead PLCC

    2.4 42PS6 PDIP

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    40/88

    40

    Door Security System (3 user & 1 master password)

    3. Pin Description:-

    3.1 VCC: Supply voltage (all packages except 42-PDIP).

    3.2 GND: Ground (all packages except 42-PDIP; for 42-PDIP GND

    connects only the logic core and the embedded program/data

    memories).

    3.3 VDD: Supply voltage for the 42-PDIP which connects only the

    logic core and the embedded pro-

    gram/data memories.

    3.4 PWRVDD: Supply voltage for the 42-PDIP which connects only

    the I/O Pad Drivers. The application board must connect both VDD andPWRVDD to the board supply voltage.

    3.5 PWRGND: Ground for the 42-PDIP which connects only the I/O

    Pad Drivers. PWRGND and GND are weakly connected through the

    common silicon substrate, but not through any metal links. The

    application board must connect both GND and PWRGND to the board

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    41/88

    41

    Door Security System (3 user & 1 master password)

    ground.

    3.6 Port 0: Port 0 is an 8-bit open drain bi-directional I/O port. As an

    output port, each pin can sink six TTL inputs. 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 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 programverification.

    3.7 Port 1: Port 1 is an 8-bit bi-directional I/O port with internal pull-

    ups. The Port 1 output buffers can

    sink/source six TTL inputs. When 1s are written to Port 1 pins, they are

    pulled high by the weak

    internal pull-ups and can be used as inputs. As inputs, Port 1 pins that

    are externally being pulled low will source current (IIL,150 A typical)

    because of the weak internal pull-ups. Some Port 1 pins provide

    additional functions. 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. Furthermore, P1.4, P1.5, P1.6,

    and P1.7 can be configured as the SPI slave port select, datainput/output and shift clock input/output pins as shown in the following

    table.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    42/88

    42

    Door Security System (3 user & 1 master password)

    3.8 Port 2: Port 2 is an 8-bit bi-directional I/O port with internal pull-

    ups. The Port 2 output buffers can sink/source six TTL inputs. When 1s

    are written to Port 2 pins, they are pulled high by the weak internal pull-

    ups and can be used as inputs. As inputs, Port 2 pins that are externally

    being pulled low will source current (IIL,150 A typical) because of the

    weak 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 use 16-bit addresses (MOVX @ DPTR). In this

    application, Port 2 uses strong internal pull-ups when emitting 1s. During

    accesses to external data memory that use 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.

    3.9 Port 3: Port 3 is an 8-bit bi-directional I/O port with internal pull-

    ups. The Port 3 output buffers can sink/source six TTL inputs. When 1s

    are written to Port 3 pins, they are pulled high by the weak internal pull-

    ups and can be used as inputs. As inputs, Port 3 pins that are externally

    being pulled low will source current (IIL,150 A typical) because of the

    weak internal pull-ups. Port 3 receives some control signals for Flash

    programming and verification. Port 3 also serves the functions of various

    special features of the AT89S8253, as shown in the following table.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    43/88

    43

    Door Security System (3 user & 1 master password)

    3.10 RST: Reset input. A high on this pin for at least two machine

    cycles while the oscillator is running resets the device.

    3.11 ALE/PROG:Address Latch Enable. ALE/PROG is an output pulsefor latching the low byte of the address (on its falling edge) 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 bedisabled by setting bit 0 of the AUXR SFR at 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.

    3.12 PSEN: Program Store Enable. PSEN is the read strobe to external

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    44/88

    44

    Door Security System (3 user & 1 master password)

    program memory (active low). When the AT89S8253 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.

    3.13 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 pinalso receives the 12-volt programming enable voltage (VPP) during Flash

    programming when 12-volt programming is selected.

    3.14 XTAL1: Input to the inverting oscillator amplifier and input to the

    internal clock operating circuit.

    3.15 XTAL2: Output from the inverting oscillator amplifier. XTAL2

    should not drive a board-level clock without a buffer.

    4. Block Diagram:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    45/88

    45

    Door Security System (3 user & 1 master password)

    5. Data Memory EEPROM and RAM:-

    The AT89S8253 implements 2K bytes of on-chip EEPROM for data

    storage and 256 bytes of RAM. The upper 128 bytes of RAM occupy a

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    46/88

    46

    Door Security System (3 user & 1 master password)

    parallel space to the Special Function Registers. That means the upper

    128 bytes have the same addresses as the SFR space but are

    physically separate from SFR space. When an instruction accesses an

    internal location above address 7FH, the address mode used in theinstruction specifies whether the CPU accesses the upper 128 bytes of

    RAM or the SFR space. Instructions that use direct addressing access

    the SFR space. For example, the following direct addressing instruction

    accesses the SFR at location 0A0H (which is P2).

    MOV 0A0H, #data

    Instructions that use indirect addressing access the upper 128 bytes of

    RAM. For example, the following indirect addressing instruction, where

    R0 contains 0A0H, accesses the data byte at address 0A0H, rather than

    P2 (whose address is 0A0H).

    MOV @R0, #data

    Note that stack operations are examples of indirect addressing, so the

    upper 128 bytes of data RAM are available as stack space. The on-chip

    EEPROM data memory is selected by setting the EEMEN bit in theEECON register at SFR address location 96H. The EEPROM address

    range is from 000H to 7FFH. MOVX instructions are used to access the

    EEPROM. To access off-chip data memory with the MOVX instructions,

    the EEMEN bit needs to be set to 0. During program execution mode

    (using the MOVX instruction) there is an auto-erase capability at the byte

    level. This means that the user can update or modify a single EEPROM

    byte location in real-time without affecting any other bytes. The EEMWE

    bit in the EECON register needs to be set to 1 before any byte location

    in the EEPROM can be written. User software should reset EEMWE bit

    to 0 if no further EEPROM write is required. EEPROM write cycles in

    the serial programming mode are self-timed and typically take 4 ms. The

    progress of EEPROM write can be monitored by reading the RDY/BSY

    bit (read-only) in SFR EECON. RDY/BSY = 0 means programming is still

    in progress and RDY/BSY= 1 means an EEPROM write cycle is

    completed and another write cycle can be initiated. Bit EELD in EECON

    controls whether the next MOVX instruction will only load the write buffer

    of the EEPROM or will actually start the programming cycle. By setting

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    47/88

    47

    Door Security System (3 user & 1 master password)

    EELD, only load will occur. Before the last MOVX in a given page of 32

    bytes, EELD should be cleared so that after the last MOVX the entire

    page will be programmed at the same time. This way, 32 bytes will only

    require 4 ms of programming time instead of 128 ms required in singlebyte programming.

    16 CHARACTER LCD x 2

    Features:-

    5 x 8 dots with cursor

    Built-in controller (KS 0066 or Equivalent)

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    48/88

    48

    Door Security System (3 user & 1 master password)

    + 5V power supply (Also available for + 3V)

    1/16 duty cycle

    B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)

    N.V. optional for + 3V power supply

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    49/88

    49

    Door Security System (3 user & 1 master password)

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    50/88

    50

    Door Security System (3 user & 1 master password)

    LM78XX

    3-Terminal 1A Positive Voltage Regulator

    Features:-

    Output Current up to 1A

    Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    51/88

    51

    Door Security System (3 user & 1 master password)

    Thermal Overload Protection

    Short Circuit Protection

    Output Transistor Safe Operating Area Protection

    General description:-

    The LM78XX series of three terminal positive regulators are available in

    the TO-220 package and with several fixed output voltages, making

    them useful in a wide range of applications. Each type employs internal

    current limiting, thermal shut down and safe operating area protection,

    making it essentially indestructible. If adequate heat sinking is provided,

    they can deliver over 1A output current. Although designed primarily as

    fixed voltage regulators, these devices can be used with external

    components to obtain adjustable voltages and currents.

    Block Diagram:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    52/88

    52

    Door Security System (3 user & 1 master password)

    Pin Assignment:-

    Absolute Maximum Rating:-

    Absolute maximum ratings are those values beyond which damage tothe device may occur. The datasheet specifications should be met,

    without exception, to ensure that the system design is reliable over its

    power supply, temperature, and output/input loading variables. Fairchild

    does not recommend operation outside datasheet specifications.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    53/88

    53

    Door Security System (3 user & 1 master password)

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    54/88

    54

    Door Security System (3 user & 1 master password)

    Note: Load and line regulation are specified at constant junction temperature.

    Changes in VO due to heating effects must be taken into account separately.Pulse testing with low duty is used.

    These parameters, although guaranteed, are not 100% tested in production.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    55/88

    55

    Door Security System (3 user & 1 master password)

    Note: Load and line regulation are specified at constant junction temperature.

    Changes in VO due to heating effects must be taken into account separately.

    Pulse testing with low duty is used.

    These parameters, although guaranteed, are not 100% tested in production.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    56/88

    56

    Door Security System (3 user & 1 master password)

    Note: Load and line regulation are specified at constant junction temperature.

    Changes in VO due to heating effects must be taken into account separately.

    Pulse testing with low duty is used.

    These parameters, although guaranteed, are not 100% tested in production.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    57/88

    57

    Door Security System (3 user & 1 master password)

    Note: Load and line regulation are specified at constant junction temperature.Changes in VO due to heating effects must be taken into account separately.

    Pulse testing with low duty is used.

    These parameters, although guaranteed, are not 100% tested in production.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    58/88

    58

    Door Security System (3 user & 1 master password)

    Note: Load and line regulation are specified at constant junction temperature.Changes in VO due to heating effects must be taken into account separately.

    Pulse testing with low duty is used.

    These parameters, although guaranteed, are not 100% tested in production.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    59/88

    59

    Door Security System (3 user & 1 master password)

    Note: Load and line regulation are specified at constant junction temperature.

    Changes in VO due to heating effects must be taken into account separately.

    Pulse testing with low duty is used.

    These parameters, although guaranteed, are not 100% tested in production.

    Note: Load and line regulation are specified at constant junction temperature.

    Changes in VO due to heating effects must be taken into account separately.

    Pulse testing with low duty is used.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    60/88

    60

    Door Security System (3 user & 1 master password)

    These parameters, although guaranteed, are not 100% tested in production.

    Note:

    Load and line regulation are specified at constant junction temperature.

    Changes in VO due to heating effects must be taken into account separately.

    Pulse testing with low duty is used.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    61/88

    61

    Door Security System (3 user & 1 master password)

    These parameters, although guaranteed, are not 100% tested in production.

    Note: Load and line regulation are specified at constant junction temperature.

    Changes in VO due to heating effects must be taken into account separately.

    Pulse testing with low duty is used.

    These parameters, although guaranteed, are not 100% tested in production.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    62/88

    62

    Door Security System (3 user & 1 master password)

    UNDERSTANDING RELAYS

    Relays:-

    Relays are used throughout the automobile. Relays which come in

    assorted sizes, ratings, and applications, are used as remote control

    switches. A typical vehicle can have 20 relays or more

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    63/88

    63

    Door Security System (3 user & 1 master password)

    Relay Locations:-

    Relays are located throughout the entire vehicle. Relay blocks, both

    large and small, are located in the engine compartment; behind the left

    or right kick panels, or under the dash are common locations. Relays are

    often grouped together or with other components like fuses or placed by

    themselves.

    Relay Position Identification:-

    Relay / Fuse block covers usually label the location and position of each

    fuse, relay, or fuse element contained within.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    64/88

    64

    Door Security System (3 user & 1 master password)

    Relay Applications:-

    Relays are remote control electrical switches that are controlled by

    another switch, such as a horn switch or a computer as in a power traincontrol module. Relays allow a small current flow circuit to control a

    higher current circuit. Several designs of relays are in use today, 3-pin,

    4-pin, 5-pin, and 6-pin, single switch or dual switches.

    Relay Operation:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    65/88

    65

    Door Security System (3 user & 1 master password)

    All relays operate using the same basic principle. Our example will use a

    commonly used 4 -pin relay. Relays have two circuits: A control circuit

    (shown in GREEN) and a load circuit (shown in RED). The control circuit

    has a small control coil while the load circuit has a switch. The coilcontrols the operation of the switch.

    Relay Energized (On):-

    Current flowing through the control circuit coil

    (pins 1 and 3) creates a small magnetic field which causes the switch toclose, pins 2 and 4. The switch, which is part of the load circuit, is used

    to control an electrical circuit that may connect to it. Current now flows

    through pins 2 and 4 shown in RED, when the relay in energized.

    Relay De-Energized (Off):-

    When current stops flowing through the controlcircuit, pins 1 and 3, the relay becomes de-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    66/88

    66

    Door Security System (3 user & 1 master password)

    energized. Without the magnetic field, the switch opens and current is

    prevented from flowing through pins 2 and 4. The relay is now OFF.

    Relay Operation:-

    When no voltage is applied to pin 1, there is no current flow through the

    coil. No current means no magnetic field is developed, and the switch is

    open. When voltage is supplied to pin 1, current flow though the coil

    creates the magnetic field needed to close the switch allowing continuity

    between pins 2 and 4.

    Relay Design Id:-

    Relays are either Normally Open or Normally Closed. Notice the position

    of the switches in the two relays shown below. Normally open relayshave a switch that remains open until energized (ON) while normally

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    67/88

    67

    Door Security System (3 user & 1 master password)

    closed relays are closed until energized. Relays are always shown in the

    de-energized position (no current flowing through the control circuit -

    OFF). Normally open relays are the most common in vehicles; however

    either can be use in Automotive applications.

    Normal ly open (NO)

    Normally

    closed (NC)

    Normally Closed Relays:-

    The operation of a Normally Closed relay is the same to that of a

    Normally Open relay, except backwards. In other words, when the relay

    control coil is NOT energized, the relay switch contacts are closed,

    completing the circuit through pins 2 and 4. When the control coil isenergized, the relay switch contacts opens, which breaks the circuit

    open and no continuity exists between pins 2 and 4.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    68/88

    68

    Door Security System (3 user & 1 master password)

    DE-ENERGIZED (OFF) ENERGIZED (ON)

    Actual Relay Design:-

    Current flows through the control coil, which is wrapped around an iron

    core. The iron core intensifies the magnetic field. The magnetic field

    attracts the upper contact arm and pulls it down, closing the contacts

    and allowing power from the power source to go to the load.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    69/88

    69

    Door Security System (3 user & 1 master password)

    Relay Variations:-

    Other relay variations include three and five pin relays. A 3-PIN relay

    instead of two B+ input sources, this relay has one B+ input at pin 1.

    Current splits inside the relay, supplying power to both the control and

    load circuits. A 5-PIN relay has a single control circuit, but two separate

    current paths for the switch: One when the relay is de-energized (OFF

    no current through the control coil) and the other the energized (ON -

    current is flowing through the control coil). When the 5-PIN relay is de-

    energized (OFF), pins 4 and 5 have continuity. When the relay is

    energized (ON), pins 3 and 5 have continuity.

    3-PIN 4-PIN 5-PIN

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    70/88

    70

    Door Security System (3 user & 1 master password)

    ISO Standardized Relays:-

    ISO relays were designed to try and standardize relay connections,

    making it easier to test and design systems. ISO relays are currentlyused by almost all automotive manufacturers today. Both 4 and 5 pin

    designs are used in both standard mini and micro sizes. FYI: ISO is

    short for International Standard Organization.

    STANDARD MINI SHOWN

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    71/88

    71

    Door Security System (3 user & 1 master password)

    Standard Mini Iso Relays Types:-

    Below are two popular standard MINI ISO relay configurations. The size

    of a ISO Standard MINI relay is a 1" square cube. Both 4 and 5 pins

    designs are used.

    5 PIN

    MINI RELAY

    4 PIN

    MINI RELAY

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    72/88

    72

    Door Security System (3 user & 1 master password)

    ISO Micro Relay Types:-

    Below are two popular MICRO ISO relay configurations. The size of a

    ISO MICRO relay is a 1" x 1" x 1/2" square (1/2 as thick as a Mini relay).Both 4 and 5 pins designs are used.

    5 PIN

    MICRO RELAY

    4 PIN

    MICRO RELAY

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    73/88

    73

    Door Security System (3 user & 1 master password)

    Voltage Spikes:-

    When the switch is closed (shown left), current flows through the coil

    from positive to negative as shown in red. This current flow creates amagnetic field around the coil. The top of the coil is positive, and the

    bottom is negative.

    When the switch is opened (shown on right), current stops flowing

    through the control circuit coil, and the magnetic field surrounding the

    coil cannot be maintained. As the magnetic field collapses across the

    coil, it induces a voltage into itself, creating a reverse polarity voltage

    spike of several hundred volts. Although the top of the coil is still 12 volts

    positive, the bottom of the coil produces several hundred positive volts

    (200+ volts or

    more); 200 is "more positive" and stronger than 12 volts, so current flows

    from the bottom of the coil up towards the top.

    Voltage Suppression Relays:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    74/88

    74

    Door Security System (3 user & 1 master password)

    Relays are often controlled by a computer. When relays are controlled

    by semiconductors such as transistors, they require some type of

    voltage suppression device. Solid state circuits are vulnerable to voltage

    spikes. Voltage spikes slam against transistors, destroying them. Whilesome computer circuits have voltage suppression built inside the

    computer,

    others rely on voltage suppression from within the relay. High ohm

    resistors, diodes, or capacitors can be used for voltage suppression.

    Diodes and resistors are the most common. NOTE: Relays are usually

    clearly marked if a suppression diode or resistor is present.

    Relays With De-Spiking Diodes:-

    A de-spiking (clamping) diode is connected in

    parallel with the relay coil. It is in the reverse biased position when the

    relay is turned on; therefore no current will flow through the diode. When

    the relay control circuit is opened (turned OFF), current stops flowing

    through the coil, causing the magnetic field to collapse. The magneticlines of force cut through the coil and induce a counter voltage (a voltage

    in reverse polarity) into the winding. The counter voltage begins to raise.

    When the bottom side of the diode sees .7 volts more positive voltage

    than the top, the diode becomes forward biased, allowing the excess

    voltage to pass, completing the circuit to the other end of the coil. The

    current flows around in the diode and coil circuit until the voltage is

    dissipated.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    75/88

    75

    Door Security System (3 user & 1 master password)

    Relays With

    De- Spiking

    Resistors:-

    High ohm resistors are sometimes used instead of diodes. A resistor is

    more durable than a diode and can suppress voltage spikes similar to a

    diode, but the resistor will allow current to flow through it whenever the

    relay is on. Therefore resistance of the resistor must be fairly high (about600 ohms) in order to prevent too much current flow in the circuit. High

    ohm resistors are not quite as efficient at suppressing a voltage spike as

    diodes.

    Circuit Identification:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    76/88

    76

    Door Security System (3 user & 1 master password)

    Relays are easy to test but often misunderstood. Using a 4 pin relay for

    our example, we must first identify the pins. Some manufacturers place

    a diagram and pin ID on the outside of the relay case to show which pins

    are part of the control circuit and which pins are part of the load circuit.

    Continuity Check For Id:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    77/88

    77

    Door Security System (3 user & 1 master password)

    If the relay is not labeled, use an ohmmeter and check to see which pins

    are connected to each other. You should typically find an ohm value of

    approximately 50 to 120 ohms between two of the pins. This is the

    control circuit. If the coil is less that 50 ohms it could be suspect. Referto manual to verify reading. The remaining two pins should read OL

    (infinite) if it's a normally open relay, or 0 ohms (continuity) if it's a

    normally closed relay. If the readings are correct, proceed to the next

    test. Note: If none of the relay pins showed a coil value and all pins show

    OL or 0 ohms, the control coil is damaged and should be replaced.

    Practical Testing:-

    Once the pins have been identified, energize the control circuit by

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    78/88

    78

    Door Security System (3 user & 1 master password)

    supplying B+ to pin 1 and a ground to pin 3. A faint "click" will be heard;

    although this "click" means the switch has moved (closed), it does not

    mean the relay is good. The load circuit switch contacts could still be

    faulty (high resistance), and further testing is required. A commonmistake technicians make is they hear a "click" and assume the relay is

    good. Take the extra step and verify operation.

    Operational Check With Testlight:-

    Now start the second part of the test. Energize the relay (control side) bysupplying B+ to pin 1 and a ground to pin 3. A click should be heard.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    79/88

    79

    Door Security System (3 user & 1 master password)

    With the relay still energized, supply B+ pin 2 of the load circuit. The test

    light will be on. De-energize (remove B+) the control circuit at pin 1; the

    test light at pin 4 should go off. A test light is preferred because a test

    light will draw current through the switch.

    Operational Check With Voltmeter:-

    A voltmeter can be substituted in place of a test light; however be aware

    if the contacts are partially burned, the voltmeter will show voltage

    indicating good contact even when bad. Remember high impedance

    digital voltmeters draw almost no current. Energize the relay (control

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    80/88

    80

    Door Security System (3 user & 1 master password)

    side) by supplying B+ to pin 1 and a ground to pin 3. A click should be

    heard. With the relay still energized supply B+ to pin 2 of the load circuit.

    Connect the RED lead to pin 4 and the BLACK lead to ground. The

    voltmeter will indicate source voltage (12V).De-energize (remove B+) thecontrol circuit at pin 1; the voltmeter should now read "zero". Re-

    energize the relay and the voltmeter should return to 12 volts.

    Operational Check With An Ohmmeter:-

    An ohmmeter can also be used to test the load circuit, but the same

    problem as the voltmeter comes into play. Energize the relay (control

    side). Supply B+ to pin 1 and a ground (neg.) to pin 3. A click should be

    heard. Place the leads on an ohmmeter to across pin 2 and pin 4.

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    81/88

    81

    Door Security System (3 user & 1 master password)

    Assuming it is a normally open relay the ohmmeter will indicate a

    complete circuit (close to zero -0 ohms). De-energize the control circuit

    at pin 1(remove B+). The ohmmeter should indicate OL (an open circuit -

    infinite). Re-energize the relay and the ohmmeter should return to "zero"ohms. Note: some manufactures provide a maximum ohm value when

    the switch contacts are closed, example 5 ohms max.

    ULN2803A 500-mA Rated Collector Current

    High-Voltage Outputs . . . 50 V

    Output Clamp Diodes

    Inputs Compatible With Various Types of Logic

    Relay Driver Applications

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    82/88

    82

    Door Security System (3 user & 1 master password)

    Compatible with ULN2800A Series

    Description/ordering information:-

    The ULN2803A is a high-voltage, high-current Darlington transistor

    array. The device consists of eight npn Darlington pairs that feature high

    voltage outputs with common-cathode clamp

    diodes for switching inductive loads. The

    collector-current rating of each Darlington pair

    is 500mA.The Darlington pairs may be

    connected in parallel for higher current

    capability.

    Applications include relay drivers, hammer

    drivers, lamp drivers, display drivers (LED and

    gas discharge), line drivers, and logic buffers.

    The ULN2803A has a 2.7-k series base

    resistor for each Darlington pair for operation

    directly with TTL or 5-V CMOS devices.

    Logic Diagram :-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    83/88

    83

    Door Security System (3 user & 1 master password)

    Schematic (each Darlington pair) :-

    Absolute maximum ratings at 25 C free-air temperature (unless

    otherwise noted):-

    Collector-emitter voltage 50V

    Input voltage ... 30V

    Continuous collector current .. 500mA

    Output clamp diode current ... 500mA

    Total substrate-terminal current .. -2.5A

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    84/88

    84

    Door Security System (3 user & 1 master password)

    Operating virtual junction

    temperature, TJ . 1500C

    Storage temperature range, Tstg. -650C to

    1500C

    Parameter measurement information:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    85/88

    85

    Door Security System (3 user & 1 master password)

    Parameter measurement information:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    86/88

    86

    Door Security System (3 user & 1 master password)

    Propagation delay times

    Parameter measurement information:-

    Northern India Engineering college

  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    87/88

    87

    Door Security System (3 user & 1 master password)

    Latch-up Test

    REFERENCES

    Websites:-

    www.8051projects.info

    www.wikipedia.org

    www.atmel.com

    www.fairchildsemi.com

    www.alldatasheet.com

    Books:-

    Northern India Engineering college

    http://www.8051projects.info/http://www.wikipedia.org/http://www.fairchildsemi.com/http://www.alldatasheet.com/http://www.8051projects.info/http://www.wikipedia.org/http://www.fairchildsemi.com/http://www.alldatasheet.com/
  • 7/31/2019 Door Locking System With 1 Master Password & 3 User Passwords

    88/88

    Door Security System (3 user & 1 master password)

    The 8051 Microcontroller

    By I. Scott MacKenzie, Raphael C.-W. Phan

    Published By Dorling Kindersley (India) Pvt. Ltd. Published in 2008

    Electronic Devices And Circuit Theory

    By Robert L. Boylestad, Louis Nashelsky

    Published By Dorling Kindersley (India) Pvt. Ltd.

    Published in 2008