IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
1.1) OVERVIEW: According ancient Greek scripts BIOMETRICS means study of life. Biometrics studie studies s common commonly ly includ include e finger fingerpri print, nt, face, face, iris, iris, voice, voice, signat signature ure,, and hand hand geomet geometry ry recogn recognitio ition n and verifi verificat cation ion.. Many Many other other modali modalitie ties s are in variou various s stages of development and assessment. Among these available biometric traits Finger Print proves to be one of the best traits providing good mismatch ratio and also reliable. The present scenario to operate a bank locker is with locks which are having keys. By this we can’t say that we are going to provide good security to our lockers. To provide perfect security and to make our work easier, we are taking the help of two different technologies viz. EMBEDDED SYSTEMS and BIOMETRICS. In this project we are using our fingerprint and password as a key to open bank locker there by avoiding the usage of keys. There by providing security and reliability. 1.2) OBJECTIVE OF THE PROJECT: This project is related with Embedded system technology. The main objective of this project is,To provide good security to bank lockers by using a unique module called fingerprint module. In which a person’s fingerprint is stored and identified .If at all a person has to enter a locker room ,he need to scan his fingerprint in the fingerprint scanner then after verification further he need to enter the desire desired d passwo password rd ,thus ,thus using using finger fingerpri print, nt, passwo password rd we are avoidi avoiding ng the usage of keys and providing good security for our lockers. 1.3) AIM OF THE PROJECT: In this this proj projec ectt hear heartt of enti entire re proj projec ectt is micr microc ocon ontr trol olle ler. r. Many Many anci ancien entt methodologies have have come up like signature signature face ,iris, voice identification, identification, but all these these can can be immita immitated ted or fabric fabricate ated d . However, However, a fingerprint fingerprint is completely completely unique to an individual and stayed unchanged for lifetime. so our project is a real time project for providing perfect authentication , we can also increase & expand
1
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
security levels by using finger print technology it also consumes low power and flexible application 1.4) ADVANTAGES&DISA ADVANTAGES&DISADVANTAGES: DVANTAGES: There are many advantages of our project because fingerprint is unique for every person it cannot be immitated or fabricated .It is not same in the case of twins also,the advantages are •
Sophisticated security
•
No manual errors
•
No false intrusion
•
Need not to carry ant card
•
Others cannot steel the user’s entry key
DISADVANTAGES
It has less memory.
•
If external memory is interface with microcontroller it takes large time to access data base
•
1.5) THEIESES ORGANISATION: This This proj projec ectt FING FINGER ERPR PRIN INT T BASE BASED D BANK BANK LOCK LOCKER ER SYST SYSTEM EM is used used for for prov provid idin ing g safe safety ty and and secu securit rity y and and to avoi avoid d the the usag usage e of keys keys.. The The pres presen entt scenario to operate a bank locker is with locks which are having keys. By this we can’t say that we are going to provide good security to our lockers. To provide perfect security and to make our work easier, we are taking the help of two different technologies viz. EMBEDDED SYSTEMS and BIOMETRICS.
CHAPTER 2 2
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
THEORITICAL CHAPTER 2.1)INTRODUCTION: This project is related with Embedded systems and bometrics technologies. The main main object objective ive of this this projec projectt is,to is,to provid provide e safety safety for our our bank bank locke lockers rs and and reliability.It uses fingerprint and password as a key to open the bank locker . When coming to our application the images of the persons who are authorized to enter into the locker room will be stored in the module with a unique id. To prove that the persons are authorized to enter that area they need to scan their images. This scanner is interfaced to 8051 microcontroller. By using this controller we will be controlling the scanning process. After the scanning has been completed the person has to enter the unique id which is given to him to open his locker with the help of a keypad. Immediately the locker will be opened. After the work has been comp comple lete ted d if a swit switch ch is pres presse sed d the the lock locker er will will be clos closed ed agai again. n. If an unauthorized person tries to scan his image then an indication will be given by a buzzer which is interfaced to the controller. If an authorized person forgets his id he will be given 3 chances to re-enter the id. This project uses regulated 5V, 500mA power supply. 7805 three terminal voltage regulator is used for voltage regulation. Bridge type full wave rectifier is used to rec rectify the ac out put of secondary of 230/12V step down transformer,NGE-OP67 module,AT89S52,lcd ,stepper motor,keypad 2.2) AT89S52 MICRO CONTROLLER: The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pinout. The on-chip Flash allows the program 3
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
memory to be reprogrammed in-system By combining a versatile 8-bit CPU with in-system programmable Flash on a mono monoli lith thic ic chip chip,, the the Atme Atmell AT89 AT89S5 S52 2 is a powe powerf rful ul micr microc ocon ontro troll ller er whic which h provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, RAM, 32 I/O I/O line lines, s, Watc Watchd hdog og time timer, r, two two data data poin pointe ters rs,, thre three e 16-b 16-bit it timer/counters, a six-ve six-vecto ctorr two-le two-level vel interr interrupt upt archit architect ecture ure,, a full full duplex duplex serial serial port, port, on-ch on-chip ip oscillator, and clock circuitry. Features • Compatible with MCS-51® Products • 8K Bytes of In-System Programmable (ISP) Flash Memory – Endurance: 1000 Write/Erase Write/Erase Cycles • 4.0V to 5.5V Operating Range • Fully Static Operation: 0 Hz to 33 MHz • Three-level Program Memory Lock • 256 x 8-bit Internal RAM • 32 Programmable I/O Lines • Three 16-bit Timer/Counters • Eight Interrupt Sources • Full Duplex UART Serial Channel • Low-power Idle and Power-down Modes • Interrupt Recovery from Power-down Mode • Watchdog Timer • Dual Data Pointer • Power-off Flag 2.3) FINGERPRINT MODULE: NGE - OP 67 fingerprint verification module. NGE - OP 67 module adopts optic fingerprint sensor, which consists of high-performance DSP and Flash. NGE- OP 4
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
67 is able to conduct fingerprint image processing, template generation, template matching, fingerprint searching, template storage, etc. Proprietary Intellectual Property
•
Optic fingerprint enrollment device, NGE - OP 67 hardware as well as fingerprint algorithm. •
Wide Application Range of Fingerprints with Different Quality Self-adaptive parameter adjustment mechanism is used in the course of finger Print enrollment. This ensures good image quality for even dry or wet fingers, thus it has wider application range.
•
Low Price The cost of module is greatly reduced by using self-developed optic fingerprint enrollment device. Easy to Use and Expand
•
It is not necessary for user to have professional knowledge in the field of fingerprint verification. User can develop powerful fingerprint verification application systems with with the command set provided by NGE - OP 67. Low Power Consumption
•
Sleep/awake control interface makes NGE - OP 67 suitable for occasions that require low power consumption. Different Security Levels
•
User can set different security level according to different application environment.
System Characteristic NG OP-67 Blue backlight Fingerprint Sensor Module adopts the optic fingerprint sensor, which consists of high-performance high-performance DSP and Flash. NG OP-67 is able to conduct fingerprint image image processing, template template generation, template template matching, fingerprint searching, template storage, etc. This finger print can can be available with various type of image qualities qualities in case of wet fingers ,dry fingers the quality varies .by using this module that type of finger prints can also be scanned easily and identified.2steps involved are 5
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
1) feature extraction 2) image extraction
2.3.2 Concepts in Fingerprint System ● Fingerprint Feature Fingerprint algorithmic means capturing features from fingerprint image, i t represents the fingerprint information. The saving, matching and capturing of fingerprint templates are all manipulated through fingerprint features. ● 1:1 Comparing 2 fingerprint templates, return info: matching or not matching. ● 1:N Searching Search the matching fingerprint from numbers of fingerprint features. Return info: No matching features or having matching features and returning the matching feature’s Id simultaneity.
System parameter and interface 1. Power supply ………………………5V 2 .Working current ……………………170mA ……………………170mA 3. Peak value current …………………200mA 4. Fingerprint input time……………… <250ms 5. 1:1 matching time ……………………<600ms Matching features + matching 6 .1:900 searching time…………………. time…………………. <2s 7 .Fingerprint capacity Max…………….. 960 8 .FAR(False Acceptance Rate) ………… <0. 001 % 9 .FRR (False Rejection Rejection Rate)…………… Rate)……………<1.5 % 10 .Fingerprint template size …………….. 512bytes 11. Outer interface …………………………UART …………………………UART 12.baud rate ………………………………..9600bps. 2.4)ULN2003: The ULN2001A, ULN2001A, ULN2002A, ULN2002A, ULN2003 ULN2003 and ULN2004A ULN2004Aare are high Voltage, high current Darlington arrays each containing seven open collector Darlington pairs with common emitters. Each channel rated at 500mAand can withstand peak 6
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
currents of 600mA.Suppressiondiodesare included for inductive load driving and the inputs are pinned opposite the outputs to simplify board layout. These versatile devices are useful for driving a wide range of loads including solenoids, relays DC motors; LED displays filament lamps, thermal print heads and high power buffers. The ULN2001A/2002A/2003A and 2004A are supplied in 16 pin pin plas plasti tic c DIP DIP pack packag ages es with with a copp copper er lead lead fram frame e to redu reduce ce ther therma mall resi resist stan ance ce.. They They are are avai availa labl ble e also also in smal smalll outl outlin ine e pack packag age e (SO(SO-16 16)) as ULN2001D/2002D/2003D/2004D.
FEATURES OF DRIVER: · Seven Darlington’s per package · Output currents500mA per driver(600mA peak) · Integrated suppression diodes for inductive loads · Outputs can be paralleled for high currents · TTL/CMOS/PMOS/DTL compatible inputs. · Inputs pinned opposite to outputs · Simplified layout 2.5) STEPPER MOTOR: A stepper motor (or step motor) is a brushless, synchronous electric motor that can divide a full rotation into a large number of steps. The motor's position can be controlled precisely, without any feedback mechanism (see open loop control). Stepper motors are similar to switched reluctance motors (which are very large steppi stepping ng motors motors with with a reduce reduced d pole pole count, count, and genera generally lly are closed closed-lo -loop op commutated).
7
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Stepper motors are constant power devices. As motor speed increases, torque decreases. (most motors exhibit maximum torque when stationary, however the torque of a motor when stationary 'holding torque' defines the ability of the motor to maintain a desired position while under external load). Steppers exhibit more vibration than other motor types, as the discrete step tends to snap the rotor from one position to another (called a detent). The vibration makes stepper motors noisier than DC motors. Generally for opening locks we cannot use dc motor so here we are using stepper motor to open the locker .It produces a step angle of 90 in order to close or to open the locker. 2.6)Liquid Crystal Displays (LCD) A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or monochrome monochrome pixels arrayed arrayed in front of a light source or reflector. reflector. Each pixel consists of a column of liquid crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of polarity of which are perpen perpendic dicula ularr to each each other. other.
Withou Withoutt the liquid liquid crysta crystals ls betwee between n them, them, light light
passing through one would be blocked by the other. The liquid crystal twists the polarization of light entering one filter to allow it to pass through the other. 2.7)POWER SUPPLY: The power supply circuits built using filters, rectifiers, and then voltage regulators. availabl available. e. Line lengths lengths Starting with an ac voltage, a steady dc voltage is obtained by rectifying the ac of 8, voltage, then filtering to a dc level, and finally, regulating to obtain a desired fixed 16, dc voltage. The regulation is usually obtained from an IC voltage regulator unit, 20, which takes a dc voltage and provides a somewhat lower dc voltage, which 24, 32 rema remain ins s the the same same even even if the the inpu inputt dc volt voltag age e varie varies, s, or the the outp output ut load load and connected to the dc voltage changes. 40 2.8)MAX232:
chara cters are all stand
8
ard, in one, two
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
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 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 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.
2.9)CONCLUSION: Micro controller is the heart of total system. The micro controller controls all the devices connected in the project. project. Micro controller sends pulses pulses to all the devices, whic which h are are conn connec ecte ted d to it. it. Fing Finger erpr prin intt modu module le is used used for for scan scanni ning ng and and identification of fingerprints.It has a capacity to store 960 records. keypad is used for entering the password. LCD displays whether the person is authenticated or unauthenticated person. ULN2003 drives the steppermotor and the motor rotates in clockwise direction(90 degrees) for opening and in anticlockwise for closing the bank locker .
CHAPTER-3 DESIGN ASPECTS 3.1)INTRODUCTION: This project is related with Embedded systems and Fingerprint technologies.The main objective of this project is to provide bank locker which which uses fingerprint and and pass passwo word rd as key key to open open the the lock locker er,i ,ins nste tead ad of carry carryin ing g keys keys . Fing Finger erpr prin intt auth authen enti tica cati tion on is poss possib ibly ly the the most most soph sophis istic ticat ated ed meth method od of all all biom biomet etric ric techno technolog logies ies and has been been thorou thoroughl ghly y verifi verified ed throug through h variou various s applic applicati ations ons.. Fingerprint authentication has particularly proved its high efficiencyThis is the simplest and most reliable project.If a owner looses his bank locker key he had to replace it,in this case there are more chances for robery ,replacing the locker with a new key takes a lot of time ,in order to overcome these difficulties and make 9
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
our our own own thin things gs to be done done easi easier er we are are goin going g for for this this ”fing ”finger erpr prin intb tbas ased ed banklocker system” Here Here ther there e
is no
need eed
to carr carry y
cards ards,n ,no o
fals false e
intr intru usion sions s,no ,no
manua nual
erro errors rs,s ,sop ophi hist stic icat ated ed secu securit rity y is prov provid ided ed,t ,thi his s proj projec ectt is high highly ly econ econom omic ical al microcontroller based arrangement, designed for use in almost all the banks in our country. 3.2)BLOCK DIAGRAM OF THE PROJECT:
16X2LCD
Power supply
AT89S5 2 UC
ULN2003A
FingerPrint Scanner
Keypad
ce
Buzz er
10
devi
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Figure1:BLOCKDIAGRAM
3.2.2)DESCRIPTION This fingerprint based bank locker system we are using finger print to provide security security to our our banklock banklockers.H ers.Here ere the scanne scannerr type is is NGE - OP OP 67. NGE NGE - OP 67 module adopts optic fingerprint sensor, which consists of high-performance DSP and Flash. NGE- OP 67 is able to conduct fingerprint image processing, template generation, template matching, fingerprint searching, template storage, etc.it can store upto 960 records This module can operate in 2 modes they are Master mode and User mode. We will be using Master mode to register the fingerprints which will be stored in the ROM present on the scanner with a unique id. Keypad is used for entering password ,LCD is used for the purpose of display whether it is a authorized person/unauthorized person, here the device is nothing but stepper motor ULN2003E is the driver used here it has 7 i/p’s and 7 o/p’s it’s unique feature of this driver.Here uln is used to drive the stepper motor. When this fingerprint module is interfaced to the microcontroller, we will be using it in user mode. In this mode we will be verifying the scanned images with the stored images(finger prints). When coming to our application the images of the persons who are authorized to enter into the locker room will be stored in the module with a unique id. To prove that the persons are authorized to enter that area they need to scan their images.after that they have to enter the password so that the locker will be opened automatically.
3.3)HARDWARE USED: The modules used for implementing this projects are, 1. POWER SUPPLYUsed for giving 5v power supply. 11
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
2. MICRO CONTROLLERIt is the heart of enttire system.Used for interfacing all these devices which are connected to it.sending pulses to each device in order to control it 3. NGE-OP67 FINGERPRINT MODULE: NG OP-67 Blue backlight Fingerprint Sensor Module adopts the optic fingerprint sensor, which consists of high-performance high-performance DSP and Flash. NG OP-67 is able to conduct fingerprint fingerprint image processing, template generation, generation, template matching, fingerprint searching, template storage, etc. 4. ULN2003It has 7 sets of inputs and outputs .It is used as driver to stepper motor. 5. STEPPER MOTORUsed for opening and closing the bank locker 6 .LCDDisp Displa lay ying ing the the mess messag ages es like like whet whethe herr the the
pers person on is auth authen enti tica cate ted d or
unauthenticated enter the password etc.
3.4)MICRO CONTROLLER: The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system By combining a versatile 8-bit CPU with in-system programmable Flash on a mono monoli lith thic ic chip chip,, the the Atme Atmell AT89 AT89S5 S52 2 is a powe powerf rful ul micr microc ocon ontro troll ller er whic which h provides a highly-flexible and cost-effective solution to many embedded control applications. The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes
12
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
of RAM, RAM, 32 I/O I/O line lines, s, Watc Watchd hdog og time timer, r, two two data data poin pointe ters rs,, thre three e 16-b 16-bit it timer/counters, a six-ve six-vecto ctorr two-le two-level vel interr interrupt upt archit architect ecture ure,, a full full duplex duplex serial serial port, port, on-ch on-chip ip oscillator, and clock circuitry. Features • Compatible with MCS-51® Products • 8K Bytes of In-System Programmable (ISP) Flash Memory – Endurance: 1000 Write/Erase Write/Erase Cycles • 4.0V to 5.5V Operating Range • Fully Static Operation: 0 Hz to 33 MHz • Three-level Program Memory Lock • 256 x 8-bit Internal RAM • 32 Programmable I/O Lines • Three 16-bit Timer/Counters • Eight Interrupt Sources • Full Duplex UART Serial Channel • Low-power Idle and Power-down Modes • Interrupt Recovery from Power-down Mode • Watchdog Timer • Dual Data Pointer • Power-off Flag 3.4.1)Internal structure:
13
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Figure2:internal diagram of at89s52
Memory Organization MCS-51 devices have a separate address space for Programand Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed.
Program Memory If the EA pin is connected connected to GND, all program program fetches fetches are directed directed to external external memory.
14
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH 1FFFH are directed to internal memory and fetches fetches to addresses 2000H through FFFFH are to external memory.
Data Memory The AT89S52 AT89S52 implem implemen ents ts 256 bytes bytes of on-ch on-chip ip RAM. RAM. The upper 128 bytes bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space.
3.4.2 PIN DIAGRAM OF 89S52:
Figure3:pin diagram of 89s52 Power Power - Vcc, Vss Reset – Reset – RST Crystal - XTAL[1,2] External device interfacing – EA, ALE, PSEN, WR, RD
15
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
I/O Port – P0[7;0], P1[7:0], P2[7:0], P3 P3 is shared with control lines – Serial I/O RxD, TxD, – external external interrupts INT0, INT1 – Counter control T0, T1 P0 and P2 are multiplexed with Address and Data bus REGISTERS: In the CPU, CPU, regist registers ers are used to store store informati information on temporar temporarily ily..
That That
information could be a byte of data to be processed, or an address pointing to the data to be fetched. The vast majority of 8051 registers registers are 8–bit registers. In the 8051 there is only one one data type: 8bits. The 8bits of a register are are shown in the diagram from the MSB (most significant bit) D7 to the LSB (least significant bit) D0. With an 8-bit data data type, any data data larger than 8bits 8bits must be broken into 8-bit chunks before it is processed. Since there are a large large number of registers in the 8051, we will concentrate on some of the widely used general-purpose registers and cover special registers in future chapters. D
D
D
D
D
D
D
D
7 6 5 4 3 2 1 0 The most widely used registers of the 8051 are A (accumulator), B, R0, R1, R2, R3, R4, R5, R6, R7, DPTR DPTR (data pointer), and PC (program counter). All of the abov above e regi regist ster ers s are are 8-bi 8-bits ts,, exce except pt DPTR DPTR and and the the prog progra ram m coun counte ter. r.
The The
accumulator, register A, is used for all arithmetic and logic instructions. SFRs (Special Function Registers) Among the registers R0-R7 is part of the 128 bytes of RAM memory. What about registers A, B, PSW, and DPTR? DPTR? Do they also have have addresses? The answer is yes. In the 8051, registers A, B, B, PSW and DPTR are part part of the group of registers commonly commonly referred to as SFR (special function registers). registers). There are many many special special functio function n regist registers ers and they are widely widely used. used.
16
The SFR can be
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
access accessed ed by the names (which (which is much easier easier)) or by their their addresse addresses. s.
The
following two points should noted about the SFR addresses. •
The Special function registers have addresses between 80H and FFH. These addresses are above 80H, since the addresses 00 to 7FH are addresses of RAM memory inside the 89S52
•
Not all the addre address ss space space of 80H to FFH is used by the SFR. SFR. The unused locations 80H to FFH are reserved and must not be used by the 8051 programmer.
Symbo l ACC B PSW SP DPTR DPL DPH P0 P1 P2 P3 IP IE TMOD TCON T2CON T2MO D TH0 TL0 TH1 TL1 TH2 TL2 RCAP2 H RCAP2 L SCON
Name Accumulator B register Program status word Stack pointer Data pointer 2 bytes Low byte High byte Port0 Port1 Port2 Port3 Interrupt priority control Interrupt enable control Timer/counter mode control Timer/counter control Timer/counter 2 control Time Timer/ r/c coun ounter ter mod mode2 cont contro roll Timer/counter 0high byte Timer/counter 0 low byte Timer/counter 1 high byte Timer/counter 1 low byte Timer/counter 2 high byte Timer/counter 2 low byte T/C T/C 2 capt captur ure e regi regist ster er high high byte T/C T/C 2 capt captur ure e regi regist ster er low low byte Serial control
Addres s 0E0H 0F0H 0D0H 81H 82H 83H 80H 90H 0A0H 0B0H 0B8H 0A8H 89H 88H 0C8H 0C9H C9H 8CH 8AH 8DH 8BH 0CDH 0CCH 0CBH 0CAH 98H
SBUF Serial data buffer 99H PCON Power control 87H Table1: 89S52 Special function register Address 17
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
3.4.3)Design considerations: Due Due to insu insuff ffic icie ienc ncy y of the the memo memory ry we are are goin going g for for many many vers versio ions ns of micr microc ocon ontr trol olle lers rs ,in ,in this this case case AT89 AT89S5 S52 2 has has 8k of flas flash h memo memory ry so it is advantageous Design Design and Efficiency Efficiency::Microcontrol Microcontrollers lers are designed designed for single single purpose purpose and focuses on only single application .so this microcontroller is very efficient .
18
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Cost: This microcontrollers available for very cheap costs and serves a lot of purposes this at89s52 also acts as a watchdog timer which is used as reset circuit in our pc’s. Speed:
Table2:speed characteristics The speed depends upon on the no clock cycles required and that is shown below
19
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
Table3:Absolute Maximum Ratings of AT89S52 3.4.4)BASIC CIRCUIT -THAT MAKES 8051 WORKS.
Figure4: Basic circuit diagram
20
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
3.4.5) Description: EA/VP Pin:The Pin:The EA on pin 31 is tied high to make the 89s52 executes program fromInternal ROM Reset Circuit RESET is an active active High input When RESET is set to High, Microcontroller Microcontroller goes back to the power on state.The 89s52 is reset by holding the RST high for at least two machine cycles and then returning it low. Power-On Reset - Initially charging of capacitor makes RST High - When capacitor charges fully it blows Manual reset -closing the switch momentarily will make RST High.
Port functions: Port 0(Pin 32-39)-Dual-purpose port- 1. general purpose I/O Port. 2. multiplexed address & data bus Open drain outputs Port Port 1 (Pin (Pin 1-8): 1-8): Dedicate Dedicated d I/O port – Used Used solely solely for interfa interfacin cing g to externa externall devices Internal pull-ups Port 2(Pin 21-28): Dual-purpose port- 1. General purpose I/O port. 2. a multiplexed address & data bus. Internal pull-ups Port 3(Pin 10-17):Dual-purpose 10-17):Dual-purpose port- 1. General purpose purpose I/O por 2. pins have alternate purpose related to special features of the 8051 Internal pull-ups
21
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Why is such an oddball crystal frequency? 11.0592 MHz crystals are often used because it can be divided to give you exac exactt cloc clock k rate rates s for for most most
of the commo common n baud baud rates rates for the the UART UART,,
especially for the higher speeds (9600, 19200). Desp Despit ite e the the "odd "oddba ball ll"" valu value, e, thes these e crys crysta tals ls are are read readil ily y avai availa labl ble e and and commonly used
The 89s52 oscillator and clock: The heart of the 89s52 circuitry that generates the clock pulses by which all the internal all internal operations are synchronized. Pins XTAL1 And XTAL2 is provided for connecting a resonant network to form an oscillator. Typically a quartz crystal and capacitors are employed. The crystal frequency is the basic internal clock frequency of the microcontroller. The manufacturers make 89C51 designs that run at specific minimum and maximum frequencies typically 1 to 16 MHz.
Figure5:crystal oscillator and clock cycle generation
By combining a versatile 8-bit CPU with in-system programmable Flash on a mono monoli lith thic ic chip chip,, the the Atme Atmell AT89 AT89S5 S52 2 is a powe powerf rful ul micr microc ocon ontro troll ller er whic which h provides a highly-flexible and cost-effective solution to many embedded control applications. 22
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, RAM, 32 I/O I/O line lines, s, Watc Watchd hdog og time timer, r, two two data data poin pointe ters rs,, thre three e 16-b 16-bit it timer/counters, a six-ve six-vecto ctorr two-le two-level vel interr interrupt upt archit architect ecture ure,, a full full duplex duplex serial serial port, port, on-ch on-chip ip oscillator, and clock circuitry.
3.5)POWER SUPPLY: 3.5.1)CIRCUIT DIAGRAM AND INTRODUCTION:
Figure 6: 5v Power Power supply circuit, circuit, Figure7:12v Power Power supply circuit Power supply unit consists of following units i) Step down transformer ii) Rectifier unit iii) Input filter 23
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
iv) Regulator unit v) Output filter
3.5.2)DESCRIPTION STEPDOWN TRANSFORMER The Step down Transformer is used to step down the main supply voltage from230V AC to lower value. This 230 AC voltage cannot be used directly, thus it is stepped down. The Transformer consists of primary and secondary coils. To reduce or step downthe voltage, the transformer is designed to contain less number of turns in its secondarycore. The output from the secondary coil is also AC waveform. Thus the conversion from AC to DC is essential. This conversion is achieved by using the Rectifier Circuit/Unit
Bridge rectifier A bridge rectifier can be made using four individual diodes, but it is also available in special packages containing the four diodes required. It is called a full-wave rectifier because it uses all the AC wave (both positive and negative sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V when conducting and there are always two diodes conducting, as shown in the diagram below. Bridge rectifiers are rated by the maximum current they can pass and the maximum reverse voltage they can withstand (this must be at least three times the supply RMS voltage so the rectifier can withstand Please see the Diodes page for more details, including pictures of bridge rectifiers.
Figure8 :circuit diagram of Bridge rectifier and their output signal INPUT FILTER: FILTER:
24
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Capacitors are used as filter. The ripples from the DC voltage are removed andpure DC voltage is obtained. And also these capacitors are used to reduce the harmonicsof the input voltage. The primary action performed by capacitor is charging and discharging. It charges in positive half cycle of the AC voltage and it will discharge in negative half cycle. So it allows only AC voltage and does not allow the DC voltage. This filter is fixed before the regulator. Thus the output is free from ripples.
Regulator Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. They are also rated by the maximum current they can pass. Negative voltage regulators are available, mainly for use in dual supplies. Most regulators include some automatic protection from excessive current ('overload protection') and overheating ('thermal protection').
Figure9:Voltage Regulator Many Many of the the fixed fixed volta voltage ge regu regula lato torr ICs ICs have have 3 lead leads s and and look look like like powe power r transistors, such as the 7805 +5V 1A regulator shown on the right Thus this can be successfully reduced here. The regulators are mainly classified for low voltage and for high voltage. Further they can also be classified as: i) Positive regulator 1---> input pin 2---> ground pin 3---> output pin It regulates the positive voltage.
25
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
ii) Negative regulator 1---> ground pin 2---> input pin 3---> output pin It regulates the negative voltage. OUTPUT FILTER: The Filter circui circuitt is often often fixed fixed after after the Regula Regulator tor circui circuit. t. Capac Capacito itorr is most most oftenused asas filter. The principle of the capacitor is to charge and discharge. It charges duringthe positive half cycle of the AC voltage and discharges during the negative half cycle. Soit allows only AC voltage and does not allow the DC voltage. This filter is fixed after theRegulator circuit to filter any of the possibly found ripples in the output received finally.Here we used 0.1μF capacitor. The output at this stage is 5V and is given to theMicrocontroller.
3.6) STEPPER MOTOR INTERFACING WITH AT89S52 USING ULN2003: STEPPER MOTOR:
Figure10:Stepper motor BASICS OF STEPPER MOTOR Of all motors, step motor is the easiest to control. It's handling simplicity is really hard to deny - all there is to do is to bring the sequence of rectangle impulses to one input of step controller and direction information to another input. Direction 26
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
information is very simple and comes down to "left" for logical one on that pin and "right" for logical zero. Motor control is also very simple - every impulse makes the motor operating for one step and if there is no impulse the motor won't start. Pause between impulses can be shorter or longer and it defines revolution rate. This rate cannot be infinite because the motor won't be able to "catch up" with all the impulses (documentation on specific motor should contain such information). The pic pictur ture e be below low rep repres resent ents s the sch scheme eme for co conne nnecti cting ng the ste step p mot motor or to microcontroller and appropriate program code follows. The key to driving a stepper is realizing how the motor is constructed. A diagram shows the representation of a 4 coil motor, so named because 4 coils are used to cause the revolution of the drive shaft. Each coil must be energized in the correct order for the motor to spin.
Step angle It is angle through which motor shaft rotates in one step. step angle is different for different motor . selection of motor according to step angle depends on the application , simply if you require small increments in rottion choose motor having smaller step angle. No of steps require to rotate one complete rotation = 360 deg. / step angle in deg Steps/second The relation between RPM and steps per sec,is given by, steps or impulses /sec. =(RPM X Steps/revolution)/60 Pause between impulses can be shorter or longer and it defines revolution rate. This rate cannot be infinite because the motor won't be able to "catch up" with all the impulses (documentation on specific motor should contain such information). So referring to RPM value in datasheet you can calculate steps/sec and from it delay or pause between impulses. 27
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
RPM calculation:One can calculate the exact RPM at which motor will run. We know that motor needs 200 pulses to complete 1 revolution. Means if 200 pulses applied in 1 second motor will complete 1 revolution in 1 second. Now 1 rev. in 1 sec means 60 rev. in 1 minute. That will give us 60 RPM. Now 200 pulses in 1 sec means the PRF is 200 Hz. And delay will be 5 milli second (ms). Now let’s see it reverse. * If delay is 10 ms then PRF will be 100 Hz. * So 100 pulses will be given in 1 sec * Motor will complete 1 revolution in 2 second * So the RPM will be 30. In same manner as you change delay the PRF will be changed and it will change RPM\ Unipolar motors A unipolar stepper motor has logically two windings per phase, one for each direction of magnet magnetic ic field. field. Since Since in this this arrang arrangeme ement nt a magnet magnetic ic pole pole can be revers reversed ed without switching the direction of current, the commutation circuit can be made very simple (e.g. a single transistor) for each winding. Typically, given a phase, one end of each winding is made common: giving three leads per phase and six leads for a typical two phase motor. Often, these two phase commons are internally joined, so the motor has only five leads.
28
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Fig 11: Unipolar stepper motor coils
In this, we are interfacing stepper Motor with One Phase on Sequence. In one phas phase e mode mode,, each each succ succes essi sive ve coil coil is ener energi gize zed d in turn turn.. One One phas phase e mode mode produces smooth rotation and lowest power consumption of three modes. Steps are applied in order from one to four. After step four, the sequenced is repeated to
step
one.
The Stepper Motor is easily interfaced with 8051 and ULN 2003.Darlinton pair with high current rating. User can make Driver Circuit with help of Transistor. But IC’s ULN 2003 is best method for ease of design. User can use Pull up and Pull down for enhancing or decaying the value of current. 3.6.1)Internal Diagram of ULN2003 driver:
Fig12: the Darlington pair connection of transistor. Darlington pairs are back to back connection of two transistors with some source resistors. The important point to remember is that the Darlington Pair is made up of two transistors and when they are arranged as shown in the circuit they are used to amplify weak signals. The amount by which the weak signal is i s amplified is called the ‘GAIN’. 29
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
3.6.2)PIN CONNECTIONS OF ULN2003:
Figure13: pin connections of ULN2003 The ULN2001A, ULN2002A, ULN2003 and ULN2004Aare high Voltage, high current Darlington arrays each containing seven open collector Darlington pairs with common emitters. Each channel rated at 500mAand can withstand peak currents of 600mA.Suppressiondiodesare included for inductive load driving and the inputs are pinned opposite the outputs to simplify board layout. These versatile devices are useful for driving a wide range of loads including solenoids, relays DC motors; LED displays filament lamps, thermal print heads and high power buffers. The ULN2001A/2002A/2003A and 2004A are supplied in 16 pin plastic DIP packages with a copper lead frame to reduce thermal resistance. They are
30
IMC available
THUM HUMB SYSTEM also
in
IMPRE PRESSIO SION small
outline
BAN BA NK package
LOCK OCKER (SO-16)
as
ULN2001D/2002D/2003D/2004D. Of all motors, step motor is the easiest to control. It's handling simplicity is really hard to deny - all there is to do is to bring the sequence of rectangle impulses to one input of step controller and direction information to another input. Direction information is very simple and comes down to "left" for logical one on that pin and "right" for logical zero. Motor control is also very simple every impulse makes the motor operating for one step and if there is no impulse the motor won't start.Stepper motor would not without the support of any driver here we are using a driver for this purpose i.e ULN2003A .
3.6.3)Design Considerations:
Table4:Absolute Maximum Ratings of ULN2003 If the stepper Motor with One Phase on Sequence. In one phase mode, each succes successiv sive e coil coil is energiz energized ed in turn. turn. One phase phase mode mode produc produces es smooth smooth rotation and lowest power consumption of three modes. Steps are applied in order from one to four. After step four, the sequenced is repeated to step oneUsuall oneUsually y these these stepper stepper motors motors are of low cost cost ,they ,they consume consume low power power
31
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
,they have more applications compared to other motors ,they are very compac and they produce various step angles 3.6.4)Circuit Diagram:
Fig 14: shows the a model of using stepper motors A stepper motor (or step motor) is a brushless, synchronous electric electric motor that can divide a full rotation into a large number of steps. The motor's position can be contro controlle lled d precis precisely ely,, withou withoutt any feedba feedback ck mechan mechanism ism (see (see open open loop loop control). Stepper motors are similar to switched reluctance motors (which are very very large large steppi stepping ng motors motors with a reduce reduced d pole pole count, count, and and genera generally lly are closed-loop commutated). Here a stepper motor is used for controlling the gates. A stepper motor is a widely used device that translates electrical pulses into mechanical movement. They function as their name suggests - they “step” a little bit at a time. Steppers don’t simply respond to a clock signal. They have several windings which need to be ener energi gize zed d in the the corr correc ectt sequ sequen ence ce befo before re the the moto motor’s r’s shaf shaftt will will rota rotate te.. Reversing the order of the sequence will cause the motor to rotate the other way The block diagram of stepper motor interfacing is shown below:
32
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Fig15: Interfacing Stepper motor using ULN2003. Port 2 is given to another ULN2003 chip to drive another stepper motor. These two chips connected to microcontroller through a source in l ine Called SIL
Figure16:Pin Configuration of ULN2003 3.6.5)DESCRIPTION: ULN2003 is a 16 pin dip. Its connections can be explained as follows: First 4-pins of chip are connected to microcontroller pin at 37-40 pins and second at 21-24 pins. And 8th pin of chip is grounded. A stepper contains 5 terminals, 4 winding wires and a power supply wire. These 4 winding wires are connected to chip and another to supply. in this circuit too the four pins "Controller pin 1",2,3 and 4 will control the motion and direction of the stepper motor according to the step sequence sent by the controller.
33
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Table5:Modes and selection modes of ULN2003. FEATURES OF DRIVER: · Seven Darlington’s per package · Output currents500mA per driver(600mA peak) · Integrated suppression diodes for inductive loads · Outputs can be paralleled for high currents · TTL/CMOS/PMOS/DTL compatible inputs. · Inputs pinned opposite to outputs · Simplified layout Applications Comput Computerer-con contro trolle lled d steppe stepperr motor motors s are one of the most most versat versatile ile forms forms of positioning systems. They are typically digitally controlled as part of an open loop system, and are simpler and more rugged than closed loop servo systems. Industrial applications are in high speed pick and place equipment and multi-axis machine CNC machines often directly driving lead screws or ball screws. In the field of lasers and optics they are frequently used in precision positioning equipment such as linear actuators, linear stages, rotation stages, goniometers, and mirror mounts. Other uses are in packaging machinery, and positioning of valve pilot stages for fluid control 34
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
systems. Commercially, stepper motors are used in floppy disk drives, flatbed scanners, computer printers, plotters and many more device.
3.7)LIQUID CRYSTAL DISPLAY(LCD):
Figure 17:2x16 lcd A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or monochrome monochrome pixels arrayed arrayed in front of a light source or reflector. reflector. Each pixel consists of a column of liquid crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of polarity of which are perpen perpendic dicula ularr to each each other. other.
Withou Withoutt the liquid liquid crysta crystals ls betwee between n them, them, light light
passing through one would be blocked by the other. The liquid crystal twists the polarization of light entering one filter to allow it to pass through the other. A program must interact with the outside world using input and output devices that communicate directly with a human being. One of the most common devices attached to an controller is an LCD display. Some of the most common LCDs connected to the contollers are 16X1, 16x2 and 20x2 displays. This means 16 char charac acte ters rs per per line line by 1 line line 16 char charac acte ters rs per per line line by 2 line lines s and and 20 characters per line by 2 lines, l ines, respectively.
35
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Here we are using using a 2x16 LCD i.e 2 rows and and 16 columns
availabl available. e. Line lengths lengths of
8,
16, 20, 24, 32 and 40 chara cters are all stand 36
ard, in one, two
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
FEATURES: •Display construction……………16 construction……………16 Characters * 2 Lines •Backlight……………………………LED(B/5.0V) •Viewing direction…………………6 o’clock •Operating temperature…………… Indoor •Driving voltage…………………… voltage…………………… Single power •Driving method……………………1/16 method……………………1/16 duty,1/5 bias •Type………………………………… COB (Chip On Board) •Number of data line………………8-bit line………………8-bit parallel 3.7.1) INTERNAL STRUCTURE:
Fig 18: Internal structure of LCD
37
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
LCDs are more energy efficient and offer safer disposal than CRTs. Its low electrical
power
consumption
poweredelectronic poweredelectronic equipment.
It
enables is
it
to
be
used
an electr electron onica ically lly-mo -modul dulate ated d
in batterybatteryoptica opticall
device made up of any number of pixels of pixels filled with liquid crystals and arrayed in front of alight light source source (backlight) backlight) or reflector or reflector to to prod produc uce e imag images es in colo colour ur or monochrome or monochrome.. The The earl earlie iest st disc discov over ery y lead leadin ing g to the the deve develo lopm pmen entt of LCD LCD tech techno nolo logy gy,, the the disc discov over ery y of liqu liquid id crys crysta tals ls,, date dates s from from 1888 1888..[1] By 2008 2008,, worldwide sales of televisions with LCD screens had surpassed the sale of CRT units.
3.7.2 PIN DESCRIPTION:
Figure19:lcd internal connections
38
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Table6:Pin Description of lcd
LCD COMMANDS DESCRIPTION RS R/W D7 D6 D5
D4 D3
D2 D1 D0
Function
0
0
0
0
0
0
0
0
0
1
Clear LCD and memory, home cursor
0
0
0
0
0
0
0
0
1
0
Clear and home cursor only
0
0
0
0
0
0
0
1
1/0 S
Screen action as display character written S=1/0:Shift screen/cursor screen/cursor I/O=1/0:cursor I/O=1/0:cursor R/L, screen L/R
0
0
0
0
0
0
1
D
C
B D=1/0:Screen on/off C=1/0:Cursor on/off B=1/0:Cursor blink/no blink
0
0
0
0
0
1
S/C R/L 0
0
S/C: 1/0:screen/Cursor 1/0:screen/ Cursor R/L: Shift one space R/L
0
0
0
0
1
DL N
F
0
0
DL=1/0:8/4 Bits per Character N=1/0; 2/1 Rows of Characters F=1/0;5*10/5*7Dots/Character
39
IMC
THUM HUMB SYSTEM
0
0
0
0
0
1
Display data address
Write to display RAM address after this
0
1
BF
Current address
BF=1/0:busy/Notbusy BF=1/0:busy/ Notbusy
1
0
Character type
Write byte to last RAM chosen
1
1
Character type
Read byte from last RAM chosen
1
IMPRE PRESSIO SION
Character address
BAN BA NK
LOCK OCKER
Write to character RAM address after this
3.7.3)Design Considerations:Specifications: Considerations: Specifications: Display Format : 16 characters (W) x 2 lines (H) General Dimensions : 80.0 mm (W) x 36.0 mm (H) x 9.5 mm (T) Character Size : 2.95 mm (W) x 4.35 mm (H) Character Pitch : 3.65 mm (W) x 5.05 mm (H) Viewing Area : 64.0 mm (W) x 13.8 mm (H) Dot Size : 0.55 mm (W) x 0.50 mm (H) Dot Pitch : 0.60 mm (W) x 0.55 mm (H) Display Type : Positive or Negative LC Fluid : STN Yellow-Green Backlight LED : Optional Polarizer Mode : Reflective View Angle : 6 o’clock or 12 o’clock Controller : S6A0069 orEquivalent Temperature Range : 0oC to 50oC (Operating); -20oC to 70oC (Storage) 3.7.4) Circuit Diagram for LCD interfacing with AT89s52:
Fig20: Circuit Diagram for LCD interfacing i nterfacing with AT89s52
A T 8 9 S 5 2
40
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
LCD LCD is used used in this this proj projec ectt for for the the purp purpos ose e of disp displa layi ying ng mess messag ages es.. LCD LCD interfacing consists of several parts like AT89C451 microprocessor, 2 × 16 line LCD are main components needed. AT89C51 is a 40 pin DIP micro processor. LCD is a 2 line 16 pin device, 2 lines means it contains 2 rows to display.To deve develo lop p a prot protoc ocol ol to inte interf rfac ace e this this LCD with ith 89S52 S52 firs firstt we hav have to understan understandhow dhow they functions functions.. These These displays displays contain two internal internal byte-wide byte-wide registers, one for command and second for characters to be displayed. There are three control signals called R/W, DI/RS and En. Select By making RS/DI signal 0 you can send different commands to display. These commands are are used used to init initia iali lize ze LCD, LCD, to disp displa lay y patt patter ern, n, to shift shift curs cursor or or scre screen en etc. etc. AT89S52 can be divided in to 4 ports, and each port consists of 8 pins. All the data data line lines s of LCD LCD are are conn connec ecte ted d with with port port P1. P1. i.e. i.e.,, data data line lines s D0-D D0-D1 1 are are connected to port P1 i.e., to pin numbers 1 to 8 through a SIL, SIL is a few ohms of resistance connected to withstand the large voltages and currents.‘EN’ pin is connected with P2.0, ‘DI’ (RS) is connected with P2.1 and R/W pin is connected with P2.2. i.e., the three pins are connected to the port two. The operation ofLCD depends upon these three pin only. For the pins 18 and 19 a crystal oscillator circuit is connected to generate clock signals to the micro processor to enable its pins. And 20th pin is grounded with oscillator 3.7.5) DESCRIPTION 41
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
EN: EN: Line is called "Enable." This control line is used to tell the LCD that you are sendin sending g it data. To send data to the LCD bring bring EN high (1) and wait wait for the minimum amount of time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again. RS: RS: Line is the "Register Select" line. When RS is low (0), the data is to be treated as a command or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the data being sent is text data which sould be displayed on the screen. For example, to display the letter "T" on the screen you would set RS high. RW: RW: Line is the "Read/Write" control line. When RW is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command Vcc, Vss, VEE : While Vcc and Vss provide +5v and ground, respectively, Vee is used for controlling LCD contrast. D0 - D7: The 8 - bit data pins, D0 - D7, are used to send information to the LCD or read the contents of the LCD's internal registers.
Logic status on control lines:
42
IMC •E
THUM HUMB SYSTEM
-
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
0 Access to LCD disabled -
1 Access to LCD enabled
• R/W -
0 Writing data to LCD - 1 Reading data from LCD
• RS
-
0 Instructions
-
1 Character
3.8)NGE - OP 67 Stand-alone fingerprint module
Figure 21: NGE-OP67fingerprint module
System Feature NGE - OP 67 fingerprint verification module. NGE - OP 67 module adopts optic fingerprint sensor, which consists of high-performance DSP and Flash. NGE- OP 67 is able to conduct fingerprint image processing, template generation, template matching, matching, fingerprint fingerprint searching, searching, template template storage, storage, etc. Compared Compared with similar similar products from other suppliers, NGE - OP 67 proudlyboasts of following features:
43
IMC
•
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Proprietary Intellectual Property Optic fingerprint enrollment device, NGE - OP 67 hardware as well as fingerprint algorithm. Wide Application Range of Fingerprints with Different Quality
•
Self-adaptive parameter adjustment mechanism is used in the course of finger Print enrollment. This ensures good image quality for even dry or wet fingers, thus it has wider application range. •
Low Price The cost of module is greatly reduced by using self-developed optic fingerprint enrollment device. Immense Improved Algorithm
•
NGE - OP 67 algorithm is specially written according to optic imaging theory.
The algorithm is good for de-shaped or low-
quality fingers due to its excellent correction and tolerance tolerance features. features. •
Flexible Application User can easily set NGE - OP 67 Module to different working modes depend depending ing on comple complexit xity y of applic applicati ation on system systems. s. User User can conduc conductt secondary development with high efficiency and reliability.
•
Easy to Use and Expand It is not necessary for user to have professional knowledge in the field of fingerprint verification. User can develop powerful fingerprint verification application systems with with the command set provided by NGE - OP 67.
•
Low Power Consumption Sleep/awake control interface makes NGE - OP 67 suitable for occasions that require low power consumption.
•
Different Security Levels User can set different security level according to different application environment.
3.8.1)FINGER PRINT SENSOR 44
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Figure22:finger print sensor solid-state fingerprint sensor is an ideal direct-contact fi ngerprint acquisition device. Designed for embedded devices, this high-performance,low-pow high-performance,low-power, er, low-cost capacitive sensor is easy to integrateinto Internet appliances such as laptops, personal digital assistants (PDAs), and mobile phones The sensor's ImageSeek™ function takes several images ofa finger and selects the best image in a fraction of a second while changing the capacitive array bias levels. The NGE-OP67 is the first fingerprint-sensing device to incorporate three modes of communication: universal serial bus (USB), micro-controller unit (MCU), and serial peripheral interface (SPI).This makes the sensor easy to integrate into different types of devices without requiring external interface devices.It also has built-in electronics that simplify the software needed to support the chip.The chip's 256 x 300 array and new thin package provide you with a space saving, costeffective image area that exposes more sensor array to thefingerprint contact area. Conserves Power: The nge-op67 operates at less than 20 microAmps instand-by mode.This reduces processing overhead and saves battery life in mobile devices.The FPS200 has an integrated automatic finger detection (AFD) circuit that sends an interrupt signal to the host microprocessor when a finger is placed on the sensor. AFD eliminates the requirement imposed on the host microprocessor to continually "poll" the fingerprint sensor to determine 45
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
whether a finger is present.This feature allows the host microprocessor to remain in stand-by mode unless a finger is placed on the sensor. It also provides you with high quality fingerprint images From all types of skin—dry to moist—in a wide range of climatic conditions, even hot and humid.This widens the application range of the sensor while dramatically reducing the false acceptance rate (FAR) and FRR 3.8.2) DESIGN CONSIDERATIONS:
System Characteristic NG OP-67 Blue backlight Fingerprint Sensor Module adopts the optic fingerprint sensor, which consists of high-performance high-performance DSP and Flash. NG OP-67 is able to conduct fingerprint image image processing, template template generation, template template matching, fingerprint searching, template storage, etc. This finger print can can be available with various type of image qualities qualities in case of wet fingers ,dry fingers the quality varies .by using this module that type of finger prints can also be scanned easily and identified.2steps involved are 1) feature extraction 2) image extraction
● Fingerprint Feature Fingerprint algorithmic means capturing features from fingerprint image, i t represents the fingerprint information. The saving, matching and capturing of fingerprint templates are all manipulated through fingerprint features. ● 1:1 Comparing 2 fingerprint templates, return info: matching or not matching. ● 1:N Searching Search the matching fingerprint from numbers of fingerprint features. Return info: No matching features or having matching features and returning the matching feature’s Id simultaneity.
System parameter and interface 1. Power supply ………………………5V 46
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
2 .Working current ……………… ……17 ……170mA 0mA 3. Peak value current …………………200mA 4. Fingerprint input time……………… <250ms 5. 1:1 matching time ……………………<600ms Matching features + matching fingerprint 6 .1:900 searching time…………………. time…………………. <2s 7 .Fingerprint capacity Max…………….. 960 8 .FAR(False Acceptance Rate) ………… <0. 001 % 9 .FRR (False Rejection Rejection Rate)…………… Rate)……………<1.5 % 10 .Fingerprint template size …………….. 512bytes 11. Outer interface …………………………UART …………………………UART 12.baud rate ………………………………..9600bps.
3.8.3)INTERNAL BLOCK DIAGRAM:
Fig23:block diagram of fingerprint module This consists of a fingerprint sensor through which scanning isdone and ccd module is the nextin this opticql light is totally reflected by using total internal reflection phenomenon This feature allows the host microprocessor to remain in stand-by mode unless a finger is placed on the sensor. It also provides you with high quality fingerprint images From all types of skin—dry to moist—in a wide range of climatic 47
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
conditions, even hot and humid.This widens the application range of the sensor while dramatically reducing the false acceptance rate (FAR) and FRR.DSP processor is used for image aquisitionand ROM is used for the storage of finger prints.
3.8.4)DESCRIPTION:
FIG24: Fingerprint Identification process Step1:Image Acquisition: Real-time image acquisition method is roughly classified into optical and nonoptical. Optical method relies on the total reflection phenomenon on the surface of glass or reinforced plastic where the fingertip is in contact. The sensor normally consists of an optical lens and a CCD module or CMOS image i mage sensor. Ultrasonic wave, heat, and pressure are also utilized to obtain images with the non-optical fingerprint sensors. Non-optical sensors are said to be relatively more suitable for massive production and size reduction such as in the integration with mobile devices. Detailed comparison is found in Table 1. Optical
Non-optical
Measuring Method
light
pressure, heat, ultrasonic wave
Strength
highly-stable performance physical/electrical durability high-quality image
low cost with mass production ion compac compactt size size integr integrate ated d with lowlowpower application
48
capacitance,
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Weakness
relatively high cost physical/electrical weakness limi limitt to siz size-re e-redu duct ctio ion n perfor performan mance ce sensit sensitive ive to the outer outer rela relati tive vely ly easy easy to fool fool environme environment(tem nt(temperat perature, ure, dryness dryness with a finger trace or fake of a finger) finger
Application
entrance, time, and PCsecurity attendance control e-commerceauthentication banking service mobile devices & smart cards PC security
Table7:optical &non optical lens characteristics Step 2. Feature Extraction: There are two main ways to compare an input fingerprint image and registered fingerprint data. One is to compare an image with another image directly. The other is to compare the so-called 'features' extracted from each fingerprint image. The latter is called feature-based/minutia-based matching. Every finger has a unique pattern formed by a flow of embossed lines called “ridges” and hollow regions between them called “valleys.” As seen in the Picture 2 below, ridges are represented as dark lines, while valleys are bright. Step 3. Matching: The The matc matchi hing ng step step is clas classi sifi fied ed into into 1:1 1:1 and and 1:N 1:N matc matchi hing ng acco accord rdin ing g to its its purpose and/or the number of reference templates. 1:1 matching is also called personal identification or verification. It is a procedure in which a user claims his/ his/he herr iden identi tity ty by mean means s of an ID and and prov proves es it with with a fing finger erpr prin int. t. The The compar compariso ison n occurs occurs only only once once betwe between en the input input finger fingerpri print nt image image and the selected
one
from
the
database
following
the
claim
by
the
user.
On the the cont contra rary ry,, 1:N 1:N matc matchi hing ng deno denote tes s a proc proced edur ure e wher where e the the syst system em dete determ rmin ines es the the user user's 's iden identit tity y by comp compar arin ing g the the inpu inputt fing finger erpr prin intt with with the the information in the database without asking for the user's claim. A good example of this is AFIS(Automated Fingerprint Identification System) frequently used in criminal investigation
49
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
3.9)MAX232: 3.9.1) INTERNAL STRUCTURE:
50
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Fig25:Internal diagram of MAX232 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 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 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.
3.9.2) PIN DIAGRAM
51
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Fig 26: MAX 232 Pin Diagram Features: 1. Operates With Single 5-V Power Supply 2. LinBiCMOSE Process Technology 3. Two Drivers and Two Receivers 4.±30-V Input Levels 5. Low Supply Current. 8 mA Typical 6. Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28 7. Designed to be Interchangeable Interchangeable With Maxim MAX232 8. Applic Applicati ations ons are TIA/EI TIA/EIA-2 A-232 32-F -F Batte Batteryry-Pow Powere ered d System Systems s Termi Terminal nals, s, Modems Modems,, Computers 9. ESD Protection Exceeds 2000 V Per MIL-STD-883, Method 3015 10. Package Options Include Plastic Small-Outline (D, DW) Packages and Standard Plastic (N) DIPs
3.9.3) DESIGN CONSIDERATIONS CONSIDERATIONS 52
IMC
THUM HUMB SYSTEM
N.o Name Purpose
1
2
C1+
V+
3
C1-
4
C2+
5
C2-
6
V-
IMPRE PRESSIO SION
capacitor C1
output of voltage pump
-
+10V, should
-
output of voltage pump / inverter
stand
at 1µF to VCC
sho should
sho should
stand at least 16V sho should
stand at least 16V -10V, should least 16V
7
T2out
Driver 2 output
RS-232
8
R2in
Receiv ceiver er 2 input
RS-23 -232
9
R2out
Rece Receiv iver er 2 out outpu putt TTL TTL
10
T2in
Driver 2 input
T TL
11
T1in
Driver 1 input
T TL
12
R1out
Rece Receiv iver er 1 out outpu putt TTL TTL
53
1µF
Capacitor Value MAX232A
100nF
capacitor
stand at least 16V
conne nnector ctor for for cap capaci acitor tor
capacitor C2
sho should
LOCK OCKER
100nF to VCC
least 16V
+ conn connec ecto torr for for cap capaci acitor tor capacitor C2
Value MAX232
stand at least 16V
conne nnector ctor for for cap capaci acitor tor
capacitor C1
Capacitor
Signal Voltage
+ conn connec ecto torr for for cap capaci acitor tor
BAN BA NK
1µF
100nF
1µF
100nF
1µF
100nF
capacitor stand
at 1µF to GND
100nF to GND
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
13
R1in
Receiv ceiver er 1 input
RS-23 -232
14
T1out
Driver 1 output
RS-232
15
GND
Ground
0V
1µF to VCC
100nF to VCC
16
VCC
Power supply
+5V
see above
see above
TABLE 8:DESIGN CONSIDERATIONS OF MAX 232
3.9.4)Ciruit diagram
Fig27:circuit diagram
3.9.5)DESCRIPTION:
54
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
A standard serial interface for PC, RS232C, requires negative logic, logic, i.e., logic 1 is -3V to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TxD and RxD pins of the microcontroll microcontroller er thus need a converter converter chip. A MAX232 MAX232 chip has long been been usin using g in many many micr microc ocon ontr trol olle lers rs boar boards ds.. It is a dual dual RS23 RS232 2 rece receiv iver er / transm transmitt itter er that that meets meets all RS232 RS232 specif specifica icatio tions ns while while using using only only +5V power power supply. It has two onboard charge pump voltage converters which generate +10V to -10V power supplies from a single 5V supply. It has four level translators, two of which are RS232 RS232 transmitte transmitters rs that convert convert TTL/CMOS TTL/CMOS input levels into +9V RS232 outputs. The other two level translators are RS232 receivers that convert RS232 input to 5V. 3.10 CONCLUSION: Microcontroller is the entire heart of the system.here it sends pulses to all components and there by controls all the devices which are interfaed to it.the fing finge erpri rprint nt mod module ule
is anoth nother er impo import rta ant mod module ule
whic which h
is used image mage
acquisition,template generation,template storage etc,keypad is used for entering the password.uln driver is used to drive the stepper stepper motor.max232 is used is as serial communication interface.buzzer rings incase of user mismatch.
CHAPTER 4 55
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
SOFTWARE IMPLEMENTATION 4.1)INTRODUCTION: The Keil Keil 8052 8052 compil compiler er packag package e includ includes es uVisi uVision2 on2 which which is an Integr Integrate ated d Development Environment (IDE) along with all the utilities you may need to create embedded application programs for the MicroController family. Keil is a cross compiler. So first we have to understand the concept of compilers and cross compilers. After then we shall learn how to work with keil. Concept of compiler: Compilers are programs used to convert a High Level Language to object code. Desk Deskto top p
comp compiilers lers prod produ uce an outpu utputt
object ject code ode
for for
the the
under nderly lyin ing g
microprocessor, but not for other microprocessors. I.E the programs written in one of the HLL like ‘C’ will compile the code to run on the system for a particular processor like x86 (underlying microprocessor in the computer). For example compilers for Dos platform is different from the Compilers for Unix platform The advantage of interpreters is that they can execute a program immediately. Secondly programs produced by compilers run much faster than the same programs executed by an interpreter. However compilers require some time before an executable program emerges. Now as compilers translate source code into object code, which is unique for each type of computer, many compilers are available for the same language. Concept of cross compiler: A cross compiler is similar to the compilers but we write a program for the target processor (like 8051 and its derivatives) on the host processors (like computer of x86) It means being in one environment you are writing a code for another enviro environme nment nt is called called cross cross develo developm pment ent.. And the compil compiler er used used for cross cross development is called cross compiler
56
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
4.2) VARIOUS LOGICS USED: In this” Fingerprintbased banklocker system”the main steps involved are 1)Interfacing lcd to microcontroller 2)Enrolling 3)Identifying 4.2.1 LOGIC 1: The logic that is used to interface the LCD includes LCD initialization, writing data, a delay logic and setting of LCD commands. 4.2.2) LOGIC 2: In this project first of all authenticated person has to scan his finger print Fingerprint authentication has particularly proved its high efficiency and further enhanced the technology in providing security.The logic used is used for enrolling the fingerprint in the finger print module there our fingerprints are stored in the ROM inside it. The finger print module can operate in 2 modes they are Master mode and User mode. We will be using Master mode to register the fingerprints which will be stored in the ROM present on the scanner with a unique id. When this module is interfaced to the microcontroller, we will be using it in user mode. In this mode we will be verifying the scanned images with the stored images. In this logic we are using in module in the master mode. If the enrollment is done successfully then we will get a message enroll success otherwise enroll failed. 4.2.3) LOGIC 3: After enrollment next step is identification. identification. In this mode we will be verifying the scanned images with the stored image.If at all the scanned fingerprint matches
57
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
with with the the stor stored ed imag image e then then a mess messag age e is disp displa laye yed d on the the lcd lcd that that is” is” Identification success”.If a unauthorized person tries to scan his fingerprint then a message will be displayed on the lcd ”Identification failed”then buzzer will start to ring indicating that a wrong person has entered the room.After identification step a message message appears appears on the lcd “enter the password” password” then we need to enter the specified specified password password .After .After entering entering the password password then the bank locker locker will be opened after sometime it will be closed . If the password is wrong then a message will be displayed on the lcd ”wrong password” 4.3)LOGIC1: Lcd interfacing 4.3.1) ALGORITHM: The algorithm that shows LOGIC 1 is as shown below. 1. Start 2. Init Initia ializ lize e the the LCD LCD 3. Clea Clearr the the disp displa lay y 4. Set LCD addres address s or or comm command and 5. Write charac character ter to the LCD LCD or string to the LCD 6. Set comm command and byte byte and and data data byte byte.. 7. Set some some dela delay y using using Delay Delay funct function ion.. 8. For RS low low or high high enable enable RS as low and and enable enable write. write. 9. For EN EN low genera generate te enab enable le puls pulse. e. 10.For EN high pull up enable pulse. 11.For RW high set Read mode. 12.Configure Port 1 to Input port. 58
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
13.Display the data.
4.3.2) FLOW CHART FOR LOGIC 1:
59
BAN BA NK
LOCK OCKER
IMC
60
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
IMC
61
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Fig 28: Flow Chart of LCD interfacing with microcontroller 4.3.3) SOURCE CODE: The source code that is written to interface the LCD with the microcontroller is as follows. Code for interfacing LCD with 89S52 microcontroller. //=============================================== //LCD PROTOTYPES void Delay(); void lcd_init();
//lcd initialisation
void lcd_clear();
//clear display
void lcd_cmd(unsigned char);
//set the lcd address or command
void lcd_char(unsigned char);
//write the character to LCD
void lcd_print(unsigned char *);
//write the string to LCD
//=============================================== sbit RS
=P1^6;
sbit EN =P1^7; #define
LCD P2
//REGISTER SELECT //ENABLE //DATA0-DATA7 TO P2
//=============================================== unsigned char i; //=============================================== void Delay() { unsigned char j; for(i=0;i<15;i++) for(j=0;j<95;j++); } //=============================================== void lcd_init() { lcd_cmd(0x38); 62
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
lcd_cmd(0x01); lcd_cmd(0x0C); lcd_cmd(0x06); lcd_cmd(0x80); } //=============================================== void lcd_clear(void) { lcd_cmd(0x01); lcd_cmd(0x80); } //=============================================== void lcd_cmd(unsigned char cmd) { Delay(); LCD
=cmd;
RS
=0;
EN
=1;
for(i=0;i<100;i++); EN
=0;
for(i=0;i<100;i++); } //=============================================== void lcd_print(unsigned char *str) { while(*str) {
63
LCD
=*str;
RS
=1;
EN
=1;
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Delay(); EN
=0;
str++; } } 4.3.4) DESCRIPTION: The logic that is used to interface the LCD LCD with the microcontroller includes includes LCD initialization initially and then the lcd is to be cleared, then the commands are set to set the address of the display and then a delay function is used to generate some delay. As per the command the display occurs. Configure port 1 as input port. This is the logic that is used to interface the LCD to the microcontroller. Thus the logic that is used to interface the LCD to the microcontroller can be explained. 4.4)LOGIC2: ENROLLMENT 4.4.1) ALGORITHM: STEP1: INITIALIZE THE REGISTERS OF MICROCONTROLLER,L MICROCONTROLLER,LCD, CD, UART STEP STEP2: 2:As Assi sign gn the the swit switch ches es and and buzz buzzer er to the the port ports s of micr microc ocon ontr trol olle ler r m1=P3^2,m2=P3^3,m3=P3^4,m4=P3^5,and m1=P3^2,m2=P3^3,m3=P3 ^4,m4=P3^5,and buzz=P1.7 STEP3:clear the lcd and print ‘finger print based banklocker system, STEP4:clear the LCD LCD and then display display put your finger and press press 1:ENROLLING 2:IDENTIFYING STEP5:IF SW1=1 then Enrolling and displays Enrolling…….. STEP6: fill the SBUF with Fp[i]
64
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
STEP7: IF (Fp[0]==00XEF)&&(Fp[1]==0X01)&&(Fp[9]==0X00) then display Enroll success STEP8: ELSE enroll enroll failed then Buz=1 then after some delay delay buz=0 STEP 9: GOTO start
4.4.1 FLOW CHART:
65
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
s START
Intialize registers
MC
with
Assign M1=P3^2,M2=P3^ 3 M3=P3^4,M4=P3^ 5 Clear the lcd Buz = P1^7;
enrolling Store Fp(i)
If KEY= 1 key= 1 SBUF
with Yes
No If ste p7 Enroll Failed
ste p7
Enroll Success
Sto p
Figure 29:flow chart for enrollment 4.4.3)SOURCE CODE: CODE: #include
66
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
#include #include #include /**********************************************************/ void Entpass(); **********************************************************/ sbit m1=P3^2;
//A
sbit m2=P3^3;
//B
sbit m3=P3^4;
//A'
sbit m4=P3^5;
//B'
sbit Buz = P1^7; /**********************************************************/ unsigned char fp[20],str[4]; unsigned char Enroll[12] ={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0 ={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X10 X01,0X00,0X03,0X10,0X00,0X14}; ,0X00,0X14}; unsigned char Identify[12] ={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0 ={0xEF,0X01,0XFF,0XFF,0XFF,0XFF,0X01,0X00,0X03,0X11 X01,0X00,0X03,0X11,0X00,0X15}; ,0X00,0X15}; unsigned char b1=0,b2=0; /**********************************************************/ void Delay1(unsigned int itime) { unsigned int i,k=0; for(i=0;i
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
/**********************************************************/ void main() { unsigned char key,i; Buz=0; m1=0;m2=0;m3=0;m4=0; lcd_init(); uart_init(); lcd_clear(); lcd_print(" Welcome To"); lcd_cmd(0xC0); lcd_print(" BIET College"); Delay1(400); Start: lcd_clear(); lcd_print("Finger Print"); lcd_cmd(0xC0); lcd_print("Bank locker Sys"); Delay1(400); while(1) { lcd_clear(); lcd_print("Put Ur Finger & "); lcd_cmd(0xC0); 68
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
lcd_print("Pres-1:ENR,2:IDT"); key = keypad(); if(key =='1') { lcd_clear(); lcd_print("Enrolling...."); Delay1(100); i=0; while(i<12) { uart_char(Enroll[i]); i++; } RI=0; for(i=0;i<14;i++) { while(!RI); fp[i] = SBUF; RI=0; } if((fp[0]==0xEF)&&(fp[1]==0x01)&&(fp[9]==0x00)) { lcd_clear(); lcd_print("Enroll Success"); 69
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
Delay1(400); b1=0; b2=0; b1=fp[11]/10; b2=fp[11]%10; lcd_cmd(0xC0); lcd_print("Id:"); lcd_cmd(0xC3); lcd_char(b1+0x30); lcd_char(b2+0x30); Delay1(500); goto Start; } else { lcd_clear(); lcd_print("Enroll Failed"); Buz=1; Delay1(400); Buz=0; goto Start; } } 4.4.4) DESCRIPTION:
70
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Intialize the registers of microcontroller ,LCD , UART and Keypad, Keypad , and then assign assign the switches switches to M1=P3.2,M M1=P3.2,M2=P3. 2=P3.3,M3= 3,M3=P3.4, P3.4,M4=P3 M4=P3.5 .5 respectiv respectively ely and buzzer to P1.7 of microcontroller. There is a unique code for enrolling finger print by using pack commands. First of all clear LCD then it will display a message “Finger print bank locker system”. After some delay it displays another message “Put your finger , Pres-1:ENR,2:IDT”. If we press the key1 in the keypad then lcd displays “ Enrolling”, then we need to scan our finger print in the finger print scanner. If the finger print is succ succes essf sful ully ly stor stored ed then then enro enroll ll is succ succes ess s If the the enro enroll llme ment nt is not not done done successfully, then lcd will display a message “Enroll failed”. Then buzzer will change from 1 to 0 state. 4.5 LOGIC 3:IDENTIFICATION 4.4.1 ALGORITHM: STEP0: Start STEP1: After enrollment success, the next step is identification. STEP2: If SW2==1 then Identifyand displays”Identifying……” STEP3: Then store SBUF with Fp[i] STEP4: STEP4:
If(
Fp[0]= Fp[0]==0X =0XEF) EF)&&( &&(Fp[ Fp[1]= 1]==0x =0x01) 01)&&( &&(Fp Fp[9] [9]==0 ==0x00 x00))
then then
displa displays ys
“Identifying success”. STEP5: Else displays “Identifying Failed” then buzzer will ON and goto STEP0. STEP6: If identification is success, success, lcd displays displays “ Enter the password”. password”. STEP7: if((str[0]=='1')&&(str[1]=='2')&&(str[2]=='3')&&(str[3]=='4')) then locker will be opened. After some delay locker will be closed. else lcd displays a message “ Wrong password”. STEP8: Stop.
71
IMC
THUM HUMB SYSTEM
4.5.2)FLOWCHART:
72
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER F
START
Clear the lcd
If key= 2
Identifying Store Fp(i)
SBUF
with
No
Yes If key =2
Identification Failed
Identification Success
ste p4
Enter password yes
No Check passw ord
Locker is opened passw by stepper ord motor delay
Locker is closed
Sto p
igure30:flow chart for identification
73
Wrong password
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
4.5.3 SOURCE CODE: if(key =='2') { lcd_clear(); lcd_print("Identifying...."); i=0; while(i<12) { uart_char(Identify[i]); i++; } i=0; while(i<16) { while(!RI); fp[i] = SBUF; RI=0; i++; } if((fp[0]==0xEF)&&(fp[1]==0x01)&&(fp[9]==0x00)) { lcd_clear(); lcd_print("Identification"); lcd_cmd(0xC0); 74
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
lcd_print("Success"); I
Delay1(400); b1=0; b2=0; b1=(fp[11])/10; b2=(fp[11])%10; lcd_cmd(0xC9); lcd_print("Id:"); lcd_cmd(0xCC); lcd_char(b1+0x30); lcd_char(b2+0x30); Delay1(300); lcd_clear();
lcd_print("Enter Password:"); Entpass();
if((str[0]=='1')&&(str[1]=='2')&&(str[2]=='3')&&(str[3]=='4')) { lcd_clear(); lcd_print("Locker opening...."); //======FORWARD======// for(i=0;i<4;i++) { m1=1;m2=1;m3=0;m4=0; Delay1(40);
75
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
m1=0;m2=1;m3=0;m4=0; Delay1(40); m1=0;m2=1;m3=1;m4=0; Delay1(40); m1=0;m2=0;m3=1;m4=0; Delay1(40); m1=0;m2=0;m3=1;m4=1; Delay1(40); m1=0;m2=0;m3=0;m4=1; Delay1(40); m1=1;m2=0;m3=0;m4=1; Delay1(40); m1=1;m2=0;m3=0;m4=0; Delay1(40); } Delay1(500); lcd_clear(); lcd_print("Locker closing...."); //======REVERSE======// for(i=0;i<4;i++) { m1=1;m2=0;m3=0;m4=0; Delay1(40); m1=1;m2=0;m3=0;m4=1; 76
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
Delay1(40); m1=0;m2=0;m3=0;m4=1; Delay1(40); m1=0;m2=0;m3=1;m4=1; Delay1(40); m1=0;m2=0;m3=1;m4=0; Delay1(40); m1=0;m2=1;m3=1;m4=0; Delay1(40); m1=0;m2=1;m3=0;m4=0; Delay1(40); m1=1;m2=1;m3=0;m4=0; Delay1(40); } Delay1(50); goto Start; } else { lcd_clear(); lcd_print("Wrong Password"); Delay1(400); goto Start; } 77
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
} else { lcd_clear(); lcd_print("Identification"); lcd_cmd(0xC0); lcd_print("Failed"); Buz=1; Delay1(400); Buz=0; goto Start; } } } } /**********************************************************/ void Entpass() { unsigned int loc=0xC0; unsigned char n=0,key=0; while(1) { key=keypad(); lcd_cmd(loc); 78
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
lcd_char(key); Delay1(150); str[n]=key; loc++; n++; if(n>=4) break; } } 4.5.4)DESCRIPTION: After enrollment is done successfully the next step is identification.here in this code we are using key 2 in the keypad for identification. Mean while we need to scan scan our our finger finger for identi identific ficati ation on if identi identific ficati ation on is done done succes successfu sfully lly the lcd displays a message that “identification success”otherwise it displays a message “identification failed” In case of successful identification the next step is entering the password we need to enter the correct password then locker will be opened automatically by the stepper motor and after some delay it will be closed. If we type the wrong password locker will not be opened again we need to do identification her in this logic we are declaring variables m1,m2,m3,m4 and initializin initializing g them with various values values for producing producing the step angle in the stepper motor 4.6)CONCLUSION: Our project software software program will be simulated by using KEIL SOFTWARE and this this prog progra ram m is dump dumped ed into into micr micro o cont contro roll ller er usin using g FLAS FLASHM HMAG AGIC IC.T .The he corresponding results can be observed.
79
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
The program will be dumped and the hardware is worked by using the code dumped in the microcontroller.Here the locker will be opened if enter the correct password.We are writing code to perform all these functions.
CHAPTER-5 RESULTS 5.1)Introduction: The idea behind this project fingerprint based bank locker system is to provide high security to our bank lockers and also providing relaibility i.e no need to carry keys ,no manual errors ,no false intrusion,no need to carry cards,easy transaction etc.Here microcontroller and fingerprint module are the main components of this system .Microcontroller is used for interfacing and controlling all the devices where where as finger finger print module module does the operatio operations ns such such as able able to conduc conductt fingerprint image processing, template generation, template matching, fingerprint searching, template storage, etc. where entering of password enrollment and identification are done through software coding .
5.2)Schematic diagram of project
80
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
Fig 31:schematic diagram
PHOTOGRAPH OF HARDWARE KIT
81
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
5.3)DESCRIPTION: This circuit consists of a Finger print scanner, an 8051 microcontroller, a uln driver driver,, a lcd,a lcd,a steppe stepperr motor, motor, keypa keypad d .Image .Image Regist Registrat ration ion:: Throug Through h Serial Serial Communication The main module of this project is finger print scanner. So we are concentrating on Fingerprint scanning. When this module is interfaced to the microcontroller, we will be using it in user mode. In this mode we will be verifying the scanned images with the stored images. id. To prove that the persons are 82
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
authorized to enter that area they need to scan their images.This fingerprint module module is connected connected to port3.0,3.1 port3.0,3.1 .NG OP67 is the finger print scanner we are using her it can store upto 960 records .It has inbuilt DSP and flash ,It provides best quality of scanning. After the scanning has been completed the person has to enter the unique id which is given to him to open his locker with the help of a keypad.Here keypad is used for entering password When coming to our application the images of the persons who are authorized to enter into the locker room will be stored in the module with a unique id. To prove that the persons are authorized to enter that area they need to scan their images. This scanner is interfaced to 8051 microcontroller. By using this controller we will be controlling the scanning process. After the scanning has been completed the person has to enter the unique id which is given to him to open his locker with the help of a keypad. Immediately the locker will be opened. After the work has been comp comple lete ted d if a swit switch ch is pres presse sed d the the lock locker er will will be clos closed ed agai again. n. If an unauthorized person tries to scan his image then an indication will be given by a buzzer which is interfaced to the controller. If an authorized person forgets his id he will be given 3 chances to re-enter the id.
83
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
CHAPTER-6 CONCLUSION&FUTURE SCOPE TO WORK 6.1 CONCLUSION: In
‘Fin ‘Finge gerr
Print rint
Based ased
Bank ank
Locke ockerr
Syste ystem m’
we
obser bserve ved d
prac practi tica call
implementation finger print technology. Fingerprint authentication has particularly proved proved its high high effici efficienc ency y and furthe furtherr enhan enhanced ced the techno technolog logy y in provid providing ing security. Even Even featur features es such such as a person person’s ’s gait, gait, face, face, or signat signature ure may chang change e with with passage of time and may be fabricated or imitated. However, a fingerprint is comple completel tely y uniqu unique e to an indivi individua duall and stayed stayed uncha unchange nged d for lifeti lifetime. me. This This exclusivity demonstrates that fingerprint authentication is far more accurate and efficient than any other methods of authentication. , we can also increase & expand security levels by using finger print technology it also consumes low power and flexible application So by this this projec projectt we succes successfu sfully lly avoide avoided d the usage usage of keys keys instea instead d used used fingerprint and password as key to open the locker thus providing safety and high reliability.we increase the no of fingerprints storage by connecting this system to a database. The main advant advantage ages s of our projec projectt are Sophis Sophistic ticate ated d securi security ty , No manual manual errors,Accuracy,No false intrusion,Need not to carry any card ,Others cannot steel the user’s entry key. 6.2) FUTURE SCOPE TO WORK:
GSM modem can be connected to this unit to communicate to security department, in case of unauthorized entry trials.
84
This project efficiency can be increased by connecting it to a database.
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
Additional modules can be added with out affecting the remaining modules. This allows the flexibility and easy maintenance of the developed system. It can be used used as E-Voting system if we remove remove the stepper stepper motor
Automatic diving license system system
No need of manual security if all banks are operated by using fingerprint technology.
BIBLIOGRAPHY: www.howstuffworks.com www.biometrics.com www.eceprojects.com www.wikipedia.com www.answers.com www.fingerprintindia.com www.google.com www.atmel.com www.ieeeprojects.com http://www.electro_tech_online.com
85
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
APPENDIX 7805 VOLTAGE REGULATOR
86
BAN BA NK
LOCK OCKER
IMC
87
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
IMC
88
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
LCD SPECIFICATIONS:SLCDLLLLllpecifications: SPECIFICATIONS:SLCDLLLLllpecifications: Display Format : 16 characters (W) x 2 lines (H) General Dimensions : 80.0 mm (W) x 36.0 mm (H) x 9.5 mm (T) Character Size : 2.95 mm (W) x 4.35 mm (H) Character Pitch : 3.65 mm (W) x 5.05 mm (H) Viewing Area : 64.0 mm (W) x 13.8 mm (H) Dot Size : 0.55 mm (W) x 0.50 mm (H) Dot Pitch : 0.60 mm (W) x 0.55 mm (H) Display Type : Positive or Negative LC Fluid : STN Yellow-Green Backlight LED : Optional Polarizer Mode : Reflective View Angle : 6 o’clock or 12 o’clock Controller : S6A0069 or Equivalent Temperature Range : 0oC to 50oC (Operating); -20oC to 70oC (Storage) NGE-OP67 fingerprint module specifications: 1. Power supply ………………………5V 2 .Working current ……………………170mA ……………………170mA 3. Peak value current …………………200mA 89
IMC
THUM HUMB SYSTEM
IMPRE PRESSIO SION
BAN BA NK
LOCK OCKER
4. Fingerprint input time……………… <250ms 5. 1:1 matching time …………………… < 600ms Matching features + matching fingerprint 6 .1:900 searching time…………………. time…………………. <2s 7 .Fingerprint capacity Max…………….. 960 8 .FAR(False Acceptance Rate) ………… <0. 001 %
90