+ All Categories
Home > Documents > Integrated Security System

Integrated Security System

Date post: 21-Apr-2015
Category:
Upload: digvijay-shamsher-singh
View: 67 times
Download: 1 times
Share this document with a friend
74
Dept. of Electronics & Comm. Engineering JIET, Jodhpur 1 1. Introduction 1.1 Project Overview The project comprises of two stages for the purpose of security: Using fingerprint module Using RFID module Thus the project ent itled ‘Integrated Security System’ has its description divided into two parts one for the fingerprint module and another for the RFID module. Let’s see the description of the project under two stages distinctly. 1.1.1 Fingerprint Module Our B. Tech. Project aims at introducing biometric capable technology for use in automating the entire attendance system for the students pursuing courses at an educational institute. The goal can be disintegrated into finer sub-targets; fingerprint capture & transfer, fingerprint image processing and wireless transfer of data in a server-client system. For each sub-task, various methods from literature are analyzed. From the study of the entire process, an integrated approach is proposed. Biometrics based technologies are supposed to be very efficient personal identifiers as they can keep track of characteristics believed to be unique to each person. Among these technologies, Fingerprint recognition is universally applied. It extracts minutia- based features from scanned images of fingerprints made by the different ridges on the fingertips. The student attendance system is very relevant in an institute like ours since it aims at eliminating all the hassles of roll calling and malpractice and promises a full-proof as well as reliable technique of keeping records of student’s attendance.
Transcript
Page 1: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

1

1. Introduction

1.1 Project Overview

The project comprises of two stages for the purpose of security:

Using fingerprint module

Using RFID module

Thus the project entitled ‘Integrated Security System’ has its description divided into two

parts – one for the fingerprint module and another for the RFID module.

Let’s see the description of the project under two stages distinctly.

1.1.1 Fingerprint Module

Our B. Tech. Project aims at introducing biometric capable technology for use in

automating the entire attendance system for the students pursuing courses at an educational

institute. The goal can be disintegrated into finer sub-targets; fingerprint capture & transfer,

fingerprint image processing and wireless transfer of data in a server-client system. For each

sub-task, various methods from literature are analyzed. From the study of the entire process,

an integrated approach is proposed.

Biometrics based technologies are supposed to be very efficient personal identifiers as they

can keep track of characteristics believed to be unique to each person. Among these

technologies, Fingerprint recognition is universally applied. It extracts minutia- based

features from scanned images of fingerprints made by the different ridges on the fingertips.

The student attendance system is very relevant in an institute like ours since it aims at

eliminating all the hassles of roll calling and malpractice and promises a full-proof as well as

reliable technique of keeping records of student’s attendance.

Page 2: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

2

1.1.2 RFID MODULE:

Radio frequency identification (RFID) systems generally consist of two components: a

powered base station, and one or more unpowered transponders. By tuning the transponder

antennas to the same frequency as the base station antenna, power transmitted by the base

station can be captured by the transponder, in essentially the same way that power is

transferred in a transformer. This eliminates the need to have a separate power source for the

transponder, which in turn allows for miniaturization.

The base station in our RFID system consists of an Atmel U2270B base station integrated

circuit (IC), Atmel/Phillips 89C51 microcontroller, an inductive coil antenna, and associated

circuitry. Both the base station and transponder are capable of transmitting and receiving

data. The base station transmits data by modulating the magnitude of the electric field sent

through its coil. The transponder can detect the modulated field through its own coil to

recover the data

The U2270B seems to be Atmel’s only commercially available 125 kHz RFID base station,

so that made the choice of base station IC rather simple. The U2270B is paired with an

Atmel/Phillips 89C51 microcontroller. The Atmel/Phillips 89C51 operates at 12 MHz with a

5 V power supply, and has a slew of features. Of particular use is the Atmel/Phillips 89C51

UART, which facilitates communicating with a PC through a standard serial port. RF

technology is commonly used in Time and Attendance Control.

Page 3: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

3

1.2 Hardware Specification

S.No. Component Quantity

1. Fingerprint Sensor 1

2. RFID Module 1

3. RFID Tags 2

4. 7805 Regulator 2

5. MAX 232 IC 3

6. Resistor 1K 2

7. Resistors :330 ohms 3

8. Resistors :10K 6

9. Resistors :8.2K 2

10. Resistor Bank 4

11. Capacitors :10µF 9

12. Capacitors :100pF 2

13. Capacitors:0.1 µF 4

14. Capacitors :22 pF 2

15. Capacitors :33pF 2

16. Capacitor:1000µF 1

17. Capacitor :104pF 1

18. Capacitor 1000 µF 1

19. Capacitor :1 µF 4

20. Crsytal Oscillator(32.7698 KHz) 1

21. Crystal Oscillator(11.0592 MHz) 2

22. Atmel 89C51 2

23. RTC DS1037 1

24. EEPROM AT24C04 1

25. Diode IN4007 5

26. SPDT Switch 2

27. Push switch 2

28. LED 6

Page 4: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

4

1.3 Software Specification

1.3.1 Altium Designer

All the schematics are designed using the Altium Designer (Winter 09 Updates).

Altium Designer is an EDA software package for printed circuit board, FPGA and

embedded software design, and associated library and release management automation. It

is developed and marketed by Altium Limited of Australia.

Schematic capture

Schematic capture module provides electronic circuit editing functionality, including:

Component library management

Schematic document editing (component placement, connectivity editing and

design rules definition)

Integration with several component distributors allows search for components and

access to manufacturer's data.

Pre-layout signal integrity analysis

Reporting and BoM facilities.

Multi-channel, hierarchical schematics and design re-use

PCB Design

Printed circuit board design module of Altium designer allows:

Component footprint library management

Component placement

Manual trace routing, with support for differential pairs, multi-trace routing, pin-

swapping and gate-swaping

Automatic trace routing

Automated multi-channel layout and routing

Manufacturing files generation with support for Gerber and ODB++ formats

Page 5: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

5

1.3.2 Code Composer

Code Composer Studio™ (CCStudio) is an integrated development environment (IDE)

for Texas Instruments (TI) embedded processor families.

CCStudio comprises a suite of tools used to develop and debug embedded applications. It

includes compilers for each of TI's device families, source code editor, project build

environment, debugger, profiler, simulators, real-time operating system and many other

features.

The intuitive IDE provides a single user interface taking you through each step of the

application development flow. Familiar tools and interfaces allow users to get started

faster than ever before and add functionality to their application thanks to sophisticated

productivity tools.

Code Composer Studio is an integrated development environment for developing

applications for Texas Instruments embedded processors. Texas Instruments embedded

processors include DSPs, ARM based devices and other processors such as MSP430.

Code Composer Studio includes a real time operating system called DSP/BIOS or

SYS/BIOS.

Code Composer Studio or CCS includes support for OS level application debug as well as

low-level JTAG based development. CCS is based on the Eclipse open source software

framework.

Page 6: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

6

1.3.3 IAR Embedded Workbench

IAR Embedded Workbench supports the CC430, 1xx, G2xx, 2xx, 3xx, 4xx, 5xx, and 6xx

families of MSP430 microcontrollers.

IAR Embedded Workbench is a high-performance C/C++ compiler and debugger tool

suite for applications based on 8-, 16-, and 32-bit microcontrollers. IAR Systems

collaborates with all of the leading silicon vendors worldwide to ensure that our software

supports more devices in more processor architectures than any other tool on the market.

Key components:

Integrated development environment with project management tools and editor

Highly optimizing C and C++ compiler for MSP430

Automatic checking of MISRA C rules (MISRA-C:2004)

Configuration files for all MSP430 devices

Run-time libraries

Relocating MSP430 assembler

Linker and librarian tools

C-SPY debugger with MSP430 simulator and support for RTOS-aware debugging

on hardware

Example projects for MSP430 and code templates

User and reference guides in PDF format

Context-sensitive online help

Hardware debugging support:

Connection via parallel or USB port

Page 7: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

7

2. SYSTEM STUDY AND ANALYSIS

2.1 Existing system

In the corporate world, various aspects of security were historically addressed separately -

notably by distinct and often no communicating departments for IT security, physical

security, and fraud prevention. Today there is a greater recognition of the interconnected

nature of security requirements, an approach variously known as holistic security, "all

hazards" management, and other terms.

Inciting factors in the convergence of security disciplines include the development of digital

video surveillance technologies and the digitization and networking of physical control

systems.

Certain concepts recur throughout different fields of security:

Assurance - assurance is the level of guarantee that a security system will behave as

expected.

Countermeasure - a countermeasure is a way to stop a threat from triggering a risk

event.

Defence in depth - never rely on one single security measure alone.

Exploit - a vulnerability that has been triggered by a threat - a risk of 1.0 (100%).

Risk - a risk is a possible event which could cause a loss.

Threat - a threat is a method of triggering a risk event that is dangerous.

Vulnerability - a weakness in a target that can potentially be exploited by a threat

security.

Page 8: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

8

2.2 Proposed system

When an employee is first enrolled in a fingerprint-based biometric time and attendance

system, the software records a template of the employee’s fingerprint and associates that

template with the employee’s ID number. This template measures the relationship between

various points in the fingerprint. Each time the employee attempts to clock in or out, the time

and attendance software verifies that the newly scanned fingerprint matches the template

originally stored for that ID number. If there is a match, the punch is recorded. Occasionally,

employees will have privacy concerns about having their fingerprint scanned. Additionally,

because biometric verification uses relatively few points of comparison, the templates used in

commercial time and attendance systems generally cannot be used for biometric

identification.

By using biometric system, it calculates payroll and doesn’t allow anyone to punch in and out

for another person and fingerprint authentication completely eliminates this so-called buddy

punching. Using a biometric clock system, employees can simply clock in and out with their

fingerprint. The attendances of the staff will be taken when they place their fingerprint on the

fingerprint scanner. The system then monitors the time of staff after they have placed their

fingerprint on the scanner device and the system will monitor the time of staff entering the

office and the system will verify whether they are late and the system will also be able to

generate payroll of the staff from the time the system verified the fingerprint. The system also

generates monthly reports on the attendance progress of a staff for a particular month. This

system will actually make their jobs easier since they no longer have to manually keep track

of hours. While those who will be required to check in may be skeptical at the beginning,

they will quickly see that the electronic time and attendance system frees them from worrying

about hours and minutes.

Page 9: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

9

2.3 Problem Description

Occasionally, employees will have privacy concerns about having their fingerprint scanned.

Additionally, because biometric verification uses relatively few points of comparison, the

templates used in commercial time and attendance systems generally cannot be used for

biometric identification.

Previously Organization systems applied manual type of tracking system by using the punch

in / out card to track staffs attendance and security. The manual system seems gave serious

issues regarding to the accuracy of the staff attendance security data. Because of that,

Organizations now move from traditional system to the biometric security system where it

gives more accuracy in terms of the staff data. Below are the issues those organizations faced

by using the traditional method of security tracking system:

a) Buddy punching issue where a colleague could punch time for other staff is always an

option.

b) Staff has to carry card to record attendance or to gain access.

c) Data entry and calculation are manually done, prone to human error. Duty Roster

management and reports are manually prepared, posing inaccuracy risk. Genuine security

data is disputable because cards can be exchanged between employees.

d) Manual calculation and self generated reports.

e) Data is manually prepared therefore slow, inaccurate and tedious.

f) When data is manually inputted at month end, even though monitoring is possible, the data

is scattered and not centralized.

g) Extra space is required for keeping the punch cards.

h) Heavy manual workload is proportional to the number of punch card machines installed

and cards used.

i) Labor intensive where data has to be inputted by administration personnel at the end of the

month.

Page 10: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

10

3. SYSTEM DESIGN

3.1 FINGERPRINT MODULE SYSTEM

The main objective of this project is to authenticate and to maintain attendance by collecting

fingerprints using fingerprint sensors.

Nowadays accurate personal identification is becoming more and more important. Usual

means (smart cards, passwords) have shown their limits. Currently fingerprint recognition is

the most widely used technique for personal identification.

The use of ink and paper to get an image from a finger was used for a long time, but

technological advances have enabled to automate the acquisition stage by means of sensors.

These sensors exploit different techniques to acquire the image (pressure, electrical field,

temperature) and require a static (matrix sensor) or mobile finger position (sweeping mode

sensor).

The project contains 2 modes, the first one is master mode and the second is user mode.

The fingerprint sensor sense the thumb impression of the particular person and that image

will be registered with username and password in fingerprint sensor module.

This project is developed on microcontroller (8051). The fingerprint sensor is serially

interfaced to the microcontroller via MAX232 IC.

The fingerprint sensor sense the thumb impression of the corresponding person and that

image will be compared with registered image and if the both images are unique, then the

microcontroller activates particular task like authenticating an image, identification of the

employee etc which also maintains the attendance record of each and every employee.

Page 11: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

11

3.1.1 BLOCK DIAGRAM

Figure1: Fingerprint module system

Page 12: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

12

3.2 RFID module system

RFID is an acronym for radio frequency identification: the use of wireless communications

to establish the identity of a physical object. .

Definition:

Radio Frequency Identification (RFID) uses a semiconductor (microchip) in a tag or label to

store data.

Data is transmitted from, or written to the tag or label when it is exposed to radio waves of

the correct frequency and with the correct communications protocols

RFID is: A proven process improvement enabler

o Process innovation

A highly capable technology when intelligently implemented

o Package development

o Factory automation

A technology that will evolve and continue to improve

Purpose of RFID:-

RFID allows data to be transmitted by a product containing an RFID tag microchip, which is

read by an RFID reader. The data transmitted can provide identification or location

information about the product, or specifics such as date of purchase or price.

Advantage of using RFID technology:-

No contact or even line-of-sight is needed to read data from a product that contains an RFID

tag. This means no more checkout scanners at grocery stores, no more unpacking shipping

boxes, and no more getting keys out of your pocket to start your car. RFID technology also

works in rain, snow and other environments where bar code or optical scan technology would

be useless.

Will RFID replace UPC bar code technology?

Probably not, at least not soon. Besides the fact that RFID tags still cost more than UPC

labels, different data capture and tracking technologies offer different capabilities. Many

businesses will likely combine RFID with existing technologies such as barcode readers or

digital cameras to achieve expanded data capture and tracking capabilities that meet their

specific business needs.

Page 13: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

13

3.2.1 BLOCK DIAGRAM

CF O/P

Fig2: RFID module system

RFID Standards:

ISO 15693 ¡V Smart Labels

ISO 14443 ¡V Contactless payments

ISO 11784 ¡V Livestock

EPC ¡VRetail

ISO 18000 ¡V various frequencies, various applications

Atmel/Phillips

Micro Controller

89C51

LCD 20x4 Display

RFID Reader Receiver

RFID TAG

(ID Card)

Power Supply

Page 14: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

14

RFID Operating Frequencies:

Low Frequency ¡V LF (125 ¡V 134 kHz)

Applications: Access control, livestock, race timing, pallet tracking, automotive

immobilizers, pet identification

- Inductively coupled devices, electro-mechanical field

- Antenna coil has many turns

- Read range (near contact to 1 meter)

- Memory usually a UID

- Limited data rate due to a lower bandwidth

High Frequency ¡V HF (13.56 MHz) ¡V Smart Labels

Applications: Supply chain, wireless commerce, ticketing, product authentication, clothing

identification, library book identification, smart cards

- Inductively coupled devices

- Fewer antenna turns than LF device

- Read range from proximity to ¡Ó 1.5 meters

- Higher data transfer rate than LF

Ultra-High Frequency ¡V UHF (860-960 MHz)

Applications: Supply chain, tool tags, RTLS, EPC case and pallet

- RF communication uses propagation coupling

- Smaller reader antenna design than LF or HF

- Read distance (1 m ¡V 10 m)

- High data transfer rate

- More complex reader electronic components

Transponder Characteristics:

RFID tags are tiny microchips with memory and an antenna coil, thinner than paper and some

only 0.3 mm across. RFID tags listen for a radio signal sent by a RFID reader. When a

RFID tag receives a query, it responds by transmitting its unique ID code and other data back

to the reader.

Tag Types: - Active Tags: Battery powered, long read range

- Semi-active: Battery power to preserve memory

- Passive Tags: Low-cost, no battery required, medium read range

Active RFID Tags:

Active RFID tags, are called transponders because they contain a transmitter that is always

¡§on¡¨, are powered by a batter, about the size of a coin, and are designed for

communications up to 100 feet from RFID reader. They are larger and more expensive than

passive tags, but can hold more data about the product and are commonly used for high-value

asset tracking. Active tags may be read-write, meaning data they contain can be written over.

Page 15: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

15

Semi-Active RFID Tags:

Semi-active tags contain a small battery that boosts the range and preserves memory.

Passive RFID Tags:

Passive tags can be as small as 0.3 mm and don¡¦t require batteries. Rather, they are powered

by the radio signal of a RFID reader, which ¡§wakes them up¡¨ to request a reply. Passive

RFID tags can be read from a distance of about 20 feet. They are generally read-only;

meaning the data they contain cannot be altered or written over.

Tag Packing Formats:

- Weatherproof or environment-proof enclosure

- Pressure Sensitive Label

- Laminated card

- Embedded in packaging or product

Transponder Examples:

- 32 mm and 23 mm capsule transponder

- ½ inch key head transponder

- Smart Labels (Clear and Adhesive

- Circular transponders

RFID Readers:

Readers are radio frequency devices that:

- Transmit and receive RF signals

- Contain a control unit to execute commands

- Incorporate an interface to transfer data

- Receives commands from a Host computer

- Passes data back to the Host

RFID readers, also called interrogators, first and foremost are used to query RFID tags in

order to obtain identification, location, and other information about the device or product the

tag is embedded in. The RF energy from the reader antenna is collected by the RFID tag

antenna and used to power up the microchip.

Main method:-

In main method, there are 3 major modes of operation. The mode of operation at startup is

normal; however the modes can be changed through the terminal. In normal mode, the reader

waits for External Interrupt2 to finish reading a response from the card. It does this in about a

thousand executions of the interrupt. When enough bits have been sampled, we turn off the

External Interrupt2. When first analyzing the response from the card, we noticed periodicity

every 540 bits. Thus, to guarantee that our sample window captures a full continuous 540 bit

cycle, we sampled 1080 bits before turning off the interrupt. An example of a 1080 bit

response looked something like this:

001111100000011111000000111111000000000000111111111100000011111000000000000

111111000000111110000001111100000011111100000111100000011111111110000000000

001111110000011111100000011111111110000000000001111110000011111111111000000

Page 16: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

16

111110000001111000000000000111111000000111111111100000000000011111100000111

111000000000000000000111111111111111100000111111000000111110000001111100000

011111100000111111000000111110000001111111111000000000000111111111110000001

111100000000000011111100000111111000000111110000001111111111000000111111000

001111110000001111100000011111000000111111000000000000111111111100000011111

000000000000111111000000111110000001111100000011111100000111111000000111111

111100000000000011111100000111111000000111111111100000000000011111100000111

111111110000001111100000011111000000000000111111000000111111111100000000000

011111100000111111000000000000000000111111111111111100000111111000000111110

000001111100000011111100000111111000000111110000001111111111000000000000111

111111110000001111100000000000011111100000111111000000111110000001111111111

000000111111000001111110000

There is a long sequence of 1's and 0's that stand out; we used these as references to identify

the start and end of the 540-bit response. To extract the 540-bit response we wrote a function

to detect a sequence of 15 to 18 1's. This function loops until it finds the start sequence and

stores it in a global variable and calculates the end sequence.

There is also something noticeable about the 540-bit sequence. There are 1's and 0's in groups

of 5, 6, 10, 11, or 12 excluding the start and stop sequence. Since 10, 11, and 12 can be made

from combinations of 5 and 6, we hypothesized that maybe these longer groups are

combinations of two groups of 5 or 6. With this in mind, we wondered whether a group of 5

or 6 bits possibly represents a single bit. This would make sense because the card cannot

perfectly transition from one modulated frequency to another without some transition. Thus a

group of 10, 11, or 12 represents two bits. Thus the reduced (90 bit) version of the 540 bit

response excluding the start and stop sequence is extracted by detecting sequences of bits and

replacing them with a single or a double bit:

010101010101011001101001010101101010101010011010010101010101100101011001011

010100101100101

From this code, it is fairly obvious that the reduced sequence is encoded in Manchester code.

If you split up the 90 bit response into pairs of bits, there are transitions within each pair:

01 01 01 01 01 01 01 10 01 10 10 01 01 01 01 10 10 10 10 10 10 01 10 10 01 01 01 01 01 01

10 01 01 01 10 01 01 10 10 10 01 01 10 01 01

A transition from low to high corresponds to a 1 and a transition from high to low

corresponds to a 0. Since two bits correspond to a single bit, the Manchester decoded

response has half the bandwidth and is thus only 45 bits long:

111111101001111000000100111111011101100011011

We believe this code is the raw data stored on the card. We have not been able to decode this

further to find it's relation to Cornell student ID number but it is not necessary since this

number is unique to each card. After decoding the initial 540 bit response to this 45 bit code,

we store this data and sampled again. To prevent false reads, we keep sampling until we

successfully read 3 consecutive identical codes. If we get 3 consecutive identical codes, we

compare this code to the code bank (where all the authorized codes are stored). The code

bank is stored in EEPROM due to limited space in SRAM. If the 3 consecutive identical

Page 17: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

17

codes match a code in the code bank, a green LED is lit for 3 seconds to signify that the door

is unlocked. If the code does not match the code bank, a red LED is lit to signify that the door

is not opened and that the code is not authorized. A statement is also printed to the

administrative terminal providing the card code, whether the card was accepted, and the time

at which the event occurred.

The other mode is called remote operation. In this mode, the admin has a choice of remotely

adding a code to a specific code bank position or remotely adding any number of codes

(bound between 1 and 20 inclusive). When adding a code to a specific code bank position, we

turn on External Interrupt2 and read the card response. Just like in normal mode, we find the

start code, reduce the sequence, and Manchester decode the sequence. We do this until we

read 5 consecutive identical codes and then store it into the specified position in the code

bank. When adding a specific quantity of codes, we first search through the status of the

code bank and find the first unused position. Then we go into remote add by position mode

and we add the code at the first unused position. We do this until either the specified quantity

of codes is stored or until the code bank is full. After either of these modes finishes

executing, the reader goes back to its normal mode, but now with the new stored codes in the

code bank.

The end of the main loop serves as a scheduler that checks the timers for certain tasks and

executes the task. It executes the function to check the receive-ready flag, turns off the LED's

after 3 seconds, and executes the counter that keeps track of time and date.

There are three types of UHF tags: passive, semi-passive, and active. Passive tags use the

signal received from the reader to power the IC, and vary their reflection of this signal to

transmit information back to the reader. Passive tags are the most common in cost-sensitive

applications, because, having no battery and no transmitter, they are very inexpensive. Semi-

passive tags, sometimes known as battery-assisted passive tags, use a battery to power the tag

electronics, but also depend on a reflected signal for communications. Active tags are full-

featured radios with their own transmitting capability independent of the reader. In this

article we will consider only passive tags, the most commonly-encountered, and range-

challenged, of the three types.

Page 18: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

18

Page 19: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

19

3.3 COMPONENT DESCRIPTION

SERIAL COMMUNICATION:

When a microprocessor communicates with the outside world, it provides data in

byte-sized chunks. In some cases, such as printers, the information is simply grabbed from

the 8-bit data bus and presented to the 8-bit data bus of the printer. This can work only if the

cable is not too long, since long cables diminish and ever distort signals. Furthermore, and 8-

bit data path is expensive. For these reasons, serial communication is used for transferring

data between two systems located at distances of hundreds of feet to millions of miles apart.

The fact that in serial communication a single data line is used instead of the 8-bit

data line of parallel communication makes it not only much cheaper but also makes it

possible for two computers located in two different cities to communicate over the telephone.

Serial data communication uses two methods, a synchronous and asynchronous. The

synchronous method transfers a block of data at a time while the synchronous transfers a

single byte at a time. It is mean possible to write software to use either of these methods, but

the programs can be tedious and long. For this reason, there are special IC chips made by

many manufacturers for serial data communications. These chips are commonly referred to as

UART (universal asynchronous receiver-transmitter) and USART (universal synchronous -

asynchronous receiver-transmitter). The8051 chips has built-in UART, which is discussed

ASYNCHRONOUS SERIAL COMMUNICATION AND DATA FRAMING:

Transmitter and receiver do not explicitly coordinate each data transmission.

Transmitter can wait arbitrarily long between transmissions. Used, for example, when

transmitter such as a keyboard may not always have data ready to send Asynchronous may

also mean no explicit information about where data bits begin and end The data coming in at

the receiving end of the data line in a serial data transfer is all 0's and 1's; it is difficult to

make sense of the data unless the sender and receiver agree on a set of rules, a protocol, on

how the data is packed, how many bits constitute the character, and when the data begins and

ends.

Page 20: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

20

START AND STOP BITS:

A synchronous serial data communication is widely used for character orientation

transmissions. In the asynchronous method, each character is placed in between start and

stop bits. This is the called framing. In data framing for asynchronous communications, the

data, such as ASCII characters, are packed in between a start bit and a stop bits. The start bit

is always one-bit but the stop bit can be one or two bits. If the transmitter and receiver are

using different speeds, stop bit will not be received at the expected time problem is called

framing error. The start bit is always a 0 and the stop bit is 1.

PARITY BIT:

In some systems in order to maintain data integrity, the parity bit of the character byte

is included in the data frame. This means that for each character we have a single parity bit

in addition to start and stop bits. The parity bit is odd or even. In case of an odd parity bit

the number of data bits of a book of including the parity bit, is even.

DATA TRANSFER RATE:

The rate of data transfer in serial data communication is stated in bps (bits per

second). Another widely used terminology for bps is baud rate. Baud rate is defined as the

number of signal changes per second. As far as the conductor wire is concerned, the baud

rates as bps are the same. If each signal change represents more than one bit, bits per second

may be greater than baud rate.

3.1.3 RS232 STANDARDS:

Two allow compatibility among the data communication equipment made by various

manufacturers; an interfacing standard called RS232, was set by the electronics industries

association (EIA) in 1960. RS 232 is the standard defined for the connection of "Data

Terminal Equipment" (DTE) to "Data Communications Equipment" (DCE).

DTE (Data Terminal Equipment) is a generic term for an item which forms part of the

"information processing" portions of a system. Examples are: computer, printer, and terminal.

Page 21: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

21

DCE (Data Communications Equipment) is a device, which provides an interface

between a DTE and a communications link.

INTERFACE FOR DTE/DCE CONNECTION

Fig 3: Data Transmission

All Signals Are “Ground Referenced” to in Pin 7

TXD, RXD---- Transmit and Receive Signal

RTS---- Request to Send, from DTE

CTS---- Clear to send, from DCE together with RTS

DTE---- Data Terminal Ready, indicates to the modem that a DTE is Connected and enabled.

DSR--- Data Set Ready, indicates to the DTE that the modem is present and turned on

Page 22: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

22

Fig 2 : RS 232 Connections Fig 3: DB9 Connections

MALE CONNECTOR FEMALE CONNECTOR

Fig4: Male & Female Connectors

Page 23: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

23

MAX 232

Fig5: MAX 232 IC

The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to

signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual

driver/receiver and typically converts the RX, TX, CTS and RTS signals.

The drivers provide RS-232 voltage level outputs (approx. ± 7.5 V) from a single + 5 V

supply via on-chip charge pumps and external capacitors. This makes it useful for

implementing RS-232 in devices that otherwise do not need any voltages outside the 0 V to

+ 5 V range, as power supply design does not need to be made more complicated just for

driving the RS-232 in this case.

The receivers reduce RS-232 inputs (which may be as high as ± 25 V), to standard

5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of

0.5 V.

The later MAX232A is backwards compatible with the original MAX232 but may operate at

higher baud rates and can use smaller external capacitors – 0.1 μF in place of the 1.0 μF

capacitors used with the original device.

The newer MAX3232 is also backwards compatible, but operates at a broader voltage range,

from 3 to 5.5 V.

Pin to pin compatible: ICL232, ST232, ADM232, and HIN232.

Page 24: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

24

VOLTAGE LEVELS:

RS232 Line Type & Logic Level RS232 Voltage TTL Voltage to/from

MAX232

Data Transmission (Rx/Tx) Logic 0 +3 V to +15 V 0 V

Data Transmission (Rx/Tx) Logic 1 -3 V to -15 V 5 V

Control Signals (RTS/CTS/DTR/DSR) Logic 0 -3 V to -15 V 5 V

Control Signals (RTS/CTS/DTR/DSR) Logic 1 +3 V to +15 V 0 V

Fig6: MAX232 pin diagram

Page 25: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

25

FINGER PRINT SENSOR

A fingerprint sensor is an electronic device used to capture a digital image of the fingerprint

pattern. The captured image is called a live scan. This live scan is digitally processed to

create a biometric template (a collection of extracted features) which is stored and used for

matching. This is an overview of some of the more commonly used fingerprint sensor

technologies.

OPTICAL

Optical fingerprint imaging involves capturing a digital image of the print using visible light.

This type of sensor is, in essence, a specialized digital camera. The top layer of the sensor,

where the finger is placed, is known as the touch surface. Beneath this layer is a light-

emitting phosphor layer which illuminates the surface of the finger. The light reflected from

the finger passes through the phosphor layer to an array of solid state pixels (a charge-

coupled device) which captures a visual image of the fingerprint. A scratched or dirty touch

surface can cause a bad image of the fingerprint. A disadvantage of this type of sensor is the

fact that the imaging capabilities are affected by the quality of skin on the finger. For

instance, a dirty or marked finger is difficult to image properly.

ULTRASONIC

Ultrasonic sensors make use of the principles of medical ultra sonography in order to create

visual images of the fingerprint. Unlike optical imaging, ultrasonic sensors use very high

frequency sound waves to penetrate the epidermal layer of skin. The sound waves are

generated using piezoelectric transducers and reflected energy is also measured using

piezoelectric materials.

CAPACITANCE

Capacitance sensors utilize the principles associated with capacitance in order to form

fingerprint images. In this method of imaging, the sensor array pixels each act as one plate of

a parallel-plate capacitor, the dermal layer (which is electrically conductive) acts as the other

plate, and the non-conductive epidermal layer acts as a dielectric.

Page 26: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

26

PASSIVE CAPACITANCE

A passive capacitance sensor uses the principle outlined above to form an image of the

fingerprint patterns on the dermal layer of skin. Each sensor pixel is used to measure the

capacitance at that point of the array. The capacitance varies between the ridges and valleys

of the fingerprint due to the fact that the volume between the dermal layer and sensing

element in valleys contains an air gap. The dielectric constant of the epidermis and the area of

the sensing element are known values. The measured capacitance values are then used to

distinguish between fingerprint ridges and valleys.

ACTIVE CAPACITANCE

Active capacitance sensors use a charging cycle to apply a voltage to the skin before

measurement takes place. The application of voltage charges the effective capacitor. The

electric field between the finger and sensor follows the pattern of the ridges in the dermal

skin layer. On the discharge cycle, the voltage across the dermal layer and sensing element is

compared against a reference voltage in order to calculate the capacitance. The distance

values are then calculated mathematically, and used to form an image of the fingerprint.

Active capacitance sensors measure the ridge patterns of the dermal layer like the ultrasonic

method. Again, this eliminates the need for clean, undamaged epidermal skin and a clean

sensing surface.

Fig7: Fingerprint Sensor

Page 27: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

27

MICROCONTROLLER

A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a

single integrated circuit containing a processor core, memory, and

programmable input/output peripherals. Microcontrollers are used in automatically controlled

products and devices, such as automobile engine control systems, implantable medical

devices, remote controls, office machines, appliances, power tools, and toys.

8051 Microcontroller

The Intel 89C51 microcontroller is one of the most popular general purpose microcontrollers

in use today. The success of the Intel 8051 spawned a number of clones which are

collectively referred to as the MCS-51 family of microcontrollers, which includes chips from

vendors such as Atmel, Philips, Infineon, and Texas Instruments.

The Intel 89C51 is an 8-bit microcontroller which means that most available operations are

limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The

Short and Standard chips are often available in DIP (dual in-line package) form, but the

Extended 8051 models often have a different form factor, and are not "drop-in compatible".

All these things are called 8051 because they can all be programmed using 8051 assembly

language, and they all share certain features (although the different models all have their own

special features).

Fig 8:8051 Microcontroller

Page 28: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

28

LCD MODULE

To display interactive messages we are using LCD Module. We examine an intelligent LCD

display of two lines, 20 characters per line that is interfaced to the 8051.The protocol

(handshaking) for the display is as shown.

Whereas D0 to D7th bit is the Data lines, RS, RW and EN pins are the control pins and

remaining pins are +5V, -5V and GND to provide supply. Where RS is the Register Select,

RW is the Read Write and EN is the Enable pin.

The display contains two internal byte-wide registers, one for commands (RS=0) and the

second for characters to be displayed (RS=1). It also contains a user-programmed RAM area

(the character RAM) that can be programmed to generate any desired character that can be

formed using a dot matrix. To distinguish between these two data areas, the hex command

byte 80 will be used to signify that the display RAM address 00h will be chosen.

Port1 is used to furnish the command or data type, and ports 3.2 to 3.4 furnish register select

and read/write levels.

Fig 9: Liquid Crystal Display (LCD)

Page 29: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

29

EEPROM

EEPROM (also written E2PROM and pronounced "e-e-prom," "double-e prom," "e-squared,"

or simply "e-prom") stands for Electrically Erasable Programmable Read-Only Memory and

is a type of non-volatile memory used in computers and other electronic devices to store

small amounts of data that must be saved when power is removed, e.g., calibration tables or

device configuration.

When larger amounts of static data are to be stored (such as in USB flash drives) a specific

type of EEPROM such as flash memory is more economical than traditional EEPROM

devices. EEPROMs are realized as arrays of floating-gate transistors.

EEPROM is user-modifiable read-only memory (ROM) that can be erased and

reprogrammed (written to) repeatedly through the application of higher than normal electrical

voltage generated externally or internally in the case of modern EEPROMs. EPROM usually

must be removed from the device for erasing and programming, whereas EEPROMs can be

programmed and erased in circuit. Originally, EEPROMs were limited to single byte

operations which made them slower, but modern EEPROMs allow multi-byte page

operations. It also has a limited life - that is, the number of times it could be reprogrammed

was limited to tens or hundreds of thousands of times. That limitation has been extended to a

million write operations in modern EEPROMs. In an EEPROM that is frequently

reprogrammed while the computer is in use, the life of the EEPROM can be an important

design consideration. It is for this reason that EEPROMs were used for configuration

information, rather than random access memory.

Fig 10: EEPROM

Page 30: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

30

REAL TIME CLOCK

Real Time Clock (RTC) is a computer clock (most often in the form of an integrated circuit)

that keeps track of the current time. Although the term often refers to the devices in personal

computers, servers and embedded systems, RTCs are present in almost any electronic device

which needs to keep accurate time.

The term is used to avoid confusion with ordinary hardware clocks which are only signals

that govern digital electronics, and do not count time in human units. RTC should not be

confused with real-time computing, which shares its three-letter acronym, but does not

directly relate to time of day.

Purpose

Although keeping time can be done without an RTC, using one has benefits:

Low power consumption (important when running from alternate power)

Frees the main system for time-critical tasks

Sometimes more accurate than other methods

A GPS receiver can shorten its startup time by comparing the current time, according to its

RTC, with the time at which it last had a valid signal.If it has been less than a few hours then

the previous ephemeris is still usable.

Power source

RTCs often have an alternate source of power, so they can continue to keep time while the

primary source of power is off or unavailable. This alternate source of power is normally a

lithium battery in older systems, but some newer systems use a super capacitor because they

are rechargeable and can be soldered. The alternate power source can also supply power to

battery backed RAM.

Page 31: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

31

Timing

Most RTCs use a crystal oscillator, but some use the power line frequency.In many cases the

oscillator's frequency is 32.768 kHz. This is the same frequency used in quartz clocks and

watches, and for the same reasons, namely that the frequency is exactly 215

cycles per second,

which is a convenient rate to use with simple binary counter circuits.

Fig 11: Real Time Clock (RTC)

RS 232 Wiring and Connectors:

Fig12:RS232 connector

RS-232 Defines Serial, Asynchronous communication, Serial bits are encoded and

transmitted one at a time. Asynchronous characters can be sent at any time and bits are not

individually synchronized. This is standard for transfer of characters across copper wire.

Page 32: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

32

4. CIRCUIT DIAGRAM

4.1 Fingerprint System:

Fig13:Fingerprint system

Page 33: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

33

4.2 RFID System :

Fig14: RFID system

Page 34: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

34

Fig14: RFID system

Page 35: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

35

5 . APPLICATIONS

Door-Lock System

Safe Box

Simple Access Controller

Vehicle Control

ATM, POS

Car immobilizers

Animal identification

Access control

Process control

Automotive immobilizer

Contactless payments

Anti-theft

Library books

Speedpass

Control Access

Production/Inventory tracking

Page 36: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

36

6. WORKING

6.1 RFID STAGE:

RFID Readers:

Readers are radio frequency devices that:

- Transmit and receive RF signals

- Contain a control unit to execute commands

- Incorporate an interface to transfer data

- Receives commands from a Host computer

- Passes data back to the Host

RFID readers, also called interrogators, first and foremost are used to query RFID tags in

order to obtain identification, location, and other information about the device or product the

tag that is embedded in. The RF energy from the reader antenna is collected by the RFID tag

antenna and used to power up the microchip.

6.2 FINGERPRINT STAGE:

Enrolling:

We are provided with one time process of storage only i.e. when you switch on the power,

that time only the enrollment of fingerprint will take place in the project. Now, for enrollment

you have to press the identification button .

If you want to enroll again, previous data will get erased. For example, the first time id

number will be generated are like 00, 01, 02, 03…so on , and then again also they will be

generated with 00, 01, 02, 03 upto 20 storage capacities.

Note: For enrollment of the fingerprint, put your finger upon the fingerprint sensor module

and press the enroll button for a definite amount of time and then release it. After getting the

successful message then only you are supposed to leave your finger.

If you get the failed message , put your finger properly (no need to press the finger module,

just touch it enough) and try again in the same way.

Page 37: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

37

Identification:

Put your finger upon the fingerprint sensor module and press the enroll button for a definite

amount of time and then release it. After getting the successful message then only you are

supposed to leave your finger.

If you get the failed message , put your finger properly (no need to press the fingerprint

module, just touch it enough) and try again in the same way. Otherwise your fingerprint will

not get registered.

Memory:

Maximum capacity is 20 times for identification. If you want to erase memory remove

fingerprint module and connect the computer through serial cable. And then open the

HyperTerminal of the computer and press ‘D’ , you get a message "MEMORY CLEAR" .

Page 38: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

38

7. APPENDIX

7.1 APPENDIX-I (DATASHEETS )

MAX 232 IC(TEXAS INSTRUMENTS)

IC 7805 (FAIRCHILD SEMICONDUCTORS)

MICROCONTROLLER 89C51(ATMEL)

EEPROM AT24C04(ATMEL)

Page 39: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

39

7.2 APPENDIX-II (SOURCE CODE)

7.2.1 FINGERPRINT SENSING SOURCE CODE

#include<reg51.h>

#include"uart.h"

#include"lcd 4 bit.h"

#include"eeprom.h"

#include "rtc.h"

sbit ennro = P3^6;

sbit ident = P3^7;

sbit red = P2^5;

sbit green = P2^4;

sbit buzzer = P2^7;

unsigned char i=0,fp[20],j=0;

unsigned char rec=0x00,dummy=0x0f,id,check;

unsigned char B1,B2,add,count,memory=0,time_set=0,t1,t2,t3,att_data=0;

code unsigned char

enroll[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X01,0X00,0X05};

code unsigned char

generate_ch[13]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X04,0x02,0X01,0X00,

0X08};

Page 40: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

40

code unsigned char

store[12]={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X06,0X06,0X02,0x00};

code unsigned char

identify[17]={0xef,0x01,0xff,0xff,0xff,0xff,0x01,0x00,0x08,0x1b,0x01,0x00,0x00,0x01,0x0

1,0x00,0x27};

void enroll_finger(void);

void identify_finger(void);

void time_display(void);

void serial() interrupt 4

{

if(RI==1)

{

fp[j]= SBUF;

if(fp[j]=='+')

{

att_data=1;

}

if(fp[j]=='D')

{

eeprom_write(1,0);

memory=1;

}

if(fp[j]=='T')

{

time_set=1;

}

j++;

Page 41: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

41

RI=0;

}

}

void clearfp(void)

{

unsigned char cl=0;

while(cl<20)

{

fp[cl]=' ';

cl++;

}

j=0;

}

void long_delay (void )

{

unsigned int g1,k1;

for(g1=0;g1<50;g1++)

for(k1=0;k1<500;k1++);

}

void delay(unsigned int value)

{

unsigned int g,k;

for(g=0;g<100;g++)

for(k=0;k<value;k++);

Page 42: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

42

}

void main()

{

unsigned char inadd,z,x1,x,i1;

red=1;

green=1;

buzzer=1;

lcd_init();

uart_init();

lcd_cmd(0x01);

lcd_puts(" welcome ");

long_delay();

lcd_cmd(0x01);

lcd_puts(" FINGER PRINT ");

lcd_cmd(0xc0);

lcd_puts(" ATTENDANCE SYS ");

z=eeprom_read(1);

if((z==0)||(z==0xff))

{

count=0;

Page 43: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

43

inadd=2;

}

else

{

count=z;

inadd=(z*7)+2;

delay(200);

}

long_delay();

again:

lcd_cmd(0x01);

lcd_puts("PUT UR FINGER");

lcd_cmd(0xc0);

time_display();

EA=1;

ES=1;

while(1) //checking for sw1

{

lcd_cmd(0xc0);

time_display();

if(ennro==0) //checking for enrolling

{

Page 44: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

44

while(ennro==0);

enroll_finger();

goto again;

}

if(ident==0) //identify

{

while(ident==0);

identify_finger();

if( check==1)

{

if(count>19)

{

lcd_cmd(0x01);

lcd_puts("NOT ABLE TO STOR");

lcd_cmd(0xc0);

lcd_puts("MAX MEMORY REACH");

long_delay();

goto again;

}

count=count+1;

eeprom_write(1,count);

eeprom_write(inadd++,id);

Page 45: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

45

for(i1=3;i1!=0;i1--)

{

eeprom_write(inadd++,rtc_read(i1-1));

}

for(i1=4;i1<7;i1++)

{

eeprom_write(inadd++,rtc_read(i1));

}

}

goto again;

}

if(att_data==1) //checking for uart input

{

att_data=0;

lcd_cmd(0x01);

lcd_puts("DATA SENDING...");

uart_putch(10);

uart_putch(13);

Page 46: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

46

uart_puts("ID TIME DATE");

uart_putch(10);

uart_putch(13);

x1=eeprom_read(1);

delay(300);

add=2;

for(x=1;x<=x1;x++)

{

z= eeprom_read(add++);

uart_putch((z/10) +48);

uart_putch((z%10) +48);

uart_puts(" ");

i1=0;

while(i1<6)

{

z= eeprom_read(add++);

B1=z&0x0f;

B2=(z&0xf0)>>4;

uart_putch(B2+48);

uart_putch(B1+48);

if(i1<2)

uart_putch(':');

if((i1>2)&&(i1!=5))

uart_putch('/');

Page 47: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

47

if(i1==2)

uart_puts(" ");

i1=i1+1;

delay(300);

}

uart_putch(10);

uart_putch(13);

}

uart_putch(10);

uart_putch(13);

uart_puts("COMPLETED");

goto again;

}

if(memory==1)

{

memory=0;

count=0;

inadd=2;

uart_putch(10);

uart_putch(13);

uart_puts("MEMORY CLEAR");

}

Page 48: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

48

if(time_set==1)

{

EA=0;

ES=0;

time_set=0;

uart_putch(10);

uart_putch(13);

uart_puts("PLEASE ENTER THE TIME IN 24 HOURES MODE & DATE");

uart_putch(10);

uart_putch(13);

uart_putch(10);

uart_putch(13);

uart_puts("ENTER THE SECONS : ");

t1=uart_getch();

uart_putch(t1);

t2=uart_getch();

uart_putch(t2);

t3=(t1|t2);

rtc_write(0,t3); //ss

uart_putch(10);

uart_putch(13);

uart_putch(10);

Page 49: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

49

uart_putch(13);

uart_puts("ENTER THE MINITS : ");

t1=uart_getch();

uart_putch(t1);

t2=uart_getch();

uart_putch(t2);

t3=(t1|t2);

rtc_write(1,t3); //MM

uart_putch(10);

uart_putch(13);

uart_putch(10);

uart_putch(13);

uart_puts("ENTER THE HOURES : ");

t1=uart_getch();

uart_putch(t1);

t2=uart_getch();

uart_putch(t2);

t3=(t1|t2);

rtc_write(2,t3); //HH

Page 50: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

50

uart_putch(10);

uart_putch(13);

uart_putch(10);

uart_putch(13);

uart_puts("ENTER THE DAY OF MONTH : ");

t1=uart_getch();

uart_putch(t1);

t2=uart_getch();

uart_putch(t2);

t3=(t1|t2);

rtc_write(4,t3); //dd

uart_putch(10);

uart_putch(13);

uart_putch(10);

uart_putch(13);

uart_puts("ENTER THE MONTH OF YEAR: ");

t1=uart_getch();

uart_putch(t1);

t2=uart_getch();

uart_putch(t2);

Page 51: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

51

t3=(t1|t2);

rtc_write(5,t3); //mm

uart_putch(10);

uart_putch(13);

uart_putch(10);

uart_putch(13);

uart_puts("ENTER THE YEAR : ");

t1=uart_getch();

uart_putch(t1);

t2=uart_getch();

uart_putch(t2);

t3=(t1|t2);

rtc_write(6,t3); //yy

uart_putch(10);

uart_putch(13);

uart_putch(10);

uart_putch(13);

uart_puts(" successfully updated time & date ");

EA=1;

Page 52: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

52

ES=1;

}

}

}

void enroll_finger(void)

{

lcd_cmd(0x01);

lcd_puts("Enrolling.....");

i=0;

clearfp();

while(i<12)

{

uart_putch(enroll[i]);

i++;

}

j=0;

fp[9]=0x01;

while(j==0);

long_delay();

if(fp[9]==0x00)

{

}

else

Page 53: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

53

{

buzzer=0;

red=0;

lcd_cmd(0x01);

lcd_puts("ENROLL FAILED");

long_delay();

long_delay();

long_delay();

buzzer=1;

red=1;

goto end;

}

clearfp();

j=0;

i=0;

while(i<13)

{

uart_putch(generate_ch[i]);

i++;

}

j=0;

fp[9]=0x01;

while(j==0);

long_delay();

if(fp[9]==0x00)

{

}

Page 54: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

54

else

{

buzzer=0;

red=0;

lcd_cmd(0x01);

lcd_puts("ENROLL FAILED");

long_delay();

long_delay();

long_delay();

buzzer=1;

red=1;

goto end;

}

clearfp();

j=0;

i=0;

while(i<12)

{

uart_putch(store[i]);

i++;

}

uart_putch(rec);

uart_putch(0x00);

uart_putch(dummy);

j=0;

Page 55: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

55

fp[9]=0x01;

while(j==0);

long_delay();

if(fp[9]==0x00)

{

green=0;

lcd_cmd(0x01);

lcd_puts(" successfully ");

lcd_cmd(0xc0);

lcd_puts(" Enrolled");

long_delay();

lcd_cmd(0x01);

lcd_puts(" ur id : ");

lcd_data(rec/10+48);

lcd_data(rec%10+48);

rec++;

dummy++;

long_delay();

long_delay();

long_delay();

green=1;

goto end;

}

else

{

buzzer=0;

red=0;

Page 56: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

56

lcd_cmd(0x01);

lcd_puts("ENROLL FAILED");

long_delay();

long_delay();

long_delay();

buzzer=1;

red=1;

goto end;

}

end:

delay_ms(1);

}

void identify_finger(void)

{

lcd_cmd(0x01);

lcd_puts("IDENTIFYING...");

clearfp();

i=0;

j=0;

while(i<17)

{

uart_putch(identify[i]);

i++;

Page 57: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

57

}

j=0;

while(j==0);

long_delay();

if(fp[9]==0x00)

{

green=0;

lcd_cmd(0x01);

lcd_puts(" successfully ");

lcd_cmd(0xc0);

lcd_puts("identified ");

check=1;

id=fp[11];

lcd_data(fp[11]/10+48);

lcd_data(fp[11]%10+48);

long_delay();

long_delay();

long_delay();

green=1;

//goto end;

}

else

{

buzzer=0;

red=0;

lcd_cmd(0x01);

lcd_puts("IDENTIFY FAILED");

Page 58: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

58

check=0;

long_delay();

long_delay();

long_delay();

buzzer=1;

red=1;

goto end;

}

end:

delay_ms(1);

}

void time_display(void)

{

unsigned char temp;

temp=rtc_read(2);

lcd_i2c(temp);

lcd_data(':');

temp=rtc_read(1);

lcd_i2c(temp);

lcd_data(':');

temp=rtc_read(0);

lcd_i2c(temp);

lcd_data(' ');

temp=rtc_read(4);

lcd_i2c(temp);

Page 59: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

59

lcd_data('/');

temp=rtc_read(5);

lcd_i2c(temp);

//lcd_data('/');

// temp=rtc_read(6);

//lcd_i2c(temp);

}

Page 60: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

60

7.2.2 RFID IDENTIFICATION SOURCE CODE

/*===========================================*/

/*------radio freq id programming------------*/

/*------PH:89C51RD+,07/04/10-----------------*/

/*===========================================*/

LCD_DPort EQU P0

LCD_Rs EQU P1.5

LCD_Rw EQU P1.6

LCD_En EQU P1.7

DELAY1 DATA 30h

DELAY2 DATA 31h

DELAY3 DATA 32h

VStack DATA 61h

FDispRFID Bit 01h

/*---------------------------------*/

org 00h

ljmp Power_on

org 23h

ljmp serial_ISR

/*-------------------------------------*/

org 100h

Power_on:

mov R0,#00h

Page 61: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

61

clr A

LclearNxtRAM:

movx @R0,a

inc R0

cjne R0,#0FFh,LclearNxtRAM

mov R0,#00h

mov 8Eh,#00h ;8EH-00H means we are use Ex-RAM

mov SP,#VStack

acall LCD_Init

clr EA

mov TMOD,#20h

mov TH1,#0FDh

mov TL1,#0FDh

mov SCON,#50h

mov IE,#90h

setb TR1

acall welcomedata

mov R0,#70h

mov R2,#10

mov R3,#00h

setb EA

/*-------------------------------------*/

MainLoop:

Page 62: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

62

jb FDispRFID,RFIDLoop

jmp MainLoop

/*--------------------------------------*/

RFIDLoop:

clr FDispRFID

mov R0,#70h

mov R2,#10

mov dptr,#CARDNUM0

call Compare

cjne R3,#01h,Check_CARD1

call CARD0Detalis

mov R0,#70h

mov R2,#10

mov R3,#00h

jmp MainLoop

Check_CARD1:

mov dptr,#CARDNUM1

call Compare

cjne R3,#01h,Check_CARD2

call CARD1Detalis

mov R0,#70h

mov R2,#10

mov R3,#00h

jmp MainLoop

Page 63: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

63

Check_CARD2:

mov dptr,#CARDNUM2

call Compare

cjne R3,#01h,Check_Invalid

call CARD2Detalis

mov R0,#70h

mov R2,#10

mov R3,#00h

jmp MainLoop

Check_Invalid:

mov R0,#70h

mov R2,#10

mov R3,#00h

call lcdclear

call displine1

mov Dptr,#Invalidcard

call DISPDATA

call delay1sec

call delay1sec

call lcdclear

acall welcomedata

jmp MainLoop

CARDNUM0: DB "42006CF4C2"

CARDNUM1: DB "42006CF4BF"

Page 64: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

64

CARDNUM2: DB "380016C5AD"

Invalidcard: DB "INVALID CARD",0

/*--------------------------------------*/

Compare:

Card1_ChK:

clr a

movc a,@a+dptr

mov b,a

movx a,@R0

cjne a,b,Next_ChK

inc R0

inc dptr

djnz R2,Card1_ChK

inc R3

ret

Next_ChK:

mov R0,#70h

mov R2,#10

ret

/*--------------------------------------*/

CARD0Detalis:

call lcdclear

call displine1

mov Dptr,#Myname0

call DISPDATA

call displine2

mov Dptr,#Myname1

Page 65: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

65

call DISPDATA

call displine3

mov Dptr,#Myname2

call DISPDATA

call displine4

mov Dptr,#Myname3

call DISPDATA

call delay1sec

call delay1sec

call lcdclear

acall welcomedata

ret

CARD1Detalis:

call lcdclear

call displine1

mov Dptr,#Mycard0

call DISPDATA

call displine2

mov Dptr,#Mycard1

call DISPDATA

call displine3

mov Dptr,#Mycard2

call DISPDATA

Page 66: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

66

call displine4

mov Dptr,#Mycard3

call DISPDATA

call delay1sec

call delay1sec

call lcdclear

acall welcomedata

ret

CARD2Detalis:

call lcdclear

call displine1

mov Dptr,#Mycard12

call DISPDATA

call displine2

mov Dptr,#Mycard13

call DISPDATA

call displine3

mov Dptr,#Mycard14

call DISPDATA

call displine4

mov Dptr,#Mycard15

call DISPDATA

Page 67: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

67

call delay1sec

call delay1sec

call lcdclear

acall welcomedata

/*******/

Myname0: DB "Vehicle Name: BMW",0

Myname1: DB "Number :203 ",0

Myname2: DB "Genre :SPORTS ",0

Myname3: DB "Motto:RIDE HARD",0

/******/

Mycard0: DB "Name :MERCEDEZ",0

Mycard1: DB "Number :2813192 ",0

Mycard2: DB "Genre : LUXURY ",0

Mycard3: DB "The Best or nothing",0

/******/

Mycard12: DB "Name :n.suryasree",0

Mycard13: DB "Number : 2813220",0

Mycard14: DB "Branch :ECE Third ",0

Mycard15: DB "College:sathyabama university",0

/*--------------------------------------*/

serial_ISR:

push Acc

push DPH

push DPL

Page 68: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

68

jb RI,RX_Service

jb TI,TX_Service

pop DPL

pop DPH

pop Acc

reti

RX_Service:

clr RI

mov a,sbuf

movx @R0,a

inc R0

djnz R2,End_isr

setb FDispRFID

ljmp End_isr

TX_Service:

clr TI

ljmp End_isr

End_isr:

pop DPL

pop DPH

pop Acc

reti

/*-----welcome data programming-----------*/

welcomedata:

call lcdclear

call displine1

Page 69: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

69

mov dptr,#mydata

call DISPDATA

call displine2

mov dptr,#mydata1

call DISPDATA

call delay1sec

call delay1sec

call lcdclear

ret

mydata : DB" Welcome To ",0

mydata1: DB"VEHICLE IDENTIFICATION",0

/*---LCD initialization program------------*/

LCD_Init:

mov a,#30h

call LCD_CMND_OUT

mov a,#38h

call LCD_CMND_OUT

mov a,#06h

call LCD_CMND_OUT

Page 70: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

70

mov a,#01h

call LCD_CMND_OUT

mov a,#0ch

call LCD_CMND_OUT

RET

/*-------lcd command programming-----------*/

LCD_CMND_OUT:

call lcd_busy

mov LCD_DPort,a

clr LCD_Rs

clr LCD_Rw

setb LCD_En

nop

nop

clr LCD_En

RET

/*-------lcd data programming-----------*/

LCD_DATA_OUT:

call lcd_busy

mov LCD_DPort,a

setb LCD_Rs

clr LCD_Rw

setb LCD_En

nop

Page 71: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

71

clr LCD_En

RET

/*----------busy check programming------*/

lcd_busy:

mov LCD_DPort,#0ffh

CLR LCD_Rs

SETB LCD_Rw

AGAIN1:

CLR LCD_EN

NOP

NOP

SETB LCD_EN

JB p0.7,AGAIN1

RET

/*-----Dispaly the string&send---------*/

DISPDATA:

Next_Char:

clr a

movc a,@a+dptr

jz End_Str

call LCD_DATA_OUT

inc dptr

jmp Next_char

End_Str:

RET

/*------display routine----------------*/

lcdclear:

mov a,#01h

Page 72: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

72

call LCD_CMND_OUT

ret

displine1:

mov a,#80h

call LCD_CMND_OUT

ret

displine2:

mov a,#0c0h

call LCD_CMND_OUT

ret

displine3:

mov a,#94h

call LCD_CMND_OUT

ret

displine4:

mov a,#0d4h

call LCD_CMND_OUT

ret

/*-------Delay routine-------------------*/

delay1sec:

mov DELAY1,#10

wait2: mov DELAY2,#200

wait1: mov DELAY3,#250

wait: djnz DELAY3,wait

djnz DELAY2,wait1

djnz DELAY1,wait2

ret

Page 73: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

73

delay500ms:

mov DELAY1,#5

wait22:mov DELAY2,#183

wait12:mov DELAY3,#250

wait0: djnz DELAY3,wait0

djnz DELAY2,wait12

djnz DELAY1,wait22

ret

delay20ms:

wait32:mov DELAY2,#40

wait31:mov DELAY3,#250

wait3: djnz DELAY3,wait3

djnz DELAY2,wait31

ret

delay:

mov DELAY1,#0

same: djnz DELAY1,same

ret

end

Page 74: Integrated Security System

Dept. of Electronics & Comm. Engineering JIET, Jodhpur

74

8. REFERENCES

http://en.wikipedia.org/wiki/Serial_Communication

http://en.wikipedia.org/wiki/Real-time_clock

http://en.wikipedia.org/wiki/Fingerprint_recognition#Fingerprint_sensors

www.ti.com/lit/ds/symlink/max232.pdf

ISO IEC TR 21000-11 (2004), Multimedia framework (MPEG-21) -- Part 11:

Evaluation Tools for Persistent Association Technologies

"Content-Based Classification, Search, and Retrieval of Audio," IEEE MultiMedia,

vol. 3, no. 3, pp. 27-36, Sept., 1996.

computer.howstuffworks.com/fingerprint-scanner.htm

www.sciencedaily.com/releases/2009/10/091026093731.htm

www.biometrics.gov/documents/fingerprintrec.pdf


Recommended