Vous êtes sur la page 1sur 64

Automatic Door Locking System

using Switch matrix

ABSTRACT

Security is a prime concern in our day -today life. Everyone wants to be


as much secure as possible. An access control for doors forms a vital
link in a security chain. The microcontroller based Door locker is an
access control system that allows only authorized persons to access a
restricted area. The system is fully controlled by the 8 bit
microcontroller AT89C2051 which has a 2Kbytes of ROM for the program
memory. The password is stored in the EPROM so that we can change it
at any time. The system has a Keypad by which the password can be
entered through it. When they entered password equals with the
password stored in the memory then the relay gets on and so that the
door is opened. If we entered a wrong password for more than three
times then the Alarm is switched on. When we go inside and come back
then the microcontroller will sense the person using the Laser light, the
microcontroller will automatically open the door for you.

TABLE OF CONTENTS
CHAPTER NO.

PAGE
NO.

TITLE

1.
2.
2.
1
2.
2
3.
3.
1
3.
2
3.
3

INTRODUCTION

PROJECT DESCRIPTION

BLOCK DIAGRAM

BLOCK DIAGRAM EXPLANATION

CIRCUIT DIAGRAM

17

MAIN CIRCUIT D IAGRAM

17

POWER SUPPLY

18

CIRCUIT EXPLANATION

18

4.

FLOW CHART

19

5.

ALGORITHM

20

6.

PROGRAM

22

7.

COMPONENTS DETAILS

40

7.1
.
7.
2
7.
3
7.
4
7.5
.
8.

RESISTOR

40

CAPACITOR

40

TRANSISTOR

41

DIODE

42

INTEGRATED CIRCUITS
PCB FABRICATION

9.

APPLICATIONS

10.

FUTURE ENHANCEMENT

11.

CONCLUSION

12.

REFERENCES

13.

APPENDICES

42
46
48
49
49
49
50

LIST OF TABLES:

1. PIN DESCRIPTION OF AT89C2051


2. PORT ALTERNATE FUNCTIONS

LIST OF FIGURES:
A. BLOCK DIAGRAM
B. PIN OUT OF AT89C2051
C. BLOCK DIAGRAM OF AT89C2051
D. PCB FBRICATION
E. FLOW CHART
F. PINOUT FOR IC LM7805
G. BLOCK DIAGRAM OF IC LM7805
H. PINOUT FOR BC547

1. INTRODUCTION

Password Based Door Security System using Microcontroller is used


in the places where we need more security. It can also used to secure
lockers and other protective doors.
T h es y s t e m c o m p r i s e s
d
and

a
the

number keypa
keypads

ar
b i t microcontroller AT89C2051. This is one
e connected to the 8
of
popular
a n d t he
the
Microcontrollers.
It has only 20 pins
re
are 15
in p u t /o u tp u t li n e s . T he mic r o c o n t
p ro g r a me mo r
ro lle r
ha s a
m
y
monitor the
o f 2 Kilobytes. The microcontroller continuously
keypad
and if somebody enters the password it will check the entered password
with the password which was stored in the memory and if it they are
same then the microcontroller will switch on the corresponding device.
The system will allow the person who knows the password and it will
not allow who dont know the password and the system will also show
the persons who try to break the protection barrier.

2. PROJECT DESCRIPTION

2.1

BLOCK DIAGRAM

Figure: A
2.2 BLOCK DIAGRAM EXPLANATION

INTELS 8051 Architecture

The generic 8051 architecture sports a Harvard architecture, which


contains two separate buses for both program and data. So, it has two
distinctive memory spaces of 64K X 8 size for both program and data.
8 bit central p r o c e s s in
w it
It is based on an
g
u n it
h
a n 8 b it
A c c u mu la t o a n a no t he r 8 b it B re g is
r
d
te r
a s ma in processing
blocks. Other portions of the architecture include few 8 bit and 16 bit
registers and 8 bit memory locations. Each 8031 device has some
amount of data R A M b u i l t
processing. This area
is

devic
in the
e
for internal
use
fo
stac
d
r
k
operations and

temporary storage of data. This base architecture is supported with on


chip peripheral functions like I/O ports, timers/counters, versatile
serial

communication port. So it is clear that this 8051 architecture was


designed to cater many real time embedded needs.
The following list gives the features of the 8051 architecture:

Optimized 8 bit CPU for control applications.


Extensive Boolean processing capabilities.
64K Program Memory address space.
64K Data Memory address space.
128 bytes of on chip Data Memory.
32 Bi directional and individually addressable I/O lines.
Two 16 bit timer/counters.
Full Duplex UART.
6 source / 5 vectors interrupt structure with priority levels.
On chip clock oscillator.
Now you may be wondering about the non mentioning of
memory space meant for the program storage, the most important part
of any
embedded controller. Originally this 8031 architecture was introduced
with on chip, `one time programmable' version of Program Memory of
size 4K X
8. Intel delivered all these microcontrollers

(8051)
with
user's program

device. The memory p o r t io n w a s ma p a t t h


fused inside the
ped
e
lo w e
t h e Pr o g ra m M e mo r y a re a . B u t, a gettin
r
end of
fte r
g
devices, customers couldn't change anything in their program code,
which was already made available inside during device fabrication. So,
very soon Intel introduced the 8031 devices (8751) with
reprogrammable type of Program Memory using built in EPROM of size
4K X 8.Like a

regular EPROM, this memory can be re programmed many times. Later


on I n te l s ta r te d ma n u fa c t u r in g t he s e 8 0 3 1 d e v i c e s w it
ho u t a n y o n c h ip P ro g r a m Memory.

Central Processing Unit

The CPU is the brain of the microcontrollers reading user's programs


and executing the expected task as per instructions stored there in.
Its primary elements a
b it A r it h me t ic Lo g
re
an 8
ic
A c c u mu la t o r ( A c
c ),
fe w mo r e 8 b it registers, B
Statu
Pointer (SP), Program
s
Word (PSW) and 16
Pr o g ra m C o u n t e r (PC ) a D a ta Po in t e R e g is te
nd
r
r
A LU (Acc) performs arithmetic and
variables.

Arithmetic

U n it ( A LU ),
register, Stack
bit re g is te rs
,
(D P TR ) . T he

logic functions on 8 bit input

operations include basic addition,


subtraction,

multiplication and division. Logical operations are AND, OR, Exclusive


OR as well as rotate, clear, complement and e t c . A p a r t f r o m a l l t
heabove,ALUisresponsibleinconditionalbranch
i n g decisions, and provides a temporary place in data transfer
operations
within the d e v i c e . r e g i s t e
B
r
divide operation
s.
During

is mainl used in multiply a


y
nd
execution, register either keeps one
B
of

the two inputs or then retains a portion of the result. For other
instructions, it can be used as another general purpose register.

10

Timers/Counters

8031 has two 16 bit Timers/Counters capable of working in


different
modes. Ea c h c o n s is ts o f a ` H i g h '
a n a ` Lo w ' b y te w h ic
b yte
d
h
c a n b e a c c e s s e d u n d e r software.
There
is a mode control register
and a control register to configure these t ime rs /c o u n t e rs n u mb e
in
r
o f w a ys . T he s e t i me rs c a n b e u to me a s u re t i interval
sed
me
s,
determine pulse widths or initiate events with one microsecond
resolution up to a maximum of 65 millisecond (corresponding to 65, 536
counts). Use software to ge t lo n g e r d e la y s . W o rk in g a s c o u n
te r, t he y c a n a c c u mu la te o c c u rr e nc e s o f external events
(from DC to 500 KHz) with 16 bit precision. I n o u r p ro je c t w e a re
us in g 8 b it mic r o c o n t ro lle r A T8 9 C 2 0 5 1 , it is t he advanced 8
bit microcontroller from ATMEL, which incorporates Flash Rom, and
Timer etc.
Features of AT89C2051:
Compatible with MCS-51 Products
2 Kbytes of Reprogrammable Flash Memory
Endurance: 1,000 Write/Erase Cycles
2.7 V to 6 V Operating Range
Fully Static Operation: 0 Hz to 24 MHz
Two-Level Program Memory Lock
128 x 8-Bit Internal RAM
15 Programmable I/O Lines
Two 16-Bit Timer/Counters
Six Interrupt Sources
11

Programmable Serial UART Channel


Direct LED Drive Outputs
On-Chip Analog Comparator
Low Power Idle and Power down Modes

DESCRIPTION

TheAT89C2051
is a
bitmic r o c o mp u
te r
w it h 2
e ra s a b le re a d
ma n u fa c t u re d
it y

o n ly

low-voltage, high-performance
CMOS
8Kb y te s o f Fla s h Pr o g ra mma b a n
le
d

me mo r y (P ER O M ) .
us in g
A t me l s
non-volatile

The

d e v ic e is

h ig h
memory

dens

technology and is compatible with the industry Standard MCS-51


instruction set and pin out. By combining a versatile 8-bit CPU with
Flash on a mo n o l it h ic c h ip , t h e At me l A T 8 9 C 2 0 5 1 is a p o w
e r fu l mic ro c o mp u t e r w h ic h provides a highly flexible and cost
effective solution to many embedded control applications.

12

PIN CONFIGURATIONS OF 8051:

Figure : B

13

BLOCK DIAGRAM

Figure: C

14

PIN DESCRIPTION OF AT89C2051:

VCC
GND
Port 1

Supply voltage.
Ground.
Port 1 is an 8 -bit bidirectional I/O port. Port pins P1.2
to P1.7 provide internal pull-ups. P1.0 and P1.1 require
external pull-ups. P1.0 and P1.1also serve as the
positive input (AIN0) and the negative input (AIN1),
respectively, of the on-chip precision analog
comparator. The Port 1output buffers can sink 20 mA
and can drive LED displays directly. When 1s are
written to Port 1 pins, they can be used as input s. When
pins P1.2 to P1.7 are used as inputs and are externally
pulled low, they will source current (IIL) because of
the internal pull-ups. Port 1 also receives code data
during
Flash programming and program verification.

Port 3

Po rt 3 p in s P3 . 0 to P3 . 5 , P3 . 7 a re s e v e n
b id ir e c t io n a l I /O p ins w it h internal pull-ups. P3.6
is
hard-wired as an input to the output of the on -chip
comparator and is not accessible as a general purpose
I/O pin.
The Port 3 output buffers can sink 20 mA. When 1s are
written to Port 3p in s t h e y a re p u l le d h ig h b y t h e
in te r n a l p u l l - u p s a n d c a n b e us e d a s inputs.
As
inputs, Port 3 pins that are externally being pulled low
will s o u r c e c u rr e ( II L) b e c a u s e o f t h e p u ll - u
nt
ps.
Po rt 3 a ls o s e r ve
s
t he functions of various special
features of the AT89C2051 as listed below. Port 3 also
receives some control signals for Flash programming
and programming verification.

RST

R e s e t in p u t . A ll I /O p in s a re r e s e t to 1 s a s s o
on
a s R S T go e s h ig h . Holding the RST pin high for two

machine cycles while the oscillator is running resets the


device. Each machine cycle takes 12 oscillator or clock
cycles
15

XTAL1

Input to the inverting oscillator amplifier and input to the


internal clock operating circuit.

XTAL2

Output from the inverting oscillator amplifier.


Table:1
PORT ALTERNATE FUNCTIONS:
Port Pin

Alternate functions

P3.0

RXD (serial input port)

P3.1

TXD (serial output port)

P3.2

INT0 (external interrupt 0)

P3.3

INT1 (external interrupt 1)

P3.4

T0 (timer 0 external input)

TABLE: 2

16

3. CIRCUIT DIAGRAM
3.1 MAIN CIRCUIT DIAGRAM

17

3.2 POWER SUPPLY DIAGRAM

FIGURE: D

3.3. CIRCUIT DIAGRAM EXPLANATION

The

Main

Part

of

the

above
the

Circuit

diagrams

is

Microcontroller AT89C2051. The Keypad was the input device and it was
connected in a matrix format so that the numbers of ports needed are
reduced.
The Microcontroller reads a four-digit p a s s w t h r o u g h t h e Ke y p a
ord
d.
T he n t he M ic r o c o n t ro lle r c o mp a r e s fo u r d ig it p a s s w o
t he
rd
withthe number
ogrammed
equal
ill

then
s w itc h

which
and
if
on

is
it

pre-pr
is

t h e M ic r o c o n t ro lle r
t h e mo t o r fo r

t he d o o r a nd if w e e n te r t he w r o n g p a s s w o rd fo r mo re t h
a n t h re e t i me s t he n a n a la r m w ill b e s w itc he d o n u n t il a r
ig h t password was pressed through the Keypad.
The Password was stored in the EEPROM and the password can be
changed at anytime using the same keypad. To change the password
dial 12345 Old password - New Password. The power supply section is
the important one. It should deliver constant output regulated power
supply

18

for successful working of the project. A 0-12V/500 mA transformer is


used for our purpose the primary of this transformer is connected in to
main supply through on/off switch& fuse for protecting from overload
and short circuit protection. The secondary is connected to the diodes
convert from 12V AC to 12V DC voltage. Which is further regulated to
+5v, by using IC 7805

4. FLOWCHART

Figure: E

19

5. ALGORITM
1.START
2.initialise lcd , keypad
3.clear lcd
4.print Enter lock code on lcd
5.get 5 char long password using matrix key
pad
6.if input = 12345 then
6.1 print Enter master code
6.2 get 10 char long password using
matrix key pad
6.3

if input = masterlock then


6.3.1

change user password


6.3.2

go to step 4

6.4

else

6.4.1 print wrong code on lcd


6.4.2 go to step 4
7.else
7.1

7.1.3

if input = userlock or input =


default lock then
7.1.1

unlock the lock

7.1.2

retry count = 3

print # to lock on lcd

20

7.1.4

accept input using matrix


key pad

7.1.5

if input = # then lock


7.1.6

goto step 4

7.2

else

7.2.1 decrement retry count


7.2.2 print wrong code on lcd
7.2.3 if retry count = 0 then
sound alarm on
7.2.4 go to step 4
8.STOP

21

6. PROGRAM
Delay
program:
#include
"delay.h"
void delayus(unsigned char delay)
{
while(delay--);
}
void delayms(unsigned char delay)
{
while(delay--)
delayus(1
49);
}
Keypad
program:
#include
"keypad.h"
#include
"delay.h"
bit keystatus =
FALSE; void
keypad_init()
{
keyport &=0x0F;

22

unsigned char getkey ()


{
unsigned char
i,j,k,key=0,temp;
k=1;
for(i=0;i<4;i++)
{
keyport
&=~(0x80>>i);
temp = keyport;
temp &=
0x07; if(7temp)
{
if(!col1)
{
key =
k+0;
while(!
col1);
return
key;
}
if(!col2)
{
key = k+1;

23

while(!
col2);
return
key;
}
if(!col3)
{
key =
k+2;
while(!
col3);
return
key;
}
j++;
}
k+=3;
keyport |=
0x80>>i;
delayms(10);
}
return FALSE;
}
unsigned char translate(unsigned
char keyval)
{if(keyval<10)

return keyval+'0';

24

else
if(keyval
==10)
return
'x';
else
if(keyval
==11)
return
'0';
else
if(keyval
==12)
return
'e';
}
LCD program:
#include "lcd.h"
#include "delay.h"
#include
<REG2051.H>
unsigned char code lockicon[]={0xe, 0xa, 0x1f, 0x1f, 0x1b,
0x1b, 0xe, 0x0}; unsigned char code unlockicon[]={0xe, 0x2,
0x1f, 0x1f, 0x1b, 0x1b, 0xe, 0x0}; unsigned char code
ex[]={0x1f, 0x1b, 0x1b, 0x1b, 0x1b, 0x1f, 0x1b, 0x1f};
unsigned char code ok[]={0x0, 0x1, 0x3, 0x16, 0x1c, 0x8,
0x0, 0x0};

void lcd_reset()
{ lcd_port = 0xFF;
delayms(20);
lcd_port =
0x03+LCD_EN;
lcd_port = 0x03;

25

delayms(10);
lcd_port =
0x03+LCD_EN;
lcd_port = 0x03;
delayms(1);
lcd_port =
0x03+LCD_EN;
lcd_port = 0x03;
delayms(1);
lcd_port =
0x02+LCD_EN;
lcd_port = 0x02;
delayms(1);
}
void lcd_init ()
{ unsigned char i;
lcd_reset();
lcd_cmd(LCD_SETFUNCTION);
lcd_cmd(LCD_SETVISIBLE+0x
04);
lcd_cmd(LCD_SETMODE+0x02
);
shift.
lcd_cmd(LCD_SETCGADD
R); for(i=0;i<8;i++)
lcd_data(lockicon[i]);
26

/ 4-bit mode - 1 line - 5x7


font.
/ Display no cursor - no
blink.
/ Automatic Increment - No
Display

for(i=0;i<8;i++)
lcd_data(unlockicon[i]);
for(i=0;i<8;i++)
lcd_data(ex[i]);
for(i=0;i<8;i++)
lcd_data(ok[i]);
lcd_cmd(LCD_SETDDADDR);
// Address DDRAM with 0
offset 80h.
}
void lcd_cmd (char cmd)
{ lcd_port = ((cmd >> 4) & 0x0F)|
LCD_EN; lcd_port = ((cmd >> 4)
& 0x0F);
lcd_port = (cmd & 0x0F)|
LCD_EN; lcd_port = (cmd &
0x0F); delayus(200);
delayus(200);
}
void lcd_data (unsigned char dat)
{ lcd_port = (((dat >> 4) & 0x0F)|LCD_EN|
LCD_RS); lcd_port = (((dat >> 4) &
0x0F)|LCD_RS);
lcd_port = ((dat & 0x0F)|LCD_EN|LCD_RS);

27

lcd_port = ((dat & 0x0F)|


LCD_RS); delayus(200);
delayus(200);
}
void lcd_str (unsigned char *str)
{while(*str){
lcd_data(*str++);
}
}
Lock program:
#include
"keypad.h"
#include "lcd.h"
#include
"delay.h"
#include
"lock.h"
unsigned char code masterlock[10]="1234567890",
defaultulock[5]="54321"; unsigned char userlock[5],
input[10];
extern bit newlock;
bit check(unsigned char *first, unsigned char *second,
unsigned char len)
{
unsigned char i=0;

28

for(i=0;i<len;i++){
if(first[i]!
=second[i])
return
FALSE;
}
return TRUE;
}
void
setulock
(){ char
status;
retry:
lcd_cmd(LCD_CLS);
lcd_cmd(LCD_SETDDADD
R); lcd_str("Enter
Mastercode");
lcd_cmd(0xC0);
lcd_data(LOCK);
lcd_data(':');
status =
getinput(10);
if(status ==
TRUE){
if(check(input,masterloc
k,10)){
retry1:

lcd_cmd(LCD_CLS);

29

lcd_str("Enter new
code");
lcd_cmd(0xC0);
lcd_data(LOCK);
lcd_data(':');
status =
getinput(5);
if(status ==
TRUE){
lcd_cmd(LCD_CLS);
lcd_data(OK);
lcd_str("lock code
saved!"); newlock =
TRUE; store_code();
delayms(250);
delayms(250);
delayms(250);
delayms(250);
goto exit;
}
else if(status ==
RETRY) goto
retry1;
else if(status == EXIT)

30

goto exit;
}
else{
lcd_cmd(LCD_CLS);
lcd_str("WRONG
CODE!");
delayms(250);
delayms(250);
delayms(250);
delayms(250);
goto exit;
}
}
else if(status ==
RETRY) goto
retry;
else if(status ==
EXIT) goto
exit;
exit:;
}
char getinput(unsigned char max)
{unsigned char i,key;

31

i=0;
while(1){
while(!
(key=getkey()));
key =
translate(key);
input[i]=key;
if(key=='x'){
if(i==0)
return EXIT;
i--;
lcd_cmd(0xC2+i);
lcd_data(' ');
lcd_cmd(0xC2+i);
}
else if(key=='e')
{

return TRUE;
}
else{
i++;
if(i>max){
lcd_cmd(LCD_CLS);

32

lcd_data(EX);
lcd_str(" Code too
Long...");
delayms(250);
delayms(250);
delayms(250);
delayms(250);
return RETRY;
}
lcd_data('*');
}}}
void store_code()
{ unsigned
char i;
for(i=0;i<5;i
++)
userlock[i]=input[i];
}
Main program:
#include "lcd.h"
#include
"keypad.h"
#include
"lock.h"
#include
"delay.h"

33

extern unsigned char input[10], userlock[5];


extern unsigned char code
defaultulock[5],masterlock[10]; bit
newlock=FALSE;
unsigned char retrycount=3;

void main(){
unsigned char
status,i=0; bit
lockstatus;
lcd_init();
keypad_ini
t();
while(1){
lcd_cmd(LCD_CLS);
lcd_str("Enter lock
code");
lcd_cmd(0xC0);
lcd_data(LOCK);
lcd_data(':');
status = getinput(5);
if(check(input,"1234
5",5)){
setulock();

34

goto done;
}
if(status ==
TRUE)
{ if(newlo
ck)
lockstatus =
check(input,userlock,5);
else
lockstatus =
check(input,defaultulock,5);
if(lockstatus){
retrycount = 3;
lockpin = 0;
lcd_cmd(LCD_CLS
); lcd_data(OK);
lcd_str(" Lock
is");
lcd_cmd(0xC0);
lcd_str("deactivat
ed!");
delayms(250);
delayms(250);
delayms(250);
delayms(250);
lcd_cmd(LCD_CLS
);

35

lcd_str("Press '#'
key to");
lcd_cmd(0xC0);
lcd_str("lock
again!");
while(getkey()!
=12); lockpin = 1;
lcd_cmd(LCD_CLS);
lcd_data(OK);
lcd_str("Lock is
active!");
delayms(250);
delayms(250);
delayms(250);
delayms(250);
}
else{
retrycount--;
lcd_cmd(LCD_CL
S); lcd_data(EX);
lcd_str(" Wrong
Code!");
lcd_cmd(0xC0);
lcd_str("Tries left =
");

36

lcd_data('0'+retry
count);
delayms(250);
delayms(250);
delayms(250);
delayms(250);
if(retrycount==0){
blocked:
lcd_cmd(LCD_CLS
); lcd_data(EX);
lcd_str("BLOCKED
");
for(i=0;i<150;i++)
{
bus=~bus;
delayms(250);
}
lcd_data(EX);
lcd_cmd(0xC0);
lcd_data(LOCK);
lcd_data(':');
status =
getinput(10);

37

if(check(input,masterlock,1
0)){
retrycount=3;
lcd_cmd(LCD_CLS);
lcd_data(EX);
lcd_str("UNBLOCKED
"); lcd_data(EX);
delayms(250);
delayms(250);
delayms(250);
delayms(250);
}
else{
lcd_cmd(LCD_CLS);
lcd_data(EX);
lcd_str("WRONG
CODE"); lcd_data(EX);
delayms(250);
delayms(250);
delayms(250);
delayms(250);

38

goto blocked;
}
}
}
}
done:;
}
}

39

7. COMPONENTS DETAILS

7.1. Resistor:

Resistor is a component that


the flow of direct or alternating
resists
electric
R e s is to c a
d iv id t h e c u r re n t, re d u c e t
c irc u it .
rs
n
li mit o r
e
he
v o lta ge p ro te c t a
,
n
electric circuit, or provide large amounts of heat
movement of charg
or light.
An electric current
is the
ed
particlescalledelectronsfromoneregiontoanoth
e r . Resistors are usually placed in electric circuits. Physicists explain
the flow of current through a material, such as a resistor, by comparing
it to water flowing through a pipe. Resistors are designed to have a
specific value of resistance. Resistors used in electric circuits are
cylindrical. They are often colour coded by three or four colour bands
that indicate the specific value of re s is ta nc e . R e s is to rs o b e y o h
m s la w , w h ic h s ta te s t h a t t h e c ur re n t d e ns it y i s directly
proportional to the electric field when the temperature is constant.

7.2 Capacitor:

Capacitor or electric condenser is a device for storing an electric


charge. The simplest form of capacitor consists of two metal plates
separated by a non touching layer called the dielectric. When one plate
is charged with electricity from a direct current or electrostatic source,
the other plate have induced in it a charge of the opposite sign; that is,
positive if the original charge is negative and negative if the original
charge is
40

positive. The electrical size of the capacitor is its capacitance.


Capacitors are limited in the amount of electric charge they can
absorb; they can c o n d u c t d i r e c t c u r r
only instance
ent
for
s
but function well as conductors in
current
alternating
circuits.
Fixed capacity and variable capacity capacitors use
conjunctio
are
d in
n
withcoilsasresonantcircuitsinradiosandothere
lectronicequipment.Capacitorsareproducedina
wide
Air, Mic
C e ra mic
Pa p e
v a r i e t y o ff o r m s .
a,
s,
r,
O il, a nd
V a c u u ms a us e d a d ie le c tr ic d e p e n d in
purpose
re
s
s
g
o n t he
for
which the device is intended.

7.3 Transistor:

Transistor is a device which transforms current flow from low resistance


p a t h to h i g h re s is ta n c e p a t h . It is c a p a b le o f p e r fo r min
g ma n y fu n c t io ns o f t h e vacuum tube in electronic circuits, the
transistor is the solid state device consisting of a tiny piece of semi
conducting material, usually germanium or silicon, to which three or
more electrical connections are made.

N-type and P-type Transistor:


A germanium or silicon crystal, containing donor impurity atoms is
called a n e ga t iv e o r n - t y p e s e mic o n d u c t o r to in d ic a te t h
e p re s e n c e o f e xc e s s n e ga t iv e ly charged electrons. The use of
an acceptor impurity produces a positive, or p -type semiconductor so
called because of the presence of positively charged holes. When an
electrical voltage is applied, the n-p junction acts as a rectifier,
permitting current to flow in only one

41

direction. If the p-type region is connected to the positive terminal of


the battery and the n-type to the negative terminal, a large current
flows through the material across the junction.

7.4 Diode:

Diode is a electronic device that allows the passage of current


in
only one d i r e c t i o n .
The firstsuch
ere
vacuumt u b e d i o d e s ,c o n s i s t i n g
la s s o r

of

an
s te e l

e n ve lo p e c o n ta in
e le c tr o d e s
in g
two

The diodes commonly used in electronic

devices

e v a c ua te d g

a cathod
e

and an
anode.

circuits are semiconductor

diodes. There are different diodes used in electronic circuits such as


Junction diode, Zener diode, Photo diodes, and tunnel diode.
Junction diodes consist of junction of two different kinds of
semiconductor material. The Zener diode is a special junction type
diode, using silicon, in which the voltage across the junction is
independent of the current through the junction.

7.5 Integrated circuits


Regulator IC (LM 7805):

p o s it iv e
3 - te r min a l
e

vo lta g

Th e LM 7 8 0 5 mo n o lit h ic
re g u la to rs e mp
lo y
internal current-limiting, thermal shutdown and
safe-area compensation, making t he
e s s e nt ia in d e s t r uc t ib le .
m
lly
If
a d e q u a te h e a t s in k in g is p r o v id t he y c a n deliver over 1.0A
ed,
output

42

current. They are intended as fixed voltage regulators in a wide range


of
applications

including

local

(on -card) regulation

for

elimination

of noise and distribution problems associated with single-point


regulation. In
addition t
o
can

us
e
use
be
d

as fixed voltage regulato


these devic
rs,
es
w i t h e x t e r n a l components
to
obtain adjustable

output voltages and currents. Considerable effort was expended to


make the entire series of regulators easy to use and minimize the
number of external components. It is not necessary to bypass the
output, although this does improve transient response. Input bypassing
is needed only if the regulator is located far from the filter capacitor of
the power supply.

Features:
Complete specifications at 1A load
Output voltage tolerances of 2% at Tj = 25
Line regulation of 0.01% of VOUT/V of VIN at 1A
load Load regulation of 0.3% of VOUT/A
Internal thermal overload protection
Internal short-circuit current limit
Output transistor safe area protection

PINOUT FOR LM7805:

43

FIGURE: F

BLOCK DIAGRAM FOR IC LM7805:

FIGURE: G

Relay Driver (BC547):


The BC547 transistor is an NPN Epitaxial Silicon Transistor. The BC547
transistor is a general-purpose transistor in small plastic packages. It is
used in general-purpose switching and amplification BC847/BC547
series 45 V, 100 mA NPN general-purpose transistors.
The BC547 transistor is an NPN bipolar transistor, in which the letters
"N" and "P" refer to the majority charge carriers inside the different
regions of the transistor. Most bipolar transistors used today are NPN,
because electron mobility is higher than whole mobility in
semiconductors, allowing greater currents and faster operation. NPN
transistors consist of a layer of P-doped
44

semiconductor (the "base") between two N-doped layers. A small


current entering the base in common-emitter mode is amplified in the
collector output. In other terms, an NPN transistor is "on" when its base
is pulled high relative to the emitter. The arrow in the NPN transistor
symbol is on the emitter leg and points in the direction of the
conventional current flow when the device is in forward active mode.
One mnemonic device for identifying the symbol for the NPN transistor
is "not pointing in." An NPN transistor can be considered as two diodes
with a shared anode region. In typical operation, the emitter base
junction is forward biased and the base collector junction is reverse
biased. In an NPN transistor, for example, when a positive voltage is
applied to the base emitter junction, the equilibrium between thermally
generated carriers and the repelling electric field of the depletion region
becomes unbalanced, allowing thermally excited electrons to inject into
the base region. These electrons wander (or "diffuse") through the base
from the region of high concentration near the emitter towards the
region of low concentration near the collector. The electrons in the base
are called minority carriers because the base is doped p-type which
would make holes the majority carrier in the base
PINOUT FOR BC547:

Figure: H
45

8. PCB FABRICATION
The first step of assembling is to produce a printed circuit board. The
fabrication of the program counter plays a crucial role in the electronic
field. The success of the circuit is also dependent on the PCB. As far as
the cost is concerned, more than 25% of the total cost is for the PCB
design and fabrication.
The board is designed using a personal computer. The layout is
drawn using the software Adobe PageMaker 6.5. The layout is printed
in a buffer sheet using a laser procedure. First, a negative screen of
the layout is prepared with the help of a professional screen printer.
Then the copper clad sheet is kept under this screen. The screen
printing ink is poured on the screen and brushed through the top of the
screen. The printed board is kept under shade for few hours till the ink
becomes dry.
The etching medium is prepared with the un-hydrous ferric
chloride water. The printed board is kept in this solution till the exposed
copper dissolves in the solution fully. After that the board is taken out
and rinsed in flowing water under a tap. The ink is removed with solder
in order to prevent oxidation.
Another screen, which contains component side layout, is prepared
and the same is printed on the component side of the board. A paper
epoxy laminate is used as the board. Both the component and the track
layout of the peripheral PCB is given at the end of this report.

46

PCB LAYOUT

47

COMPONENT LAYOUT

9. APPLICATIONS

Our electronic door lock performed as expected. We were able to


implement all the functions specified in our proposal. The biggest hurdle
we had to overcome with this project was interfacing the micro
controller with the hardware
We f e e l t h a t h i
doo
components.
t
s electronic
r
marketabl
because
us
e
it
is easy to
e,

lock is ver
y
comparatively

inexpensive due to low power consumption, and highly reliable. This


door lock is therefore particularly useful in applications such as hotel
room door locks, residential housing, and even office buildings.

48

10. FUTURE ENHANCEMENTS


E le c t r ic a l d e v ic e s s uc h a s L i g h ts , C o mp u te r e tc c a n
b e c o nt ro lle d b y u s in g separate passwords.
The system can be easily connected to the personal computer for
further control.
Other than the speaker sounds, all the lights are made to turned on if
password entered is wrong for three times and also a hidden camera
is used to record the faces who trespassed.
We can use this system as an attendance register for the students to
enter a class room with their respective password.

11. CONCLUSION
This project is meant for security systems whose access is only for
respected authorities. Using a microcontroller the password entered is
checked with the stored password and then does the corresponding
operations. Here we use a 5 digit password for better secrecy.

12. REFERENCES

Electronic circuits and devices: J.B. Gupta.

Op-amps and linear integrated circuits: Ramakanth A. Gayakward

Integrated circuits : K.R. Botkar

The 8051 microcontrollers: Muhammed Ali Mazidi

49

13. APPENDICES

5
0

Vous aimerez peut-être aussi