Beruflich Dokumente
Kultur Dokumente
INTRODUCTION
In today's modern world, security plays an important role. Every person has precious
accessories like gold, jewelry or cash. It is not enough to have these accessories, but
security of this is very important, for this purpose we keep them in bank lockers. Still
we often hear or read in news paper that some fake person has access the locker of
another person and have stolen money.
In order to overcome this type of frauds, authentification of the person who wants to
use the locker is very important,. In this project; we are designing advance security
systems for banking which will ensure the guanine access of the locker overcoming
all the misuses. For this we are using microcontroller, RFID reader, Finger print
module, and LCD. The RFID reader reads the details of the RFID passport .The
RFID acts as a medium to retrieve data from server .The output of RFID reader is
serially communicated to PIC and sends the data wirelessly with the help of ZigBee
transceiver. On the other side the other ZigBee receiver receives the details and sends
to the server. Here, the server compares with the data already there. If it matches, the
fingerprint module will be activated. The person is allowed to press on that module.
If the data matches with fingerprint library, then the person is allowed, less he would
be termed as a criminal by giving an alarm/buzzing signal. The PIC displays the
details through the LCD connected at the port .
Dept. Of Electronics
CAS Vattamkulam
CASE STUDY
NEED FOR BANK SECURITY SYSTEM
There is a saying that NECESSITIES IS THE MOTHER OF ALL INVENTIONS.
Which in a more advanced version would read APPLICATION DRIVES THE
TECHNOLOGY? Going by those lines, we would like to highlight some areas of
work where our project has some potential use. Our project is basically concerned
with banking locker systems. It is about taking all the security parameters and
compare it with what is in the database and react accordingly. These applications are
possible due to some of the advantages of our work.
The are as follows:
1. User friendly
2. Applications at major banks
3. Software in embedded C
4. Easy interfacing with PC .
We decided to do a project on smart bank locker access system in the seventh
semester. The idea came to us while searching for topics on which to do project
work. We always wanted to put theory that we studied into practice. Our inspiration
in this direction was our subject embedded system in which we studied the principles
governing real time application.
In this first couple of months we spent searching topics for project work, we came
across numerous instances of the rapid advancements made in the field of bank
security system as described in various journals and magazines as well as over the
internet.
Dept. Of Electronics
CAS Vattamkulam
Use of keysMost of the banks in India gives key to the bank locker for the accessing
of locker. Usually there are two keys of the bank locker one belongs to locker holder
and other is given to the manager of the bank.
Dept. Of Electronics
CAS Vattamkulam
There are number of drawbacks of using key as a security for accessing locker like
1. The key can be lost and the locker holder suffer the different headache of getting
new key as well as he cant use the locker in mean time.
2. The key can be stolen or duplicate key can be easily made and unauthorized
person can access the locker.
While searching on the various methods used for the security application, we have
come across number of advance technique of security, these security methods really
temptated us and we are inspired to use the best among them, combination of three.
The methods we have chosen for our project, they are widely used in many vital
areas where security requirement is very severe as well as these methods assures
100% security.
Dept. Of Electronics
CAS Vattamkulam
HARDWARE STUDY
BLOCK DIAGRAM
Dept. Of Electronics
CAS Vattamkulam
MICRO CONTROLLER
The microcontroller PIC 18F24J50 is used in this project. It is the brain of the project
and it controls the entire working of this project.
LCD
LCD unit is used to display the details about the person and the key number.
Dept. Of Electronics
CAS Vattamkulam
BUZZER
It is used to produce beep sound.
MAX232
The serial interface used here is the MAX 232. Max 232 converts RS232 voltage
levels to TTL voltage levels and TTL voltage to RS232. It provides 2-channel
RS232C ports and 2- channel TTL ports. Since RS232 is not compatible with todays
microprocessors and microcontrollers we need a line driver to convert the RS232Ss
signals to TTL voltage levels that will be acceptable to the todays microprocessor
pins. One example of such a converter is MAX232 from Maxim Corporation.
Dept. Of Electronics
CAS Vattamkulam
a) OVERVIEW
Embedded systems run the computing devices hidden inside a vast array of everyday
products and appliances such as cell phones, toys, handheld PDAs, cameras, and
microwave ovens. Cars are full of them, as are airplanes, satellites, and advanced
military and medical equipments. As applications grow increasingly complex, so do
the complexities of the embedded computing devices. The goal of this course is to
develop a comprehensive understanding of the technologies behind the embedded
systems design. The students develop an appreciation of the existing capabilities and
limitations of various steps in overall design methodology - modeling/specification,
exploration,
partitioning,
synthesis
(hardware/software/interface),
Dept. Of Electronics
CAS Vattamkulam
and
MICROCONTROLLERS VERSUS
Dept. Of Electronics
CAS Vattamkulam
MICROPROCESSORS
The microprocessor is a clock driven semiconductor device consisting of electronic
logic circuits. By microprocessor is meant the general purpose microprocessors such
as Intels x86 family. These microprocessors contain no RAM, no ROM, and no I/O
ports on the chip itself.
The microprocessors is capable of performing various computing functions
And making decisions to change the sequence of program execution. The
microprocessor is in many ways similar to CPU but includes all the logic circuitry
including the control unit, on one chip. The microprocessor is divided mainly into
three segments they are Arithmetic Logic Unit (ALU), Register Array and Control
Unit.
Arithmetic Logic Unit This is the area of the microprocessor where various
computing functions are performed on data. The ALU performs such arithmetic
operations as additions and subtractions, and such logic functions as AND, OR, and
exclusive OR.
Register Array This area of microprocessors consists of various registers
.These registers are primarily used to store data temporarily during the execution of a
program and are accessible to the user through instructions.
Control unit The control unit provides the necessary timing and control
signals to all the operations in the microcomputer. It controls the flow of data
between the microprocessor and memory and peripherals.
A microcontroller has a CPU in addition to a fixed amount of RAM, ROM
I/O ports and a timer all on a single chip. The fixed amount of on chip ROM, RAM
and number of I/O ports in microcontrollers make them ideal for many applications
in which cost and space are critical.
Dept. Of Electronics
CAS Vattamkulam
10
Speed.
Packaging.
Power consumptions.
The amount of RAM and ROM on chip.
The number of I/O pins and timer on the chip.
Cost per unit
Dept. Of Electronics
CAS Vattamkulam
11
PIC 18F24J50
Low-Power, High-Speed CMOS Flash Technology
Dept. Of Electronics
CAS Vattamkulam
12
PIC18F24J 50
CHIP DIAGRAM
Dept. Of Electronics
CAS Vattamkulam
13
ACCUMULATOR
Acc is the Accumulator register.
B REGISTER
The B register is used during multiply and divide operations. For other instructions it
can be treated as another scratch pad register.
STACK POINTER
The stack pointer register is 8 bits wide. It is incremented before data is stored
during PUSH and CALL executions.
DATA POINTER
The Data pointer (DTPR) consists of a high byte and a low byte. Its functions are to
hold a 16-bit address. It may be manipulated as 16-bit register or as two independent
8-bit registers.
TIMER REGISTERS
Register pairs (THO, TLO), (THI, TLI) and (TH 2, TL2) are the 16-bit counter register
for timer/counter 0,1 and 2 respectively.
CONTROL REGISTERS
Special function registers IP, IF, TMOD, TCON, T 2CON, T2 MOD, SCON and
PCON contain control and status bits for the interrupt system, the timer/counters and
the serial port.
Dept. Of Electronics
CAS Vattamkulam
14
MCLR :- The Master Clear pin is an optional external reset that is activated
by pulling the
pin low. The MCLR pin can be setup as an standard digital
input pin or be enabled as an external reset pin. This is controlled by a
configuration setting.
Port C
RST
Reset input a high on-this pin for two-machine cycles while the oscillator is running
resets the device.
Dept. Of Electronics
CAS Vattamkulam
15
ALE/PROG
Address latch enable output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input during flash
programming. In normal operations ALE is emitted at a constant rate of 1/16 the
oscillator frequency, and may be used for external timing or clocking purposes.
PSEN
Program store enable is the read strobe to external program memory, when the
microcontroller is executing code from external program memory locations. EA
should be strapped to vie for internal program executions.
This pin also receives the 12 VOH programming enable voltage (V pp) during flash
programming for parts that require 12 volt Vpp.
Dept. Of Electronics
CAS Vattamkulam
16
CRYSTAL OSCILLATOR
XTAL 1: Input to the inverting oscillator amplifier and input to the Internal
XTAL 1 and XTAL 2 are the input and output, respectively of an inverting
amplifier, which can be configured for use as an on-chip oscillator, as shown
in figure (1). Either a quartz crystal or ceramic resonator may be used.
They are no requirements on the duly cycle of the external clock signal, since
the input to the internal clocking circuitry is through a divide by two flip flop, but
minimum and maximum voltage, high and low time specifications must be observed.
Dept. Of Electronics
CAS Vattamkulam
17
Dept. Of Electronics
CAS Vattamkulam
18
MAX232
The MAX232 is an IC, first created in 1987 by Maxim Integrated Products, that
converts signals from an RS-232 serial port to signals suitable for use in TTL
compatible digital logic circuits. The MAX232 is a dual driver/receiver and typically
converts the RX, TX, CTS and RTS signals.
The drivers provide RS-232 voltage level outputs (approx. 7.5 V) from a
single + 5 V supply via on-chip charge pumps and external capacitors. This makes it
useful for implementing RS-232 in devices that otherwise do not need any voltages
outside the 0 V to + 5 V range, as power supply design does not need to be made
more complicated just for driving the RS-232 in this case.
The receivers reduce RS-232 inputs (which may be as high as 25 V), to
standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a
typical hysteresis of 0.5 V.
Dept. Of Electronics
CAS Vattamkulam
19
Dept. Of Electronics
CAS Vattamkulam
20
LCD
Dept. Of Electronics
CAS Vattamkulam
21
Dept. Of Electronics
CAS Vattamkulam
22
Dept. Of Electronics
CAS Vattamkulam
23
Dept. Of Electronics
CAS Vattamkulam
24
IC 4066
The 4066 contains 4 analogue bilateral switches, each with an active-high enable
input (A) and two input/outputs (X and Y). When the enable input is set high, the X
and Y terminals are connected by a low impedance; this is the on condition. When
the enable is low, there is a high impedance path between X and Y, and the switch
is off.
The 4066 is pin-compatible with the 4016, but has a significantly
lower on impedance and more constant on resistance over the full range of input
voltage. Therefore, the 4066 is preferable to the 4016 in most cases.
Dept. Of Electronics
CAS Vattamkulam
25
CIRCUIT DIAGRAM
Dept. Of Electronics
CAS Vattamkulam
26
SOFTWARE STUDY
EMBEDDED C
An embedded hardware device, depending on its size and capabilities, can have an
operating systemsuch as embedded Linuxwith limited or minimal functionality
compared to a desktop version. For very small embedded devices, an OS might be
entirely absent: it is not possible to write programs, compile, and run and debug the
code in such small devices. In such a situation, it is necessary to use cross compilers
(or assemblers), which compile programs written in a high-level language on a host
system (typically a PC) and generate code for a target system (for example, an
embedded device). If we write assembly programs and use an assembler running on
a host to generate code for a target device, it is a cross assembler. So, we can write
programs on our PC generate code for the embedded device and run it there. This
solves the problem of creating executable code for embedded systems, but testing,
debugging or tracing embedded programs are difficult.
C is the language of choice for most of the programming done for embedded
systems. It might appear that assembly language is intuitively the most obvious
choice, since embedded programming is all about programming hardware devices
such as microcontrollers. It is true that micro-controllers were initially programmed
mostly in assembly language as with other embedded devices. It is not that difficult
to write an assembly program since the assembly language produces the tightest
code, making it possible to squeeze every possible byte of memory usage. However,
the problem is that it becomes difficult to use for any reasonably-sized program, and
even a slightly complicated device. The difficulties are in getting assembly
programs to work correctly; and understanding, debugging, testing and, most
importantly, maintaining them in the long run.
Dept. Of Electronics
CAS Vattamkulam
27
Dept. Of Electronics
CAS Vattamkulam
28
Also, high quality C compilers can often generate code that is comparable to the
speed of programs written in assembly. So, the benefits of using assembly for
efficiency are negligible compared to the ease with which programmers can write C
code. However, if performance is the key to make or break a device, then it is hard to
beat assembly. For example, DSP (digital signal processing) devices are mostly
programmed in assembly even today, because performance is the most important
requirement in these devices. Languages such as C++ have features that are often
bulky, inefficient or inappropriate for use in resource constrained environments
such as embedded devices. In particular, virtual functions and exception handling
are two language features that are not efficient in terms of space and speed in
embedded systems. Sometimes, C++ programming is used as Safe C, where
only a small subset of C++ features is included. However, for convenience, most
embedded projects pragmatically use C itself. Languages with managed
runtimes, such as Java, are mostly heavyweight. Running Java programs requires
a Java Virtual Machine, which can take up a lot of resources.
Though Java is popular in high-end mobile phones because of the portability it
provides and for browsing the Web, it is rarely suitable for use in small embedded
devices. There are numerous special purposes or proprietary languages meant to
be used in embedded systems such as B# and Dynamic C. Others, like Forth, are
also well suited for the purpose. However, C is widely used and familiar to
programmers worldwide, and its tools are easily available.
Dept. Of Electronics
CAS Vattamkulam
29
CHARACTERESTICS OF EMBEDDED C
Like most imperative languages in the ALGOL tradition, C has facilities for
structured programming and allows lexical variable scope and recursion, while a
static type system prevents many unintended operations. In C, all executable
Code is contained within functions. Function parameters are always passed by
value. Pass-by-reference is achieved in C by explicitly passing pointer values.
Heterogeneous aggregate data types (struct) allow related data elements to be
combined and manipulated as a unit. C program source text is free-format, using the
semicolon as a statement terminator (not a delimiter).
C also exhibits the following more specific characteristics:
Lack of nested function definitions
Variables may be hidden in nested blocks
Partially weak typing; for instance, characters can be used as integers
Low-level access to computer memory by converting machine addresses to typed
pointers
Function and data pointers supporting ad hoc run-time polymorphism
Array indexing as a secondary notion, defined in terms of pointer arithmetic
A preprocessor for macro definition, source code file inclusion, and conditional
compilation
Complex functionality such as I/O, string manipulation, and mathematical
functions consistently delegated to library routines
A relatively small set of reserved keywords
A lexical structure that resembles B more than ALGOL, for example
{ ... } rather than ALGOL's begin ... end
the equal-sign is for assignment (copying), much like Fortran
two consecutive equal-signs are to test for equality (compare to .EQ. in Fortran or
the equal-sign in BASIC)
Dept. Of Electronics
CAS Vattamkulam
30
&& and || in place of ALGOL's and or (these are semantically distinct from the
bit-wise operators & and | because they will never evaluate the right operand if
the result can be determined from the left alone (short-circuit evaluation)).
FLOW CHART
Dept. Of Electronics
CAS Vattamkulam
31
EMBEDDED C PROGRAM
#include<htc.h>
#include<string.h>
#include"lcd5.c"
#define SWITCH1_FINGER RA3
#define SWITCH2_RFID RA2
#define buzzer RA5
#define red_led RC0
#define green_led RC1
#define _XTAL_FREQ 10000000
#define ack 0x07
void request(void);
void initialize(void);
void server_init(void);
bit checksum_calculation(unsigned char *fp,unsigned char);
void send_serial2(unsigned char *serial2,unsigned char);
void send_serial1(unsigned char *serial1,unsigned char);
void split(unsigned char *fp3,unsigned char);
void initialvalues(void);
//*******************************************************************
*************************************
unsigned int t_num;
unsigned char
search[]={0xEF,0x1,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x3,0x1,0x0,0x5};
unsigned char
charfile[]={0xEF,0x1,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x4,0x2,0x1,0x0,0x8};
unsigned char
Dept. Of Electronics
CAS Vattamkulam
32
compare[]={0xEF,0x1,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x8,0x1B,0x1,0x0,0x0,0x1,0x
0x1,0x0,0x27};
unsigned char
tempreq[]={0xEF,0x1,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x4,0x9,0x1,0x0,0xF}
unsigned char
nofinger[]={0xEF,0x1,0xFF,0xFF,0xFF,0xFA,0x07,0x00,0x03,0x02,0x00,0x0C};
unsigned char
resend[]={0xEF,0x1,0xFF,0xFF,0xFF,0xFA,0x07,0x00,0x03,0x04,0x00,0x0E};
unsigned char
ok[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFA,0x07,0x00,0x03,0x00,0x00,0x0A};
unsigned char
templocation[]={0xEF,0x1,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x6,0x6,0x1};
unsigned char
deletefull[]={0xEF,0x01,0xFF,0xFF,0xFF,0xFF,0x1,0x0,0x03,0x0D,0x00,0x11};
unsigned char
deletebylocation[]={0xEF,0x1,0xFF,0xFF,0xFF,0xFF,0x01,0x00,0x07,0x0C};
enum statetype
{idle,srch,chrf,cmpr,match,mmatch,tmpreq,over,downloadcmplte,deleteall,deleteloca
tion}state;
//*******************************************************************
****************************************
#define U1R
RC7
#define U1T
Dept. Of Electronics
CAS Vattamkulam
33
#define U2T_REG 5
#define U2R_PIN 1
#define EINT0 RB0 //Interrupt 0 RB0
#define EINT1 RPINR1 //Interrupt 1 RP11
#define EINT1_PIN 11 //Interrupt 1 RP11
#define EINT2 RPINR2 //Interrupt 2 RP12
#define EINT2_PIN 12 //Interrupt 2 RP12
#define EINT3 RPINR3 //Interrupt 3 RP13
#define EINT3_PIN 13 //Interrupt 3 RP13
//*************************************************
unsigned int t_num;
unsigned char t_var = 255, t_cnt = 0, i=0, j=0,s=0;
unsigned char rcv_Buffer[50];
unsigned char rcv_server[50];
unsigned char name[20],tot[10],prize[10];
unsigned char rcv_Buffer_pos1 = 0;
unsigned char rcv_Buffer_pos2 = 0;
unsigned char rcvd_RfidTag_f = 0;
unsigned char rcvd_ServerData_f = 0;
unsigned char clr_lcd_f = 0;
unsigned char clr_string_f = 0;
unsigned char count1=0,count2=0,count3=0;
unsigned char server_char = 0;
unsigned char server_Data_pos[8];
unsigned char namerequest[]="name";
Dept. Of Electronics
CAS Vattamkulam
34
35
while(--b)
{
__delay_ms(10);
}
}
//*************************************************
void init_reqd()
{
//Initialize all
GIE = 0;
//TRISC = 0;
//E1=0;
//E2E3=0;
EECON2 = 0x55;
EECON2 = 0xAA;
PPSCON = 0; //for UART2 asigned at pins Rx=3,Tx=2
RPINR16 = 1;
RPOR0= 5;
U2R= U2R_PIN;
U2T= U2T_REG;
//EINT1= EINT1_PIN; //Ext. int. 1,2,3
//EINT2= EINT2_PIN;
//EINT3= EINT3_PIN;
//EECON2 = 0x55;
Dept. Of Electronics
CAS Vattamkulam
36
//EECON2= 0xAA;
PPSCON = 1;
USBEN = 0;//disable USB
UTRDIS = 1;
//INT0IE = 1; //Ext. Interrupts
//INT1IE = 0;
//INT2IE = 0;
//INT3IE = 0;
//INTEDG0 = 0; //Falling Edge
//INTEDG1 = 0;
//INTEDG2 = 0;
//INTEDG3 = 0;
//TRISC2 = 0; //test only
GIE = 1;
PEIE = 1;
//TRISC0=0;
//RC0=1;
//TRISB=0X00;
PCFG1 = 1;
PCFG0 = 1;
PCFG8 = 1;
PCFG9 = 1;
PCFG10=1;
PCFG11 = 1;
PCFG12=1;
PCFG4 = 1;
Dept. Of Electronics
CAS Vattamkulam
37
PCFG3 = 1;
PCFG2 = 1;
PCFG1 = 1;
PCFG0 = 1;
TRISC0=0;
TRISC1=0;
TRISC2=0;
TRISB0=1;
TRISB1=0;
TRISB2=0;
TRISB3=0;
TRISB4=0;
TRISB5=0;
TRISB6=0;
TRISB7=0;
TRISA2=0;
TRISA3=0;
TRISA5=0;
TRISC7 =1;
TRISC6=0;
TRISA0=0;
TRISA1=1;
}
//**************************************************
void init_timer()
{
Dept. Of Electronics
CAS Vattamkulam
38
GIE=1;
PEIE=1;
TMR0IE=0;
T0CON=0B00000100;
}
//**************************************************
void init_serial_ports()
{
SPEN = 1;
SYNC = 0;
BRGH = 1;
BRG16 = 0;
SPBRG = 79; //9600 @ 10MHz
TXEN = 1;
CREN = 1;
RC1IE = 1;
SPEN2 = 1;
SYNC2 = 0;
BRGH2 = 1;
BRG162 = 0;
SPBRG2 = 79;
TXEN2 = 1;
CREN2 = 1;
RC2IE = 1;
PCFG1 = 1;
PCFG0 = 1;
Dept. Of Electronics
CAS Vattamkulam
39
TRISC7 = 1;
SWITCH1_FINGER=0;
my_delay(2);
SWITCH2_RFID=1;
my_delay(2);
}
//**************************************************
void put_serial1(unsigned char c)
{
while(!TRMT);
TXREG = c;
}
void put_serial2(unsigned char c)
{
while(!TRMT2);
TXREG2 = c;
}
void puts_serial1(const unsigned char *c)
{
while(*c)
put_serial1(*c++);
}
//**************************************************
//interrupt Function
void interrupt fn_isr_hp(void)
Dept. Of Electronics
CAS Vattamkulam
40
{
if(RC1IF==1&&rfid_validbit==0)
{
RC1IF=0;
rcv_Buffer[rcv_Buffer_pos1] = RCREG;
//put_serial2(rcv_Buffer[rcv_Buffer_pos1]); //test only
if(rcv_Buffer[rcv_Buffer_pos1-1]==0xD&&rcv_Buffer[rcv_Buffer_pos1]==0X0A)
{
rcvd_RfidTag_f =1;
rcv_Buffer_pos1 = 0;
clr_string_f = 1;
//put_serial1('S');
RC1IF=0;
}
rcv_Buffer_pos1++;
}
if(RC1IF==1&&rfid_validbit==1)
{
RC1IF=0;
switch(sequence_count)
{
case 0: if(RCREG==0XEF)
sequence_count=1;
break;
case 1: if(RCREG==0X01)
Dept. Of Electronics
CAS Vattamkulam
41
sequence_count=2;
else if(RCREG==0XEF)
sequence_count=1;
else
sequence_count=0;
break;
case 2: if(RCREG==0XFF)
sequence_count=3
else if(RCREG==0XEF)
sequence_count=1;
else
sequence_count=0;
break;
case 3: if(RCREG==0XFF)
sequence_count=4;
else if(RCREG==0XEF)
sequence_count=1;
else
sequence_count=0
break;
case 4: if(RCREG==0XFF)
sequence_count=5;
else if(RCREG==0XEF)
sequence_count=1;
else
sequence_count=0;
Dept. Of Electronics
CAS Vattamkulam
42
break;
case 5: if(RCREG==0XFF)
sequence_count=6;
else if(RCREG==0XEF)
sequence_count=1;
else
sequence_count=0;
break;
case 6:sequence_count=7;
break;
}
if(sequence_count>6)
{
rcv_thmp[rcve_count]=RCREG;
rcv_thmp[rcve_count+1]='\0';
//Finding Packet Size
if(rcve_count==2)
{
packet_size=(rcv_thmp[1]*0x100+rcv_thmp[2])+3;
length_calc=1;
}
//Stop Recieving
if(rcve_count>=packet_size-1 && length_calc==1)
{
rcvd_thmp_f=1;
sequence_count=0;
Dept. Of Electronics
CAS Vattamkulam
43
length_calc=0;
}
rcve_count++;
}
}
if(RC2IF)
{
RC2IF=0;
rcv_server[rcv_Buffer_pos2] = RCREG2;
//put_serial2(RCREG2);
if(rcv_server[rcv_Buffer_pos2-1]==0xD&&rcv_server[rcv_Buffer_pos2]==0X0A)
{
rcvd_ServerData_f = 1;
//rcv_Buffer_pos2=0;
RC2IF=0;
clr_string_f = 1;
//RC0=0;
//put_serial2('S');
}
rcv_Buffer_pos2++;
}
if(TMR0IF)
{
TMR0IF =0;
buzzer=0;
TMR0ON=0;
Dept. Of Electronics
CAS Vattamkulam
44
}
}
//**************************************************
void main(void)
{
sizeofsearch=sizeof(search);
sizeofcharfile=sizeof(charfile);
sizeofcompare=sizeof(compare);
sizeoftempreq=sizeof(tempreq);
sizeoftemplocation=sizeof(templocation);
sizeofdeletefull=sizeof(deletefull);
sizeofdeletebylocation=sizeof(deletebylocation);
initialize();
init_reqd();
init_serial_ports();
lcd_init();
init_timer();
lcd_goto(0);// select first line
lcd_puts("<<---------------->>");
lcd_goto(0x40);// Select second line
lcd_puts("System Init 1 -> OK");
lcd_goto(0x14);
lcd_puts("System Init 2 -> OK");
lcd_goto(0x54);
Dept. Of Electronics
CAS Vattamkulam
45
lcd_puts("<<---------------->>");
my_delay(300);
lcd_goto(0);// select first line
lcd_puts("
");
");
lcd_goto(0x14);
lcd_puts("
");
lcd_goto(0x54);
lcd_puts("
");
red_led=0;
green_led=0;
while(1)
{
if(rcvd_thmp_f==1)
{
rcvd_thmp_f=0;
checksum_bit=checksum_calculation(&rcv_thmp[0],packet_size);
}
if(checksum_bit==1 && rcv_thmp[0]==ack)
{
checksum_bit=0;
checksum_calculation_routine=0;
startingbit=0;
lcd_goto(0x16);
Dept. Of Electronics
CAS Vattamkulam
46
if(rcv_thmp[3]==0x00)
{
switch(state)
{
case srch: state=chrf;
break;
case chrf: state=cmpr;
break;
case cmpr: state=match;
//matchsound
T0CON=0B00000100;
buzzer=1;
TMR0ON=1;
finger_valid_flag=1;
break;
case tmpreq: template_request=1;
send_serial2(&ok[0],12);
break;
case downloadcmplte:
send_serial2(&ok[0],12);
CREN2=1;
server_init();
state=srch;
break;
Dept. Of Electronics
CAS Vattamkulam
47
break;
Dept. Of Electronics
CAS Vattamkulam
48
}
}
if(state!=match&&template_request==0)
{
initialize();
if(state==srch)
{
//before_scan= !status_switch;
}
request();
}
}
if(finger_valid_flag)
{
finger_valid_flag=0;
address_bit=1;
send_serial2(&adress[0],6);
send_serial2(&rcv_thmp[0],packet_size);
rcv_server[0]='\0';
packet_size2=0;
sequence_count2=0;
rcv_server_count=0;
Dept. Of Electronics
CAS Vattamkulam
49
{
rcvd_ServerData_f = 0;
lcd_goto(0);
lcd_puts("
");
lcd_goto(0x40);
lcd_puts("
");
lcd_goto(0x14);
lcd_puts("
");
lcd_goto(0x54);
lcd_puts("
");
//lcd_goto(0);
//lcd_puts("WELCOME");
//lcd_goto(0x40);
rcv_server[3]='\0';
rfid=strcmp("RFY",rcv_server);
rfidn=strcmp("RFN",rcv_server);
rfidalready=strcmp("RFV",rcv_server);
fingvalid=strcmp("FIY",rcv_server);
fingnvalid=strcmp("FIN",rcv_server);
votemarked_status=strcmp("VMC",rcv_server);
rcv_server[0]='\0';
rcv_Buffer_pos2=0;
}
if(rfid==0)
{
Dept. Of Electronics
CAS Vattamkulam
50
rfid=2;
SWITCH1_FINGER=1;
my_delay(2);
SWITCH2_RFID=0;
my_delay(2);
lcd_clear();
lcd_goto(0);
lcd_puts("YOUR ID IS MATCHING");
lcd_goto(0X40);
lcd_puts("PUT YOUR FINGER");
rfid_validbit=1;
state=srch;
request();
}
if(rfidn==0)
{
lcd_goto(0);
lcd_puts("
");
lcd_goto(0X40);
lcd_puts("
");
rfidn=2;
lcd_clear();
lcd_goto(0);
lcd_puts("YOUR ID NOT MATCHING");
red_led=1;
buzzer=1;
Dept. Of Electronics
CAS Vattamkulam
51
green_led=0;
my_delay(500);
red_led=0;
buzzer=0;
lcd_clear();
rcv_Buffer[0]='\0';
}
if(fingvalid==0)
{
fingvalid=2;
namerequest_bit=1;
send_serial2(&namerequest[0],4);
}
if(namerequest_bit==1&&rcvd_ServerData_f==1)
{
rcvd_ServerData_f=0;
namerequest_bit=0;
lcd_goto(0);
lcd_puts("
");
lcd_goto(0X40);
lcd_puts("
");
rcv_Buffer[8]='\0';
rcv_server[rcv_Buffer_pos2-2]='\0';
lcd_goto(0);
lcd_puts(rcv_server);
lcd_goto(0x40);
Dept. Of Electronics
CAS Vattamkulam
52
lcd_puts("ID:");
lcd_puts(rcv_Buffer);
green_led=1;
red_led=0;
my_delay(500);
green_led=0;
rcv_server[0]='\0';
rcv_Buffer[0]='\0';
rcv_Buffer_pos2=0;
}
if(fingnvalid==0)
{
fingnvalid=2;
lcd_goto(0);
lcd_puts("
");
lcd_goto(0X40);
lcd_puts("
");
lcd_goto(0);
lcd_puts("FINGER NOT MATCHING");
rcv_Buffer[0]='\0';
rfid_validbit=0;
SWITCH1_FINGER=0;
my_delay(2);
SWITCH2_RFID=1;
my_delay(2);
red_led=1;
Dept. Of Electronics
CAS Vattamkulam
53
my_delay(500);
red_led=0;
}
if(votemarked_status==0)
{
lcd_clear();
lcd_goto(0);
lcd_puts("*WELCOME TO BANK NAME*");
rfid_validbit=0;
SWITCH1_FINGER=0;
my_delay(2);
SWITCH2_RFID=1;
my_delay(2);
red_led=0;
green_led=0;
}
if(rcvd_RfidTag_f==1)
{
rcvd_RfidTag_f=0;
put_serial2('R');
put_serial2('F');
send_serial2(&rcv_Buffer[0],8);
//rcv_Buffer_pos2=0;
rcv_Buffer_pos1=0;
//rcv_Buffer[0]='\0';
}
Dept. Of Electronics
CAS Vattamkulam
54
}
}
void send_serial2(unsigned char *serial2,unsigned char array_size)
{
unsigned char *fp2,ps2,*start2=0;
fp2=serial2;
ps2=array_size;
for(start2=fp2;start2<(fp2+ps2);start2++)
{
while(!TRMT2);
TXREG2=*start2;
}
}
void send_serial1(unsigned char *serial1,unsigned char array_size1)
{
unsigned char *fp8,ps3,*start4=0;
fp8=serial1;
ps3=array_size1;
for(start4=fp8;start4<(fp8+ps3);start4++)
{
while(!TRMT);
TXREG=*start4;
}
}
void initialvalues(void)
{
Dept. Of Electronics
CAS Vattamkulam
55
rcv_server[0]='\0';
split_array[0]='\0';
count1=0;
count2=0;
count3=0;
name[0]='\0';
tot[0]='\0';
prize[0]='\0';
rcv_Buffer_pos2=0;
rcv_Buffer_pos1=0;
}
void request(void)
{
switch(state)
{
case chrf: send_serial1(&charfile[0],sizeofcharfile);
break;
case cmpr: send_serial1(&compare[0],sizeofcompare);
break;
case srch: send_serial1(&search[0],sizeofsearch);
break;
case tmpreq: send_serial1(&tempreq[0],sizeoftempreq);
break;
case downloadcmplte:send_serial1(&templocation[0],sizeoftemplocation);
while(!TRMT);
TXREG=0x00;
Dept. Of Electronics
CAS Vattamkulam
56
//put_serial1(buffer_location);
//put_serial1(location_msb);
//put_serial1(location_lsb);
break;
case deleteall:
send_serial1(&deletefull[0],sizeofdeletefull);
break;
case deletelocation:send_serial1(&deletebylocation[0],sizeofdeletebylocation);
while(!TRMT);
TXREG=0x00;
//put_serial1(0x00);
put_serial1(buffer_location1);
while(!TRMT);
TXREG=0x00;
//put_serial1(0x00);
//put_serial1(0x01);
while(!TRMT);
TXREG=0x01;
put_serial1(location_msb1);
put_serial1(location_lsb1);
break;
}
}
void initialize(void)
{
rcv_thmp[0] = '\0';
rcvd_thmp_f =0;
Dept. Of Electronics
CAS Vattamkulam
57
rcve_count=0;
packet_size=0;
check_sum=0;
original_checksum=0;
}
bit checksum_calculation(unsigned char *fp,unsigned char ps)
{
unsigned char *fp1,ps1,*start=0;
checksum_calculation_routine=1;
fp1=fp;
for(start=fp1;start<=(fp1+(ps-3));start++)
check_sum=((check_sum)+(*start));
original_checksum=((*(fp1+(ps-2))*0x100)+(*(fp1+(ps-1))));
return(check_sum==original_checksum);
}
void server_init(void)
{
//rcv_server[0]='\0';
//rcv_server_count=0;
//sequence_count2=0;
//packet_size2=0;
}
Dept. Of Electronics
CAS Vattamkulam
58
absolutely essential that our PCB software prints holes in the middle of pads ,
which will act as center marks when drilling. It is virtually impossible to
accurately hand drill boards without these holes. Here layout is printed on a
butter paper (transparent paper). It is screen printed on the copper clad, etched by
using ferric chloride solution and drilled by using a PCB drill.
Generally the making of the PCB can be divided into four simple steps :
1. Components layout and design
2. PCB layout designing
3. Drilling
4. Etching of the PCB
Dept. Of Electronics
CAS Vattamkulam
59
PCB LAYOUT
Draw the circuit connection of the component layout. While drawing the track ,
the size of the track should be kept in mind. For example, the track size for
the power
flowing through the track. The spacing between the two tracks should not be very
less. The next step is to transfer the PCB layout to the PCB laminate. Always
use good quality, pre-coated photo resist fiber glass (FR4) board. Check carefully
for scratches in protective covering. You dont need dark room or subdued lighting
when handling boards, as long as you avoid direct sunlight, minimize unnecessary
exposure, and develop immediately after UV exposure. Instagraphic Microgram
board develops really want to make low-resolution PCBs is essential, and should
allow exposure times from 2 to 10 minutes in 15 to 30 seconds increments. It is
useful if the timer has an audible indication when the timing period has completed.
A timer from a scrap microwave oven would be ideal. Use glass sheet rather than
plastic for the top of the UV unit and a light-box for lining up double-sided
artworks. If you do a lot of double-sided PCBs, it may be worth making a doublesided exposure unit, where the PCB can be sandwiched between two light sources to
expose both sides simultaneously. To find the exposure time for a particular UV unit
and laminate type, expose a test piece in 30 seconds increment from 2 to 8 minutes.
The photo resist board needs
to be exposed to UV light through artwork, using a UV exposure box. UV exposure
units can easily be made using standard fluorescent lamp ballasts and UV tubes. For
small PCBs two or four 8-watt, 30.5cm tubes will be adequate. For larger (A3) units,
four 38cm tubes are ideal. To determine the tube-to-glass spacing, place a sheet of
tracing paper on the glass and adjust the distance to get the most even light level over
the surface of the paper. Even illumination is a lot easier to obtain with 4-tube units.
Generally speaking over exposure is better than under exposure. For a single sided
PCB, place the artworks toner side up on the UV box glass, peel of the protective
film from the laminate, and place its sensitive side down on printers. You may need
to specify a vertical offset in your PCB software to make it print on the right part of
the page.
Dept. Of Electronics
CAS Vattamkulam
60
For this we should select the suitable PCB laminate. Usually two types of laminates
are available:
1. Phenolic board
2. Fiber glass epoxy board
Phenolic boards are cheaper than latter. By transferring the layout
to the laminate, clean the copper side of the laminate using petrol or
alcoholic spirit or using commercially available cleaning sprays. Place a
carbon paper on the copper side of the PCB and the design layout next to
carbon paper . Neatly redraw the trace on the design layout on to the
carbon paper. Using a marvel pen or fine brush redraw the trace of the
carbon paper on to the PCB laminate.
Dept. Of Electronics
CAS Vattamkulam
61
DRILLING
The
diameter
of
the
holes
varies
depending
upon
the
component that it should hold . It is about 1mm for ICs , about 1.25mm for
capacitors and resistors and
ferric chloride to
water . The solution , which is nicely stirred , is then taken in a flat plastic
tray . The PCB is immersed in the solution and the laminate is thoroughly
washed with water . Alcohol
SOLDERING
Soldering
material for the purpose of making continuous and permanent path for the
flow of electricity.
Features:
1.Retain adequate strength at low as well as at high temperature.
2. Provide an electrically conducting path.
3. Connects the components together to form joints.
4. Allow heat flow between components.
5. Form a liquid gas tight seat.
Dept. Of Electronics
CAS Vattamkulam
62
SOLDERING EQUIPMENTS
SOLDER
Solder is used for joining two or more metals at temperature
below their metal point. The popularly used solders are the alloys of tin
(60% ) and lead (40% ) that melts at 190 C and solidifies when it cools.
Most of the wire is flux cored type. When such soldering wires are used , no
extra soldering flux is needed .
FLEX
In order to make the surface accept the solder readily,
the
SOLDERING IRON
It is the tool used to melt the solder and apply at the joints in
the circuit . It operates at 230V ac supply. the power range of the soldering
iron are low , 25W , 35W , 65W , 125W etc . The iron bit at the tip of it
gets heated up within a few minutes .
SOLDERING GUN
It is a gun shaped soldering tool used especially when heat is
required . Its trigger is a switch that controls the ac voltage to the bit.
SOLDERING STATION
It is an equipment that provides a iron a control console that
controls the temperature . The temperature is maintained by a feed back control
loop.
Dept. Of Electronics
CAS Vattamkulam
63
SOLDERING PROCESS
Make the layout of component in the circuit. Plug in the cord of the soldering iron
in to the mains to get it heated.
Straighten and clean the component leads using a blade or knife. Apply a little
flux on the leads. Take a little solder from iron and heated.
Apply the molten solid on the leads. Care must be taken to avoid the components
from heated up.
Mount the components on the PCB by lending the leads of the components. Use
nose-pliers.
Apply flux on the joints and solder the joints. Soldering must be done in minimum
time to avoid dry soldering and heating up of the components.
Wash the residue using Isopropanol and brush
Dept. Of Electronics
CAS Vattamkulam
64
ADVANTAGES
Totally package secure.
Unique for every person.
Environmental reliable.
No proxy punching.
Dept. Of Electronics
CAS Vattamkulam
65
LIMITATIONS
Costly.
Using the fingerprint scanner does not take into consideration when a person
physically changes.
In the manual labour industry, since employees are usually working with
their hands, their fingers may get rough or scratched which could lead to a
miss reading
Dept. Of Electronics
CAS Vattamkulam
66
FUTURE SCOPE
We can use this type of Access control system in many areas such as electronic safe
for vehicles , to secure some important section in company and also in government
office , etc.
Dept. Of Electronics
CAS Vattamkulam
67
CONCLUSION
We could complete our project named BANK SECURITY SYSTEM successfully
within scheduled time period. Our project provides new revolution in modern
world. We can reduce theft in bank locker by providing full security to it.Therefore
the antisocial crimes in banks can be controlled by our project. By implementing our
project the bank larceny can be avoided and so it will provide efficient security in
banks. The concept can be developed further by increasing the range of controller
and interfacing GSM module in output side to provide more security.
Dept. Of Electronics
CAS Vattamkulam
68
BIBILIOGRAPHY
Dept. Of Electronics
CAS Vattamkulam
69
DATASHEETS
Dept. Of Electronics
CAS Vattamkulam
70
Dept. Of Electronics
CAS Vattamkulam
71
Dept. Of Electronics
CAS Vattamkulam
72
Dept. Of Electronics
CAS Vattamkulam
73
Dept. Of Electronics
CAS Vattamkulam
74
Dept. Of Electronics
CAS Vattamkulam
75
Dept. Of Electronics
CAS Vattamkulam
76
Dept. Of Electronics
CAS Vattamkulam
77
Dept. Of Electronics
CAS Vattamkulam
78
Dept. Of Electronics
CAS Vattamkulam
79
Dept. Of Electronics
CAS Vattamkulam
80
Dept. Of Electronics
CAS Vattamkulam
81
Dept. Of Electronics
CAS Vattamkulam
82
Dept. Of Electronics
CAS Vattamkulam
83
Dept. Of Electronics
CAS Vattamkulam
84
Dept. Of Electronics
CAS Vattamkulam
85
Dept. Of Electronics
CAS Vattamkulam
86
Dept. Of Electronics
CAS Vattamkulam
87
Dept. Of Electronics
CAS Vattamkulam
88
Dept. Of Electronics
CAS Vattamkulam
89
Dept. Of Electronics
CAS Vattamkulam
90
Dept. Of Electronics
CAS Vattamkulam
91
Dept. Of Electronics
CAS Vattamkulam
92
Dept. Of Electronics
CAS Vattamkulam
93
Dept. Of Electronics
CAS Vattamkulam
94
Dept. Of Electronics
CAS Vattamkulam
95
Dept. Of Electronics
CAS Vattamkulam
96
Dept. Of Electronics
CAS Vattamkulam
97
Dept. Of Electronics
CAS Vattamkulam
98