You are on page 1of 6

Ri

zviCol
legeofEngi
neer
ing

2020
RI
ZVIEDUCATI
ONSOCI
ETY’
s
Of
fCar
terRoad,
Bandr
aWest
,Mumbai
-

ARDUI
NOSERVO

BY
Shivam Maury a(
31)
Saji
dShaikh( 53)
Must ansi
rPresswala
(35)
Satyam Vishwakarma
(61)

SUBJECT:MMC
CONTENTS

TOPI
C PAGENO.
Descr
ipt
ion 2

Ci
rcui
tDi
agr
am 3

Component
s&Saf
etyPr
ecaut
ion 3

Code 4-
5

Bl
ockDi
agr
am 5

1
ARDI
NOSERVER

DESCRI
PTI
ON:
WE HAVE CONFI
GURE ARDUI
NO KEYPAD WITH ARDUI
NO
SERVOMOTOR.WECANTYPETHEPASSWORDBYKEYPADI F
THEPASSWORDISCORRECT,THENTHEMI CROSERVOWILL
TURNAROUNDANDTHELEDGREENLI GHTWILLBEON,AND
I
FTHEPASSWORDTYPEDBYKEYPADI SWRONG,THENTHE
SERVOWILLNOTBEOPENEDANDTHELEDREDLI GHTWILL
BEON

2
CI
RCUI
TDI
AGRAM:
-

COMPONENTLI
ST:
-

Name Quant
it
y Component
U2 1 Ar
dui
noUnoR3
SERVO1 1 Mi
croSer
vo
KEYPAD1 1 Key
pad4x4
D1 1 RedLED

3
D2 1 Gr
eenLED
R1 2 1kΩResi
stor
R2

CODE:
-
#i nclude<Ser vo.h>
#include<Key pad.h>
Ser voSer voMot or;
char *passwor d=" 789";
i
ntposi ti
on=0;
constby teROWS=4;
constby teCOLS=4;
charkey s[ROWS] [
COLS]={
{'
1','
2',
'3'
,'
A'},
{'
4','
5',
'6'
,'
B'},
{'
7','
8',
'9'
,'
C'},
{'
*',
'0'
,'
#',
'D'}
};
byter owPi ns[ROWS]={9, 8,7,6};
bytecol Pins[COLS]={5, 4,3,2};
Key padkey pad=Key pad(makeKey map(
key
s),r
owPi
ns,col
Pins,ROWS,
COLS) ;
//Cr eatet wov ari
abl esforLEDLights
i
ntRedpi nLock=12;
i
ntGr eenpinUnl ock=10;
voidset up( )
{
pinMode( Redpi nLock, OUTPUT) ;
pinMode( Greenpi nUnl ock,OUTPUT);
Ser voMot or.attach( 11);
LockedPosi tion(true);
}
voidl oop()
{
charkey=key pad. getKey()
;
i
f( key==' * '
||key==' #')
{
posi t
ion=0;
4
LockedPosi t
ion(t
rue);
}
i
f( key==passwor d[positi
on]
)
{
position++;
}
i
f( posit
ion==3)
{
LockedPosi t
ion(f
alse);
}
delay(100);
}
voidLockedPosi t
ion(i
ntlocked)
{
i
f( l
ocked)
{
digit
alWr i
te(
RedpinLock,HIGH) ;
digit
alWr i
te(
GreenpinUnlock,LOW);
Ser v
oMot or.
writ
e(11);
}
else
{
digit
alWr i
te(
RedpinLock,LOW) ;
digit
alWr i
te(
GreenpinUnlock,HIGH)
;
Ser v
oMot or.
writ
e(90);
}
}

BLOCKDI
AGRAM:
-

You might also like