Message Scrolling Board based on SMS Relaying Implemented using Arduino Mega and GSM Modem
PROJECT REPORT SBMITTE! I" PARTIA# $##$I#ME"T O$ T%E RE&IREME"T $OR T%E A'AR! O$ T%E !EGREE O$
BAC%E#OR O$ E"GI"EERI"G E#ECTRO"ICS A"! COMM"ICATIO" E"GI"EERI"G
Submitted by ()a*a Ebadur Ra)man +,-./,0/12.234 Bodampati Satis) C)andra +,-./,0/12.224 Abdus Saboor Asad +,-./,0/12.2-4
Under the Esteemed Guidance of M5Satis) M5Satis ) 6ada7 6ada7 Asst5 Pro8essor
MET%O!IST CO##EGE O$ E"GI"EERI"G 9 TEC%"O#OG6 (I"G (OTI: %6!ERABA! 0.,2;0.,-
1 |Page
CERTIFICATE This is to certify that the Project Project report entitled ‘Message Scrolling Board based on SMS Relaying Implemented using Arduino Mega and GSM Modem’ Modem ’ is the work done by !a"a Ebadur Ra!man Ra!man #$%&'$(')*&*+,#$%&'$(')*&*+, Bodampati Satis! C!andra C!andra #$%&'$(')*&**,#$%&'$(')*&**, Abdus Saboor Asad #$%&'$(')*&*%,#$%&'$(')*&*%,Engineering #B/E, in Electronics submitted in partial fulfillment for the award award of Bac!elor o. Engineering and Communication Engineering, Methodist College of Engineering affiliated to Osmania Uniersity, !yderabad"
Internal Guide M. Satish Yadav Assistant rofessor, De!t. of E"E
Pro*ect Coordinator
%ead o8 t)e department Dr. N.H. SHOBHA REDDY, rofessor and Head, De!t. of E"E
E
Mr.D.#$%RAM Mr.D.#$%RAM MANAHOR Assistant rofessor De!t. of E"E
2 |Page
AC("O'#E!GEME"T &he satisfaction and eu!horia that accom!an' the successfu( com!(etion of an' tas) *ou(d +e incom!(ete *ithout the mentionin of the !eo!(e *hose constant uidance and encouraement made it !ossi+(e. -e ta)e !(easure in !resentin +efore 'ou, our !roect, *hich is resu(t of studied +(end of +oth research and )no*(ede. -e *ou(d *ou(d (i)e (i)e to e/!res e/!resss our sincer sinceree ratit ratitude ude and and inde+ inde+te tedne dness ss to our !roec !roectt su!ervisor M5Satis) 6ada7 Asst. rofessor for the )ind encouraement and constant su!!ort e/tended in com!(etion of this !roect *or). -e e/!r e/!res esss our our earn earnes estt rat ratit itud udee to our our inte intern rna( a( uid uide, e, Assis ssista tant nt rof rofes esso sor r Mr5!5Sures), De!artment of E"E, our !roect uide, for his constant su!!ort, encouraement
and uidance. -e are ratefu( for his coo!eration and his va(ua+(e suestions. -e *ou(d (i)e to e/!ress our than)s to our rinci!a( rinci!a( !r5=5S Girid)ar A>ula and a(( the 8aculty members, staff of De!artment of E(ectronics and "ommunication Enineerin and friends *ho rendered va(ua+(e he(! in ma)in this, !roect a successfu( one.
3 |Page
!EC#ARATIO"
-e here+' certif' that the *or) *hich is +ein !resented in the &HES$S EN&$&0ED ‘Message Scrolling Board based on SMS Relaying Implemented using Arduino Mega and GSM Modem’ +' ()a*a Ebadur;Ra)man: Bodampati Satis) C)andra: Abdus Saboor Asad on !artia( fu(fi((ment of re1uirements for the a*ard of deree of B.E. 2E"E3 su+mitted in
the De!artment of E(ectronics And "ommunication Enineerin at Methodist "o((ee of Enineerin 4 &echno(o', H'dera+ad is an authentic record of our *or) carried out durin the fina( 'ear 25678 9 567:3 under the su!ervision of Mr5 M5Satis) 6ada7 , Asst. rofessor, De!t of E"E.
&he matter !resented in the thesis has not +een su+mitted +' us;me in an' other universit';institute for the a*ard of B.E Deree. No !art of the thesis is direct(' co!ied from +oo)s;ourna(s;internet +ut a !art of the content cou(d +e the a(read' !u+(ished information. &he re!ort is +ased on the !roect *or) done entire(' +' us;me and not co!ied from an' other source
Signatures o8 t)e Student+s4
273 %haa E+adur9Rahman 27:6<75<=868>3
253 Bodam!ati Satish "handra 27:6<75<=86883
2=3 A+dus Sa+oor Asad 27:6<75<=8868:3
4 |Page
TAB#E O$ CO"TE"TS #IST O$ $IGRES55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555557i #IST O$ TAB#ES5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555557i ABSTRACT5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555557ii O=ER=IE' O$ PROJECT555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555, 1.1 INTRODUCTION............................................................................................... 1 1.2 AIM OF PROJECT..............................................................................................1 1.3 BLOCK DIAGRAM............................................................................................. 2
AR!I"O BOAR! 'IT% ATMEGA10? MICROCO"TRO##ER55555555555555555555555555555555555 1 2.1 Introd!t"on o# Ard"no Board......................................................................... 3 2.2 C$ara!ter"%t"!% o# Ard"no &oard....................................................................3 2.3 Ard"no Mega2'()..........................................................................................' 2.* P"n !on+grat"on o# AT,ega2'()...................................................................( 2.' P"n De%!r"-t"on................................................................................................( 2.( $/ Ard"no0............................................................................................... 1)
GSM TEC%"O#OG65555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555,0 3.1 Introd!t"on.................................................................................................. 12 3.2 Te!$n"!a Deta"%........................................................................................... 13 3.3 GM MODEMPC Inter#a!"ng..........................................................................1' 3.* GM ,ode, 45))617)) M89:....................................................................... 1(
S%I$T REGISTERS5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555,? *.1 Introd!t"on.................................................................................................. 17 *.2 er"aIn and er"aOt 4IO:...................................................................... 17 *.3 er"a"n; -araeot 4IPO:..........................................................................15 *.* Parae"n; er"aot 4PIO:..........................................................................2) *.' U%e%.............................................................................................................. 21 *.( 8"%tor/.......................................................................................................... 22
5 |Page
*.< <*8C'5' 7 &"t $"#t Reg"%ter Mode #or Ard"no..........................................22 *.7 Inter#a!"ng O# Ard"no Mega2'() and <*8C'5'..........................................2'
S! CAR! 9 S! CAR! MO!#E555555555555555555555555555555555555555555555555555555555555555555555555555555555555555550'.2 ARDUINO D CARD MODULE........................................................................2< '.2.1 Inter#a!"ng D !ard ="t$ Ard"no Board.....................................................25
#IG%T EMITTI"G !IO!ES +#E!s45555555555555555555555555555555555555555555555555555555555555555555555555555555555551, (.1 Introd!t"on.................................................................................................. 31 (.2 8"%tor/.......................................................................................................... 32 (.3 or>"ng Pr"n!"-e.......................................................................................... 33 (.* A--"!at"on%.................................................................................................. 3*
#E! !ISP#A6S55555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555512 <.1 Introd!t"on.................................................................................................. 3' <.2 8"%tor/.......................................................................................................... 3' <.3 Dot Matr"? D"%-a/........................................................................................ 3( <.* LED Matr"? D"%-a/........................................................................................3< <.' or>"ng o# LED Matr"?.................................................................................. 37 <.( ACII C$ara!ter% and T$e"r De!od"ng...........................................................*) <.7 Inter#a!"ng D ="t$ Ard"no........................................................................ *'
SO$T'ARE 9 PROGRAMMI"G55555555555555555555555555555555555555555555555555555555555555555555555555555555555555553/ 7.1 Ard"no IDE................................................................................................... *< 7.1 PROGRAMMING............................................................................................. *7 7.1.1 PROGRAM UED FOR GM MEAGE CROLLING BOARD.........................*5
6 |Page
0$S& O? ?$GURES
F"g 1.1@ Bo!> D"agra, o# GM Led !ro"ng Board..............................2 F"g 2.1@ Ard"no Mega2'()...................................................................' F"g 2.2@ P"n d"agra, o# At,ega2'()....................................................( F"g 3.1@ Ar!$"te!tre o# GM Net=or>.................................................13 F"g 3.2@ GM Mode 45))A:...............................................................1( F"g *.1@ IPO.......................................................................................15 F"g *.2@ *B"t PIO $"#t Reg"%ter.........................................................2) F"g *.3@ $"#t Reg"%ter Mode.............................................................22 F"g *.*@ <*8C'5' P"n Ot And De%!r"-t"on.........................................2* F"g *.'@ Inter#a!"ng O# Ard"no and <*8C'5'.....................................2' F"g '.1@ Ard"no D !ard Mode........................................................2< F"g '.2@ D Card Mode "r"ng Bo!> D"agra,..................................3) F"g '.3@ D Card Mode Conne!ted to Ard"no Board.......................3) F"g (.1@ D"erent T/-e% O# LED%.........................................................32 F"g (.2@ ",-e LED.............................................................................33 F"g (.3@ or>"ng o# LED% 4Band D"agra,:..........................................3* F"g <.1@ ",-e LED Matr"? D"%-a/.....................................................37 F"g <.2@ LED% Conne!ted In Matr"? 47?7:............................................37 F"g <.3@ A %tandard '?< LED dot ,atr"? d"%-a/ %tr!tre..................35 F"g <.*@ !ann"ng a!ro%% t$e Co,n% and #eed"ng ="t$ a--ro-r"ate Ro= ae%.........................................................................................*) F"g <.'@ D"erent P"!tre% $o="ng t$e Pre-arat"on o# LED Matr"?.....** F"g <.(@ Inter#a!"ng o# Ard"no and LED Matr"?...................................*( F"g <.<@ C$ara!ter A on t$e '?< LED d"%-a/...................................*< F"g <.7@ -e!"a !$ara!ter on t$e '
0$S& O? &AB0 Y
Ta&e 2.1@ Ard"no Mega 2'() PIN ,a--"ng ta&e..............................1) Ta&e 3.1@ Ba%"! AT Co,,and%...........................................................1< Ta&e <.1@ Ro= Hae% o# Ea!$ Co,n #or D"%-a/"ng A...................35 Ta&e <.2@ Ta&e %$o="ng ACII Code% and t$e"r B"nar/ E"aent% #or A-$a&et%...........................................................................................*1 7 |Page
ABS&RA"&
Message Scrolling Board based on SMS Relaying Implemented using Arduino Mega and GSM Modem
Ever' institution, orani@ation or an' commercia( esta+(ishment *ou(d +e (ad to announce an' ne* event or activit' to the !u+(ic. Or there is a necessit' to announce some im!ortant head(ines in !u+(ic. &his can +e achieved +' a !erson announcin for 1uite some time or for convenience 0ED +oards can +e insta((ed and the ne*s scro((s on the 0ED +oard. Such +oards uti(i@e microcontro((er and the messae to +e dis!(a'ed is fed to it on(' once. But it is devoid of the f(e/i+i(it' of chanin the messae. -e(( this can a(so +e achieved if there is a *a' to feed the microcontro((er *ith messae d'namica(('. Hence, this !roect aims at achievin the a+ove !ur!ose usin GSM modu(e *hich can feed the messae d'namica(('. &here is one !articu(ar advantae of usin GSM Modem in this !roect. Since this invo(ves SMS, the user can dis!(a' messae of choice even he;she is at an' iven !(ace. GSM +ased Messae Re(a'in and Dis!(a'in on 0ED Board is an automated microcontro((er e(ectronic s'stem *hich scro((s te/t on an 0ED +oard, the messae to +e dis!(a'ed can +e d'namica((' chaned usin GSM modu(e to *hich the user sends an SMS. -hen the user sends a te/t to +e dis!(a'ed via SMS, GSM modu(e receives and transfers the te/t to Arduino. &he code in Arduino converts each character in the te/t into a 5 Dimensiona( arra' of 7s and 6s. &he arra' si@e de!ends on the si@e of the 0ED matri/ +ein used on the 0ED dis!(a' +oard. &hese 7s and 6s are fed to 0ED driver circuit, *hich does its o*n uni1ue ro(e. 0ED Matri/ is an n num+er of either C/C or 8/< matrices or sometime a sin(e matri/ of : co(umns and < ro*s made of 0EDs, *hich receive data one after the other, i.e., the' are cascaded in series +' the 0DE driver circuit. $n conc(usion, this microcontro((er +ased dis!(a'in of te/t on 0ED matrices +oard is advantaeous, not to mention (o* cost, +' !rovidin d'namic 'et sim!(e and f(e/i+(e aid to institutions, orani@ations or commercia( esta+(ishments to dis!(a' and scro(( te/ts. &he sco!e
8 |Page
of a!!(ication of this !roect can +e e/!anded +' the choice of the user. Our !roect is a modest !rotot'!e of interatin GSM and 0ED scro((in.
9 |Page
C%APTER .,
O#ER#$E- O? ROE"&
,5, I"TRO!CTIO"
Over the (ast fe* 'ears, the GSM ce((u(ar !hone has ro*n from a (u/ur' item o*ned +' the rich to somethin so common that one out of five !eo!(e a(read' o*ns one. &his is ama@in *hen *e (oo) at the fact that our countr' is a deve(o!in one *ith a(most ha(f our !o!u(ation (ivin +e(o* the !overt' (ine. &his continuous(' ro*in !o!u(arit' of the GSM ce(( !hone has s!urred the ro*th of the countr's ce((u(ar net*or) infrastructure. &he !rimar' reason *e can see for this tremendous and une/!ected ce((u(ar +oom is the !o!u(arit' of the short messae service 2SMS3. A variet' of services have ro*n around SMS. &he (ed Dis!(a' S'stem is aimed at the co((ees and universities for dis!(a'in da'9to9 da' information continuous(' or at reu(ar interva(s durin the *or)in hours. Bein GSM9 +ased s'stem, it offers f(e/i+i(it' to dis!(a' f(ash ne*s or announcements faster than the !roramma+(e s'stem. GSM9+ased dis!(a' s'stem can a(so +e used at other !u+(ic !(aces (i)e schoo(s, hos!ita(s, rai(*a' stations, ardens etc. *ithout affectin the surroundin environment. &he (ed dis!(a' s'stem main(' consists of a GSM receiver and a dis!(a' too()it *hich can +e !rorammed from an authori@ed mo+i(e !hone. $t receives the SMS, va(idates the sendin Mo+i(e $dentification Num+er 2M$N3 and dis!(a's the desired information after necessar' code conversion. $t can serve Mo+i(e $dentification Num+er 2M$N3 and dis!(a's the desired information after necessar' code conversion $t can serve as an e(ectronic notice +oard and dis!(a' the im!ortant notices instantaneous(' thus avoidin (atenc'. Bein *ire(ess, the GSM +ased (ed dis!(a' is eas' to e/!and and a((o*s the user to add more dis!(a' units at an'time and at an' (ocation in the cam!us de!endin on the re1uirement of the institute.
,50 AIM O$ PROJECT
1 |Page
A te/t messae is t'!ed in the GSM mo+i(e !hone and sent it +' usin SMS service of the mo+i(e !hone to 0ED movin dis!(a' +oards. A GSM modem is connected to the 0ED dis!(a' hard*are is used to receive the SMS and send it to the contro((er circuit of the 0ED dis!(a'. &hen the contro((er circuit of the 0ED dis!(a' fi(ters the messae content in SMS and chanes the dis!(a' te/t in 0ED dis!(a' d'namica(('. F>B' usin this SMS service it is !ossi+(e to chane the te/t in the 0ED dis!(a' +oard from an'*here in the countr'. &he idea descri+ed in this !a!er reduces the tota( cost that is re1uired in the traditiona( 0ED dis!(a' +oards not on(' it ma)es easier to send messae to the 0ED dis!(a' +oards. &he s'stem uses a GSM modem at the dis!(a' side to receive SMS. An $" A&mea=5C +e(ons to Arduino microcontro((er +oard act as contro((er to drive the 0ED dis!(a' +oard. A(on *ith these a !o*er su!!(' unit and su!!ortin hard*are for microcontro((er is used.
,51 B#OC( !IAGRAM
&here are main(' four com!onents used for !rocessin 4 !erformin the action *hich are as fo((o*s •
Arduino +oard *ith atmea=5C microcontro((er
GSM Modem 0ED Driver "ircuit 0ED Board •
•
•
User "e((
SD card Modu(e ARDU$NO
GSM Microcontro((e Modem ?i 7.7 B(oc) Diaram of GSM 0ed Scro((in Board
0ED Driver "ircuit
0ED Matri/ Dis!(a'
"HA&ER 65
2 |Page
ARDU$NO BOARD -$&H A&MEGA=5C M$"RO"ON&RO00ER
05, Introduction o8 Arduino Board
Arduino is an o!en9source e(ectronics !rotot'!in !(atform +ased on f(e/i+(e, eas'9to9 use hard*are and soft*are. $tIs intended for artists, desiners, ho++'ists, and an'one interested in creatin interactive o+ects or environments. Arduino can sense the environment +' receivin in!ut from a variet' of sensors and can affect its surroundins +' contro((in (ihts, motors, and other actuators. &he microcontro((er on the +oard is !rorammed usin the Arduino !rorammin (anuae 2+ased on -irin3 and the Arduino deve(o!ment environment 2+ased on rocessin3. Arduino !roects can +e stand9a(one or the' can communicate *ith soft*are runnin on a com!uter 2e.. ?(ash, rocessin, and Ma/MS. $t is a too( for ma)in com!uters that can sense and contro( more of the !h'sica( *or(d than 'our des)to! com!uter. $tIs an o!en9source !h'sica( com!utin !(atform +ased on a sim!(e microcontro((er +oard, and a deve(o!ment environment for *ritin soft*are for the +oard. Arduino can +e used to deve(o! interactive o+ects, ta)in in!uts from a variet' of s*itches or sensors, and contro((in a variet' of (ihts, motors, and other !h'sica( out!uts. Arduino !roects can +e stand9a(one, or the' can +e communicated *ith soft*are runnin on 'our com!uter 2e.. ?(ash, rocessin, Ma/MS.3 &he +oards can +e assem+(ed +' hand or !urchased !reassem+(edJ the o!en9source $DE can +e do*n(oaded for free. &he Arduino !rorammin (anuae is an im!(ementation of -irin, a simi(ar !h'sica( com!utin !(atform, *hich is +ased on the rocessin mu(timedia !rorammin environment.
050 C)aracteristics o8 Arduino board
a3
Ine
3 |Page
Arduino +oards are re(ative(' ine/!ensive com!ared to other microcontro((er !(atforms. &he (east e/!ensive version of the Arduino modu(e can +e assem+(ed +' hand, and even
b)
the !re9assem+(ed Arduino modu(es cost (ess than K86 Cross;plat8orm &he Arduino soft*are runs on -indo*s, Macintosh OSL, and 0inu/ o!eratin
c)
s'stems. Most microcontro((er s'stems are (imited to -indo*s. Simple: clear programming en7ironment &he Arduino !rorammin environment is eas'9to9use for +einners, 'et f(e/i+(e enouh for advanced users to ta)e advantae of as *e((. ?or teachers, itIs convenient(' +ased on the rocessin !rorammin environment, so students (earnin to !roram in
d)
that environment *i(( +e fami(iar *ith the (oo) and fee( of Arduino Open source and e
e)
the A#R " !rorammin (anuae on *hich itIs +ased. Open source and e
051 Arduino Mega02-.
&he Mea 58:6 is a microcontro((er +oard +ased on the A&mea58:6. $t has 8> diita( in!ut;out!ut !ins 2of *hich 78 can +e used as -M out!uts3, 7: ana(o in!uts, > UAR&s 2hard*are seria( !orts3, a 7: MH@ cr'sta( osci((ator, a USB connection, a !o*er ac), an $"S 4 |Page
header, and a reset +utton. $t contains ever'thin needed to su!!ort the microcontro((erJ sim!(' connect it to a com!uter *ith a USB ca+(e or !o*er it *ith a A"9to9D" ada!ter or +atter' to et started. &he Mea 58:6 +oard is com!ati+(e *ith most shie(ds desined for the Uno and the former +oards Duemi(anove or Diecimi(a. &he Mea 58:6 is an u!date to the Arduino Mea, *hich it re!(aces.
?i 5.7 Arduino Mea58:6
5 |Page
5.> in confiuration of A&mea58:6
6 |Page
?i 5.5 in diaram of Atmea58:6 052 Pin !escription
=CC Diita( su!!(' vo(tae G"! Ground Port B +PB/4 ort B is an C9+it +i9directiona( $;O !ort *ith interna( !u((9u! resistors 2se(ected
for each +it3. &he ort B out!ut +uffers have s'mmetrica( drive characteristics *ith +oth hih sin) and source ca!a+i(it'. As in!uts, ort B !ins that are e/terna((' !u((ed (o* *i(( 7 |Page
source current if the !u((9u! resistors are activated. &he ort B !ins are tri9stated *hen a reset condition +ecomes active, even if the c(oc) is not runnin. De!endin on the c(oc) se(ection fuse settins, B< can +e used as out!ut from the invertin Osci((ator am!(ifier. PB- De!endin on the c(oc) se(ection fuse settins, B: can +e used as in!ut to the invertin Osci((ator am!(ifier and in!ut to the interna( c(oc) o!eratin circuit. Port C +PC24 ort " is a <9+it +i9directiona( $;O !ort *ith interna( !u((9u! resistors 2se(ected
for each +it3. &he out!ut +uffers have s'mmetrica( drive characteristics *ith +oth hih sin) and source ca!a+i(it'. As in!uts, ort " !ins that are e/terna((' !u((ed (o* *i(( source current if the !u((9u! resistors are activated. &he ort " !ins are tri9stated *hen a reset condition +ecomes active, even if the c(oc) is not runnin. PC- ": is used as an $;O !in. Note that the e(ectrica( characteristics of ": differ from those of the other !ins of ort ".J ": is used as a Reset in!ut. A (o* (eve( on this !in for (oner than the minimum !u(se (enth *i(( enerate a Reset, even if the c(oc) is not runnin. Port ! +P!/4 ort D is an C9+it +i9directiona( $;O !ort *ith interna( !u((9u! resistors 2se(ected for each +it3. &he ort D out!ut +uffers have s'mmetrica( drive characteristics *ith +oth hih sin) and source ca!a+i(it'. As in!uts, ort D !ins that are e/terna((' !u((ed (o* *i(( source current if the !u((9u! resistors are activated. &he ort D !ins are tri9stated *hen a reset condition +ecomes active, even if the c(oc) is not runnin. A=cc A#"" is the su!!(' vo(tae !in for the A;D "onverter. $t shou(d +e e/terna((' connected to #"", even if the AD" is not used. $f the AD" is used, it shou(d +e connected to #"" throuh a (o*9!ass fi(ter. Note that ":...> use diita( su!!(' vo(tae. ARE$ ARE? is the ana(o reference !in for the A;D "onverter.
Pin "umber
Pin "ame
Mapped Pin "ame
7
G8 2 O"6B 3
Diita( !in > 2-M3
5 = >
E6 2 RLD6;"$N&C 3 E7 2 &LD6 3 E5 2 L"%6;A$N6 3
Diita( !in 6 2RL63 Diita( !in 7 2&L63
8 : <
E= 2 O"=A;A$N7 3 E> 2 O"=B;$N&> 3 E8 2 O"=";$N&8 3
Diita( !in 8 2-M3 Diita( !in 5 2-M3 Diita( !in = 2-M3
C
E: 2 &=;$N&: 3
8 |Page
76 77
E< 2 "0%O;$"=;$N&< 3 #"" GND
75 7= 7>
H6 2 RLD5 3 H7 2 &LD5 3 H5 2 L"%5 3
Diita( !in 7< 2RL53 Diita( !in 7: 2&L53
78 7: 7<
H= 2 O">A 3 H> 2 O">B 3 H8 2 O">" 3
Diita( !in : 2-M3 Diita( !in < 2-M3 Diita( !in C 2-M3
7C 7 56
H: 2 O"5B 3 B6 2 SS;"$N&6 3 B7 2 S"%;"$N&7 3
Diita( !in 2-M3 Diita( !in 8= 2SS3 Diita( !in 85 2S"%3
57 55 5=
B5 2 MOS$;"$N&5 3 B= 2 M$SO;"$N&= 3 B> 2 O"5A;"$N&> 3
Diita( !in 87 2MOS$3 Diita( !in 86 2M$SO3 Diita( !in 76 2-M3
5> 58 5:
B8 2 O"7A;"$N&8 3 B: 2 O"7B;"$N&: 3 B< 2 O"6A;O"7";"$N&< 3
Diita( !in 77 2-M3 Diita( !in 75 2-M3 Diita( !in 7= 2-M3
5< 5C 5
H< 2 &> 3 G= 2 &OS"5 3 G> 2 &OS"7 3
=6 =7 =5
RESE& #"" GND
RESE& #"" GND
== => =8
L&A05 L&A07 06 2 $"> 3
L&A05 L&A07 Diita( !in >
=: =< =C
07 2 $"8 3 05 2 &8 3 0= 2 O"8A 3
Diita( !in >C Diita( !in >< Diita( !in >: 2-M3
= >6
0> 2 O"8B 3 08 2 O"8" 3
Diita( !in >8 2-M3 Diita( !in >> 2-M3
>7 >5 >=
0: 0< D6 2 S"0;$N&6 3
Diita( !in >= Diita( !in >5 Diita( !in 57 2S"03
>> >8 >:
D7 2 SDA;$N&7 3 D5 2 RLD$;$N&5 3 D= 2 &LD7;$N&= 3
Diita( !in 56 2SDA3 Diita( !in 7 2RL73 Diita( !in 7C 2&L73
>< >C >
D> 2 $"7 3 D8 2 L"%7 3 D: 2 &7 3
86 87
D< 2 &6 3 G6 2 -R 3
#"" GND
Diita( !in =C Diita( !in >7 9 |Page
85 8= 8>
G7 2 RD 3 "6 2 AC 3 "7 2 A 3
Diita( !in >6 Diita( !in =< Diita( !in =:
88 8: 8<
"5 2 A76 3 "= 2 A77 3 "> 2 A75 3
Diita( !in =8 Diita( !in => Diita( !in ==
8C 8 :6
"8 2 A7= 3 ": 2 A7> 3 "< 2 A78 3
Diita( !in =5 Diita( !in =7 Diita( !in =6
:7 :5 :=
#"" GND 6 2 RLD=;"$N& 3
#"" GND Diita( !in 78 2RL=3
:> :8 ::
7 2 &LD=;"$N&76 3 5 2 L"%=;"$N&77 3 = 2 "$N&75 3
Diita( !in 7> 2&L=3
:< :C :
> 2 "$N&7= 3 8 2 "$N&7> 3 : 2 "$N& 78 3
<6 <7 <5
G5 2 A0E 3 A< 2 AD< 3 A: 2 AD: 3
Diita( !in = Diita( !in 5 Diita( !in 5C
<= <> <8
A8 2 AD8 3 A> 2 AD> 3 A= 2 AD= 3
Diita( !in 5< Diita( !in 5: Diita( !in 58
<: <<
A5 2 AD5 3 A7 2 AD7 3 A6 2 AD6 3
Diita( !in 5> Diita( !in 5= Diita( !in 55
< C6 C7
< #"" GND
#"" GND
C5 C=
%< 2 AD"78;"$N&5= 3 %: 2 AD"7>;"$N&55 3
Ana(o !in 78 Ana(o !in 7>
C> C8 C:
%8 2 AD"7=;"$N&57 3 %> 2 AD"75;"$N&56 3 %= 2 AD"77;"$N&7 3
Ana(o !in 7= Ana(o !in 75 Ana(o !in 77
C< CC C
%5 2 AD"76;"$N&7C 3 %7 2 AD";"$N&7< 3 %6 2 AD"C;"$N&7: 3
Ana(o !in 76 Ana(o !in Ana(o !in C
6 7 5
?< 2 AD"< 3 ?: 2 AD": 3 ?8 2 AD"8;&MS 3
Ana(o !in < Ana(o !in : Ana(o !in 8
= >
?> 2 AD">;&M% 3 ?= 2 AD"= 3
Ana(o !in > Ana(o !in = 10 | P a g e
8 : <
?5 2 AD"5 3 ?7 2 AD"7 3 ?6 2 AD"6 3
Ana(o !in 5 Ana(o !in 7 Ana(o !in 6
C 766
ARE? GND A#""
Ana(o Reference GND #""
Table 05, Arduino Mega 02-. PI" mapping table 05- ')y Arduino
&han)s to its sim!(e and accessi+(e user e/!erience, Arduino has +een used in thousands of different !roects and a!!(ications. &he Arduino soft*are is eas'9to9use for +einners, 'et f(e/i+(e enouh for advanced users. $t runs on Mac, -indo*s, and 0inu/. &eachers and students use it to +ui(d (o* cost scientific instruments, to !rove chemistr' and !h'sics !rinci!(es, or to et started *ith !rorammin and ro+otics. Desiners and architects +ui(d interactive !rotot'!es, musicians and artists use it for insta((ations and to e/!eriment *ith ne* musica( instruments. Ma)ers, of course, use it to +ui(d man' of the !roects e/hi+ited at the Ma)er ?aire, for e/am!(e. Arduino is a )e' too( to (earn ne* thins. An'one 9 chi(dren, ho++'ists, artists, !rorammers 9 can start tin)erin ust fo((o*in the ste! +' ste! instructions of a )it, or sharin ideas on(ine *ith other mem+ers of the Arduino communit'. &here are man' other microcontro((ers and microcontro((er !(atforms avai(a+(e for !h'sica( com!utin. ara((a/ Basic Stam!, NetmediaIs BL95>, hidets, M$&Is Hand' +oard, and man' others offer simi(ar functiona(it'. A(( of these too(s ta)e the mess' detai(s of microcontro((er !rorammin and *ra! it u! in an eas'9to9use !ac)ae. Arduino a(so sim!(ifies the !rocess of *or)in *ith microcontro((ers, +ut it offers some advantae for teachers, students, and interested amateurs over other s'stems Ine
11 | P a g e
Simple: clear programming en7ironment 9 &he Arduino Soft*are 2$DE3 is eas'9to9use for
+einners, 'et f(e/i+(e enouh for advanced users to ta)e advantae of as *e((. ?or teachers, itIs convenient(' +ased on the rocessin !rorammin environment, so students (earnin to !roram in that environment *i(( +e fami(iar *ith ho* the Arduino $DE *or)s. Open source and e
C%APTER .1
GSM &E"HNO0OGY
15, Introduction
GSM 2G(o+a( S'stem for Mo+i(e "ommunications, oriina((' #roupe $p%cial Mobile 3, is a standard deve(o!ed +' the Euro!ean &e(ecommunications Standards $nstitute 2E&S$3 to descri+e the !rotoco(s for second9eneration 25G3 diita( ce((u(ar net*or)s used +' mo+i(e !hones, first de!(o'ed in ?in(and in u(' 77. As of 567> it has +ecome the defau(t (o+a(
12 | P a g e
standard for mo+i(e communications 9 *ith over 6 mar)et share, o!eratin in over 57 countries and territories. 5G net*or)s deve(o!ed as a re!(acement for first eneration 27G3 ana(o ce((u(ar net*or)s, and the GSM standard oriina((' descri+ed a diita(, circuit9s*itched net*or) o!timi@ed for fu(( du!(e/ voice te(e!hon'. &his e/!anded over time to inc(ude data communications, first +' circuit9s*itched trans!ort, then +' !ac)et data trans!ort viaGRS 2Genera( ac)et Radio Services3 and EDGE 2Enhanced Data rates for GSM Evo(ution or EGRS3. Su+se1uent(', the =G deve(o!ed third9eneration 2=G3 UM&S standards fo((o*ed +' fourth9 eneration 2>G3 0&E Advanced standards, *hich do not form !art of the E&S$ GSM standard.GSM is a trademar) o*ned +' the GSM Association. $t ma' a(so refer to the 2initia(('3mos common voice codec used, ?u(( Rate.
150 Tec)nical !etails
?i =.7 Architecture of GSM Net*or) A. Net*or) structure
&he net*or) is structured into a num+er of discrete sections 13 | P a g e
Base Station Su+s'stem P the +ase stations and their contro((ers e/!(ained Net*or) and S*itchin Su+s'stem P the !art of the net*or) most simi(ar to a fi/ed net*or), sometimes ust ca((ed the core net*or) GRS "ore Net*or) P the o!tiona( !art *hich a((o*s !ac)et9+ased $nternet connections O!erations su!!ort s'stem 2OSS3 P net*or) maintenance B5 Base Station Subsystem GSM is a ce((u(ar net*or) , *hich means that ce(( !hones connect to it +' searchin for ce((s in the immediate vicinit'. &here are five different ce(( si@es in a GSM net*or)Q macro, micro, !ico, femto, and um+re((a ce((s. &he coverae area of each ce(( varies accordin to the im!(ementation environment. Macro ce((s can +e rearded as ce((s *here the +ase station antenna is insta((ed on a mast or a +ui(din a+ove averae roofto! (eve(. Micro ce((s are ce((s *hose antenna heiht is under averae roofto! (eve(J the' are t'!ica((' used in ur+an areas. icoce((s are sma(( ce((s *hose coverae diameter is a fe* do@en metresJ the' are main(' used indoors. ?emtoce((s are ce((s desined for use in residentia( or sma(( +usiness environments and connect to the service !roviders net*or) via a +road+and internet connection. Um+re((a ce((s are used to cover shado*ed reions of sma((er ce((s and fi(( in a!s in coverae +et*een those ce((s. "e(( hori@onta( radius varies de!endin on antenna heiht, antenna ain, and !ro!aation conditions from a cou!(e of hundred meters to severa( tens of )i(ometres. &he (onest distance the GSM s!ecification su!!orts in !ractica( use is =8 )i(ometres 255 mi3. &here are a(so severa( im!(ementations of the conce!t of an e/tended ce(( *here the ce(( radius cou(d +e dou+(e or even more, de!endin on the antenna s'stem, the t'!e of terrain, and the timin advance. $ndoor coverae is a(so su!!orted +' GSM and ma' +e achieved +' usin an indoor !icoce(( +ase station, or an indoor re!eater *ith distri+uted indoor antennas fed throuh !o*er s!(itters, to de(iver the radio sina(s from an antenna outdoors to the se!arate indoor distri+uted antenna s'stem. &hese are t'!ica((' de!(o'ed *hen sinificant ca(( ca!acit' is needed indoors, (i)e in sho!!in centers or air!orts. Ho*ever, this is not a !rere1uisite, since indoor coverae is a(so !rovided +' in9+ui(din !enetration of the radio sina(s from an' near+' ce((. C5 GSM carrier 8reuencies
14 | P a g e
GSM net*or)s o!erate in a num+er of different carrier fre1uenc' ranes 2se!arated into GSM fre1uenc' ranes fo ranes forr 5G and UM&S fre1uenc' +ands for =G3, *ith most 5G GSM net*or)s o!eratin in the 66 MH@ or 7C66 MH@ +ands. -here these +ands *ere a(read' a((ocated, the C86 MH@ and 766 MH@ +ands *ere used instead 2for e/am!(e in "anada and the United States3. $n rare cases the >66 and >86 MH@ fre1uenc' +ands are assined in some countries +ecause the' *ere !revious(' used for first9eneration s'stems. Most =G =G net*or)s net*or)s in Euro!e o!erate in the 5766 MH@ fre1uenc' +and. ?or more information on *or(d*ide GSM fre1uenc' usae, see GSM fre1uenc' +ands. +ands. Reard(ess of the fre1uenc' se(ected +' an o!erator, it is divided into times(ots times(ots for for individua( individua( !hones. &his a((o*s eiht fu((9rate or si/teen ha(f9rate s!eech channe(s !er radio fre1uenc'. fre1uenc'. &hese &hese eiht eiht radio radio times( times(ots ots 2or +urst !eriod !eriods3 s3 are are rou! rou!ed ed into into a &DMA frame. Ha(f9rate Ha(f9rate chan channe ne(s (s use use a(te a(tern rnat atee fram frames es in the the same same time times( s(ot ot.. &h &hee chan channe ne(( data data rate rate for for a(( a(( C channe(s is5<6.C== )+it;s, and the frame duration is >.:78 ms. &he transmission !o*er in the handset is (imited to a ma/imum of 5 *atts in GSM C86;66 and 7 *att in GSM 7C66;766. !5 Subscriber Identity Module +SIM4 One of the )e' features of GSM is the Su+scri Su+scri+er +er $dentit' Modu(e, Modu(e, common(' )no*n as a S$M S$M card card.. &he S$M is a deta detach cha+ a+(e (e sma smart rt card containi containin n the userIs userIs su+s su+scri! cri!tion tion information and !hone +oo). &his a((o*s the user to retain his or her information after s*itchi s*itchin n handsets handsets.. A(ter A(ternati native(' ve(',, the user can a(so chane chane o!erato o!erators rs *hi(e *hi(e retaini retainin n the handset sim!(' +' chanin the S$M. Some o!erators *i(( +(oc) this + ' a((o*in the !hone to use on(' a sin(e S$M, or on(' a S$M issued +' themJ this !ractice is )no*n as S$M (oc)in. (oc)in.
151 GSM MO!EM;PC Inter8acing
GSM Modem is used to receive messae from the authori@ed user. &his GSM modem re1uires a S$M card from a *ire(ess carrier in order to o!erate. &his S$M num+er is contact num+er of the receivin section. "s use A& commands to contro( modems. A(thouh GSM modem is interfaced *ith " throu throuh h B(uet B(uetoot ooth h usin usin a #B !ror !roram am,, a GSM GSM mo modem dem can can +e teste tested d +efor +eforee actua( actua((' (' 15 | P a g e
im!(ementin into the s'stem. &he MS H'!er&ermina( is a hand' too( *hen it comes to testin the GSM device. $t can +e found at Start 9 rorams 9Accessories 9"ommunications 9 H'!er&ermina(. #arious !arameters (i)e connection name, icon, com !ort, and correct !ort settins are s!ecified for our GSM modem. ?ina((' in the h'!er termina( main *indo*, A& commands are sent and res!onds received from GSM modem can +e seen. -e *i(( first have to t'!e A&T A res!onse O% shou(d +e returned from the mo+i(e !hone or GSM modem. No* *e *i(( t'!e A&"$N. A&"$N. &he A& A& command A& A&"$N is used to 1uer 1uer' ' *het *hethe herr the the mo mo+i +i(e (e !hon !honee or GSM GSM modem odem is *ait *aitin in for for a $N $N 2!er 2!erso sona na(( identification num+er, i.e. !ass*ord3. $f the res!onse is "$N READY, it means the S$M card is read' for use. After this, various A& commands de!endin on the used modems instruction set are send to modem and res!onses are received. &his !rocess is ver' usefu( in testin GSM modems.
153 GSM modem +D..,?.. M%F4
A GSM modem is a *ire(ess modem that *or)s *ith a GSM *ire(ess net*or). A *ire(ess modem +ehaves (i)e a dia(9u! modem. &he main difference +et*een them is that a dia(9u! modem sends and receives data throuh a fi/ed te(e!hone (ine *hi(e a *ire(ess modem sends and receives data throuh radio *aves. 0i)e a GSM mo+i(e !hone, a GSM modem re1uires a S$M card from a *ire(ess carrier in order to o!erate.
16 | P a g e
?i =.5 GSM Modu(e 266A3 Genera((', com!uters use A& commands to contro( modems. Readin of messae from the S$M card inserted into the modem is done +' sendin the a!!ro!riate a!!ro!riate A& A& command command to the modem. $n addition to the standard A& commands, GSM modems su!!ort an e/tended set of A& commands. &hese e/tended A& commands are defined in the GSM standards. Some common +asic SMS re(ated A& "ommands are sho*n in ta+(e +e(o*
Table Table 15, 1 5, Basic Basi c AT Commands
17 | P a g e
C%APTER .3
SH$?& REG$S&ERS
35, Introduction
$n diita( circuits, a shift reister is a cascade of f(i! f(o!s, sharin the same c(oc) , in *hich the out!ut of each f(i!9f(o! is connected to the data in!ut of the ne/t f(i!9f(o! in the chain, resu(tin in a circuit that shifts +' one !osition the +it arra' stored in it, shifting in the data !resent at its in!ut and shifting out the (ast +it in the arra', at each transition of the c(oc) in!ut. More enera((', a shift reister ma' +e mu(tidimensiona(, such that its data in and stae out!uts are themse(ves +it arra's this is im!(emented sim!(' +' runnin severa( shift reisters of the same +it9(enth in !ara((e(. Shift reisters can have +oth !ara((e( and seria( in!uts and out!uts. &hese are often confiured as Iseria(9in, !ara((e(9outI 2S$O3 or as I!ara((e(9in, seria(9outI 2$SO3. &here are a(so t'!es that have +oth seria( and !ara((e( in!ut and t'!es *ith seria( and !ara((e( out!ut. &here are a(so I+idirectiona(I shift reisters *hich a((o* shiftin in +oth directions 0VR or RV0. &he seria( in!ut and (ast out!ut of a shift reister can a(so +e connected to create a Icircu(ar shift reisterI.
350 Serial;In and Serial;Out +SISO4
18 | P a g e
&hese are the sim!(est )ind of shift reisters. &he data strin is !resented at IData $nI, and is shifted riht one stae each time IData AdvanceI is +rouht hih. At each advance, the +it on the far (eft 2i.e. IData $nI3 is shifted into the first f(i!9f(o!Is out!ut. &he +it on the far riht 2i.e. IData OutI3 is shifted out and (ost. &he data are stored after each f(i!9f(o! on the IWI out!ut, so there are four storae Is(otsI avai(a+(e in this arranement, hence it is a >9+it Reister. &o ive an idea of the shiftin !attern, imaine that the reister ho(ds 6666 2so a(( storae s(ots are em!t'3. As IData $nI !resents 7,6,7,7,6,6,6,6 2in that order, *ith a !u(se at IData AdvanceI each timeQthis is ca((ed c(oc)in or stro+in3 to the reister, this is the resu(t. &he (eft hand co(umn corres!onds to the (eft9most f(i!9f(o!Is out!ut !in, and so on. So the seria( out!ut of the entire reister is 76776666. $t can +e seen that if data *ere to +e continued to in!ut, it *ou(d et e/act(' *hat *as !ut in, +ut offset +' four IData AdvanceI c'c(es. &his arranement is the hard*are e1uiva(ent of a 1ueue. A(so, at an' time, the *ho(e reister can +e set to @ero +' +rinin the reset 2R3 !ins hih. &his arranement !erforms destructive readout 9 each datum is (ost once it has +een shifted out of the riht9most +it.
351 Serial;in: parallel;out +SIPO4
?i >.7 S$O &his confiuration a((o*s conversion from seria( to !ara((e( format. Data is in!ut seria((', as descri+ed in the S$SO section a+ove. Once the data has +een c(oc)ed in, it ma' +e either read off at each out!ut simu(taneous(', or it can +e shifted out $n this confiuration, each f(i!9f(o! is ede triered. &he initia( f(i!9f(o! o!erates at the iven c(oc) fre1uenc'. Each su+se1uent f(i!9f(o! ha(ves the fre1uenc' of its !redecessor, *hich 19 | P a g e
dou+(es its dut' c'c(e. As a resu(t, it ta)es t*ice as (on for the risin;fa((in ede to trier each su+se1uent f(i!9f(o!J this staers the seria( in!ut in the time domain, (eadin to !ara((e( out!ut. $n cases *here the !ara((e( out!uts shou(d not chane durin the seria( (oadin !rocess, it is desira+(e to use a (atched or +uffered out!ut. $n a (atched shift reister 2such as the <>883 the seria( data is first (oaded into an interna( +uffer reister, then u!on recei!t of a (oad sina( the state of the +uffer reister is co!ied into a set of out!ut reisters. $n enera(, the !ractica( a!!(ication of the seria(9in;!ara((e(9out shift reister is to convert data from seria( format on a sin(e *ire to !ara((e( format on mu(ti!(e *ires.
353 Parallel;in: Serial;out +PISO4
&his confiuration has the data in!ut on (ines D7 throuh D> in !ara((e( format, +ein D7 the MSB. &o *rite the data to the reister, the -rite;Shift contro( (ine must +e he(d 0O-. &o shift the data, the -;S contro( (ine is +rouht H$GH and the reisters are c(oc)ed. &he arranement no* acts as a S$SO shift reister, *ith D7 as the Data $n!ut. Ho*ever, as (on as the num+er of c(oc) c'c(es is not more than the (enth of the data9strin, the Data Out!ut, W, *i(( +e the !ara((e( data read off in order.
?i >.5 >9Bit $SO Shift Reister &he animation +e(o* sho*s the *rite;shift se1uence, inc(udin the interna( state of the shift reister.
20 | P a g e
352 ses
One of the most common uses of a shift reister is to convert +et*een seria( and !ara((e( interfaces. &his is usefu( as man' circuits *or) on rou!s of +its in !ara((e(, +ut seria( interfaces are sim!(er to construct. Shift reisters can +e used as sim!(e de(a' circuits. Severa( +idirectiona( shift reisters cou(d a(so +e connected in !ara((e( for a hard*are im!(ementation of a stac) . S$O reisters are common(' attached to the out!ut of micro!rocessors *hen more Genera( ur!ose $n!ut;Out!ut !ins are re1uired than are avai(a+(e. &his a((o*s severa( +inar' devices to +e contro((ed usin on(' t*o or three !ins, +ut s(o*er than !ara((e( $;O 9 the devices in 1uestion are attached to the !ara((e( out!uts of the shift reister, then the desired state of a(( those devices can +e sent out of the micro!rocessor usin a sin(e seria( connection. Simi(ar(', $SO confiurations are common(' used to add more +inar' in!uts to a micro!rocessor than are avai(a+(e 9 each +inar' in!ut 2i.e. a +utton or more com!(icated circuitr'3 is attached to a !ara((e( in!ut of the shift reister, then the data is sent +ac) via seria( to the micro!rocessor usin severa( fe*er (ines than oriina((' re1uired. Shift reisters can a(so +e used as !u(se e/tenders. "om!ared to monosta+(e mu(tivi+rators, the timin has no de!endenc' on com!onent va(ues, ho*ever it re1uires e/terna( c(oc) and the timin accurac' is (imited +' a ranu(arit' of this c(oc). $n ear(' com!uters, shift reisters *ere used to hand(e data !rocessin t*o num+ers to +e added *ere stored in t*o shift reisters and c(oc)ed out into an arithmetic and (oic unit 2A0U3 *ith the resu(t +ein fed +ac) to the in!ut of one of the shift reisters 2the accumu(ator3 *hich *as one 21 | P a g e
+it (oner since +inar' addition can on(' resu(t in an ans*er that is the same si@e or one +it (oner. Man' com!uter (anuaes inc(ude instructions to Ishift rihtI and Ishift (eftI the data in a reister, effective(' dividin +' t*o or mu(ti!('in +' t*o for each !(ace shifted. #er' (are seria(9in seria(9out shift reisters 2thousands of +its in si@e3 *ere used in a simi(ar manner to the ear(ier de(a' (ine memor' in some devices +ui(t in the ear(' 7<6s. Such memories
*ere
sometimes
ca((ed circu(atin memor'.
?or
e/am!(e,
the Data!oint
==66 termina( stored its dis!(a' of 58 ro*s of <5 co(umns of u!!er9case characters usin fift'9 four 5669+it shift reisters, arraned in si/ trac)s of nine !ac)s each, !rovidin storae for 7C66 si/9+it characters. &he shift reister desin meant that scro((in the termina( dis!(a' cou(d +e accom!(ished +' sim!(' !ausin the dis!(a' out!ut to s)i! one (ine of characters.
35- %istory
One of the first )no*n e/am!(es of a shift reister *as in the "o(ossus, a code9 +rea)in
machine
+ui(t
in
7>=.
$t
*as
a
five9stae
device
+ui(t
of vacuum
tu+es and th'ratrons. A shift reister *as a(so used in the $AS machine, +ui(t +' ohn von Neumann and others at the $nstitute for Advanced Stud' in the (ate 7>6s.
35/ /3%C2D2 ? bit S)i8t Register Module 8or Arduino
?i >.= Shift Reister Modu(e A5 General !escription
22 | P a g e
&his is a +rea)out +oard for <>H"88 C +it Shift Reister. &he <>H"&88 are hih9 s!eed Si9ate "MOS devices and are !in com!ati+(e *ith 0o*9!o*er Schott)' &&0 20S&&03. &he' are s!ecified in com!(iance *ith EDE" standard No. H"88J <>H"&88 are C9stae seria( shift reisters *ith a storae reister and =9state out!uts. &he reisters have se!arate c(oc)s.Data is shifted on the !ositive9oin transitions of the shift reister c(oc) in!ut 2SH"3. &he data in each reister is transferred to the storae reister on a !ositive9oin transition of the storae reister c(oc) in!ut 2S&"3. $f +oth c(oc)s are connected toether, the shift reister *i(( a(*a's +e one c(oc) !u(se ahead of the storae reister.&he shift reister has a seria( in!ut 2DS3 and a seria( standard out!ut 2W? e/ceeds 5 666 # MM ESD559A7789A e/ceeds 566 # Mu(ti!(e !ac)ae o!tions C5 Applications Seria(9to9!ara((e( data conversion Remote contro( ho(din reister
!5 Pinning in8ormation
23 | P a g e
?i >.> <>H"88 in Out And Descri!tion
35? Inter8acing O8 Arduino Mega02-. and /3%C2D2
24 | P a g e
?i >.8 $nterfacin Of Arduino and <>H"88
C%APTER .2
SD "ARD 4 SD "ARD MODU0E
25, Introduction to S! cards Secure !igital +S!4 is a non9vo(ati(e memor' card format deve(o!ed +' the SD "ard
Association 2SDA3 for use in !orta+(e devices. &he standard *as introduced in Auust 7 +'
25 | P a g e
oint efforts +et*een SanDis), anasonic 2Matsushita E(ectric3 and &oshi+a as an im!rovement over Mu(ti Media "ards2MM"3,and has +ecome the de facto industr' standard. &he three com!anies formed SD9=", 00", a com!an' that (icenses and enforces inte((ectua( !ro!ert' rihts associated *ith SD memor' cards and SD host and anci((ar' !roducts. &he com!anies a(so formed the SD Association in anuar' 5666 to !romote SD "ard standards. &he SD Association is a non9!rofit orani@ation that sets memor' card standards intended to sim!(if' the use and o!timi@e the !erformance of consumer e(ectronics !roducts. SDA toda' has a+out 7,666 mem+er com!anies. Secure Diita( inc(udes four card fami(ies avai(a+(e in three different form factors. &he four fami(ies are the oriina( Standard9"a!acit' 2SDS"3, the Hih9"a!acit' 2SDH"3, the eLtended9"a!acit' 2SDL"3, and the SD$O, *hich com+ines in!ut;out!ut functions *ith data storae. &he three form factors are the oriina( si@e, the mini si@e, and the micro si@e. E(ectrica((' !assive ada!ters a((o* a sma((er card to fit and function in a device +ui(t for a (arer card. &he SD cardIs sma(( foot!rint is an idea( storae medium for sma((er, thinner and more !orta+(e e(ectronic devices. &here are man' com+inations of form factors and device fami(ies, a(thouh as of 567=, the !revai(in formats are fu((9 or micro9si@e SDH" and fu(( or micro SDL" &he SDA uses severa( trademar)ed (oos o*ned and (icensed +' SD9=", 00" to enforce com!(iance *ith its s!ecifications and assure users of com!ati+i(it'. 8.5 ARDU$NO SD "ARD MODU0E
26 | P a g e
?i 8.7 Arduino SD card Modu(e &he Arduino SD "ard Shie(d is a sim!(e so(ution for transferrin data to and from a standard SD card. &he !inout is direct(' com!ati+(e *ith Arduino, +ut can a(so +e used *ith other microcontro((ers. $t a((o*s 'ou to add mass storae and data (oin to 'our !roect. $eatures
Brea) out +oard for standard SD card. "ontains a s*itch to se(ect the f(ash card s(ot Sits direct(' on a Arduino A(so +e used *ith other microcontro((ers O7er7ie@ S! Cards @or> only at 151= and +oth the !o*er and $;O (eve(s must +e • • • •
accommodated. &he modu(e sho*n here uses ?E&s for (eve( shiftin and a =.=# reu(ator for !o*er *hen o!eratin from 8.6# . A s*itch a((o*s the modu(e to +e used *ith Arduinos ; Yourduino Ro+o7 or Minis etc. runnin at =.=#. -e have tested the YourDuinoRo+o7 *ith itIs !o*er um!er set to =.=# and the SD card modu(e set at =.=# and it *or)s *e((. &his modu(e a(so has a MicroSD soc)et on the +ac) side, and *e have tested 5G+ and >G+ MicroSD cards !(ued in there. &he' *or)ed O% *ith the Sd?A& (i+rar'. &hese cards are formatted ?A&=5 and SD;H" &he communication +et*een the microcontro((er and the SD card uses S$, *hich ta)es !(ace on diita( !ins 77, 75, and 7= 2on most Arduino +oards3 or 86, 87, and 85 2Arduino Mea3. Additiona((', another !in must +e used to se(ect the SD card. &his can +e the hard*are SS !in 9 !in 76 2on most Arduino +oards3 or !in 8= 2on the Mea3 9 or another !in s!ecified in the ca(( to SD.+ein23 $ormattingPreparing t)e card 2NB *henever referrin to the SD card, it means SD and microSD si@es, as *e(( as SD and SDHD formats3 Most SD cards *or) riht out of the +o/, +ut itIs !ossi+(e 'ou have one that *as used in a com!uter or camera and it cannot +e read +' the SD (i+rar'. ?ormattin the card *i(( create a fi(e s'stem that the Arduino can read and *rite to. $tIs not desira+(e to format SD cards fre1uent(', as it shortens their (ife s!an.
27 | P a g e
You(( need a SD reader and com!uter to format 'our card. &he (i+rar' su!!orts the ?A&7: and ?A&=5 fi(e s'stems, +ut use?A&7: *hen !ossi+(e. &he !rocess to format is fair(' straihtfor*ard. 'indo@s riht c(ic) on 'our cards director' and choose ?ormatT from the dro! do*n. Ma)e sure 'ou choose ?A& as the fi(e s'stem. OS O!en Dis) Uti(it' 2(ocated in A!!(icationsUti(ities3. "hoose the "ard, c(ic) on the erase ta+, se(ect MS9DOS2?A&3 as the ?ormat, and c(ic) Erase. NB OSL !(aces a num+er of hiddenT fi(es on the device *hen it formats a drive. &o format a SD car *ithout the e/tra fi(es on OSL, fo((o* these notes on 0ad'adas site. #inu< -ith a SD card inserted, o!en a termina( *indo*. At the !rom!t, t'!e df , and !ress enter. &he *indo*s *i(( re!ort the device name of 'our SD card, it shou(d (oo) somethin (i)e ;dev;sd+7. Unmount the SD card, +ut (eave it in the com!uter. &'!e sudo m)dosfs 9? 7: ;dev;sd+7, re!(acin the device name *ith 'ours. Remove the SD card and re!(ace it to verif' it *or)s. $ile "aming ?A& fi(e s'stems have a (imitation *hen it comes to namin conventions. You must use the C.= format, so that fi(e names (oo) (i)e NAME667.EL&T, *here NAME667T is an C character or fe*er strin, and EL&T is a = character e/tension. eo!(e common(' use the e/tensions .&L& and .0OG. $t is !ossi+(e to have a shorter fi(e name 2for e/am!(e, m'data.t/t, or time.(o3, +ut 'ou cannot use (oner fi(e names. OpeningClosing 8iles -hen 'ou use fi(e.*rite23, it doesnIt *rite to the card unti( 'ou f(ush23 or c(ose23. -henever 'ou o!en a fi(e, +e sure to c(ose it to save 'our data. As of version 7.6, it is !ossi+(e to have mu(ti!(e fi(es o!en 8.5.7 $nterfacin SD card *ith Arduino Board
28 | P a g e
?i 8.5 SD "ard Modu(e -irin B(oc) Diaram
?i 8.= SD "ard Modu(e "onnected to Arduino Board &he Arduino sho*s the fo((o*in !in names XS$ 76 2SS3 S(ave Se(ect 77 2MOS$3 Master Out S(ave $n 75 2M$SO3 Master $n S(ave Out 29 | P a g e
7= 2S"%3 S'stem "(oc)
&o c(arif' this to connect this modu(e 'ou must connect 2Arduino in3 9 Modu(e in 76 2SS3 to "S 77 2MOS$3 to D$ 75 2M$SO3 to DO 7= 2S"%3 to "0% and G to GND and to 8#
C%APTER .-
0$GH& EM$&&$NG D$ODES 20EDs3
-5, Introduction
A 0iht Emittin Diode 2#E!3 is a t*o9(ead semiconductor (iht source. $t is a !Pn unction diode, *hich emits (iht *hen activated. -hen a suita+(e vo(tae is a!!(ied to the (eads, e(ectrons are a+(e to recom+ine *ith e(ectron ho(es *ithin the device, re(easin ener' in the form of !hotons. &his effect is ca((ed e(ectro(uminescence, and the co(or of the (iht 2corres!ondin to the ener' of the !hoton3 is determined +' the ener' +and a! of the semiconductor.
An 0ED is often sma(( in area 2(ess than 7 mm 53 and interated o!tica( com!onents ma' +e used to sha!e its radiation !attern. A!!earin as !ractica( e(ectronic com!onents in 7:5, the ear(iest 0EDs emitted (o*9 intensit' infrared (iht. $nfrared 0EDs are sti(( fre1uent(' used as transmittin e(ements in remote9contro( circuits, such as those in remote contro(s for a *ide variet' of consumer e(ectronics. &he first visi+(e9(iht 0EDs *ere a(so of (o* intensit', and (imited to red. Modern 30 | P a g e
0EDs are avai(a+(e across the visi+(e, u(travio(et, and infrared *ave(enths, *ith ver' hih +rihtness. Ear(' 0EDs *ere often used as indicator (am!s for e(ectronic devices, re!(acin sma(( incandescent +u(+s. &he' *ere soon !ac)aed into numeric readouts in the form of seven9 sement dis!(a's, and *ere common(' seen in diita( c(oc)s. Recent deve(o!ments in 0EDs !ermit them to +e used in environmenta( and tas) (ihtin. 0EDs have man' advantaes over incandescent (iht sources inc(udin (o*er ener' consum!tion, (oner (ifetime, im!roved !h'sica( ro+ustness, sma((er si@e, and faster s*itchin. 0iht9emittin diodes are no* used in a!!(ications as diverse as aviation (ihtin, automotive head(am!s, advertisin, enera( (ihtin, traffic sina(s, camera f(ashes and even 0ED *a((!a!er . As of 5678, 0EDs !o*erfu( enouh for room (ihtin remain some*hat more e/!ensive, and re1uire more !recise current and heat manaement, than com!act f(uorescent (am! sources of com!ara+(e out!ut. 0EDs have a((o*ed ne* te/t, video dis!(a's, and sensors to +e deve(o!ed, *hi(e their hih s*itchin rates are a(so usefu( in advanced communications techno(o'.
?i :.7 Different &'!es Of 0EDs
?i :.5 Sim!(e 0ED -50 %istory
31 | P a g e
E(ectro(uminescence as a !henomenon *as discovered in 76< +' the British e/!erimenter H. . Round of Marconi 0a+s, usin a cr'sta( of si(icon car+ide and acatIs9 *his)er detector . Soviet inventor O(e 0osev re!orted creation of the first 0ED in 75<. His research *as distri+uted in Soviet, German and British scientific ourna(s, +ut no !ractica( use *as made of the discover' for severa( decades. %urt 0ehovec, "ar( Accardo and Ed*ard amochian, e/!(ained these first (iht9emittin diodes in 787 usin an a!!aratus em!(o'in Si" cr'sta(s *ith a current source of +atter' or !u(se enerator and *ith a com!arison to a variant, !ure, cr'sta( in 78=. Ru+in Braunstein of the Radio "or!oration of America re!orted on infrared emission from a((ium arsenide 2GaAs3 and other semiconductor a((o's in 788.Braunstein o+served infrared emission enerated +' sim!(e diode structures usin a((ium antimonide 2GaS+3, GaAs, indium !hos!hide 2$n3, and si(icon9ermanium 2SiGe3 a((o's at room tem!erature and at << )e(vins. $n 78<, Braunstein further demonstrated that the rudimentar' devices cou(d +e used for non9radio communication across a short distance. As noted +' %roemer BraunsteinT had set u! a sim!(e o!tica( communications (in) Music emerin from a record !(a'er *as used via suita+(e e(ectronics to modu(ate the for*ard current of a GaAs diode. &he emitted (iht *as detected +' a +S diode some distance a*a'. &his sina( *as fed into an audio am!(ifier, and !(a'ed +ac) +' a (ouds!ea)er. $nterce!tin the +eam sto!!ed the music. -e had a reat dea( of fun !(a'in *ith this setu!. &his setu! !resaed the use of 0EDs for o!tica( communication a!!(ications.
-51 'or>ing Principle
32 | P a g e
?i :.= -or)in of 0EDs 2Band Diaram3 A 9N unction can convert the a+sor+ed (iht ener' into its !ro!ortiona( e(ectric current. &he same !rocess is reversed here 2i.e. the 9N unction emits (iht *hen e(ectrica( ener' is a!!(ied on it3. &his !henomenon is enera((' ca((ed e(ectro(uminescence, *hich can +e defined as the emission of (iht from a semi9conductor under the inf(uence of an e(ectric fie(d. &he chare carriers recom+ine in a for*ard 9N unction as the e(ectrons cross from the N9reion and recom+ine *ith the ho(es e/istin in the 9reion. ?ree e(ectrons are in the conduction +and of ener' (eve(s, *hi(e ho(es are in the va(ence ener' +and. &hus the ener' (eve( of the ho(es *i(( +e (esser than the ener' (eve(s of the e(ectrons. Some !art of the ener' must +e dissi!ated in order to recom+ine the e(ectrons and the ho(es. &his ener' is emitted in the form of heat and (iht. &he e(ectrons dissi!ate ener' in the form of heat for si(icon and ermanium diodes +ut in a((ium arsenide !hos!hide 2GaAs3 and a((ium !hos!hide 2Ga3 semiconductors, the e(ectrons dissi!ate ener' +' emittin !hotons. $f the semiconductor is trans(ucent, the unction +ecomes the source of (iht as it is emitted, thus +ecomin a (iht9emittin diode, +ut *hen the unction is reverse +iased no (iht *i(( +e !roduced +' the 0ED and, on the contrar', the device ma' a(so et damaed.
-53 Applications
33 | P a g e
0ED uses fa(( into four maor cateories 7. #isua( sina(s *here (iht oes more or (ess direct(' from the source to the human e'e, to conve' a messae or meanin. 5. $((umination *here (iht is ref(ected from o+ects to ive visua( res!onse of these o+ects. =. Measurin and interactin *ith !rocesses invo(vin no human vision. >. Narro* +and (iht sensors *here 0EDs o!erate in a reverse9+ias mode and res!ond to incident (iht, instead of emittin (iht.
C%APTER ./
0ED D$S0AYS
/5, Introduction
An 0ED dis!(a' is a f(at !ane( dis!(a', *hich uses an arra' of (iht9emittin diodes as !i/e(s for a video dis!(a'. &heir +rihtness a((o*s them to +e used outdoors in store sins and +i((+oards, and in recent 'ears the' have a(so +ecome common(' used in destination sins on !u+(ic trans!ort vehic(es. 0ED dis!(a's are ca!a+(e of !rovidin enera( i((umination in addition to visua( dis!(a', as *hen used for stae (ihtin or other decorative 2as o!!osed to informationa(3 !ur!oses.
/50 %istory
&he first true a((90ED f(at !ane( te(evision screen *as !ossi+(' deve(o!ed, demonstrated and documented +' ames . Mitche(( in 7<<. &he modu(ar, sca(a+(e dis!(a' *as initia((' desined *ith hundreds of M#86 0EDs and a ne*(' avai(a+(e transistor9transistor (oic memor' addressin circuit from &e/as $nstruments. &he 9inch thin f(at !ane( !rotot'!e and the scientific !a!er *ere dis!(a'ed at the 5th $SE? e/!o in -ashinton D.". in Ma' 7
34 | P a g e
dis!(a' 20"D3 matri/ desin *as a(so cited in the 0ED !a!er as an a(ternative /9' scan techno(o' and as a future a(ternate te(evision dis!(a' method. Additiona( reconition *as !rovided +' -estinhouse Educationa( ?oundation Honors Grou! and the conce!t !rotot'!e *as a(so a se(ected scientific !a!er at the $o*a Academ' of Science of the Universit' of Northern $o*a. &he re!(acement of the <6 'ear hih9vo(tae ana(o s'stem 2cathode9ra' tu+e techno(o'3 *ith a diita( /9' scan s'stem has +een a sinificant achievement. Dis!(acement of the e(ectromanetic scan s'stems inc(uded the remova( of inductive def(ection, e(ectron +eam and co(or converence circuits. &he diita( /9' scan s'stem has he(!ed the modern te(evision to co((a!seT into its current thin form factor. &he 7<< mode( *as monochromatic +' desin. Efficient +(ue 0EDs did not arrive for another decade. 0are dis!(a's no* use hih9+rihtness diodes to enerate a *ide s!ectrum of co(ors. $t too) three decades and oranic (iht9emittin diodes for Son' to introduce an O0ED , the Son' LE097 O0ED screen *hich *as mar)eted in 566. 0ater, at "ES 5675, Son' !resented "r'sta( 0ED, a *ith a true 0ED9dis!(a' 2in *hich 0EDs are used to !roduce actua( imaes rather than actin as +ac)(ihtin for other t'!es of dis!(a', as in0ED9+ac)(it 0"D dis!(a's *hich are common(' mar)eted as 0ED s3, thouh no such mode(s have entered mass !roduction. &he (arest manufacturer of *a(( 0ED screen dis!(a's is Shen@hen, "hina9+ased 0e'ard O!toe(ectronic.
/51 !ot Matri< !isplay
A dot9matri/ dis!(a' is a dis!(a' device used to dis!(a' information on machines, c(oc)s, rai(*a' de!arture indicators and man' other devices re1uirin a sim!(e dis!(a' device of (imited reso(ution. &he dis!(a' consists of a dot matri/ of (ihts or mechanica( indicators arraned in a rectanu(ar confiuration 2other sha!es are a(so !ossi+(e, a(thouh not common3 such that +' s*itchin on or off se(ected (ihts, te/t or ra!hics can +e dis!(a'ed. A dot matri/ contro((er
35 | P a g e
converts instructions from a !rocessor into sina(s *hich turns on or off (ihts in the matri/ so that the re1uired dis!(a' is !roduced. Usua( character reso(utions A common si@e for a character is 8Z< !i/e(s, either se!arated *ith +(an) (ines *ith no dots 2in most te/t9on(' dis!(a's3, or *ith (ines of +(an) !i/e(s 2ma)in the rea( si@e :/C3. &his is seen on most ra!hic ca(cu(ators, such as "asio ca(cu(ators or &$9C5 and su!erior. A sma((er si@e is =Z8 2or >/: *hen se!arated *ith +(an) !i/e(s3. &his is seen on the &$9 C6 ca(cu(ator as a !ure, fi/ed9si@e =Z8 font, or on most
?i <.7 Sim!(e 0ED Matri/ Dis!(a' Structure of 0ED Matri/ $n a matri/ format 0EDs are arraned in ro*s and co(umns. You can a(so thin) of them as ' and / coordinates. 0ets assume *e have >Z> matri/. Ro*s *ou(d +e mar)ed from A to D and co(umns from 7 to >. No* *e can address each 0ED +' ro* and co(umn. &o! (eft (ed *ou(d +e 2A,73. Bottom do*n (ed *ou(d +e 2D,>3.
36 | P a g e
?i <.5 0EDs "onnected $n Matri/ 2C/C3 ?iure a+ove sho*s the different confiurations. &he difference +et*een these t*o confiurations is ho* 'ou (it a (ed. -ith common9ro* anode current sources 2!ositive vo(tae3 are attached to ro*s A..D and currents sin)s 2neative vo(tae, round3 to co(umns 7..>. -ith common9ro* cathode current sin)s are attached to ro*s A..D and currents sources to co(umns 7..>. ?or e/am!(e. &o (iht +ottom do*n (ed 2D,>3 of common cathode matri/ 'ou *ou(d feed !ositive vo(tae to co(umn > and connect ro* D to round. ?or sa)e of c(arit' $ *i(( usin common9ro* cathode in e/am!(es for the rest of this artic(e. /52 'or>ing o8 #E! Matri<
$n a dot matri/ dis!(a', mu(ti!(e 0EDs are *ired toether in ro*s and co(umns. &his is done to minimi@e the num+er of !ins re1uired to drive them. ?or e/am!(e, a CZC matri/ of 0EDs 2sho*n +e(o*3 *ou(d need :> $;O !ins, one for each 0ED !i/e(. B' *irin a(( the anodes toether in ro*s 2R7 throuh RC3, and cathodes in co(umns 2"7 throuh "C3, the re1uired num+er of $;O !ins is reduced to 7:. Each 0ED is addressed +' its ro* and co(umn num+er. $n the fiure +e(o*, if R> is !u((ed hih and "= is !u((ed (o*, the 0ED in fourth ro* and third co(umn *i(( +e turned on. "haracters can +e dis!(a'ed +' fast scannin of either ro*s or co(umns. Su!!ose, *e *ant to dis!(a' the a(!ha+et AT -e *i(( first se(ect the co(umn "7 2*hich means "7 is !u((ed (o* in this case3, and dese(ect other co(umns +' +(oc)in their round !aths 2one *a' of doin that is +' !u((in "5 throuh "8 !ins to (oic hih3. No*, the first co(umn is active, and 'ou need to turn on the 0EDs in the ro*s R5 throuh R< of this co(umn, *hich can +e done +' a!!('in for*ard +ias vo(taes to these ro*s. Ne/t, se(ect the co(umn "5 2and dese(ect a(( other co(umns3, and a!!(' for*ard +ias to R7 and R8, and so on. &herefore, +' scannin across the co(umn 1uic)(' 2 766 times !er second3, and turnin on the
37 | P a g e
res!ective 0EDs in each ro* of that co(umn, the !ersistence of vision comes in to !(a', and *e !erceive the dis!(a' imae as sti((.
?i <.= A standard 8/< 0ED dot matri/ dis!(a' structure &he ta+(e +e(o* ives the (oic (eve(s to +e a!!(ied to R7 throuh R< for each of the co(umns in order to dis!(a' the a(!ha+et A. Ro@HCol R, R0 R1 R3 R2 RR/
C, 6 7 7 7 7 7 7
C0 7 6 6 6 7 6 6
C1 7 6 6 6 7 6 6
C3 7 6 6 6 7 6 6
C2 6 7 7 7 7 7 7
Table /5, Ro@ =alues o8 Eac) Column 8or !isplaying A
38 | P a g e
?ast Scannin of Ro*s and "o(umns ives c(ear !erce!tion of A
?i <.> Scannin across the "o(umns and feedin *ith a!!ro!riate Ro* va(ues /5- ASCII C)aracters and T)eir !ecoding
-e are usin AS"$$ codes in our !roect for dis!(a' !ur!ose on matri/ of 0EDs. &he character to +e dis!(a'ed is read as AS"$$ character and is then decoded into its corres!ondin +inar' and then the +inar' is sent to matri/ and then the 0EDs (o* accordin to the +inar' code 7 ives a (o*in 0ED and 6 ives an off 0EDT Symbol
Decimal
Binary
Symbol
Decimal
Binary
A
65
01000001
a
97
01100001
B
66
01000010
b
98
01100010
C
67
01000011
c
99
01100011
D
68
01000100
d
100
01100100
E
69
01000101
e
101
01100101
F
70
01000110
f
102
01100110
G
71
01000111
g
103
01100111
H
72
01001000
h
104
01101000
I
73
01001001
i
105
01101001
J
74
01001010
j
106
01101010
39 | P a g e
K
75
01001011
/
107
01101011
76
01001100
108
01101100
!
77
01001101
109
01101101
"
78
01001110
110
01101110
#
79
01001111
111
01101111
$
80
01010000
112
01110000
%
81
01010001
113
01110001
&
82
01010010
114
01110010
'
83
01010011
115
01110011
(
84
01010100
116
01110100
)
85
01010101
117
01110101
*
86
01010110
:
118
01110110
+
87
01010111
;
119
01110111
,
88
01011000
<
120
01111000
-
89
01011001
=
121
01111001
.
90
01011010
>
122
01111010
Table /50 Table s)o@ing ASCII Codes and t)eir Binary Eui7alents 8or Alp)abets <.< Bui(din an 0ED Matri/
&o +ui(d a >Z> common9ro* cathode matri/ 'ou *i(( need 7: 0EDs, four resistors, some headers and !rotot'!in +oard. -e started +' (uin the 0EDs to !rotot'!in +oard *ith e!o/' (ue. &his *a' it is easier to have 0EDs +eautifu((' a(ined. -hen (ue is dr' it is time to +end and so(der. ?irst +end a(( cathodes to (eft as c(ose to !rotot'!in +oard as !ossi+(e. So(der a(( cathodes in each ro* toether. -hen cathodes are read', +end a(( anodes. Anodes must not touch cathodes, *e used !iece of !(astic tu+in to he(! +endin the anodes to form a +ride a+ove cathodes.
No* so(der toether a(( anodes in each ro*. So(der the headers and connect cathode ro*s direct(' to the header .
40 | P a g e
Anode ro*s are connected to header *ith current (imitin resistors. #a(ue of the resistor de!ends on the 0ED used. "hec) the 0ED datasheet for for*ard vo(tae and current. 0ED ca(cu(ator *i(( he(! 'ou findin out correct resistor. Matri/ is no* read' for testin.
Addressin Sin(e 0ED
"onnectin round to ro* A and !ositive vo(tae to co(umn 7 *i(( (iht the to! riht 0ED 2A,73.
41 | P a g e
"onnectin round to ro* D and !ositive vo(tae to co(umn > *i(( (iht the +ottom do*n 0ED2D,>3.
$ntuition *ou(d sa' (ihtin the +oth 2A,73 and 2D,>3 at the same time is ust connectin a(( the four *ires. &his is not the case. &here are four 0EDs *hich are (it. &his is +ecause current is a(so f(o*in throuh 2A,>3 and 2D,73.
42 | P a g e
?i <.8 Different ictures Sho*in the re!aration of 0ED Matri/ Multiple
Mu(ti!(e/in can +e used to dis!(a' ar+itrar' !atterns *ith (ed matrices. Mu(ti!(e/in is sometimes a(so ca((ed scannin. $t scans ro*s 2usua((' from u! to do*n3 and (ihts needed (eds on(' in one ro* at time. Somethin (i)e fo((o*in Start +' havin ever'thin disconnected. 5. "onnect !ositive vo(tae a(( the needed co(umns. =. "onnect ro* to round. &his (ihts the needed (eds in the ro*. >. Disconnect the ro* and a(( co(umns. 8. Do the same ste!s one +' one to a(( ro*s and then start from the +einnin. :. Do this s(o*(' and 'ou *ou(d see +(in)in 0ED ro*s. Do it rea((' fast and human e'e can see the *ho(e !attern. henomenon is ca((ed !ersistence of vision.
/5? Inter8acing SS! @it) Arduino
43 | P a g e
?i <.: $nterfacin of Arduino and 0ED Matri/ Microcontro((er +ased scro((in messae dis!(a' has the fo((o*in features 7. &he messae to +e dis!(a'ed is stored in memor' and the messae (enth to +e dis!(a'ed is (imited on(' +' free memor' s!ace of the microcontro((er. 5. &he num+er of character dis!(a'ed at a time can +e hih as =6. =. &he runnin s!eed of the messae can +e increased or decreased +' !ressin s*itches. Here, the circuit is desined for dis!(a'in En(ish character on a =80ED dot matri/ dis!(a'. Microcontro((er !ort is used to dis!(a' code and c(oc) sina( for the scro((in messae dis!(a'. ara((e(9in!ut !ara((e( out!ut reisters are used to shift the sina( from riht to (eft. &he c(oc) !u(se and code sina( are enerated +' microcontro((er !roram and out!ut from the !ort. &heoretica((', *e can add infinite num+er of $O reisters +ut the ma/imum num+er of reisters is actua((' (imited to the current trierin va(ue of the c(oc) !u(se. -hen c(oc) is iven to the shift reister it dis!(a's the data to 0ED and !rovides in!ut to ne/t shift reister and the !rocess oes on. &he a+ove +(oc) diaram is for sin(e character and there are man' such characters in s'stem .&he microcontro((er is connected *ith GSM
44 | P a g e
modem *hich is used to receive an' messae and that !articu(ar messae *i(( +e dis!(a'ed on the 0ED matri/ dis!(a'. Other s!ecia( characters can +e added as fo((o*s. Su!!ose 'ou *ant to dis!(a' character A . Dra* A on the 8/< 0ED dis!(a'. ‟
‟
?i <.< "haracter A on the 8/< 0ED dis!(a' ‟
Su!!ose 'ou *ant to dis!(a' s!ecia( character [ on the 8 L
?i <.C S!ecia( character [T on the 8 L
SO?&-ARE 4 ROGRAMM$NG
?5, Arduino I!E
45 | P a g e
Arduino !rorams ma' +e *ritten in an' !rorammin (anuae *ith a com!i(er that !roduces +inar' machine code. Atme( !rovides a deve(o!ment environment for their microcontro((ers, A#R Studio and the ne*er Atme( Studio. &he Arduino !roect !rovides the Arduino interated deve(o!ment environment 2$DE3, *hich is a cross9!(atform a!!(ication *ritten in the !rorammin (anuae ava. $t oriinated from the $DE for the (anuaes rocessin and -irin. $t is desined to introduce !rorammin to artists and other ne*comers unfami(iar *ith soft*are deve(o!ment. $t inc(udes a code editor *ith features such as s'nta/ hih(ihtin, +race matchin, and automatic indentation, and !rovides sim!(e one9c(ic) mechanism to com!i(e and (oad !rorams to an Arduino +oard. A !roram *ritten *ith the $DE for Arduino is ca((ed a s)etch.
?i C.7 Arduino $DE runnin on -indo*s OS &he Arduino $DE su!!orts the (anuaes " and " usin s!ecia( ru(es to orani@e code. &he Arduino $DE su!!(ies a soft*are (i+rar' ca((ed -irin from the -irin !roect, *hich !rovides man' common in!ut and out!ut !rocedures. A t'!ica( Arduino ";" s)etch consist of t*o functions that are com!i(ed and (in)ed *ith a !roram stu+ main23 into an e/ecuta+(e c'c(ic e/ecutive !roram setu!23 a function that runs once at the start of a !roram and that can initia(i@e settins. 46 | P a g e
(oo!23 a function ca((ed re!eated(' unti( the +oard !o*ers off. After com!i(in and (in)in *ith the GNU too(chain, a(so inc(uded *ith the $DE distri+ution, the Arduino $DE em!(o's the !roram avrdude to convert the e/ecuta+(e code into a te/t fi(e in he/adecima( codin that is (oaded into the Arduino +oard +' a (oader !roram in the +oardIs firm*are.
?5, PROGRAMMI"G
A t'!ica( !roram for a +einnin Arduino !rorammer +(in)s a (iht9emittin diode 20ED3 on and off. &his !roram is usua((' (oaded in the Arduino +oard +' the manufacturer. $n the Arduino environment, a user miht *rite such a !roram as sho*n \define 0ED]$N 7= void setu!23 ^ !inMode20ED]$N, OU&U&3J _
&& Enable pin '( for digital output
void (oo!23 ^ diita(-rite20ED]$N, H$GH3J && Turn on the )E* de(a'276663J && +ait one second '--- milliseconds. diita(-rite20ED]$N, 0O-3J && Turn off the )E* de(a'276663J && +ait one second
?i C.5 o*er 0ED 2Red3 and $nterated 0ED on 0ine 7= 2Green3 on Arduino "om!ati+(e Board Most Arduino +oards contain an 0ED and a (oad resistor connected +et*een the !in 7= and round, *hich is a convenient feature for man' sim!(e tests. &he !revious code *ou(d not +e seen +' a standard " com!i(er as a va(id !roram, so *hen the user c(ic)s the U!(oad to $;O +oard +utton in the $DE, a co!' of the code is *ritten to a tem!orar' fi(e *ith an e/tra inc(ude header at the to! and a ver' sim!(e main23 function at the +ottom, to ma)e it a va(id " !roram.&he Arduino $DE uses the GNU too(chain and A#R 0i+c to com!i(e !rorams, and 47 | P a g e
uses avrdude to u!(oad !rorams to the +oard.As the Arduino !(atform uses Atme( microcontro((ers, Atme(Is deve(o!ment environment, A#R Studio or the ne*er Atme( Studio, ma' a(so +e used to deve(o! soft*are for the Arduino.
?5,5, PROGRAM SE! $OR GSM MESSAGE SCRO##I"G BOAR!
ScrollingBoard5Ino
\inc(ude characters.h char incomin]char ` 6J \define DA&A 5 \define 0A&"H = \define "0O"% : \define MR 8 char strF766 ` J int inde/ ` 6J int mss ` 6J int start ` 6J void (oo!23 ^ if2Seria(7.avai(a+(e23 63 ^ incomin]char`Seria(7.read23J
48 | P a g e
if22incomin]char ` I I3 44 2incomin]char [` I@I33
Seria(.!rint2incomin]char3J
e(se ^
Seria(.!rint23J
Seria(.!rint22int3incomin]char3J
Seria(.!rint23J
if2incomin]char``763
Seria(.!rint(n23J _ _ if2Seria(.avai(a+(e23 63 ^ incomin]char ` Seria(.read23J
Seria(7.!rint2incomin]char3J _ _ void setu!23 ^ !inMode20A&"H, OU&U&3J 49 | P a g e
!inMode2"0O"%, OU&U&3J !inMode2DA&A, OU&U&3J !inMode2MR, OU&U&3J diita(-rite2MR, H$GH3J Seria(.+ein2:663J Seria(7.+ein2:663J de(a'2756663J _ void (oo!23 ^ if2Seria(7.avai(a+(e23 63 ^ incomin]char`Seria(7.read23J if22incomin]char ` I I3 44 2incomin]char [` I@I33 ^ if2start `` =3 ^
Seria(.!rint2incomin]char3J strFinde/ ` incomin]charJ
inde/J 50 | P a g e
_ _ e(se ^
if2incomin]char``763J
startJ _ mss ` 7J _ if2mss `` 73 ^ inde/ ` 6J start ` 6J mss ` 6J _ diita(-rite2MR, H$GH3J for2int i ` 6J i [ si@eof2str3 9 7J i3 ^ int inde/ ` 6J if2:8 [` strFi 44 strFi [` 63 51 | P a g e
^ for2int ` 6J [ si@eof2asciiSet73J 3 ^ if2strFi `` asciiSet7F3 inde/ ` J _ for2int ) ` 6J ) [ 8J )3 ^ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, characterSet7Finde/F)3J diita(-rite20A&"H, H$GH3J
de(a'25663J _ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, 63J diita(-rite20A&"H, H$GH3J _ e(se if2< [` strFi 44 strFi [` 7553 ^ for2int ` 6J [ si@eof2asciiSet53J 3 52 | P a g e
^ if2strFi `` asciiSet5F3 inde/ ` J _
for2int ) ` 6J ) [ 8J )3 ^ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, characterSet5Finde/F)3J diita(-rite20A&"H, H$GH3J
de(a'25663J _ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, 63J diita(-rite20A&"H, H$GH3J _ e(se if2>C [` strFi 44 strFi [` 8<3 ^ for2int ` 6J [ si@eof2asciiSet=3J 3 ^ 53 | P a g e
if2strFi `` asciiSet=F3 inde/ ` J _ for2int ) ` 6J ) [ 8J )3 ^ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, characterSet=Finde/F)3J diita(-rite20A&"H, H$GH3J
de(a'25663J _ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, 63J diita(-rite20A&"H, H$GH3J _
e(se ^ for2int ` 6J [ si@eof2asciiSet>3J 3 ^ if2strFi `` asciiSet>F3 inde/ ` J 54 | P a g e
_ for2int ) ` 6J ) [ 8J )3 ^ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, characterSet>Finde/F)3J diita(-rite20A&"H, H$GH3J
de(a'25663J _ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, 63J diita(-rite20A&"H, H$GH3J _ _
for2int i ` 6J i [ >J i3 ^ diita(-rite20A&"H, 0O-3J shiftOut2DA&A, "0O"%, MSB?$RS&, 63J diita(-rite20A&"H, H$GH3J de(a'2=663J 55 | P a g e
_ diita(-rite2MR, 0O-3J _ C)aracters5) int asciiSet,K0-L ` ^:8, ::, :<, :C, :, <6, <7, <5, <=, <>, <8, <:, <<, ,
C8, C:, C<, CC, C, 6_J int asciiSet0K0-L ` ^<, C, , 766, 767, 765, 76=, 76>, 768, 76:, 76<, 76C, 76, 776, 777,
775, 77=, 77>, 778, 77:, 77<, 77C, 77, 756, 757, 755_J int asciiSet1K,.L ` ^>C, >, 86, 87, 85, 8=, 8>, 88, 8:, 8<_J int asciiSet3K0DL ` ^==, :>, =8, =:, =<, =C, >5, >6, >7, 8, >8, >=, :7, 75=, 758, 7, =, 8C, 8,
=>, =, :=, ><, 75>, :6, :5, >>, >:, =5_J c)ar c)aracterSet,K0-LK2L ` ^^75:, 7<, 7<, 7<, 75:_, ^75<, <=, <=, <=, 8>_, ^:5, :8, :8, :8,
=>_, ^75<, :8, :8, =>, 5C_, ^75<, <=, <=, <=, :8_, ^75<, , , , 7_, ^:5, :8, <=, <=, 755_, ^75<, C, C, C, 75<_, ^6, :8, 75<, :8, 6_, ^=5, :>, :8, :=, 7_, ^75<, C, 56, =>, :8_, ^75<, :>, :>, :>, :>_, ^75<, 5, 75, 5, 75<_, ^75<, >, C, 7:, 75<_, ^:5, :8, :8, :8, :5_, ^75<, , , , :_, ^:5, :8, C7, ==, >_, ^75<, , 58, >7, <6_, ^<6, <=, <=, <=, >_, ^7, 7, 75<, 7, 7_, ^:=, :>, :>, :>, :=_, ^=7, =5, :>, =5, =7_, ^:=, :>, 8:, :>, :=_, ^, 56, C, 56, _, ^<, C, 775, C, <_, ^<, C7, <=, :, :<__J c)ar c)aracterSet0K0-LK2L ` ^^=5, C>, C>, C>, 756_, ^75<, <5, :C, :C, 8:_, ^8:, :C, :C, :C,
=5_, ^8:, :C, :C, <5, 75<_, ^8:, C>, C>, C>, C_,
56 | P a g e