You are on page 1of 11

Abstract

1hls ls an lnLeresLlng ldea ln whlch a message ls dlsplayed on an LCu screen whenever a sound
ls produced 1he message remalns on LCu for a shorL duraLlon of Llme and Lhen dlsappears 1hls
Loplc demonsLraLes Lhe lnLerfaclng of a sound operaLed clrculL and LCu dlsplay wlLh Lhe 8031
mlcroconLroller (A189C31) 1he clrculL can be used Lo dlsplay welcome message aL enLrance or
warnlng messages aL publlc places lL can also be used Lo ald communlcaLlon for deaf and dumb
people
scr|pt|on
1he clrculL conslsLs of four ma[or modules namely a sound sensor an ampllfylng clrculL a
conLrol clrculL and a dlsplay module A swlLchlng clrculL ls also employed afLer Lhe ampllfler
Any sound say clap ls deLecLed by a mlcrophone (condenser mlc) whlch acLs as Lhe sound
sensor 1hls mlc ls connecLed Lo a Lwo sLage LranslsLor ampllfler 1he mlc ouLpuL ls Lhus
ampllfled Lo a sulLable level so LhaL lL can be deLecLed aL Lhe 11L loglc

1he ouLpuL of Lhe ampllfler ls coupled wlLh a LranslsLor swlLch Whenever a hlgh volLage ouLpuL
ls recelved from Lhe ampllfler lL generaLes a pulse 1he LranslsLor swlLchlng clrculL also ensures
LhaL a hlgh 11L loglc ls noL recelved aL Lhe mlcroconLroller due Lo nolse slgnals

1he pulses from Lhe swlLchlng clrculL are fed Lo Lhe mlcroconLroller A189C31s pln whlch ls
programmed Lo deLecL Lhe pulses Whenever a hlgh pulse aL mlcroconLroller lnpuL ls deLecLed
a message 'PLLLC WC8Lu' ls senL Lo a 16x2 LCu 1he message remalns on Lhe LCu dlsplay for a
shorL duraLlon afLer whlch lL ls cleared agaln 1he message ls repeaLed whenever a hlgh pulse
(due Lo clap sound) ls recelved by Lhe conLroller

1he daLa plns of Lhe LCu are connecLed Lo porL 2 whlle Lhe conLrol plns (8S 8/W Ln) are
connecLed Lo plns 13 of porL 1 respecLlvely 1he mlcroconLroller recelves sound pulses
Lhrough Lhe flrsL pln of porL 0

omponnts

A189 M|crocontro||r
A189C31 ls an 8blL mlcroconLroller and belongs Lo ALmels 8031 famlly A189C31 has 4k8 of
llash programmable and erasable read only memory (L8CM) and 128 byLes of 8AM lL can be
erased and program Lo a maxlmum of 1000 Llmes
ln 40 pln A189C31 Lhere are four porLs deslgnaLed as
1

2

3
and
0
All Lhese porLs are 8blL
bldlrecLlonal porLs Lhey can be used as boLh lnpuL and ouLpuL porLs LxcepL
0
whlch
needs exLernal pullups resL of Lhe porLs have lnLernal pullups When 1s are wrlLLen Lo Lhese
porL plns Lhey are pulled hlgh by Lhe lnLernal pullups and can be used as lnpuLs 1hese porLs
are also blL addressable and so Lhelr blLs can also be accessed lndlvldually
orL
0
and
2
are also used Lo provlde low byLe and hlgh byLe addresses respecLlvely when
connecLed Lo an exLernal memory orL 3 has mulLlplexed plns for speclal funcLlons llke serlal
communlcaLlon hardware lnLerrupLs Llmer lnpuLs and read/wrlLe operaLlon from exLernal
memory A189C31 has an lnbullL uA81 for serlal communlcaLlon lL can be programmed Lo
operaLe aL dlfferenL baud raLes lncludlng Lwo Llmers hardware lnLerrupLs lL has a LoLal of slx
lnLerrupLs


9|n scr|pt|on

9|n No nct|on Nam


1
8 blL lnpuL/ouLpuL porL (
1
) plns

1
0
2
1
1
3
1
2
4
1
3
3
1
4
6
1
3
7
1
6
8
1
7
9 8eseL pln AcLlve hlgh 8eseL
10
lnpuL (recelver) for serlal
communlcaLlon
8xu
8 blL
lnpuL/ouLpuL
porL (
3
) plns

3
0
11
CuLpuL (LransmlLLer) for serlal
communlcaLlon
1xu
3
1
12 LxLernal lnLerrupL 1 lnL0
3
2
13 LxLernal lnLerrupL 2 lnL1
3
3
14 1lmer1 exLernal lnpuL 1
0

3
4
13 1lmer2 exLernal lnpuL 1
1

3
3
16 WrlLe Lo exLernal daLa memory WrlLe
3
6
17 8ead from exLernal daLa memory 8ead
3
7
18
CuarLz crysLal osclllaLor (up Lo 24 MPz)
CrysLal 2
19 CrysLal 1
20 Cround (0v) Cround
21 8 blL lnpuL/ouLpuL porL (
2
) plns
/
Plghorder address blLs when lnLerfaclng wlLh exLernal memory

2
0/ A
8

22
2
1/ A
9

23
2
2/ A
10

24
2
3/ A
11

23
2
4/ A
12

26
2
3/ A
13

27
2
6/ A
14

28
2
7/ A
13

29 rogram sLore enable 8ead from exLernal program memory SLn
30
Address LaLch Lnable ALL
rogram pulse lnpuL durlng llash programmlng rog
31
LxLernal Access Lnable vcc for lnLernal program execuLlons LA
rogrammlng enable volLage 12v (durlng llash programmlng) vpp
32
8 blL lnpuL/ouLpuL porL (
0
) plns

Loworder address blLs when lnLerfaclng wlLh exLernal memory


0
7/ Au
7

33
0
6/ Au
6

34
0
3/ Au
3

33
0
4/ Au
4

36
0
3/ Au
3

37
0
2/ Au
2

38
0
1/ Au
1

39
0
0/ Au
0

40 Supply volLage 3v (up Lo 66v) vcc


Cu (Llquld CrysLal ulsplay) screen ls an elecLronlc dlsplay module and flnd a wlde range of
appllcaLlons A 16x2 LCu dlsplay ls very baslc module and ls very commonly used ln varlous
devlces and clrculLs 1hese modules are preferred over seven segmenLs and oLher mulLl
segmenL LLus 1he reasons belng LCus are economlcal easlly programmable have no
llmlLaLlon of dlsplaylng speclal even cusLom characLers ) anlmaLlons and so on

A 16x2 LCu means lL can dlsplay 16 characLers per llne and Lhere are 2 such llnes ln Lhls LCu
each characLer ls dlsplayed ln 3x7 plxel maLrlx 1hls LCu has Lwo reglsLers namely Command
and uaLa
1he command reglsLer sLores Lhe command lnsLrucLlons glven Lo Lhe LCu A command ls an
lnsLrucLlon glven Lo LCu Lo do a predeflned Lask llke lnlLlallzlng lL clearlng lLs screen seLLlng Lhe
cursor poslLlon conLrolllng dlsplay eLc 1he daLa reglsLer sLores Lhe daLa Lo be dlsplayed on Lhe
LCu 1he daLa ls Lhe ASCll value of Lhe characLer Lo be dlsplayed on Lhe LCu
9|n |agram

9|n scr|pt|on

9|n No nct|on Nam
1 Cround (0v) Cround
2 Supply volLage 3v (47v 33v) vcc
3 ConLrasL ad[usLmenL Lhrough a varlable reslsLor

v
LL

4 SelecLs command reglsLer when low and daLa reglsLer when hlgh 8eglsLer SelecL
3 Low Lo wrlLe Lo Lhe reglsLer Plgh Lo read from Lhe reglsLer 8ead/wrlLe
6 Sends daLa Lo daLa plns when a hlgh Lo low pulse ls glven Lnable
7
8blL daLa plns
u80
8 u81
9 u82
10 u83
11 u84
12 u83
13 u86
14 u87
13 8ackllghL v
CC
(3v) Led+
16 8ackllghL Cround (0v) Led


ondnsr m|crophon
Condenser mlcrophone (mlc) ls a Lransducer LhaL uses a capaclLor (or condenser) Lo converL
acousLlcal energy lnLo elecLrlcal energy 1he sound waves resulL lnLo elecLrlc slgnals LhaL can be
used Lo drlve a clrculL or devlce 1he pln connecLed Lo Lhe case of mlc ls connecLed Lo ground
and Lhe oLher pln glves Lhe ouLpuL

A slmple capaclLor has Lwo plaLes wlLh a volLage dlfference beLween Lhem 1he capaclLance
depends on Lhe dlsLance beLween Lhese plaLes ln condenser mlc a dlaphragm (of llghL
maLerlal) acLs as one of Lhe plaLes When sound waves sLrlke Lhe dlaphragm Lhe dlsLance
beLween Lhe plaLes changes and so does Lhe capaclLance When Lhe plaLes come closer
Lhereby lncreaslng Lhe capaclLance a charge currenL ls generaLed Slmllarly Lhe capaclLance
decreases and a dlscharge currenL occur when Lhe plaLes move aparL

1here are Lwo meLhods of exLracLlng sound slgnals from mlc namely uC blased and radlo
frequency (8l) ln uC blased meLhod Lhe charge wlLhln Lhe capsule dlaphragm and flxed
plaLe assembly remalns consLanL 1he volLage varlaLlons across Lhe capsule are passed
Lhrough a serles reslsLor and are furLher ampllfled ln 8l meLhod elLher Lhe capaclLance change
modulaLes Lhe ampllLude of ouLpuL of a low 8l osclllaLor or Lhe capsule ls a parL of a resonanL
clrculL whlch modulaLes Lhe frequency of ouLpuL

1rans|stor 88
8C348 ls general purpose slllcon nn blpolar [uncLlon LranslsLor lL ls used for ampllflcaLlon
and swlLchlng purposes 1he currenL galn may vary beLween 110 and 800 1he maxlmum uC
currenL galn ls 800

1he LranslsLor Lermlnals requlre a flxed uC volLage Lo operaLe ln Lhe deslred reglon of lLs
characLerlsLlc curves 1hls ls known as Lhe blaslng lor ampllflcaLlon appllcaLlons Lhe LranslsLor
ls blased such LhaL lL ls parLly on for all lnpuL condlLlons 1he lnpuL slgnal aL base ls ampllfled
and Laken aL Lhe emlLLer 8C348 ls used ln common emlLLer conflguraLlon for ampllflers 1he
volLage dlvlder ls Lhe commonly used blaslng mode lor swlLchlng appllcaLlons LranslsLor ls
blased so LhaL lL remalns fully on lf Lhere ls a slgnal aL lLs base ln Lhe absence of base slgnal lL
geLs compleLely off

1rans|stor 8

ConLrols a larger currenL aL collecLor emlLLer Lermlnals8C347 ls malnly used for ampllflcaLlon
and swlLchlng purposes lL has a maxlmum currenL galn of 800 lLs equlvalenL LranslsLors are
8C348 and 8C349 1he LranslsLor Lermlnals requlre a flxed uC volLage Lo operaLe ln Lhe deslred
reglon of lLs characLerlsLlc curves 1hls ls known as Lhe blaslng lor ampllflcaLlon appllcaLlons
Lhe LranslsLor ls blased such LhaL lL ls parLly on for all lnpuL condlLlons 1he lnpuL slgnal aL base
ls ampllfled and Laken aL Lhe emlLLer 8C347 ls used ln common emlLLer conflguraLlon for
ampllflers 1he volLage dlvlder ls Lhe commonly used blaslng mode lor swlLchlng appllcaLlons
LranslsLor ls blased so LhaL lL remalns fully on lf Lhere ls a slgnal aL lLs base ln Lhe absence of
base slgnal lL geLs compleLely off



|rc|t d|agram





orc cod
// rogram Lo dlsplay a slngle message on Lhe sound of a clap
#lncludereg31h
#deflne porL 1
#deflne daLaporL 2 //uaLa porL for LCu
#deflne sec 1000
//CCn18CL lnS
sblL rs porL0
sblL rw porL1
sblL e porL2
sblL sensor_lnpuL00
vold delay(unslgned lnL msec) //1lme delay funcLlon

lnL l[
for(l0lmsecl++)
for([0[1273[++)

vold lcd_cmd(unslgned char lLem) //luncLlon Lo send command Lo LCu

daLaporL lLem
rs 0
rw0
e1
delay(1)
e0
reLurn

vold lcd_daLa(unslgned char lLem) // luncLlon Lo send daLa Lo LCu

daLaporL lLem
rs 1
rw0
e1
delay(1)
e0
reLurn

vold lcd_daLa_sLrlng(unslgned char *sLr) //luncLlon Lo send sLrlng Lo LCu

lnL l0
whlle(sLrl!0)

lcd_daLa(sLrl)
l++
delay(10)

reLurn

vold maln()

unslgned char sLr1 PLLLC
unslgned char sLr2 WC8Lu
sensor_lnpuL1
sensor_lnpuL0
lcd_cmd(0x38)
lcd_cmd(0x0e)
lcd_cmd(0x01)
whlle(1)

lf(sensor_lnpuL1)

lcd_cmd(0x82)
lcd_daLa_sLrlng(sLr1)
lcd_cmd(0xc6)
lcd_daLa_sLrlng(sLr2)
delay(sec)
lcd_cmd(0x01)
delay(100)



rnc
hLLp//wwwenglneersgaragecom

You might also like