93
CHAPTER 1 1.1 INTRODUCTION This note is to describe about the setup and configuration of the multimodal security system Multimodal Security System For Bank Locker and Secure Locations with GSM Alert and Remote Alarm Activation using PIC16F877A microcontroller. Here each locker is provided with a simple and cost efficient digital system that controls the lock to the locker instead of a key. The digital system is connected to a computer in the bank that in turn has the database of the customers with various details of them including their fingerprints. The communication between the computer and the microcontroller is provided via an RS-232 drivers/receiver and 74157 data multiplexer. The pic microcontroller is used to interface the number of components installed in the system such as the pc, pc interfacing circuit, data 1

Final Report (1)

  • Upload
    sri-ram

  • View
    254

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Final Report (1)

CHAPTER 1

1.1 INTRODUCTION

This note is to describe about the setup and configuration of the

multimodal security system Multimodal Security System For Bank

Locker and Secure Locations with GSM Alert and Remote Alarm

Activation using PIC16F877A microcontroller. Here each locker is

provided with a simple and cost efficient digital system that controls the

lock to the locker instead of a key. The digital system is connected to a

computer in the bank that in turn has the database of the customers with

various details of them including their fingerprints. The communication

between the computer and the microcontroller is provided via an RS-232

drivers/receiver and 74157 data multiplexer.

The pic microcontroller is used to interface the number of

components installed in the system such as the pc, pc interfacing circuit,

data multiplexer, gsm modem, electronic lock, LCD and alarm. This

system is designed using Embedded systems programming and has been

tested. This system thus helps provide secured bank locker systems thus

preventing theft by unauthorised persons accessing the lockers.

1

Page 2: Final Report (1)

1.2 LITERATURE SURVEY

1.2.1 EXISTING SYSTEM:

Most of the banks today use two keys to open the lockers. If the

bank manager wants to open the locker, two keys must be inserted in the

locker. One of which belongs to manager and second belongs to another

employee of the bank( cashier). The above system has many drawbacks,

Both the bank employees must have to present with the keys to open the

locker which is not secure. There is possibility of loosing the key which

makes the system insecure to the customer. The system is unabled to

match with today fast moving digital world. The keys can be

manufactured exactly similar to original ones which is very unsafe.

The Security Deposit will be kept under Bank's lien in respect of

rentals and other dues on locker services viz. breaking open or

replacement of lock in case of loss of keys etc. Locker facility is provided

by the bank at its selected branches. The lockers are allotted on first come

first served basis to the customers only. At the time of hiring the locker,

bank will obtain a minimum-security deposit in the form of FDR from

the lessee for the amount which would cover 3 years rent and the charges

for breaking open the locker in case of such eventualities.

An acknowledgement will be issued by the bank for fixed deposit

to be kept as security deposit. Loss of key should be immediately

informed to the bank branch. The bank is responsible for any loss.

2

Page 3: Final Report (1)

The locker is to be operated during the specified timing displayed at the

branches. You can operate the locker either singly or jointly, but only one

key is allotted per customer, while the other key remains with the bank.

Storing too much jewellery and valuables in the house at times

becomes a security issue and an impediment in case of natural calamities.

Bank lockers offers you, a safe, trustworthy space to store your valuables,

jewellery , documents and other things dear to you.

In bank lockers and others secure locations the existing system that

is used to protect the safe and lockers is the mechanical lock system. This

lock system uses a key to unlock the lockers. Thus the existing system is

not a reliable means as the mechanical locks are not secure and can be

broken by any means. And thus making and the bank lockers and other

secure locations, such as, jewelry shops, houses, etc..,. More unsecure.

Considering all these drawbacks we have designed a bank locker

system which is small attempt to compete with the today’s digital world.

1.2.2 PROPOSED SYSTEM:

The main aim of this project to provide secure banking system, by

taking fingerprints as authorized identity at banks.

In this ever growing field of electronics everything which is

manufactured is too compact and easy to handle and to understand. The

world is moving towards the automation, day by day as technology is

improving new systems are introduced. Bank locker system is one of the

3

Page 4: Final Report (1)

way of giving something new to world of traveling. Bank lockers are

used to keep the money, jwellery, important documents etc.

Bank locker security is most important for the safety of the

valuables. There are many cases of bank robbery from the bank lockers. .

In today life bank ATM centers are also not safe enough as there has been

some cases of money robbery from these ATMS. Taking this in account

we have provided a bank locker system which provides safe and user

friendly operation.

The purpose of the project is to provide a secured and reliable

environment to the customers for their banking transactions by providing

a unique identity to every user using the FINGER PRINT identification

technology. Here in this project we are going provide the at most security

since it is taking the FINGER PRINTS as the authentication for our

account. So whenever we want to access our account first we have to

press the finger on the finger print scanner. Scanner is interfaced to the

micro controller with the serial interfacing. The micro controller reads the

data from the scanner. The micro controller allows those users, who are

authorized to operate the account. If any unauthorized user tries to

operate the account the micro controller switches on the security alarm.

The total information about the account holders is stored in the

EEPROM.

4

Page 5: Final Report (1)

CHAPTER 2

2.1 BLOCK DIAGRAM

Fig 2.1 Block Diagram of Secure BankLocker system

5

Page 6: Final Report (1)

2.2 BLOCK DIAGRAM DESCRIPTION

The block diagram of the project is as shown above. It consists of

following materials involved as listed below,

In the given block diagram the finger print scanner is connected to a bank

computer which contains the user database including their corresponding

fingerprints.

There are a number of components used in this system that are interfaced

using a PIC microcontroller.

A pc interfacing circuit is provided to interface the user database and the

microcontroller.

In this system we use applications such as a fingerprint scanner and a

gsm modem, and they are connected together using a data multiplexer.

The entire system is controlled by the microcontroller. It is connected

with an LCD screen present in the locker and the electronic lock drives

provided for security.

An alarm is connected with the microcontroller that may be activated

whenever there is a fault access to the locker.

Whenever there is a correct entry of data the microcontroller directs the

electronic locker to open else the alarm will be activated.

6

Page 7: Final Report (1)

2.3 CIRCUIT DIAGRAM :

Fig 2.2 Circuit Diagram of System

7

Page 8: Final Report (1)

CHAPTER 3

TOOLS USED

3.1 SOFTWARE TOOLS

3.1.1 MPLAB IDE

IDE-INTEGRATED DEVELOPMENT ENVIRONMENT

IDE is a software application that provides comprehensive facilities to

computer programmers for software development. An IDE normally

consists of Source Code Editor,Compiler and Debugger.

A soure code editor is a text editor program designed specifically

forediting source code of computer programs by programmers.

A compiler is a computer program that transforms source code written in

a programming language into another computer language. The most

common reason for wanting to transform source code is to create an

executable program.

A special program used to find errors in other programs. A debugger

allows a programmer to stop a program at any point and examine and

change the values of variables.

MPLAB IDE is a free,integrated toolset for the development of

embedded applications employing microchip’s PIC and dsPIC

microcontrollers.

MPLAB IDE runs as 32-bit application on MS Windows.

8

Page 9: Final Report (1)

MPLAB is easy to use and includes a host of free software components

for fast application development and super-charged debugging.

MPLAB IDE also serves as a single,unified fraphical user interface for

additional Microchip and third party software and hardware development

tools.

MPLAB IDE is a integrated toolset for the development of embedded

applications employing Microchip’s PIC microcontrollers.

The MPLAB IDE runs as a 32-bit application on Microsoft windows.

Both assembly and C programming languages can be used with MPLAB

IDE.

3.1.2 ORCAD DESIGN

ORCAD really consists of tools

There are two types of tools.

Capture

Layout

Capture is used for design entry in schematic form.

Layout is a tool for designing the physical layout of components and

circuits on PCB

ORCAD is a proprietary software tool suite used primarily for electronic

design automation.

This software is used mainly to create electronic prints for manufacturing

of printed circuit boards.

It is also used by electronic design engineers and electronic technicians to

manufacture electronic schematics and diagrams and for their simulation.

9

Page 10: Final Report (1)

During the design process, you will move back and forth between these

two tools.

3.2 HARDWARE TOOLS

GSM Module

Data Multiplexer

Electronic Lock Drive and Lock

Microcontrollers – PIC

Alarm

LCD

10

Page 11: Final Report (1)

CHAPTER 4

POWER SUPPLY

4.1 INTRODUCTION:

Power supply is a device that transfers electric power from a

source to a load using electronic circuits. typical application of the power

supplies is to convert utility’s AC input power to regulated voltage

required for electronic equipments.

4.2 BASIC FUNCTIONAL UNITS:

Most electronic circuits need a DC supply such as a battery to

power them. Since the mains supply is AC it has to be converted to DC to

be useful electronics. This is what a power supply does.

Fig 4.1 Power Supply Unit

11

Page 12: Final Report (1)

First the AC mains supply passes through an isolating switch and

safety fuse before it enters the power supply unit.

In most cases the high voltage mains supply is too high for the

electronic circuitry.  It is therefore stepped down to a lower value by

means of a Transformer. The mains voltage can be stepped up where

high DC voltages are required. From the transformer the AC voltage is

fed to a rectifier circuit consisting of one or more diodes.

The rectifier converts AC voltage to DC voltage. This DC is not

steady as from a battery. It is pulsating. The pulsations are smoothed out

by passing them through a smoothing circuit called a filter. In its simplest

form the filter is a capacitor and resistor.

Any remaining small variations can, if necessary, be removed by a

regulator circuit which gives out a very steady voltage.This regulator

also removes any variations in the DC voltage output caused by the AC

mains voltage changing in value. Regulators are available in the

form of Integrated Circuits with only three connections.

Each of the blocks is described in more detail below:

Transformer - steps down high voltage AC mains to low voltage

AC.

Rectifier - converts AC to DC, but the DC output is varying.

Smoothing - smooths the DC from varying greatly to a small

ripple.

12

Page 13: Final Report (1)

Regulator - eliminates ripple by setting DC output to a fixed

voltage.

4.3 WORKING PRINCIPLE:

Fig 4.2 Circuit Diagram of Power Supply

The first section is the TRANSFORMER. The transformer

steps up or steps down the input line voltage and isolates the power

supply from the power line. The RECTIFIER section converts the

alternating current input signal to a pulsating direct current. And the

pulsating dc is not desirable. For this reason a FILTER section is used to

convert pulsating dc to a purer, more desirable form of dc voltage. The

final section, the REGULATOR, does just what the name implies. It

maintains the output of the power supply at a constant level in spite of

large changes in load current or input line voltages.

4.4 TRANSFORMER:

13

Page 14: Final Report (1)

A TRANSFORMER is a device that transfers electrical

energy from one circuit to another by electromagnetic induction

(transformer action). The electrical energy is always transferred without a

change in frequency, but may involve changes in magnitudes of voltage

and current. Because a transformer works on the principle of

electromagnetic induction, it must be used with an input source voltage

that varies in amplitude. There are many types of power that fit this

description; for ease of explanation and understanding, transformer

action will be explained using an ac voltage as the input source.The

centertap transformer is used in the power supply unit. a center-tapped

transformer and two diodes can form a full-wave rectifier that allows

both half-cycles of the AC waveform to contribute to the direct current,

making it smoother than a half-wave rectifier.a center tap is a wire that is

connected to a point half way along one of the windings of a

transformer , inductor or a resistor.

Center taps are sometimes used on inductors for the

coupling of signals, although most tappings are not at the centre but

usually near one end. In the case of resistors, tapping is usually done only

with potentiometers, and center tapping is just a special case of normal

operation of these devices.

4.5 RECTIFIER:

Rectification is the conversion of alternating current (AC) to

direct current (DC). This almost always involves the use of some device

that only allows one-way flow of electrons. As we have seen, this is

14

Page 15: Final Report (1)

exactly what a semiconductor diode does. The simplest type of rectifier

circuit is the half-wave rectifier, so called because it only allows one half

of an AC waveform to pass through to the load.

4.6 HALF WAVE RECTIFICATION:

A half wave rectifier is a special case of a clipper. In half wave

rectification, either the positive or negative half of the AC wave is passed

easily while the other half is blocked, depending on the polarity of the

rectifier. Because only one half of the input waveform reaches the output,

it is very inefficient if used for power transfer. Half wave rectification

can be achieved with a single diode in a one phase supply.

Fig 4.3 Half Wave Rectifier

For most power applications, half-wave rectification is

insufficient for the task. The harmonic content of the rectifier's output

waveform is very large and consequently difficult to filter. Furthermore,

AC power source only works to supply power to the load once every

half-cycle, meaning that much of its capacity is unused. Half-wave

rectification is, however, a very simple way to reduce power to a resistive

15

Page 16: Final Report (1)

load. Some two-position lamp dimmer switches apply full AC power to

the lamp filament for "full" brightness and then half-wave rectify it for a

lesser light output.

4.7 FULL WAVE RECTIFICATION:

IN4001 is the diode that is used to construct rectifier.If we

need to rectify AC power so as to obtain the full use of both half-cycles

of the sine wave, a different rectifier circuit configuration must be used.

Such a circuit is called a full-wave rectifier. One type of full-wave

rectifier, called the center-tap design, uses a transformer with a center-

tapped secondary winding and two diodes, like this:

Fig 4.4 Full Wave Rectifier Circuit(Center-tap)

This circuit's operation is easily understood one half-cycle at a

time. Consider the first half-cycle, when the source voltage polarity is

positive (+) on top and negative (-) on bottom. At this time, only the top

16

Page 17: Final Report (1)

diode is conducting; the bottom diode is blocking current, and the load

"sees" the first half of the sine wave, positive on top and negative on

bottom. Only the top half of the transformer's secondary winding carries

current during this half-cycle:

Fig 4.5 Full Wave Rectifier Circuit First half Cycle

During the next half-cycle, the AC polarity reverses. Now, the

other diode and the other half of the transformer's secondary winding

carry current while the portions of the circuit formerly carrying current

during the last half-cycle sit idle. The load still "sees" half of a sine wave,

of the same polarity as before: positive on top and negative on bottom:

17

Page 18: Final Report (1)

Fig 4.6 Full Wave Rectifier Circuit Second half Cycle

One disadvantage of this full-wave rectifier design is the necessity

of a transformer with a center-tapped secondary winding. If the circuit in

question is one of high power, the size and expense of a suitable

transformer is significant. Consequently, the center-tap rectifier design is

seen only in low-power applications.

Another, more popular full-wave rectifier design exists, and it is

built around a four-diode bridge configuration. For obvious reasons, this

design is called a full-wave bridge:

Fig 4.7 Full Wave Rectifier Circuit (Bridge)

18

Page 19: Final Report (1)

Current directions in the full-wave bridge rectifier circuit are as

follows for each half-cycle.Here we do not use the full wave bridge

rectifier circuit.

4.8 FILTER:

This DC is not steady from a rectifier. It is pulsating. The

pulsations are smoothed out by passing them through a smoothing circuit

called filter. In its simplest form the filter is a capacitor and resistor.

4.9 CAPACITOR FILTER

The simple capacitor filter is the most basic type of power supply

filter. The use of this filter is very limited. It is sometimes used on

extremely high-voltage, low-current power supplies for cathode-ray and

similar electron tubes that require very little load current from the supply.

This filter is also used in circuits where the power-supply ripple

frequency is not critical and can be relatively high. The simple capacitor

filter consists of a single-filter element. This capacitor (C1) is connected

across the output of the rectifier in parallel with the load. The RC charge

time of the filter capacitor (C1) must be short and the RC discharge time

must be long to eliminate ripple action when using this filter. In other

words, the capacitor must charge up fast with preferably no discharge at

all. Better filtering also results when the frequency is high; therefore, the

full-wave rectifier output is easier to filter than the half-wave rectifier

because of its higher frequency.

4.10 78L05 REGULATOR:

19

Page 20: Final Report (1)

78L05 is the regulator used for the regulation of the DC output

from the filter.The LM78LXX series of three terminal positive regulators

is available with several fixed output voltages making them useful in a

wide range of applications. When used as a zener diode/resistor

combination replacement, the LM78LXX usually results in an effective

output impedance improvement of two orders of magnitude, and lower

quiescent current. These regulators can provide local on card regulation,

eliminating the distribution problems associated with single point

regulation. The voltages available allow the LM78LXX to be used in

logic systems, instrumentation, HiFi, and other solid state electronic

equipment.

The LM78LXX is available in the plastic TO-92 (Z) package, the

plastic SO-8 (M) package and a chip sized package (8-Bump micro

SMD) using National's micro SMD package technology. With adequate

heat sinking the regulator can deliver 100mA output current. Current

limiting is included to limit the peak output current to a safe value. Safe

area protection for the output transistors is provided to limit internal

power dissipation. If internal power dissipation becomes too high for the

heat sinking provided, the thermal shutdown circuit takes over preventing

the IC from overheating.

20

Page 21: Final Report (1)

CHAPTER 5

PIC MICROCONTROLLER

5.1 INTRODUCTION TO PIC MICROCONTROLLERS

The term PIC, or Peripheral Interface Controller, is the name given

by Microchip Technologies to its single – chip microcontrollers. These

devices have been phenomenally successful in the market for many

reasons, the most significant ones are mentioned below. PIC micros have

grown in steadily in popularity over the last decade, ever since their

inception into the market in the early 1990s. PIC micros have grown to

become the most widely used microcontrollers in the 8- bit

microcontroller segment.

The PIC16F877 is 40 pin IC. There are six ports in this

microcontroller. Namely PORT A, PORT B, PORT C, PORT D and

PORT E. Among these ports PORT B, PORT C and PORT D contains 8-

pins, where PORTA contains 6-pins and PORT E contains 3-pins.

Each pins in the ports can be used as either input or output pins.

Before using the port pins as input or output, directions should be given

in TRIS register. For example setting all the bits in TRIS D register

indicates all the pins in PORT D are used input pins.

21

Page 22: Final Report (1)

Clearing all the bits in TRIS D register indicates all the pins in

PORT D are used as output pins. Likewise TRIS A, TRIS B, TRIS C,

TRIS E registers available for PORT A, PORT B, PORT C and PORT E.

The main factors that account for the popularity of PIC micros

include the following:

Speed: When operated at its maximum clock rate, a PIC executes

most instructions in 0.2µs, or five instructions in a microsecond.

Instruction set simplicity: The instruction set consists of just 35

instructions.

Integration of operational features: PIC micros have features

like Power on Reset and Brown out protection which ensures that the

chip operates only when the supply voltage is within specification. A

watchdog timer resets the PIC if the chip ever malfunctions and deviates

from its normal operations.

Flexibility in clock sources: The PIC micros can be run with four

different types of clock sources which help in cost cutting and power

saving.

High current capabilities of ports: The ports pins on PIC micros

can source and sink up to 25mA, which make them all the more versatile

and economic.

Serial programming via two pins: PIC micros can be

programmed serially with two pins, which bring down the complexity

and the cost of PIC programmers, drastically.

22

Page 23: Final Report (1)

On chip EEPROM: The on chip EEPROM helps retain critical

data even if the power is down. There by reducing the cost of and

external EEPROM from the overall system cost.

5.2 MICROCONTROLLER ARCHITECTURE

23

Page 24: Final Report (1)

Fig 5.1 Microcontroller Architecture

5.3 GENERAL DESCRIPTION OF P16F877

24

Page 25: Final Report (1)

The architecture of PIC16F877 contains 4-banks of register

files such as Bank 0, Bank 1, Bank 2 and Bank 3 from 00h-07h, 80h-FFh,

100h-17Fh and 180h-1FFh respectively. And it is also having program

FLASH memory, Data memory and Data EEPROM of 8K, 368 and 256

Bytes respectively.

5.4 REGISTER FILE

The term register file in PIC terminology used to denote the

locations than an instruction can access via an address. The register file

consists of two components, they are

General purpose register file

Special purpose register file

5.4.1 GENERAL PURPOSE REGISTER FILE

The general-purpose register file is another name for the

microcontrollers RAM. Data can be written to each 8-bit location,

updated and retrieved any number of times. All control registers are

coming under the general purpose register file.

5.4.2 SPECIAL PURPOSE REGISTER FILE

The special purpose register file contains input and output ports as

well as the control registers used to establish each bit of port as either an

input or output. It contains registers that provide the data input and data

output to the variety of resources on the chip, such as the timers, the

serial ports and the analog–to–digital converter. It has registers that

25

Page 26: Final Report (1)

contain control bits for selecting the mode of operation of a chip resource

as well as enabling or disabling its operation.Every instruction that can

employ the direct addressing mode can, as an alternative employ the

indirect addressing mode. In this alternative mode, the full 8-bit register

file address is first written into FSR, a special purpose register that serves

as an address pointer to any address throughout the entire register file.

5.5 MINIMUMBASICCIRCUIT EXPLANATION FOR

PIC16F877A

Fig 5.2 Circuit Diagram for PIC 16F877A

The Minimum basic circuit is the fundamental circuit that is

required for the microcontroller to run. The above shown circuit is one of

the possible minimum basic circuits for the PIC. Like most other

microcontrollers, for the PIC to execute any application the following are

required

26

Page 27: Final Report (1)

The Power Input

The Clock input

The Reset circuit

5.5.1 THE POWER INPUT :

The microcontroller works on 5V DC and it can be given either to

Pin 32 or Pin 11. Both these pins are Vdd inputs or power inputs. The Vss

signal on the microcontroller must be connected to the ground these are

Pins 10 or Pin 31.

Between the 5V and the ground a 0.1uF capacitor is connected.

This capacitor is used to eliminate any noise in the 5V input to the

microcontroller. This capacitor is called a Decoupling capacitor.

5.5.2 THE CLOCK CIRCUIT :

Any microcontroller or processor needs a clock source for it to

execute a program. There are various ways of giving the clock signal to a

microcontroller, the most reliable and the common method used is to use

a crystal oscillator. Between the Pin number 13 and 14 a crystal oscillator

is connected. When the power is given to the microcontroller, the crystal

oscillator starts producing clock signals at a frequency of 20MHz.

A 20MHz crystal is used because it is the highest frequency at

which the PIC can work and hence it gives the fastest program execution

speed at this frequency. If required, lesser frequencies can also be used.

27

Page 28: Final Report (1)

For changing the frequency a different crystal of a different resonant

frequency must be used.

To the crystal two ceramic capacitors are connected each of 33pF

value. These two capacitors are called loading capacitors and are required

for the crystal to produce a continuous and uniform clock signal. The

values of these capacitors are specified by the manufacturer of the crystal

and the microcontroller.

5.5.3 THE RESET CIRCUIT :

Pin 1 on the PIC is the RESET signal input. The RESET signal is

an active low signal. When a low voltage (0V) is applied to the pin 1, the

microcontroller gets reset. For the normal execution of the project the pin

1 must be maintained at a high voltage (5V).

For providing the RESET signal a resistor and a switch are

connected to pin1. The resistor is connected to 5V and this will normally

maintain the pin 1 at 5V and the microcontroller will function normally.

When the switch is pressed pin 1 is connected to ground and the voltage

at pin 1 becomes 0V. Under this condition the microcontroller gets reset.

Thus pressing the switch will reset the microcontroller.

28

Page 29: Final Report (1)

5.5 PIN DIAGRAM

Fig 5.3 Pin Diagram

29

Page 30: Final Report (1)

5.6 EXPLANATION FOR PIC16F877A :

To operate a microcontroller, you need some basic components to

support it and the circuit we call it basic circuit. above, i will share the

schematic of basic circuit to operate a PIC16F877A microcontroller.

IN4148 - is a Shockley diode to allow the microcontroller to be

programmed by ICSP method

SW - is a 2 pins push button to allow manually reset the microcontroller

R1k - is a 1K 1/4 W resistor to pull high or enable the MCLR pin

XTAL - is a crystal oscillator to generate clock to the microcontroller

C - supporting parts for the crystal

VCC - 5V supply

GND - 0V

5.7 FEATURES:

High-performance RISC CPU

All single cycle instructions except for program branches which are 2 cycle

Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle

Up to 8K x 14 words of Flash Program Memory,

Up to 256 x 8 bytes of EEPROM data memory

Pin out compatible to the PIC16C73/74/76/77

30

Page 31: Final Report (1)

Interrupt capability -up to 14 internal/external

Eight level deep hardware stack

Direct, indirect, and relative addressing modes

Power-on Reset (POR)

Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)

Watchdog Timer (WDT) with its own on-chip RC Oscillator for reliable operation

Programmable code-protection

Power saving SLEEP mode

Selectable oscillator options

Low-power, high-speed CMOS EPROM/EEPROM technology

Fully static design

In-Circuit Serial Programming (ICSP) via two pins

Only single 5V source needed for programming capability

In-Circuit Debugging via two pins

Processor read/write access to program memory

Wide operating voltage range: 2.5V to 5.5V

High Sink/Source Current: 25 mA

Commercial and Industrial temperature ranges

31

Page 32: Final Report (1)

CHAPTER 6

PC INTERFACING

6.1 INTRODUCTION

To interface the project to the computer, the RS232 port on the

computer is used.RS232 is the technical name of the serial port on the

computer, which is also referred to as the comm port (communications

port). Before going into the details of the RS232 lets first evaluate all the

other options available and find out why the RS232 port is used for the

project.

The standard IBM clone PC has a variety of ports or interfaces

available for different applications. Some of these ports like the VGA

port, the Ethernet port and the PS2 port are for dedicated purposes. But

the rest of the interfaces are quite general and can be used for interfacing

custom hardware and applications like experimental projects. These are

the ports like,

1. The Universal Serial Bus Port or the USB port

2. The Parallel port.

3. The Serial port or the Common port

6.1.1 THE USB PORT :

The Universal serial Bus Port or in short the USB port is

undoubtedly the most popular general purpose port that is available on

32

Page 33: Final Report (1)

the computer. Also any relatively modern computer has normally four

and some times even six USB ports. Hence the chances of finding a free

USB port for interfacing are always quite high. The USB is a very good

option when high speed communication is required. But the USB is not

always a very good option for experimental interfacing like in the case of

a project.

USB in spite all its advantages is a relatively complicated port to

use in terms of programming. Also most software like Visual Basic or

even technical software likes Lab View; don’t have features to use the

USB port directly. Hence if a user wants to interface a custom hardware

to a USB port he has to write device drivers which require a in depth and

a detailed knowledge of the operating system. Also for interfacing a

application to the USB port, the application hardware must have a USB

controller IC, or a microcontroller which supports USB communication.

Hence using a USB port is both complicated on the hardware and the

software front.

6.1.2 THE PARALLER PORT:

The parallel port on the computer was actually developed for

communication with line printers. Until a few years back printers still

used the parallel port. But now with the USB port becoming the preferred

choice for all peripheral communications, the parallel port is not used any

more. But to maintain compatibility with older computers, recent

computers still have the parallel port. Generally computers have always

had only one parallel port and even today a single parallel port is present

33

Page 34: Final Report (1)

on all computers. Since printers generally use the USB port, the parallel

port is most often available free for being used as a general purpose port.

The parallel port is a simple port to use in terms of hardware

requirements for interfacing to the port. But the only and the main draw

back to using the parallel port lies in the concept of parallel

communication. For doing 8 bit data transfer over a parallel port 8 wires

are used and also 8 pins on a microcontroller would be used up. Using up

8 pins on a microcontroller just for communication is not a very efficient

usage of the microcontroller. Also since 8 wires are used for the

communication, the cable becomes bulky. Another major disadvantage of

the parallel port is the limitation on the distance of communication.

Depending upon the speed of the communication the distance of

communication for the parallel port is about a few feats only. Hence the

parallel port is also not the best choice when it comes to general purpose

interfacing.

6.1.3 THE SERIAL PORT :

The serial port or the comm port (short form for communication

port) is another available option for interfacing to the PC. The serial port

on computers is in accordance with the RS232 standard defined by the

EIA/TIA (Electronic Industry Association and the Telecommunications

Industry Association) and hence is also referred to as the RS232 port (RS

means Recommended Standard).

34

Page 35: Final Report (1)

The RS232 port was developed in the 1970’s for connecting

devices like modems to a computer. Later on they were used for many

other functions like connecting mouse, keyboards and even printers to a

computer. But with the USB gaining in popularity the serial port is very

rarely used these days. Hence the RS232 port like the parallel port is

almost always free.

But unlike the parallel port the RS232 port is much easier to use

for general purpose interfacing and experimentation. On the

programming front the serial port is the easiest of all the ports on a

computer to use. Serial port can be directly accesses from most high level

languages directly with simple commands. Also most microcontrollers

come with a inbuilt serial communication module (USART) and hence

programming the PC and a microcontroller for serial communication is

very easy.

Also since the communication is serial the number of wires

required for data transfer is also minimal. Mostly just three wires are

sufficient for doing full duplex serial communication. Hence the cabling

is also simple and the number of pins used up on the microcontroller is

also minimal. Also the RS232 is capable of communicating over much

more longer distances than the parallel port.

The RS232 standard defines two types of connectors that can be

used for communication.

35

Page 36: Final Report (1)

Fig 6.1 RS-232 Connector Pin Assignment

The two types of connectors are shown above. Among the two the

25 pin connectors has become obsolete and is not used any more. All

computers these days have the 9 pin connector. Even on the 9 pin

connectors most signals are not used these days as they were primarily

designed for communication with a modem. In fact for simple

experimental purposes only three of the 9 pins are used. These are pins 2,

3 and 5. Pin 2 is for receiving data, pin 3 is transmitting data and pin 5 is

ground. With these three pins most communications can be

accomplished.

36

Page 37: Final Report (1)

The only drawback to RS232 port is the fact that it works at

different voltage levels than conventional TTL/CMOS devices like

microcontrollers. Because of this a voltage conversion device or circuit is

required between the PC and the microcontroller.

6.2 RS232 VOLTAGE LEVELS

As mentioned earlier RS232 uses voltage levels which are very

different from TTL/CMOS circuits or devices. The reason being the fact

that RS232 was defined in 1962 and at that time TTL/CMOS circuits

were not widely used. Also RS232 was created to handle relatively long

distances and hence used much higher voltages than any other digital

circuits. In the RS232 standard, a logic “HIGH” or logic 1 is represented

by a -5V to -15V signal and a logic “LOW” or a logic 0 is represented by

a +5V to +15V signal during transmission.

During reception, a logic HIGH or a logic 1 is represented by a -

3V to -15V signal and a logic LOW or logic 0 is represented by a +3V to

+15V signal.

These Voltages are a stark contrast to the voltages used by most

TTL/CMOS circuits where a logic HIGH or logic 1 is generally

represented by a +5V signal and a logic LOW or logic 0 is represented by

a 0V signal.

37

Page 38: Final Report (1)

Fig 6.2 RS-232 Voltage Level

6.3 RS232 VOLTAGE LEVEL CONVERTERS:

As mentioned earlier the microcontroller uses TTL/CMOS signals

and hence by connecting the microcontroller directly to the RS232 port

the communication is not possible as both use different voltage levels.

Hence there is a need to use a circuit or a device which can convert the

TTL/CMOS signals to RS232 signals and vice versa.

This voltage level conversion can be done either using discrete

components or using ICs which are specifically built for the purpose of

RS232 voltage level conversions. There a quite a few ICs available for

38

0V

+5V

-5V

+15V

-15V

Logic 0

Logic 1

0V

+3V

-3V

+15V

-15V

Logic 0

Logic 1

Transmission Reception

Page 39: Final Report (1)

this purpose, one such IC is MAX232. The MAX 232 is a very popular

IC and it is in a way the default choice for RS232 voltage conversions.

The MAX 232 is automatically converts TTL/CMOS input to RS232

signals and vice versa.

Fig 6.3 Pin Diagram of MAX232

39

Page 40: Final Report (1)

Fig 6.4 Circuit Diagram

The MAX232 is a 16 pin IC and it requires external 5 capacitors to

do the voltage conversions. MAX232 uses a 5V power input and from the

5 volts it generates +10V and -10V, which are used for the RS232

communication as they are within the RS232 voltage levels.

There are two buffers for converting from RS232 to TTL/CMOS

and two for conversion for TTL/CMOS to RS232. Pin number 11, 12 are

TTL/CMOS inputs and the corresponding RS232 signals can be taken out

from pins 14 and 7. Similarly pins 13, 8 are RS232 inputs and the

corresponding TTL/CMOS out puts can be taken on pins 12 and 9.

40

Page 41: Final Report (1)

CHAPTER 7

DATA MULTIPLEXER

7.1 INTRODUTION

A multiplexer (or MUX) is a device that selects one of several

analog or digital input signals and forwards the selected input into a

single line. A multiplexer of 2n inputs has n select lines, which are used

to select which input line to send to the output. Multiplexers are mainly

used to increase the amount of data that can be sent over the network

within a certain amount of time and bandwidth. A multiplexer is also

called a data selector.

7.2 GENERAL DESCRIPTION

These data selectors/multiplexers contain inverters and drivers to

supply full on-chip data selection to the four output gates.

Fig 7.1 Order Number 54157DMQB(Multiplexer)

41

Page 42: Final Report (1)

A separate strobe input is provided. A 4-bit word is selected from

one of two sources and is routed to the four outputs.

INPUTOUTPUTStrobe Select A B

HLLLL

XLLHH

XLHXX

XXXLH

LLHLH

Table 7.1 Function Table

7.3 ABSOLUTE MAXIMUM RATINGS

If Military/Aerospace specified devices are required,please contact the

National Semiconductor Sales Office/Distributors for availability and

specifications.

Supply Voltage = 7V , Input Voltage = 5.5V

Operating Free Air Temperature Range

DM54 and 54 b55§C to a125§C

DM74 0§C to a70§C

Storage Temperature Range b65§C to a150§C

42

Page 43: Final Report (1)

7.4 LOGIC DIAGRAM

Fig 7.2 Logic Diagram

7.5 FEATURES

Buffered inputs and outputs .

Typical propagation time 9 Ns.

Typical power dissipation 150 mW.

Alternate Military/Aerospace device (54157) is available. Contact a

National Semiconductor Sales Office/Distributor for specifications.

7.6 APPLICATIONS

Expand any data input point.

Multiplex dual data buses.

Generate four functions of two variables (one variable is common).

43

Page 44: Final Report (1)

CHAPTER 8

GSM MODEM

8.1 DEFINITION

Gobal system for mobile communication (GSM) is a globally

accepted standard for digital cellular communication. GSM is the name

of a standardization group established in 1982 to create a common

European mobile telephone standard that would formulate specifications

for a pan-European mobile cellular radio system operating at 900MHz.

8.2 THE GSM NETWORK

GSM provides recommendations, not requirements. The GSM

specifications define the functions and interface requirements in detail

but do not address the hardware.

Fig 8.1 GSM Network

44

Page 45: Final Report (1)

The reason for this is limit the designers as little as possible but

still to make it possible for the operators to buy equipment from different

suppliers. The GSM network is divided into three major systems : the

switching system(SS), the base station system(BSS),and the operation

and support system (OSS).

8.3 FACTS OF GSM MODEM:

The GSM/GPRS Modem comes with a serial interface through

which the modem can be controlled using AT command interface. An

antenna and a power adapter are provided.

AT commands are ATtention commands used for various operation with a

modem like a GSM modem.

Ex:

ATD <number> - is used for dialing to a certain number.

Similarly there are AT commands used for all the different operations

possible with a modem.

There are standard and extended AT commands.

Standard AT commands are mainly used for telephone and FAX related

applications.

Extended AT commands are used with GSM modems for SMS and data

related communications.

For sending sms AT+CMGS is used.

45

Page 46: Final Report (1)

The basic segregation of working of the modem is as under:

• Voice calls

• SMS

• GSM Data calls

• GPRS

Voice calls:

Voice calls are not an application area to be targeted. In future if

interfaces like a microphone and speaker are provided for some

applications then this can be considered.

SMS:

SMS is an area where the modem can be used to provide features

like:

• Pre-stored SMS transmission, these SMS can be transmitted on certain

trigger events in an automation system.

• SMS can also be used in areas where small text information has to be

sent. The transmitter can be an automation system or machines like

vending machines, collection machines or applications like positioning

46

Page 47: Final Report (1)

systems where the navigator keeps on sending SMS at particular time

intervals

• SMS can be a solution where GSM data call or GPRS services are not

available

GSM Data Calls:

Data calls can be made using this modem. Data calls can be made

to a normal PSTN modem/phone line also (even received). Data calls are

basically made to send/receive data streams between two units either

PC’s or embedded devices. The advantage of Data calls over SMS is that

both parties are capable of sending/receiving data through their terminals.

Some points to be remembered in case of data calls:

• The data call service doesn’t come with a normal SIM which is

purchased but has to be requested with the service provider (say Airtel).

• Upon activation of data/fax service you are provided with two separate

numbers i.e. the Data call number and the Fax service number.

• Data calls are established using Circuit Switched data connections.

• Right now the speed at which data can be transmitted is 9.6 kbps.

• The modem supports speeds up to 14.4 kbps but the provider give a

maximum data rate of 9.6 kbps during GSM data call.

47

Page 48: Final Report (1)

• Technologies like HSCSD (high Speed Circuit Switched Data) will

improve drastically the data rates, but still in pipeline..

CHAPTER 9

FINGER PRINT SCANNER

9.1 FINGER PRINT SCANNER

The fingerprint recognition system may suffer attacks at different

points during the authentication process. The following figure shows the

possible points. In each of these point the data may be altered and forced

an authentication of unregistered user.

Fig 9.1 Block Diagram of Finger Print Technique

48

Page 49: Final Report (1)

The most common attacks occur by the use of fake fingerprint during the

capture of image. A fake fingerprint are build from latent fingerprint left

at touched items such as glasses, doorknobs, glossy paper, etc. Using this

fingerprint are build three-dimensional molds of rubber membrane, glue,

or gelatin.

During the transmission of the image to the feature extractor may occur

interception of the channel, and consequently, the fingerprint image may

be stolen and later, used for fake fingerprint construction or for directly

access to feature extractor by bypassing the scanner.

The feature extractor may be substitute by a Trojan horse, which bypass

the feature extractor and generate artificial template and submit to the

matcher.

The transmission channel between the feature extractor and matching

may also be intercepted and the fingerprint feature may be stored for the

later use.

In the matching module may occur the same problem as in the feature

extractor. The presence of Trojan horse may produce always the desired

result independent of the input fingerprint.

The database may also suffer attack of Trojan horse, by which can be

created artificial record and submit to the matching module.

The record of legitimate user may be stolen by intercepting the

communication channel between the database and matching.

49

Page 50: Final Report (1)

Finally, the channel between the matching module and the application

requesting verification is also susceptible for possible attacks.

All these attacks are similar to those presented in token and

knowledge based authentication (password) system, except the case of

attack using fake fingerprints which is particular of fingerprint

recognition system. In this subsection are presented some

recommendation to countermeasure the possible attacks, in especial the

attacks by the use of fake fingerprint.

Independently how the fingerprint was stolen, the fingerprint

scanners should be able to reject the fake fingerprints. However detecting

the aliveness of a finger it is not an easy task.

The main problem relies on how to differentiate a live finger from

that one made of some synthetic material. There has been proposed some

ideas to deal with this problem, which consist in using the thermal,

electric and optical properties of the material presented to the fingerprint

scanner. By using the temperature information, for example, it is

expected that the fake finger made of silicone rubber is about 2 degree

cooler than a live finger, however, due the temperature variation of the

environment and the possibility of artificial heating the fake finger, the

thermal measurements are not very reliable.

The conductivity is another measure that could be explored,

however, the conductivity of a live finger varies a lot depending of

weather condition such as humidity and temperature. The optical

properties such absorption, reflection, scattering and refraction, in the

50

Page 51: Final Report (1)

human skin are different than many other synthetic material. However, it

is not difficult to find materials that have optical properties close to those

of a live finger.

As we can see, there no exists a reliable characteristic that could reject

all fake fingerprints. Therefore, it is important to take special attention

during the design and development of a secure fingerprint system. Here

are listed some considerations in order to improve the security.

Enroll and use multiple finger for single authentication

Change occasionally the patterns by using multiple fingerprint

Use device that detect better the aliveness of the finger

For more secure system, include password verification

Occasionally re-enroll the fingerprint

Allow identification to occur only from a certain fingerprint scanner

Reduce the sensitivity to reduce the possibility of false positive

Control the physical access to fingerprint scanner where possible

Make regular maintenance of devices for heavy usage environments

9.2 FINGERPRINT SEGMENTATION

51

Page 52: Final Report (1)

Before extracting the feature of a fingerprint, it is important to

separate the fingerprint regions (presence of ridges) from the background.

This limits the region to be processed and therefore reduces the

processing time and false feature extraction. A correct segmentation may

be, in some cases, very difficult, especially in poor quality fingerprint

image or noisy images, such as presence of latents. The same information

used for quality extraction, such as contrast, ridge orientation and ridge

frequency can be used for the segmentation or inclusive the quantified

region quality may be used directly by considering as background the

regions with quality below some threshold. Normally, the segmentation

are also computed by block in the same way as the quality extraction. In

the above figure is shown the contour of the segmented region

superimposed over the original image.

original image image with segmentation

Fig 9.2 Finger Print Segmentation

52

Page 53: Final Report (1)

9.3 STRENGTHENS AND WEAKNESS

The fingerprint recognition technique is the dominant technology in

the biometric market. There many factors that contribute for this success.

High level of accuracy. It is proven that the fingerprint recognition

technology may reach recognition rate near 100% in good quality

images.

Easy to use devices, the device used for capturing fingerprint

image are intuitive and easy to use.

Ability to enroll multiple fingers, if there some problem with one

finger, the fingerprint technology still can be used with the other 9

fingers, sometimes using multiple finger improve the recognition.

Range of deployments environments, It can be used in any place

where biometric authentication or identification are needed.

9.4 LIMITATIONS OF THE FINGERPRINT TECHNOLOGY :

Inability to enroll some users. About 2 % of the population have

poor quality of fingerprint, especially the elder people and manual

worker. For these cases one need to consider other biometrics or any

other solution.

Performance deterioration over time. Although the fingerprint is

a stable physiological characteristic, it can suffer some small changes

along the time and therefore it can affect the performance of the whole

53

Page 54: Final Report (1)

system. To overcome this problem, may be necessary to re-enroll the

fingerprint and/or use multiple fingerprints enrollment.

Association with forensic application. The fingerprint

technology has been associate with forensic and this can cause

discomfort to some people. Specially, in the countries where it is not

habitual the use of fingerprint.

Need to deploy specialized devices. The device needed for

fingerprint capture is not yet present on desktops, at sales point, etc, as is

the case of microphones and telephones used in voice recognition. The

integration of fingerprint scanner within the keyboard will reduce this

weakness.

CHAPTER 10

LIQUID CRYSTAL DISPLAY

10.1 INTRODUCTION

Liquid Crystal Displays (LCDs) have materials, which combine

the properties of both Liquids and Crystals. Rather than having a melting

point, they have a temperature range with in which the molecules are

almost as mobile as they would be in a Liquid, but are grouped together

in an ordered form similar to a crystal.

54

Page 55: Final Report (1)

The LCDs used exclusively in watches, calculators and measuring

instruments are the simple seven-segment displays, having a limited

amount of numeric data. The recent advances in technology have resulted

in better legibility, more information displaying capability and a wider

temperature range. These have resulted in the LCDs being extensively

used in telecommunications and entertainment electronics. The LCDs

have even started replacing the Cathode Ray Tubes (CRTs) used for the

display of text and graphics, and also in small TV applications.

10.2 ELECTRO-OPTICAL CHARACTERISTICS OF THE LCD’s:

The Electro-optical characteristic of the LCD depends on the type

of Liquid Crystal material used. The widely used types are the Twisted

Nematic (TN) and the super Twisted Nematic (STN) types. The

legibility/readability of an LCD depends on a variety of factors such as

the type of display, driving and illumination conditions, viewing angle

and the operating temperature. The important optical characteristics by

which legibility is expressed are: brightness, contrast ratio and viewing

angle.

10.3 BRIGHTNESS:

Brightness of an LCD is the ratio of the luminance of the incident

light. Reflective displays will therefore tend to appear rather grey/dark. A

brighter display can be obtained by providing backlighting.

10.4 CONTRAST RATIO:

55

Page 56: Final Report (1)

Contrast ratio of an LCD is defined as the ratio of brightness of the

lighted/non-activated pixels to that of the darkened/activated pixels.

Brightness of non-activated pixels (B2)

Contrast Ratio = ------------------------------------------------

Brightness of activated pixels (B1)

Brightness and contrast, both depends on the polarisers used. Low

efficiency polarisers give bright displays but a low contrast. High

efficiency polarisers give a high contrast but reduce the brightness.

10.5 VIEWING ANGLE AND DIRECTION :

The viewing angle can be defined as the cone subtended by the

viewer’s eye, when the display is viewed at the two extreme angles while

having a readable contrast level.The viewing direction can be defined as

the viewer’s-eyes direction with respect to the normal drawn

perpendicular to the Display’s surface. When the Display is viewed from

above the normal, it is termed as the top view (12o’clock) and when from

below the normal, it is termed as the bottom view (6o’clock).

A1-Approximate Nominal viewing cone (Top&Bottom view) for TN

type.

B1- Approximate Adjustable viewing cone (Top& Bottom view) for TN

type.

A2- Approximate Nominal viewing cone for STN type.

56

Page 57: Final Report (1)

B2- Approximate Adjustable viewing cone for STN type.

The approximate viewing angle for TN type is 40-45 degrees and

for STN type is 75 degrees.

The temperature ranges are as follows:

Particulars NormalTemp.Range Extd.Temp.Range

Operating temperature 0ºC to +50ºC -20ºC to +70ºC

Storage temperature -20ºC to +70ºC -30ºC to +80ºC

TABLE 10.1

10.6 CONNECTING LCDs:

The terminals of the LCD are etched under the edges of the top

glass panel. The LCDs can be electrically connected to the PCB/driver

circuits by using conductive Rubber strips, fixed pins or by foil.

The following features of the conductive rubber strips like:

Simple design with a wide range of sizes, easy assembling, shock

and vibration absorption, absence of corrosion even at 100% humidity,

better conductivity without any abrasion and a longer life, makes them

the widely used connecting materials out of the three types.

The conductive rubber (elastomer) consists of alternate conductive

(carbon filled) and insulating rubber section. Insulating layers of soft

rubber or sponge covers the two sides of this effective contact section.

57

Page 58: Final Report (1)

When squeezed between the LCD and the PCB, at least one

conductive section connects between opposite contacts, while at least one

insulating section prevents short circuit with adjacent contacts. For the

proper electrical contact, a bezel or a clamp maintains the contact

pressure. Maintaining the appropriate contact pressure is on the display.

CONCLUSION

This project “multimodal security system for bank locker and

secure locations with GSM alert and remote alarm activation” is used

to secure the bank sectors and other locations such as jewellery shops,

home lockers, etc..,

58

Page 59: Final Report (1)

In the existing system only mechanical locks were used, in the

proposed system we are using electronic locks in the place of

mechanical locks, and this is more secure and cost efficient.

APPENDIX

#include <pic.h>

#include <string.h>

59

Page 60: Final Report (1)

#include "delay.h"

#include "output.h"

#include "gsm.h"

#define ycard 1

#define forpc (cs0 = 1)

#define forRFID ((cs0 = 0))

extern volatile bit gsmreadyled @ (unsigned)&PORTD*8+5;

static volatile bit yesled @ (unsigned)&PORTD*8+6;

static volatile bit cs0 @ (unsigned)&PORTC*8+1;

void rxdatafrompc(void);

void changetogsm(void);

void changetopc(void);

void txalerttogsm(void);

void alertmsg(void);

unsigned bank1 char mblno[11], code[10];

unsigned const char mblno_police[] = "9003636359";

void main(void)

60

Page 61: Final Report (1)

{

usartinit(9600);

gsmreadyled = 1;

msdelay(500);

gsmreadyled = 0;

yesled = 1;

msdelay(500);

yesled = 0;

changetogsm();

msdelay(500);

checkgsmready();

while (1)

{

changetopc();

while(usartrx() != 'S');

if(usartrx() != 'Y')

{

61

Page 62: Final Report (1)

relay = 1;

changetogsm();

txalerttogsm();

relay = 0;

}

msdelay(2000);

}

}

void changetogsm(void)

{

forgsm;

RCIE = 1;

msdelay(1000);

}

void changetopc(void)

{

forpc;

62

Page 63: Final Report (1)

msdelay(1000);

RCIE = 0;

}

void txalerttogsm(void)

{

gsmreadyled = 0;

RCIE = 0;

do

{

txgsmmblno(mblno_police);

alertmsg();

checkgsmtx();

}while(!gsmokbit);

gsmreadyled = 1;

RCIE = 1;

}

void alertmsg (void)

63

Page 64: Final Report (1)

{

usarttxs("UNAUTHORISED CARD USAGE AT ATM No. :

34561233, SBI, N.L.ROAD, CHENNAI");

}

void interrupt intl(void)

{

if (RCIF)

{

if(gsmokstartbit)

{

dummy_gsmreceivedata = RCREG;

}

else

{

gsmreceive_routine();

}

}

64

Page 65: Final Report (1)

}

}

REFERENCES

PIC Microcontroller Project Book by John Iovine

PIC Basic Projects: 30 Projects using PIC BASIC and PIC

BASIC PRO by Dogan Ibrahim In Stock.

www.microchip.com

65

Page 66: Final Report (1)

www.mikroe.com/en/books/picbook/picbook.htm

www.electronics4u.com

66