Professional Documents
Culture Documents
Kepad Password Report&
Kepad Password Report&
QUESTION:
PRESENTED BY:
This report deals with simulation of a keypad lock system which only grants access when the
entered password is correct. Different devices are used in the system such as a 4*3 keypad, a
microcontroller DSPIC 33FJ32GP204 and its peripherals, a 16*2 led display and LEDS to
denote our output.
I. OBJECTIVE
The objective or the aim of this project, “KEYPAD CODE ACCESS” is to turn on lamps
connected on the PORTB of the DSPIC P33FJ32GP204 when the password entered using a 4x3
keypad is correct. If the user enters wrong password more than three times, the system will be
locked, and one will need to reset the system by pressing the reset push.
a) MICROCONTROLLER
The microcontroller used is the DSPIC 33F32GP204 which is a 32 bits The
program which shows how the system functions is loaded into the microcontroller
which is the brain of the system.
U1
19 21
RA0/CN2/VREF+/AN0 RB0/CN4/RP0/C2IN-/AN2/PGED1
20 22
RA1/CN3/VREF-/AN1 RB1/CN5/RP1/C2IN+/AN3/PGEC1
30 23
RA2/CN30/CLKI/OSCI RB2/CN6/RP2/AN4
31 24
RA3/CN29/CLKO/OSCO RB3/CN7/RP3/AN5
34 33
RA4/CN0/T1CK/SOSCO RB4/CN1/RP4/SOSCI
13 41
RA7/TCK RB5/CN27/RP5/ASDA1/PGED3
32 42
RA8/TDO RB6/CN24/RP6/ASCL1/PGEC3
35 43
RA9/TDI RB7/CN23/RP7/INT0
12 44
RA10/TMS RB8/CN22/RP8/SCL1
1
RB9/CN21/RP9/SDA1
25 8
RC0/CN8/RP16/AN6 RB10/CN16/RP10/PGED2
26 9
RC1/CN9/RP17/AN7 RB11/CN15/RP11/PGEC2
27 10
RC2/CN10/RP18/AN8 RB12/CN14/RP12/AN12
36 11
RC3/CN28/RP19 RB13/CN13/RP13/AN11
37 14
RC4/CN25/RP20 RB14/CN12/RP14/AN10
38 15
RC5/CN26/RP21 RB15/CN11/RP15/AN9
2
RC6/CN18/RP22
3 17
RC7/CN17/RP23 AVDD
4 16
RC8/CN20/RP24 AVSS
5
RC9/CN19/RP25
7
VCAP/VDDCORE
18
MCLR
DSPIC33FJ32GP204
b) 16*2 LED DISPLAY
The LED display makes the system more user friendly. It display 16 characters
per row of which these rows are 2. It helps the user visualise the password he/she is
entering. It also tells the user if the password entered is right or wrong.
LCD1
LM016L
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3
4
5
6
7
8
9
10
11
12
13
14
c) KEYPAD
The keypad just helps us to enter the password into the system. It is a 4*3 keypad
with digits from 0-9 and 2 extra-digits which are # and *.
1
A
1 2 3
B
4 5 6
C
7 8 9
D
0 #
d) LEDS
The leds used are of 2 colours. 1 yellow which shows our password is correct and
grants access to the system and a green one for the interrupt.
D2
R1
220
LED-YELLOW
D1
R4
220
LED-GREEN
II. CIRCUIT DIAGRAM
// Pin direction
char password[]="1759";
char txt[16];
key = 0;
while (!key);
switch (key)
return key;
void main()
{
TRISA.F0=0;
ADPCFG = 0xFFFF;
lcd_init();
L1:
lcd_cmd(_lcd_clear);
lcd_cmd(_lcd_cursor_off);
do
i=i+1;
key=keypad() ;
if(i<=4)
txt[i-1]=key;
Lcd_chr(2,i,txt[i-1]);
comp=memcmp(password,txt,4);
if(key==35)
key=0;
if(comp==0)
{
lcd_cmd(_lcd_clear);
Lcd_Out(1, 6, "WELCOME");
lcd_out(2,1,"ARTHUR GUINNESS");
PORTA.F0=1;
Delay_ms(10000);
PORTA.F0=0;
i=0;
goto L1;
else
lcd_cmd(_lcd_clear);
lcd_out(1,3,"WRONG PASSWORD");
Delay_ms(1000);
cnt=cnt++;
if(cnt==3)
set=1;
goto blocked;
else
i=0;
goto L1;
}
} while (1);
blocked:
while(set)
lcd_out(1,1,"SYS IS BLOCKED!!");
lcd_out(2,2,"PLZ RESET...");
delay_ms(100);
} //Endless loop}
IV. SIMULATION RESULTS
When the system is put on
CONCLUSION
To conclude, we were able to design our system and make it function the way we wanted. A single
password gave us access to the system and also when there is an interrupt, our system manages it
well.