Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A project submitted in partial fulfillment for the requirement of the award of the degree of
Bachelor of Engineering
In
Electronics & Communication
By:
Sam Abhinav Kullu (2k7/EC/690)
Sandeep Kumar (2k7/EC/691)
Sudhanshu Bhasin (2k7/EC/699)
Sujeet Kumar (2k7/EC/700)
Under the guidance of
Mrs. Priyanka Jain
Assistant Professor
We hereby declare that the work which is being presented in the major
project entitled "Interactive Voice Response System" in the partial
fulfillment for the award of degree of Bachelor of Engineering in
Electronics & Communication submitted to Delhi College Of
Engineering, University of Delhi, is an authentic record of our own
work carried out under the supervision of Mrs. Priyanka Jain,
Assistant Professor, Department Of Electronics & Communication, Delhi
College Of Engineering, University of Delhi. We have not submitted
the matter represented in this dissertation for the award of any other
degree or diploma or any other purpose whatever.
It is also certified that this dissertation has not been submitted for the
award of any other degree or diploma in any other college/university.
4
Table of Contents
Chapter 1 Introduction.............................................................................................. 3
1.1 Description....................................................................................................... 4
1.2 Objective .....……………………………………………………………...…....6
1.3 Layout of chapters... …………………………………………………………...6
Chapter 2 Literature Survey.………………………………………………………..7
2.1 History and technology background.............................................................. 8
2.2 Typical Uses .............................................................................. ……………9
2.3 Potential Uses ………………………………………………………………..11
2.4 Criticism …………………………………………….……………………….13
Chapter 3 General Overview of IVRS System……………………………………15
3.1 What is IVRS?......................................................................................16
3.2 Technology used……………………………………………………………..17
3.3 Block diagram………………………………………………………………..20
3.4 Components…………...……………………………….……………….…....21
3.5 Explanation………… ………………………………………………….…..21
3.5.1 Telephone …………………….……………………………………..….21
3.5.2 DTMF signaling.….……………………………………………………...23
3.5.3 Ring detector………..……………………………………………….…...25
3.5.4 ON-OFF hook stimulator…….. ……………………………………..….26
3.5.5 Microcontroller.……………………………………………………….....26
3.5.6 Voltage convertor………..………………………………………………27
3.5.7 PC serial port....……………………………………………………….....27
3.5.8 Interfacing circuit………..……………………………………………….28
3.6 Hardware describtion..……………………………………………………..…28
3.6.1 Microcontroller.…………………….……………………………………28
3.6.2 DTMF decoder.…………………………………………………………...30
5
3.5.3 Ring detector………..………………………………...……………….…..56
3.5.4 ON-OFF hook stimulator…….. ……………………...………………..….28
Chapter 6 Methodology……………………………..……..………………................64
Appendices………………………………………………………………..………..….72
Source Code………………………………………………………….……………..….72
References……………...……………………..………………………………….…….85
6
CHAPTER 1
INTRODUCTION
7
1.1 DESCRIPTION
N o w - a - d a y s e v e r y i n s t it u t i o n n e e d s a u t o ma ti o n. A s a p a r t o f
c o l l e g e a u t o ma t i o n , we h a v e d e c i d e d t o d o a p r o j e c t “ V o ic e
I n t e ra c t i v e S y st e m f o r C o l le g e Au t o ma ti o n ” . Ou r p ro j e c t a l l o w s
t h e u s e r t o k n o w t h e st u d e n t ’ s r a n k i n a n y e x a m t h ro u g h t h e
t e l e p h o n e l i n e w i th o u t i n te r f e r e nc e o f t h e c o l l e g e a u t h o ri t y . I n
t h e h a rd w a r e si d e e mb e d d e d sy s t e m h a s b e e n u se d . A 4 0 p i n
mi c r o c o n tr o l l e r 8 9 C2 0 5 1 i s u se d b e c a u s e o f i t s c o m p a t i b il i t y wi t h
o u r h a rd wa r e . T h i s m i c ro c o n t ro l l e r c o n t ro l s t h e w h o l e h a rd w a r e .
T e l e p h o n e l i n e i s u se d fo r c o m m u n i c a ti o n p u r p o se . V i s u a l B a s i c
h a s b e e n u s e d for so ft wa r e p r o g r a m mi n g .
I n o u r P r o j e c t a 2 0 p i n M i c r o c o n tr o l l e r AT 8 9 C 2 0 5 1 i s u se d t o
c o n tr o l t h e wh o le h a r d w a r e . T h e M i c ro c o n t ro l l e r s e n s e s t h e
D T M F si g n a l t h ro u g h th e D T M F d e c o d e r IC M T 8 8 7 0 a n d i t
r e sp o n d s a c c o r d i n g t o th e d e c o d e d si g n a l. T h e c i r c u i t h a s a n
i n b u i l t P h o n e R in g se n so r c ir c u i t a n d t h e sy st e m w i l l t a k e o v e r
t h e p h o n e a u t o m a t i c a l l y u s i n g a 1 2 V r e l a y . T h e m i c ro c o n t ro l l e r
w i l l re c e i v e t h e s ig n a l fr o m t h e di st a n c e t e l e p h o n e a n d i t d e c o d e s
t h e s i g n a l a n d f e t c h e s t h e d a t a f r o m t h e P C t h r o u g h t h e se r i a l
8
p o r t , b a s e d o n t h e t e l e p h o n e s ig n a l , a n d se n d s th e d a ta t h r o u g h
t h e t e l e p h o n e l in e .
9
1.2 OBJECTIVE
T h e o b j e c t i v e o f o u r p ro j e c t i s t o k n o w th e s t u d e n t ’ s ra n k i n a n
i n t e r fe r e n c e of college a u t h o ri t y . By d i a l in g th e p ro v i d e d
t e l e p h o n e n u mb e r , o n e c a n d i g u p t h e i n fo r ma ti o n o f th e s t u d e n t .
O n e o f th e a d v a n t a g e s i s t h e t i me sp e n d in g f o r c o l l e g e o f fi c ia l s
i n a n s w e r i n g p h on e c a l l s fro m o u t s i d e r s w il l b e r e d u c e d .
In next chapters, we give review of the IVR system, a detailed introduction to the
technology, Hardware used and show its distinctiveness from other softwares. This
SYSTEM.
10
CHAPTER 2
LITERATURE SURVEY
11
2.1 HISTORY
The blueprint for IVR began in 1941, when Bell System developed a new tone
dialing methodology. Bell unveiled the first telephone that could dial area codes
using Dual Tone Multi Frequency DTMF technology at the Seattle World Fair in
Despite the fact that more companies began using the system in the 1970s to
automate tasks in call centers, the technology was still costly and complicated
which made for low market penetration. However, by the 1980s a number of new
competitors entered the market and uptake of IVR technology started to increase.
When call centers began to migrate to multimedia contact centers in the late 90's,
Integration (CTI) with IVR systems. IVR became vital for call centers deploying
universal queuing and routing solutions and acted as an agent which collected
12
Having remained technologically static since its development in the 1980s, speech
recognition started to become more common and cheaper to deploy. This was due
from propriety code to the VXML standard. The introduction of the VXML
standard also simplified the integration process between IVR systems and any back
end hosts.
• IVR systems are typically used to service high call volumes, reduce cost and
• Call centers use IVR systems to identify and segment callers. The ability to
Information can be fed to the caller allowing choices such as: wait in the
will allow the IVR system to look up the caller line identification (CLI) on a
network database and identify the caller. This is currently accurate for about
13
80% of inbound calls. In the cases where CLI is withheld or unavailable, the
password. The use of DNIS will ensure that the correct application and
• The use of IVR and voice automation enables a company to improve its
customer service and lower its costs, due to the fact that callers’ queries can
be resolved without the cost of a live agent who, in turn, can be directed to
deal with specific areas of the service. If the caller does not find the
transferred to an agent who can deal with them directly through CTI
integration. This makes for a more efficient system in which agents have
retention, up selling, cross selling and issue resolution. This way, the
opposed to dealing with basic enquiries that require yes/no responses, such
effective job.
14
• IVR also enables customer prioritisation. In a system whereby individual
platinum card holder, the service will automatically prioritise the individuals
call and, in the case of a platinum card holder, move them to the front of the
calling queue.
• Voice-Activated Dialers
are used in many hospitals and large businesses to reduce the caller waiting
hospital staff and transfer the inbound call to the paged person.
The largest installed IVR platforms are used for applications such as tele-
voting on TV game shows such as Pop Idol and Big Brother which can
generate enormous call spikes. Often the network provider will have to
logos)
o Weather forecasts
• Clinical Trials
organizations to conduct clinical trials and manage the large volumes of data
and their responses will be logged into a database and possibly recorded at
• Outbound Calling
16
IVR systems can be used for outbound calls, as IVR systems are more
intelligent than Dialler systems, they can recognise different line conditions.
o Fax Tone (IVR can leave a Fax Message based upon a TIFF Image)
o Answer (IVR can tell the customer who is calling and ask them to wait for
an agent)
IVR uses Call Progress Detection to monitor Line conditions, and report to
2.4 CRITICISM
IVR is sometimes criticized as being unhelpful and difficult to use due to poor
design and lack of appreciation of the caller's needs.[4] Some callers object to
human respondent. A properly designed IVR application should provide the caller's
17
companies use IVR to reduce operational costs and will not offer similar services
using agents. Such services tend to frustrate customers who feel that their right to
speak to an agent is being restricted. Companies that deploy such services tend to
ignore customer opinion. Such services are used in debt recovery and giveaways
18
CHAPTER 3
GENERAL OVERVIEW
OF
IVRS
19
3.1 What is IVR System ?
a computer to detect voice and keypad inputs. IVR technology is used extensively
speech recognition, after which they can service their own enquiries by following
generated audio to further direct users on how to proceed. IVR systems can be used
to control almost any function where the interface can be broken down into a series
support lines, IVR systems generally scale well to handle large call volumes.
It has become common in industries that have recently entered the telecom
Attendant and IVR are distinct and mean different things to traditional telecom
professionals, whereas emerging telephony and VoIP professionals often use the
20
term IVR as a catch-all to signify any kind of telephony menu, even a basic
automated attendant.
DTMF signals (entered from the telephone keypad) and natural language speech
Other technologies include the ability to speak complex and dynamic information
(TTS). TTS is computer generated synthesized speech that is no longer the robotic
voice generally associated with computers. Real voices create the speech in tiny
fragments that are spliced together (concatenated) before being played to the caller.
4. Hosted IVR
21
more complex voicemail experience to the caller. For example, the IVR could ask
if the caller wishes to hear, edit, forward or remove a message that was just
recorded.
An automatic call distributor (ACD) is often the first point of contact when calling
many larger businesses. An ACD uses digital storage devices to play greetings or
announcements, but typically routes a caller without prompting for input. An IVR
can play announcements and request an input from the caller. This information can
be used to profile the caller and route the call to an agent with a particular skillset.
skill.)
identifying the needs of the caller. Information can be obtained from the caller
numbers from the IVR are often compared to caller ID data for security reasons
and additional IVR responses are required if the caller ID data does not match the
account record.
IVR call flows are created in a variety of ways. A traditional IVR depended upon
22
are structured similar to WWW pages, using VoiceXML[1], CCXML[2], SRGS[3],
allows a Web server to act as an application server, freeing the developer to focus
on the call flow. It was widely believed that developers would no longer require
dialogue. This is the difference between a good user experience and IVR hell.
Higher level IVR development tools are available in recent years to further
simplify the application development process. A call flow diagram can be drawn
with a GUI tool and the application code (VoiceXML or SALT) can be
mechanisms for software integration, such as HTTP interface to web site and Java
based on (a) the call-originator input, (b) information received from a database,
and (c) information in the incoming call, such as the time of day.
ARUs increase the number of information calls handled and to provide consistent
23
3.3 BLOCK DIAGRAM
TELEPHONE
LINE
DTMF DECODER PC
SERIAL
VOLTAGE PORT
CONVERTER
PERSONAL
MICRO COMPUTER
RING DETECTOR
CONTROLLER
PC
SPEAKER
OUT
ON/OFF
HOOK
SIMULATOR
INTERFACING
CIRCUIT
24
3.4 COMPONENTS
T h e a b o v e Bl o c k d i a g r a m c o n s i st o f fo l l o wi n g B l o c k s
1 . T e l e p h o n e s e c t io n
2 . D T M F De c o d e r
3 . R in g D e t e c to r
4 . O N / O F F h o o k S imu l a t o r
5 . M i c r o c o n t r o l le r
6 . V o lt a g e c o n v e rt e r
7 . P C S e ri a l P o r t
8 . P e r so n a l Co mp u te r ( P C )
3 .5 EXPLANATION
3 . 5 . 1 . T EL EP H O NE
I n v e n t e d b y Be ll a n d h i s a s s i s t a n t , T h o ma s A. W a t so n , t h e
t e l e p h o n e ma r k e d a s i g n i fi c a n t d e v e l o p m e n t in t h e h is t o ry o f
e l e c tr i c a l c o m m u n i c a t io n sy s te ms . In the e a rl i e s t magneto-
t e l e p h o n e o f 1 8 7 6 , t h e s p e a k e r’ s v o i c e wa s c o n v e r t e d i n t o
e l e c tr i c a l e n e rg y p a t te rn s t h a t c o u l d b e s e n d o v e r r e a s o n a b l y l o n g
d i st a n c e s o v e r w i r e s to a r e c e i v e r, w h i c h wo u ld c o n v e rt t h e s e
e n e rg y p a t t e r n s b a c k i n t o th e o r i g i n a l s o u n d w a v e s fo r t h e
l i st e n e r.
25
O u t g o i n g Ca l l
The dial pad, also called keypad or touch-tone pad, is used to dial
t e l e p h o n e n u mb e r s a s w e l l a s i n t e r a c t wi t h v o ic e p ro c e s si n g
s y st e m s u c h a s a v o i c e ma il a n d i n t e r a c ti v e v o i c e r e sp o n se ( IV R ).
T h e a d d r e s s s i g n a l i n g f o r a n o u t g o i n g c a l l c a n be a c c o mp l i sh e d
b y 3 d i f f e r e n t me t h o d s: p u l s e d i a l ( r o t a r y ) , re a l to n e mu l t i p l e
f r e q u e n c y ( D T M F ) , o r mu lt i fr e q u e n c y ( M F )
M u lt i - F r e q u e n c y (M F ) :
I t h o w e v e r b e c a me m o re p o p u l ar w it h t h e i n t ro d u c t io n o f d u a l
t o n e m u l ti p l e fr e q u e n c y ( DT M F ) mo d e o f d i a l i n g . S in g le c h i p
D T M F e n c o d e r s/ d e c o d e r s a re a v a i l a b l e t o d a y , w h i c h ma k e t h e
d e s i g n i n g su c h sy s te ms e a sy a n d r e l ia b l e
M u l t i- f re q u e n c y si g n a l i n g i s s i mi la r t o D T M F a n d i s u s e d o n
t ru n k c i r c u i t, p a y te le p h o n e s . Co m b i n a t i o n o f t wo t o n e s i s u s e d t o
t r a n s m it s i g n a l i ng i n fo r ma t i o n , M F a n d D T M F si g n a l s a r e mo r e
r e l i a b l e a n d c o n s i d e r a b l y fa st e r th a n p u l se d i a l . In b o t h me th o d s,
d i g i t s a r e t r a n s m it t e d a t t h e r a t e of a b o u t 7 d i gi t s p e r s e c o n d .
26
I n c o mi n g c a l l
W h e n a te le p h o n e se t i s c a l l e d , t h e l o c a l e x c h a n g e g e n e ra t e s a
h i g h ri n g v o l ta g e o f a b o u t 9 0 -1 0 5 Vo l t s AC wi t h a f r e q u e n c y o f
2 0 H z su p e ri mp o se d o v e r t h e mi n u s ( - ) 4 8 V o l t DC . A c a p a c i t o r i n
t h e p h o n e p a s s e s t h e AC b u t b l o c k D C. U p o n d e t e c t i n g t h e AC
v o l t a g e , t h e p h on e p r o v i d e s a n a u d ib le s ig n a l t h a t a l t o s t h e u s e r
of an i n c o mi n g c a l l. Each telephone se t p ro v id e a ringer
e q u iv a l e n t n u mb e r ( R E N) a s d e f i n e d wi t h i n F C C p a r t 6 8 a n d E I A
R S -4 7 0 . T h e RE N i s u se d t o e n s u r e t h a t t h e l o c a l e x c h a n g e c a n
provide the correct amount of power re q u i re d t o r in g the
t e l e p h o n e . It d e s c r i b e s th e fr e q u e n c y r a n g e , p o w e r r a n g e , a n d
b i a s v o lt a g e ra n g e o f t h e t e l e p h o n e s e t . Wh e n t h e p h o n e i s
a n s we r e d , D C c u r r e n t b e g i n s t o fl o w in t h e l o o p . T h e l o c a l
e x c h a n g e t h e c ur r e n t fl o w a n d r e m o v e s t h e s u p e r i mp o s e d r i n g
v o l t a g e . T h e -4 8V o l t s DC th a t i s a l w a y s o n t h e li n e o p e r a te s t h e
t e l e p h o n e wh e n it i s b e in g u s e d .
3 . 5 . 2 DT M F S I G N A L I NG
D T M F st a n d s fo r D u a l T o n e M u l t i p l e F r e q u e n c y . It i s a t o n e
c o n si st i n g of t wo fr e q u e nc i e s superimposed. Individual
f r e q u e n c i e s a re c h o se n su c h t h a t i t i s e a sy t o d e s i g n fi l t e r s a n d
e a sy to t ra n s m it th e t o n e s t h r o u g h a te l e p h on e l i n e h a v i n g
b a n d wi d t h o f a p p r o x i ma t e ly 3 . 5 k Hz . DT M F wa s n o t i n t e n d e d t o
b e u s e d fo r d a t a t r a n s f e r , it w a s me a n t t o b e u s e d f o r s e n d i n g t h e
27
c o n tr o l s i g n a l s a l o n g t h e te l e p h on e l i n e . W i t h s t a n d a r d d e c o d e r s
i t i s p o ss i b l e t o s e n d 1 0 b e e p s p e r se c o n d i . e . , f iv e b i t s p e r
s e c o n d . DT M F st a n d a rd s p e c i f i e s 5 0 ms to n e s a n d 6 0 0 ms d u r a t i o n
b e t w e e n t wo s u c c e s s i v e t o n e s .
697 Hz 1 2 3 A
770 Hz 4 5 6 B
852 Hz 7 8 9 C
941 Hz * 0 # D
G e ne r a t i n g D T M F
D T M F si g n a ls c a n b e g e n e r a t e d t h r o u g h d e d i c a t e d I C s o r b y u si n g
R C n e t w o rk s c o n n e c t e d t o a mi c r o p r o c e ss o r. M T 8 88 0 i s a n
e x a mp l e o f a d e di c a t e d IC . Bu t g e tt i n g t h e l a t t e r me t h o d w o rk i s
a b i t d i ff i c u l t i f h i g h a c c u r a c y i s n e e d e d . T h e c ry s t a l fr e q u e n c y
n e e d s t o b e s a c r i fi c e d fo r a n o n s t a n d a r d c y c l e le ng t h . He n c e t h i s
28
me th o d is u se d fo r si mp l e a p p l i c a t i o n s. M o s t o ft e n , a P I C m ic ro
c o u ld b e u se d fo r t h e a b o v e p u rp os e .
D e c o d i n g DT M F
D e t e c t i n g DT M F w it h s a t is fa c t o r y p r e c i s i o n i s a h a rd t h i n g .
O f t e n , a d e d ic a t e d I C su c h a s M T 8 8 7 0 i s u s e d fo r t h i s p u r p o s e . It
u s e s t wo 6 th o r d e r b a n d -p a s s fi l t e r s u si n g s wi tc h e d c a p a c i to r
f il t e r s a n d i t s u p p r e s s e s a n y h a r mo n i c s. H e n c e t h e y c a n p r o d u c e
pretty good sine waves fr o m d i s t o rt e d in p u t . Hence it is
p r e f e r re d . A g a i n mi c r o p r o c e s so r s c a n a l so b e u s e d , b u t t h e ir
a p p li c a t io n i s li mi t e d .
I t i s u s e d t o d e t e c t t h e ri n g s i g n a l fro m t h e t e l e p h o n e l i n e . It
g i v e s o u t a l o g i c a l o u t p u t to t h e mi c r o c o n t ro l l e r . A n o p t o c o u p l e r
M C T 2 E i s u s e d a s ri n g d e te c t o r .
I f r in g i s p re se n t – l o g i c 0
E ls e - l o g ic 1
N o r ma l t i me v o lt a g e i n te l e p h o n e l i n e = 4 8 V d . c
O F F h o o k v o l ta ge - 1 2 V d . c
R in g si g n a l v o l t a g e - 7 5 V a . c
29
3 .5 .4 . ON– OFF HOOK SIMULA TOR
I t i s u s e d to p i c k u p t h e t e l e p h o n e e l e c t r o n i c a l l y . A 1 2 v o l t d . c
s i g n a l i s o b t a in e d b y p la c i n g a re s i st o r a c r o s s th e te le p h o n e l i n e .
I t i s u s e d t o d e t e c t wh e t h e r t h e H a n d se t i s i n O N h o o k c o n d i t i o n
o r O F F h o o k c o n d it i o n s o a s t o se n d th e in fo r ma t i o n t o t h e
mi c r o c o n tr o l l e r . A 1 2 V r e l a y i s u s e d fo r t h e p u rp o s e .
3 .5 .5 . MICR OC ON TROLLE R
M i c r o c o n t ro l l e r s a r e n o t a s w e l l k n o wn t o t h e g e n e r a l p u b l ic , o r
t o m a n y in t h e te c h n i c a l c o m m u n i t y , a s a r e t h e m o r e g l a m o ro u s
mi c r o p r o c e s so r. T h e p u b l i c i s, h o w e v e r, v e r y w e ll a w a r e t h a t
“ s o me t h i n g ” i s r e s p o n s ib l e fo r a l l o f th e s ma rt VC R s , c lo c k
r a d i o s, w a sh e r s a n d d r y e r s, v i d e o g a me s , t e l e p h o n es , m i c ro wa v e s,
T Vs , a u t o mo b i l e s , t o y s , v e n d i n g ma c h in e s, c o p ie r s , e l e v a t o r s,
i ro n s, a n d a m y ri a d o f o t h e r a r t ic le s t h a t a r e i n t e l l ig e n t a n d
“ p r o g r a mm a b l e ” . C o mp a n ie s are a l so aware that being
30
c o m p e t i ti v e i n th i s a g e o f t h e m i c r o c h i p r e q u ir e s t h e ir p ro d u c t s,
o r t h e ma c h i n e r y t h e y u s e t o ma k e t h o se p r o d u c t s , t o h a v e so m e
“ s ma r t s” .
3 .5 .6 . VOLTA GE C ON VERTER
T h i s i s u s e d t o co n v e rt T T L lo g i c v o l t a g e in to R S 2 3 2 v o l t a g e .
T T L L og i c : lo g ic 1 = 5 v
lo g i c 0 = G N D
RS232 : l og i c 1 = + 9 v
lo g i c 0 = - 9 v
I C M A X2 3 2 i s u se d a s v o l t a g e c o n v e rt e r . An e x t e rn a l c r y st a l
o s c i ll a to r i s u s e d fo r i t s o p e ra ti o n.
3 .5 .7 . PC S ERIAL PORT
T h i s p o rt i s u se d to g e t d a t a fr o m m i c ro c o n t ro ll e r t o p e r s o n a l
c o m p u t e r i n s e r ia l m a n n e r . Al l IB M P C a n d c o mp a t i b l e c o m p u t e r s
a r e t y p i c a l l y e q u ip p e d wi t h t wo se ri a l p o r t s a n d o n e p a r a l l e l p o rt .
A l t h o u g h t h e se t wo t y p e s o f p o rt s a r e u s e d fo r c o m m u n i c a t i n g
w i t h e x t e rn a l d e vi c e s , t h e y wo r k i n d i f fe r e n t wa y s.
31
A p a r a ll e l p o r t s e n d s a n d r e c e i v e s d a t a e i g h t b i t s a t a t i me o v e r 8
s e p a r a t e wi re s. T h i s a l l o w s d a ta t o b e t r a n s f e r r e d v e ry q u i c k l y;
h o w e v e r , th e c a bl e r e q u i r e d i s mo r e b u l k y b e c a u se o f th e n u mb e r
o f i n d i v i d u a l w i r e s i t mu st c o n ta i n . P a r a l l e l p o r t s a re t y p i c a l l y
u s e d t o c o n n e c t a P C t o a p ri n t e r a n d a re r a r e l y u s e d fo r m u c h
e l s e . A s e r i a l p o rt s e n d s a n d r e c e i v e s d a t a o n e b i t a t a t i me o v e r
o n e w ir e . W h i le i t t a k e s e ig h t t i me s a s l o n g t o t r a n s fe r e a c h b y t e
o f d a t a t h i s w a y , o n l y a fe w w ir e s a r e re q u i re d .
I n f a c t , t wo - w a y ( fu ll d u p l e x ) c o m mu n i c a t i o n s i s p o s s ib le wi t h
o n l y t h r e e se p a ra t e wi r e s - o n e t o s e n d , o n e t o r e c e i v e , a n d a
c o m mo n si g n a l g ro u n d wi r e .
T h i s i s u s e d to i n te r f a c e t h e a u d i o si g n a l fr o m th e c o mp u t e r t o
t h e t e l e p h o n e l in e
3 .6 .1 MICROCONTROLL ER
T h e AT 8 9 C 2 0 5 1 i s a l o w -v o lt a g e , h i g h - p e r fo r m a n c e C M O S 8 -b i t
mi c r o c o m p u t e r wi t h 2 Kb y t e s o f F l a s h p ro g ra m ma b le a n d e r a s a b l e
r e a d o n l y me mo r y ( P E R OM ) . T h e d e v i c e is ma n u fa c t u r e d u s i ng
32
A t me l ’ s h i g h d e n s it y n o n v o l a t i l e m e mo r y t e c h n o l o g y a n d i s
c o m p a t i b l e wi t h th e in d u st r y st a n d a rd M C S -5 1 i n s tr u c ti o n s e t a n d
p i n o u t . By c o mb i n i n g a v e r sa t il e 8 - b i t C P U w i th F l a s h o n a
mo n o li t h i c c h ip , the A t me l AT89C2051 is a p o w e r fu l
mi c r o c o m p u t e r which provides a h ig h ly fl e x i b l e and c o st
e f f e c t i v e so lu ti on t o ma n y e mb e d d e d c o n tr o l a p p l ic a ti o n s .
T h e AT 8 9 C 2 0 5 1 p ro v id e s t h e fo l l o wi n g st a n d a r d f e a t u r e s : 2
K b y te s o f F l a s h , 1 2 8 b y t e s o f R A M , 1 5 I/ O li n e s, t wo 1 6 -b i t
t i me r / c o u n t e r s, fiv e v e c t o r tw o - le v e l in te rr u p t a r c h i t e c t u r e , a fu l l
duplex se r i a l port, a p r e c i s io n analog c o mp a r a t o r , o n - c h ip
o s c i ll a to r a n d c lo c k c i r c u i t ry .
I n a d d i t i o n, th e A T 8 9 C 2 0 5 1 i s d e si g n e d w i th s t a t ic lo g ic fo r
o p e r a t i o n d o w n to z e ro f re q u e n c y a n d su p p o rt s t w o s o ftw a r e
s e l e c t a b l e p o we r s a v i n g mo d e s. T h e I d l e M o d e s t o p s t h e C P U
w h il e a ll o w in g t h e R A M , t i me r / c o u n t e r s, se ri a l po r t a n d i n te rr u p t
s y st e m t o c o n t i nu e f u n c t i o n i n g. T h e P o we r Do w n M o d e s a v e s t h e
R AM c o n t e n t s b u t f r e e z e s th e o s c i l l a t o r d i sa b li ng a l l o t h e r c h i p
f u n c t i o n s u n ti l t he n e x t h a rd w a r e r e se t .
3 . 6 . 1 . 1 P i n C o n f ig u r a ti o n
T h e mi c r o c o n t r o l l e r A T 8 9 C 2 0 5 1 i s a v a il a b le i n 2 0 p i n D u a l
I n l in e P a c k a g e (D I P) .
33
F i g u r e . 3 . 5 P i n d ia g r a m o f AT 8 9 C 2 0 5 1
3 .6 .2 DTMF Decod er
T h e M T 8 8 7 0 i s a s i n g l e c h i p D T M F r e c e iv e r i n c o rp o r a t i n g
s w i tc h e d c a p a c i t o r f i lt e r te c h n o l o g y a n d a n a d v a n c e d d i g i t a l
c o u n ti n g / a v e r a g i n g a l g o r it h m f o r p e r i o d me a s u r e me n t. T h e
f u n c t i o n a l b l o c k d i a g r a m o f M T 8 87 0 i s s h o wn i n t he b e l o w fi g u r e
d e p ic t s t h e i n t e rn a l wo r k i n g o f t hi s d e v i c e .
34
Fi g u re . 3 . 8 F u n c t io n a l d ia g r a m o f IC M T 8 8 7 0
T h e DT M F si g n a l i s fi r s t b u f fe re d b y in p u t o p - a mp t h a t a l l o w s
a d j u s t me n t g a i n a n d c h o i c e o f in p u t c o n fig u ra ti o n . T h e i n p u t
s t a g e i s f o l l o w e d b y a l o w p a s s R C a c t i v e f i lt e r , w h i c h p e r f o r m s
a n t a l i a s in g fu n c ti o n . D i a l t o n e a t 3 5 0 a n d 4 4 0 H z i s t h e n r e j e c t e d
b y a 3 r d o r d e r s w i t c h e d c a p a c i t o r n o tc h fi l t e r. Th e s i g n a l i s s t il l
i n it s i n d i v i d u a l c o mp o n e n t s b y t w o 6 t h o r d e r swi t c h e d c a p a c it o r
b a n d p a s s fi l t e r. E a c h c o m p o n e n t s mo o t h e d b y a n o u t p u t fil t e r
a n d sq u a re d b y a h a rd l i mi t i n g c o m p a r a t o r. T h e t w o r e su l t i n g
r e c t a n g u la r w a v e f o r ms a r e t h e n a p p l ie d to a d i g i t al c i r c u i t , w h e r e
35
a c o u n t i n g a l g o r i th m me a s u r e s a n d a v e r a g e s t h e r e p e r i o d s . A n
a c c u r a t e r e fe r e n c e c l o c k i s d e r iv e d f r o m a n in e x p e n s i v e e x t e r n a l
3 . 5 8 M H z c r y st a l .
T h e t i m e re q u i r e d t o d e t e c t a v a l i d t o n e p a i r t d P i s a fu n c t io n o f
d e c o d e a l g o r it hm , t o n e f r e q u e n c y , a n d t h e p re v i o u s st a t e o f t h e
d e c o d e d l o g i c . E st (e a r ly , s t e e r i n g o u t p u t ) i n d i c a t e s t h a t t w o
t o n e s o f v a l i d f re q u e n c y h a v e b e e n d e t e c te d a n d i n i t i a t e s a n RC
t i mi n g c i r c u i t . If b o t h t o n e s a r e p r e s e n t fo r a mi n i mu m g u a r d
t i me , d e t e r mi n e d b y a n e x t e rn a l R C n e t w o rk , t h e D T M F s i g n a l i s
d e c o d e d a n d t h e r e s u l t in g d a t a l a t c h e d o n t h e o u t pu t r e g i st e r. T h e
d e l a y e d st e e ri n g o u t p u t ( st D ) i s r a i se d to i n d i c a t e t h a t n e w d a t a i s
a v a i l a b le . ( T h e o u t p u t c o r r e s p o n d i n g t o e a c h k e y p r e s s e d i s
s h o wn i n t h e t ru th t a b le )
3.6.2.1Tone detection
A f t e r re c e i v i n g a DT M F t o n e t h e D T M F d e c o d e r (M T 8 8 7 0 ) p l a c e s
t h e c o r r e s p o n d i ng b i n a r y n u mb e r o n i t s o u t p u t ( S tD ) g o e s h i g h t o
s t a te th a t n e w d a t a i s a v a i l a b l e . T h e d e t e c t i o n o f t h e d e l a y e d
s t e e ri n g o u t p u t i s to t h e d u r a t i o n o f t h e re c e i v e d D T M F re c e i v e r
has already been explained.
36
F i g u r e . 3 . 9 Pi n D i a g r a m o f I C M T8 8 7 0
3 . 6 . 2 . 3 F u n c t io na l D e s c r i p ti o n
T h e MT 8 8 7 0 D/ M T 8 8 7 0 D- 1 mo n o l i t h ic D T M F re c e i v e r o f f e r s
s m a l l s i z e , l o w p o we r c o n s u mp t i o n a n d h i g h p e r f o r m a n c e . I t s
a r c h i t e c tu r e c o n s i st s o f a b a n d s p l i t fi lt e r se c t io n , w h i c h
s e p a r a t e s t h e h i gh a n d l o w g r o u p t o n e s , fo l l o we d b y a d i g i t a l
c o u n ti n g s e c t i o n w h i c h v e ri fi e s t h e f re q u e n c y a n d d u ra t io n o f
t h e re c e i v e d t o n e s b e fo r e p a s s in g t h e c o r re sp o n d in g c o d e t o
the output bus.
F i lt e r S e c t io n
S e p a ra ti o n o f t h e l o w- g r o u p a n d h i g h g r o u p t o n e s is a c h i e v e d b y
a p p ly i n g t h e D T M F s i g n a l t o t h e i n p u t s o f t w o s i x th -o r d e r
s w i tc h e d c a p a c i to r b a n d p a s s fi l t e r s, t h e b a n d w i d th s o f w h i c h
37
c o r r e sp o n d t o t h e l o w a n d h i g h g ro u p fr e q u e n c i e s . T h e f il t e r
s e c t i o n a l s o i n c o r p o r a t e s n o t ch e s a t 3 5 0 a n d 4 4 0 H z fo r
e x c e p t i o n a l d i a l to n e r e je c t i o n ( s e e F i g u r e 3 ). E a c h fi lt e r o u t p u t
i s fo l l o w e d b y a s i n g l e o r d e r s wi t c h e d c a p a c i t o r f il t e r s e c t i o n
w h ic h s m o o t h e s t h e s i g n a l s p ri o r t o l i mi t i n g . L i mi ti n g i s
p e r f o r m e d b y h ig h -g a in c o mp a ra to r s wh i c h a r e p ro v id e d wi t h
h y s te re si s to p r e v e n t d e t e c t i o n o f u n w a n t e d lo w - le v e l s ig n a l s.
T h e o u t p u t s o f t h e c o mp a r a t o r s p r o v i d e fu ll r a i l l o g i c s w i n g s a t
t h e fr e q u e n c ie s of th e i n c o mi n g D T M F si g n a ls .
D e c o d e r Se c t io n
F o l l o wi n g th e fi lt e r s e c ti o n i s a d e c o d e r e mp l o y i n g d i g i t a l
c o u n ti n g t e c h n i q u e s t o d e te r m in e th e F r e q u e n c i e s o f t h e i n c o mi ng
t o n e s a n d t o v e r i fy t h a t t h e y c o r re sp o n d t o s t a n d a rd DT M F
f r e q u e n c i e s. A c o m p le x a v e r a g i ng a l g o r i t h m p r o te c t s a g a i n st t o n e
s i m u la t io n b y e x t r a n e o u s si g n a l s s u c h a s v o i c e w h i l e p r o v i d i n g
t o l e r a n c e t o s ma l l f re q u e n c y d e v i a t i o n a n d v a ri a t i o n s . T h i s
a v e ra g i n g a l g o r i th m h a s b e e n d e v e lo p e d t o e n s u r e a n o p t i m u m
c o m b i n a t i o n o f i m m u n i ty t o t a l k - o ff a n d t o l e r a n c e t o th e p r e se n c e
o f i n t e r fe r in g f r e q u e n c ie s (t h i r d to n e s) a n d no i se . W h e n t h e
d e t e c t o r r e c o g n iz e s t h e p r e se n c e o f t wo v a li d t o n e s ( t h i s i s
r e fe rr e d to as the “ s ig n a l c o n d i ti o n ” in s o me i n d u st r y
s p e c i f ic a t i o n s) th e “E a r l y S t e e r i n g ” ( E S t ) o u t p u t wi l l g o t o a n
a c ti v e st a te . An y su b se q u e n t l o s s o f si g n a l c o n di t i o n w i ll c a u s e
E S t to a s s u me a n i n a c ti v e st a t e . T h e st e e ri n g c ir c u i t w o rk s i n
38
r e v e r se t o v a li d a te t h e i n t e r d i g i t p a u se b e t w e e n s i g n a l s. T h u s , a s
w e l l a s r e j e c ti n g s i g n a l s to o sh o r t t o b e c o n si d e re d v a l i d , t h e
r e c e iv e r wi l l t o l e r a t e s i g n a l i n t e r r u p t io n s ( d r o p o u t ) t o o sh o r t t o
b e c o n si d e r e d a v a li d p a u se . T h i s fa c i l it y , t o ge t h e r wi t h t h e
c a p a b i l it y o f se l e c t in g t h e s t e e r i n g t i m e c o n s ta n t s e x t e r n a l l y,
a l l o w s t h e d e si g n e r to t a i l o r p e r fo r m a n c e t o me e t a wi d e v a r i e t y
o f sy s te m r e q u i r e me n t s .
3 . 6 . 2 . 4 G u a r d T i m e A d j u s t me n t
I n ma n y s it u a ti o n s n o t r e q u ir i n g s e l e c t i o n o f to n e d u r a t i o n a n d
i n t e r d i g i t a l p a u s e , t h e s i m p l e st e e r i n g c i r c u i t sh o wn i n F i g u r e 4
i s a p p li c a b l e . Co m p o n e n t v a l u e s a r e c h o s e n a c c o rd i n g t o t h e
formula:
t R E C = t D P + t GT P
t I D= t D A + t G T A
T h e v a lu e o f tD P i s a d e v i c e p a r a me t e r a n d t RE C i s t h e
mi n i mu m s i g n a l d u r a t i o n t o b e r e c o g n i z e d by t h e re c e i v e r .
D i f fe re n t st e e ri n g a rr a n g e me n t s ma y be used to select
i n d e p e n d e n t l y t h e g u a rd t i m e s fo r to n e P r e s e n t ( t G T P ) a n d t o n e
absent (t GT A ). This ma y be necessary to me e t sy s t e m
s p e c i f ic a t i o n s wh i c h p l a c e b o t h a c c e p t a n d r e j e c t l i m it s o n b o t h
t o n e d u r a t i o n a n d i n t e r d i g i t a l p a u se . Gu a rd t i me a d j u s t m e n t a l s o
a l l o w s t h e d e s i g n e r t o ta il o r s y st e m p a ra m e t e r s s u c h a s t a l k o ff
and n o i se i mm u n i t y . In c re a si n g tREC i mp r o v e s t a l k - o ff
39
p e r f o r m a n c e s i n c e i t r e d u c e s t h e p ro b a b i l it y t h a t to n e s s i m u l a t e d
b y sp e e c h w il l ma i n t a i n si g n a l c o n d i t i o n l o n g e n o u g h t o b e
r e g i st e r e d . A lt e r n a t i v e l y , a r e l a t i v e l y sh o rt t RE C w i th a l o n g t D O
w o u ld b e a p p ro p r i a t e fo r e x t r e me l y n o i sy . E n v ir o n m e n t s su c h a s
f a st a c q u i si t i o n ti m e a n d i mmu n it y t o t o n e d r o p - o ut s a r e r e q u i r e d .
3.6.2.6 Features
• C o mp l e t e DT M F R e c e i v e r r e c o m me n d e d fo r mo s t a p p li c a t io n s,
l e a v in g R t o b e se l e c t e d b y t h e d e s i g n e r
• L o w p o w e r c o n s u mp ti o n
• I n t e r n a l g a i n s e t t in g a mp l i fi e r
• C e n t r a l o f fi c e q u a l i ty
• P o we r - d o wn mo d e
• I n h i b i t mo d e
• B a c k wa r d c o m p a t i b l e wi t h M T 8 87 0 C /M T 8 8 7 0 C - 1
3 . 6 . 2 . 7 Ap p l i c a t i o n s
• P a g i n g sy s t e ms
• R e p e a t e r sy s te ms / m o b i le ra d io
• C r e d i t c a r d sy s t e ms
• Remote control
• Personal computers
40
• T e le p h o n e a n sw e ri n g m a c h i n e
Th e M A X2 2 0 – M A X2 4 9 fa mi l y of line d r i v e r s/ r e c e i v e r s is
i n t e n d e d fo r a l l E I A /T I A- 2 3 2 E a n d V . 2 8 / V. 2 4 c o m mu n i c a t io n s
i n t e r fa c e s , p a rt i c u l a r l y a p p l i c a t i on s w h e r e ±1 2 V i s n o t a v a i l a b l e .
T h e s e p a r t s a r e e s p e c i a l l y u se fu l i n b a t t e r y - p ow e r e d s y st e m s ,
s i n c e t h e i r lo w - p o w e r sh u t d o w n m o d e r e d u c e s p o w e r d i s si p a t i o n
t o l e ss t h a n 5 µ W .
Feature
• O p e r a t e fr o m S i n g l e + 5 V P o w e r S u p p l y
• L o w - P o we r R e c e i v e M o d e i n S h u td o w n
• M e e t A ll E I A / T I A -2 3 2 E a n d V. 2 8 S p e c i f i c a t i o n s
• M u l t ip le D r iv e r s a n d R e c e iv e r s
• 3 - S t a t e D r i v e r a n d R e c e i v e r O u tp ut s
41
3 . 6 . 3 . 1 P IN Di a gr a m
F i g u r e 3 . 10 P i n D ia g r a m o f M A X2 3 2
S i n c e t h e R S 2 3 2 i s n o t c o mp a t i bl e wi t h t o d a y ’ s m i c ro p ro c e s s o r s
a n d m ic ro c o n t ro l l e r s, w e n e e d a l i n e d r i v e r ( v o l t a g e c o n v e r t e r ) t o
c o n v e r t th e R S 2 3 2 ’ s s i g n a l s to T T L v o lt a g e l e v e l s t h a t w i l l b e
a c c e p t a b l e t o t h e 8 0 5 1 ’s T x D a n d Rx D p i n s. On e e x a m p le o f s u c h
a c o n v e r t e r i s M A X2 3 2 f r o m M a x i m C o rp . T h e M A X 2 3 2 c o n v e r t s
f r o m R S 2 3 2 v o l ta g e l e v e ls to T T L v o lt a g e le v e l s, a n d v i c e v e r s a .
O n e a d v a n t a g e o f t h e M A X2 3 2 c h i p i s t h a t i t u se s a + 5 V p o we r
s o u rc e wh i c h i s th e sa m e a s t h e s o u r c e v o l t a g e fo r t h e 8 0 5 1 .
42
3 . 3 . 2 F u n c t io n a l D ia g r a m o f M A X 2 3 2
F i g u re 3 . 1 1 F u n c ti o n a l D i a g r a m o f M AX 2 3 2
T h e M A X2 3 2 h a s t w o se t s o f l i n e d r i v e r s fo r t r a n s f e r ri n g a n d
r e c e iv i n g d a ta , a s s h o wn i n F i g u re 1 0 -7 . T h e l i n e d r i v e r s u s e d fo r
T x D a re c a l l e d T 1 a n d T 2 wh i l e t h e l i n e d ri v e r s f o r R x d a r e
d e s i g n a t e d a s R 1 a n d R2 . In ma n y a p p l ic a t i o n s o n l y o n e o f e a c h
i s u se d fo r e x a m p le , T 1 a n d R 1 a r e u se d t o g e t h e r f o r T x D a n d
43
R x D o f t h e 8 0 5 1 a n d th e se c o n d s e t i s l e ft u nu s e d . N o t ic e i n
M A X 2 3 2 t h a t t h e T 1 li n e d ri v e r ha s a d e s ig n a t i o n o f T 1 i n a n d T 1
o u t o n p i n n u m b e r s 1 1 a n d 1 4 , r e s p e c t iv e l y . T h e T 1 in p i n i s t h e
T T L si d e a n d i s c o n n e c t e d to T x D o f t h e mi c r o c o n t r o l le r, wh i l e
T 1 o u t i s t h e R S 2 3 2 si d e t h a t i s c o n n e c t e d to t h e R x D p i n o f t h e
R S 2 3 2 DB c o n n e c t o r.
T h e R1 l i n e d ri ve r h a s a d e s i g n a ti o n o f R1 i n a n d R i o u t o n p i n
n u mb e r s 1 3 a n d 1 2 , r e sp e c t i v e l y . T h e R1 i n ( p in 1 3 ) i s t h e R S 2 3 2
s i d e th a t i s c o n ne c te d to t h e T x D p in o f t h e R S 2 32 DB c o n n e c to r,
a n d R 1 o u t ( p i n 1 2 ) i s t h e T T L s id e th a t i s c o n n e c t e d t o t h e R x D
p i n o f t h e mi c r o c o n tr o l l e r . S e e f i g u r e 1 0 -7 . No ti c e t h e n u l l
mo d e m c o n n e c t i on wh e re R x D fo r o n e i s T x D fo r th e o t h e r .
M A X 2 3 2 r e q u i r e s f o u r c a p a c i t o r s r a n g i n g f ro m 1 t o 2 2 F . T h e
mo s t wi d e l y u s e d v a l u e fo r th e se c a p a c it o r s i s 2 2 n f.
3 . 3 . 3 AP P L I C A T I O N S
• P o r ta b l e Co mp u t e r s
• L o w - P o we r M o d e ms
• I n t e r fa c e T ra n sl a t i o n
• B a t te ry - P o w e r e d R S - 2 3 2 S y s t e ms
• M u l t id ro p R S -2 3 2 N e t w o rk s
44
CHAPTER 4
CIRCUIT
EXPLANATION
45
4.1 CIRCUIT DIAGRAM
46
4.2 CIRCUIT OPERATION
• When the telephone is in the idle condition, the voltage will be -48V.
• The opto isolator is used to isolate the microcontroller from high voltage AC
signals and it consists of GaAs infrared emitting diode optically coupled to a
monolithic silicon phototransistor.
• The microcontroller will detect the ring through the port 1.5 and it will count
the number of rings.
• After a fixed number of rings, the microcontroller will send a signal to the
relay and then the automatic off-hooking of the telephone takes place. At the
same time, microcontroller will transmit ‘Z’ to the computer which is an
indication to play the ‘Welcome’ message.
• The relay used is DPDT type and after automatic off-hooking takes place,
the relay connects the telephone lines to the decoder IC 8870 and isolation
transformer.
• The transformer used is a line transformer used to isolate voice card from
high voltages.
• As the telephone lines are connected to the voice card, the caller gets to hear
the stored messages and asks the caller to enter the roll number of the
student whose result is to be known. After the caller dials the roll number
from the touch tone keypad of his telephone, that number will be decoded by
the decoder IC 8870 and the decoded information will be sent to the
computer via the microcontroller.
47
• Computer on receiving the decoded information will check the database to
access the result of the student whose roll number is entered.
• Then the computer will send the desired information to the voice card and
the caller will get to hear the result of the student on his telephone through
the voice card.
4 . 2 . 1 T e l e p h o n e R in g s e n so r
T h i s C i r c u i t c a n b e u se d t o c o n n e c t a n y t e l e p h o n e to t h e
t e l e p h o n e li n e . W h e n t h e t e l e p h o n e h a n d s e t s a r e i n o n - h o o k
p o s it i o n , t h e c u r r e n t t h r o u g h t h e o p t o c o u p l e r L E D s i s i n a d e q u a t e
t o a c t i v a t e t h e i r i n b u i l t t r a n s i s t o r s . H o we v e r t h e r i n g s i g n a l
p a s se s t o te l e p h o n e i n p a r a l l e l s i n c e th e t e l e p h o n e l i n e i s
c o n n e c t e d to th e t e l e p h o n e i n s tr u me n t s t h r o u g h c o mb i n a t i o n o f
i n b u i l t L E D s o f o p t o c o u p le r s in p a ra l l e l wi t h re v e r se d i o d e s
w h il e t h e ‘ - ‘ m a r k e d t e l e p h o n e l in e is c o n n e c t e d t o t h e r e l a y.
I n i ti a l l y wh e n th e h a n d s e t s o f a ll t h e t e l e p h o ne s a r e o n t h e
c r a d l e s , t h e o p t oc o u p l e r w i ll n o t c o n d u c t a d e q u a t e l y a n d a s s u c h
t h e e m it t e r s o f i n b u i lt t r a n si s to r s o f o p t o c o u pl e rs a r e a t lo w
l e v e l. T h e t r a n s i s t o r o u tp u t a v a i la b l e a t t h e e m it t e r s a r e i n v e r t e d
t o l o g i c 1 st a t e a n d a p p l i e d t o t h e M i c r o c o n t r o l le r.
I n th i s c i r c u it o pt o c o u p l e r i s u se d t o s e n se t h e r i n g si g n a l. A r i n g
v o l t a g e f ro m e x c h a n g e i s a r o u n d 7 0 t o 9 0 v o lt (2 5 H Z A C ) c o m e
48
v i a te l e p h o n e l in e s. T h e t e l e p h on e li n e i s c o n n e c t e d to t h e r i n g
s e n so r ( o p t o c o u p le r I C M C T 2 E ) wi l l d e t e c t t h i s s i g n a l a n d t he
capacitor C2 (1 µ f/ 2 5 v ) b y p a s se s t h e 1 3 . 5 mA t o 6 0 ma A , AC
r in g in g c u rr e n t so t h a t t h e o p t o c o u p l e r g e t t u r n e d ON ( t h e d i o d e
a n t i p a r a l l e l wi t h t h e L E D ) a n o p t o c o u p l e r p r o v i d e c o n d i t i o n
d u r i n g t h e n e g a t iv e h a l f c y c l e o f th e ri n g i n g c u r r e n t . A s t h e
r e su l t , t r a n s i st o r T 1 g e t s fo rw a r d b i a s e d a n d i t c o n d u c t s , p u l l i ng
i t ’ s c o l l e c t o r t o w a rd s g ro u n d . T h i s wi l l t u rn ON t h e re la y b y
p r o v i d i n g th e m a g n e t i z i n g c u r r e n t . T h i s wi l l C e a s e s t h e DC
v o l t a g e a c r o ss t h e p h o n e l in e . T h e a u d i o si g n a l i s e x te n d e d t o t h e
O N / O F F h o o k d e t e c t o r ( Op t o c o u pl e r I C ). I f t h e t e l e p h o n e h a n d s e t
i s O N h o o k c o n d it i o n me a n s t h e te l e p h o n e L i n e c o n s i s t o f 4 8 v , t o
get a closed lo o p connection w i th the exchange fo r
c o m mu n i c a ti o n . H e r e a n o p t o c o u p l e r i s u s e d f o r O N/ O F F h o ok
d e t e c t io n , i t g e ts t h i s 4 8 v a s i n p u t a n d t h e p h o t o d i o d e a c q u i r e a
c o n d u c t i o n v o l t ag e a r o u n d 1 2 v b y t h e u s e o f r e si s to r R 1 . T h e
c o n d u c t i o n o f p h o to d io d e e mi t s l i g h t t o wa r d s p h o t o tr a n s i st o r a n d
t h e r e b y i t g e t s t h e G N D, w h i c h c on n e c t a 1 0 k r e si s to r ( R2 ) a c r o s s
t h e T e l e p h o n e L in e . S o t h a t t h e e x c h a n g e d e t e c t a s i g n a l f r o m t h e
s u b s c r i b e r s, t h a t t h e s u b s c r i b e r w a s r e a d y fo r c o m mu n i c a t i o n . I f
t h e t e l e p h o n e l in e i s u s e d fo r me s s a g e T x a n d Rx m e a n s , t h e h a n d
s e t i s fi r st p i c k e d u p t o c o n fo r m t h a t t h e i n c o m in g si g n a l i s V o ic e
o r M e s s a g e . A f t e r t h a t t h e su b s c r i b e r c a n p l a c e t h e h a n d se t wi t h
t h e b a se s e t . Onc e t h e h a n d se t i s p i c k e d u p m e a n s t h e µ c w il l
s e n t a a c k n o wl e d g e me n t si g n a l t o t h e µ c a t t h e d e s i g n a t i o n s i d e
. so t h a t th e h o o k d e t e c t o r wi l l p ro v i d e v o l t a g e d r o p in t h e L a n d
49
l i n e v o l t a g e , t h e r e b y a c l o se d l o o p c ir c u i t i s fo r me d b e t we e n
S u b s c r ib e r s a n d T e l e p h o n e e x c h a n g e .
I f i t i s a Vo i c e s i g n a l me a n s th e O N/ O FF h o o k d e t e c t o r fu n c t i o n
i s s a me a n d t h e H a n d se t i s u se d f o r V o i c e c o m m u n i c a ti o n . On c e
t h e h a n d s e t i s p l a c e d wi t h t h e b a s e se t a ft e r t h e v oi c e o r me s s a g e
c o m mu n i c a ti o n me a n s th e R e l a y c o n n e c t e d wi t h R i n g s e n s o r g e t
d e - e n e rg i z e d a n d T e l e p h o n e l i n e is d i s c o n n e c te d by t h e µ c .
O p t o c o u p l e r ( I C M CT 2 E)
T h e M CT 2 E o p to i s o la t o r s c o n si st o f a g a l l iu m a r s e n i d e in f r a r e d
e m it t i n g d i o d e d r i v in g a si l ic o n p h o to t r a n s i st o r i n a 6 -p in d u a l
i n - li n e p a c k a g e .
F i g u re . 4 . 2 . 1 P h o to tr a n s i st o r O p t o c o u p le
Feature
50
• U L re c o g n i z e d ( F i l e # E 90 7 0 0 )
• V DE r e c o g n iz e d ( Fi l e # 9 4 7 6 6 )
• M C T 2 a n d M CT 2 E a r e a l so a v a i l a b l e in w h i te p a c k a g e b y
s p e c i fy i n g -M s u ff i x , e g . M CT 2 - M
S c h e m a ti c d i a g r a m
F i g u r e 4 . 3 S c h e m a t i c d i a g r a m o f o p t o c o u p le r
Application
• P o we r su p p ly r e g u l a to r s
• D i g i ta l l o g i c inp u t s
• Microprocessor inputs
51
4 . 2 . 2 O N /O F F HO O K S IM U L A TO R
D u ri n g r i n g s ig n a l 7 0 t o 9 0 V r ms a t 2 0 -2 5 HZ A C w il l c o m e
t h r o u g h t h e t e l e p h o n e l i n e fr o m t h e E x c h a n ge b a t t e r y . T h e
o u t g o i n g si g n a l in g re fe r s s ig n a l r e a c h in g t h e e x c h a n g e fr o m t h e
s u b s c r i b e r s t e l e p h o n e , i n d i c a ti n g O N -h o o k , O F F - h o o k , h a n g u p,
d i a l i n g e t c . On c e t h e h a n d se t i s p i c k e d u p me a n s i t i s in o f f h o o k
c o n d it i o n a n d n o w t h e v o l t a g e r e d u c e s t o 4 7 v t o 4 8 v a n d ( i t i s
g i v e n t o i n p u t o n ON / OF F h o o k d e t e c t o r o p t o c ou p l e r I C ) C r a d l e
s w i tc h c l o s e s to fo r m a c l o se d l o o p c i r c u i t wi th t h e e x c h a n g e
b a t t e r y a n d t h e t e l e p h o n e c ir c u i t . T h i s c i r c u i t i s r e fe rr e d a s t h e
l o c a l l o o p c ir c u i t . E x c h a n g e b a t t e r y v o l t a g e s a r e t y p i c a l l y 4 8
v o l t s. T h e l o o p c u r r e n t i s u s e d b y th e e x c h a n g e t o e s ta b l i s h
O N / O F F h o o k s ta tu s o f t h e t e l e p h o n e . I f t h e l o o p c u r r e n t i s
1 3 . 5 mA t o 6 0 mA t h e e x c h a n g e d e t e c t s it a s OF F h o o k c o n d i t i o n
a n d i f th e lo o p c u r re n t i s l e s s t h a n 7 . 5 mA t h e e x c h a n g e i n t e r p re t s
i t a s O N h o o k c o n d i ti o n .
T h e o p e ra te d li n e v o l ta g e i s a b o u t 5 0 v D C a n d t h e i n c o mi n g
v o i c e v o l t a g e t o t h e t e l e p h o n e i n s tr u me n t v a r i e s f ro m 0 . 5 v to 1
v o l t a n d t h e ma x i m u m o u t g o i n g v o i c e v o l t a g e i s a b u t 2 v r m s . T h e
r in g si g n a l is 70- 90v r ms at 20 -25HZ.In pulse dialing
t e l e p h o n e s r e g i st e r s ig n a l i n g i s k n o w n a s D C l o o p s i g n a l i n g . I n
this case the dialed number is conveyed to the exchange by
“ m a k e ” a n d “b r e a k ” o f l o o p c ir c u i t .
52
W h e n a ri n g sig n a l i s p r e se n t , t h e mi c r o c o n tr o l l e r w il l
s w i tc h o n th e R EL A Y t o a c h i e v e O F F h o o k c o n d i ti o n .
4 . 2 . 2 . 1 RE L A Y
T h e re l a y i s o n e o f t h e mo s t w i d e l y u se d c o mp o n e n t s in i n d u s tr i a l
e l e c tr o n i c s . I n c o m b in a t io n w i th t r a n si s to r s , S C Rs , e le c t ro n t u b e s,
a n d o th e r c i r c u it e l e m e n t , t h i s e l e c tr o ma g n e t i c d e v ic e p e r fo r m s
c o u n tl e s s t a s k s. T h i s re la y s a r e u s e d a s p r o t e c t i v e d e v ic e fo r
s w i tc h i n g , fo r i n d i c a t i n g a n d fo r t r a n s mi s si o n .
T ra n s m i s si o n r e l a y s a r e u se d in c o n j u n c t i o n wi t h t r a n s fo r m e r s,
i n d u c t o r s, c a p a c i t o r s i n p o w e r s y st e m a n d i n t e l e p h o n e a n d i n
o t h e r c o m mu n ic a t i o n s y st e m s . R e l a y s a r e e le c t ro ma g n e t i c a l l y
o p e r a t e d re mo t e l y c o n tr o l l e d s wi t c h e s wi t h o n e o r mo r e s e t s o f
c o n ta c t s. W h e n e n e rg iz e d , t h e r e l a y o p e r a t e s t o o p e n o r c l o se i t s
c o n ta c t s o r to o p e n so m e c o n t a c ts a n d c l o s e o t h e r s. C o n t a c t s w h i c h
a r e o p e n w h e n t h e re la y i s n o t e n e rg i z e d a re c a l l e d n o r m a l l y o p e n
( N O) o r si mp l y o p e n c o n t a c t s . C o n t a c t s , w h i c h a r e c l o s e d wh e n t h e
r e l a y i s n o t e n e rg iz e d , a r e c a l l e d n o r ma l ly c lo s e d c o n t a c t s.
F i g u re . 4 . 4 Re la y
53
R e l a y c o n t a c t a r e h e l d i n t h e i r n o r ma l p o si t i o n e it h e r b y s p r i n g or
b y s o me g r a v i t y a c t i v a t e d me c h a n i s m. An a d ju s t me n t o r a d j u st me n t s
a r e u su a ll y p ro v id e d t o s e t r e s t ra i n i n g fo rc e t o c a u s e t h e re la y t o
o p e r a t e w i th in p r e d e t e r m i n e d c i r c u i t c o n d i t i o n s.
R e l a y s a re e le c t ro m a g n e t i c c o mp o n e n t s wh i c h h a s a n o p e r a t i n g c o il
a n d c o n t a c t. T he c o i l sh a ll b e e n e rg i z e d wi t h A C o r D C s u p p ly .
A c c o r d i n g l y re la y s a r e a v a i l a b l e wi t h A C \ D C o p e r a t i n g c o i l s o f
v a r i o u s m a g n i t u de s s a y fr o m 6 V D C t o 2 2 0 V D C o r f o r A C v o l t a g e s
r a n g i n g fro m 2 0 V A C t o 4 4 0 AC .
T h e o p e ra ti n g p ri n c i p l e o f r e l a y s i s a s fo l lo w s w h e n t h e c o i l is
e n e rg i z e d , a n i r o n c o re a t t a c h e d t o t h i s a s s e mb l y g e t s ma g n e t iz e d .
T h i s t h e n a t t ra c t s a n a r m a t u r e w h i c h h a s e l e c t ri c a l c o n n e c t e d t o it .
T h e e l e c t ri c a l t e r mi n a l s s h o u l d b e f a b r i c a t e d i n s u c h a w a y t h a t t h e r e
s h a l l b e o n e c o m mo n t e r mi n a l; o n e n o r ma ll y c l o se d ( N C ) c o n t a c t
a n d o n e n o r ma l l y o p e n ( N O) c o n t a c t s . W h e n t h e re l a y i s n o t
e n e rg i z e d t h e c o n n e c t io n i s c lo s e d b e t we e n c o m mo n a n d NO
c o n ta c t s t h i s st a t e i s r e v e r s e d wh e n t h e r e l a y i s e n e r g i z e d t h i s r e l a y
c i r c u i t s h a l l b e u se d t o s wi t c h o n o t h e r p o we r c ir c u i t s, u si n g lo w
c o n tr o l v o l t a g e . T h e p o w e r c i r c u it a n d c o n t ro l c i r c u i t a r e p r a c t i c a l ly
i so l a t e d .
54
4 .2 .3 Serial Ports i n Co mpu ter
A l l I BM P C a n d c o m p a t i b l e c o m p u t e r s a r e t y p i c a l l y e q u ip p e d
w i t h t w o s e r i a l p o r t s a n d o n e p a r a l l e l p o rt . A l th o u g h t h e se t w o
t y p e s o f p o r t s a r e u se d f o r c o m m u n i c a ti n g wi t h e x t e r n a l d e v i c e s,
t h e y w o rk i n d i f fe re n t w a y s .
A p a r a ll e l p o r t s e n d s a n d r e c e i v e s d a t a e i g h t b i t s a t a t i me o v e r 8
s e p a r a t e wi re s. T h i s a l l o w s d a ta t o b e t r a n s f e r r e d v e ry q u i c k l y;
h o w e v e r , th e c a bl e r e q u i r e d i s mo r e b u l k y b e c a u se o f th e n u mb e r
o f i n d i v i d u a l w i r e s i t mu st c o n ta i n . P a r a l l e l p o r t s a re t y p i c a l l y
u s e d t o c o n n e c t a P C t o a p ri n t e r a n d a re r a r e l y u s e d fo r m u c h
e l s e . A s e r i a l p o rt s e n d s a n d r e c e i v e s d a t a o n e b i t a t a t i me o v e r
o n e w ir e . W h i le i t t a k e s e ig h t t i me s a s l o n g t o t r a n s fe r e a c h b y t e
o f d a t a th i s w a y , o n l y a fe w wi r e s a r e re q u i re d . I n fa c t , t wo - w a y
( fu l l d u p l e x ) c o m m u n i c a t i o n s i s p o s si b l e w it h o n l y t h r e e se p a r a t e
w i r e s - o n e t o s e n d , o n e t o re c e i v e , a n d a c o m mo n s i g n a l g r o u n d
wire.
RS-232C
R S -2 3 2 s t a n d s fo r R e c o m me n d S t a n d a rd n u m b e r 23 2 a n d C i s t h e
latest revision of th e st a n d a rd . The serial ports on m o st
c o m p u t e r s u s e a su b se t o f t h e R S - 2 3 2 C st a n d a r d . T h e fu l l RS -
2 3 2 C st a n d a rd s p e c i f ie s a 2 5 - p i n " D" c o n n e c to r o f w h i c h 2 2 p i n s
a r e u s e d . Mo st o f t h e s e p i n s a r e n o t n e e d e d f o r n o r m a l P C
55
c o m mu n i c a ti o n s , a n d i n d e e d , mo s t n e w PC s a r e e q u i p p e d wi t h
ma l e D t y p e c o n n e c t o r s h a v in g on l y 9 p in s.
P i n d e ta i l s o f P C s e r i a l p o r t
RS232
Connector
1 CD DSR 6
2 RD 7
3 TD RTS 8
4 CTS
DTR RI 9
5 GND
9 P in Co n n e c to r on a DT E device (PC
c o n ne c t io n )
P in
D ir e c t i o n o f s i gn a l :
N u mb e r
C a r ri e r D e t e c t ( C D ) ( fr o m D C E ) I n c o m in g s ig n a l f r o m
1
a modem
2 R e c e iv e d D a ta (R D) In c o mi n g Da t a fr o m a D CE
3 T r a n s m i tt e d D a t a ( T D ) O u t g o i n g D a ta to a DC E
D a t a T e r mi n a l R e a d y ( D T R) O u t g o i n g h a n d sh a k i n g
4
s ig n a l
5 S i g n a l G ro u n d Co mm o n re fe r e n c e v o l t a g e
56
6 D a t a S e t Re a d y ( D S R ) I n c o m in g h a n d s h a k i n g si g n a l
7 R e q u e st T o S e n d (R T S ) O u t g o i n g fl o w c o n t r o l s i g n a l
8 C l e a r T o S e n d (C T S ) I n c o m in g fl o w c o n t ro l s ig n a l
R i n g I n d i c a to r (R I) ( fr o m D C E ) I n c o m i n g s i g n a l f r o m
9
a modem
4 .3 P OWER SUPP LY
57
F i g u r e 4 . 5 P o we r S u p p l y U n i t
T h e p o we r su p p ly s e c t i o n i s t h e i mp o r t a n t o n e . It s h o u l d d e l i v e r
c o n st a n t o u t p u t re g u l a t e d p o we r s u p p l y fo r su c c e s s f u l w o rk in g o f
t h e p r o j e c t . A 0 -1 2 V/ 5 0 0 mA t r a n s f o r m e r i s u s e d fo r o u r p u rp o s e ;
t h e p ri ma ry o f th i s t ra n s fo r me r i s c o n n e c t e d i n t o ma i n s u p p l y
t h r o u g h o n / o f f s w i t c h & fu s e f o r p ro t e c ti n g f r o m o v e rl o a d a n d
s h o rt c i r c u i t p ro t e c ti o n . T h e s e c on d a ry i s c o n n e c t e d t o t h e d i o d e s
c o n v e r t f ro m 1 2 V A C t o 1 2 V D C v o l ta g e , w h i c h i s fu rt h e r
r e g u l a t e d t o + 5 v, b y u s i n g IC 7 8 05 .
T h e L M 7 8 0 5 mo n o l it h i c 3 - t e r m i n a l p o s it i v e v o lt a g e re g u l a t o r s
e m p lo y i n t e r n a l c u r re n t -l i mi t i n g , t h e r ma l s h u t d o w n a n d s a f e - a re a
c o m p e n s a t i o n , m a k i n g t h e m e s s e n t i a l ly i n d e st r u c t i b l e . I f a d e q u a t e
h e a t s in k in g i s p r o v i d e d , t h e y c a n d e li v e r o v e r 1 . 0 A o u t p ut
c u r r e n t . T h e y a r e i n te n d e d a s fi x e d v o l ta g e r e g ula t o r s i n a w i d e
r a n g e o f a p p l i c a t i o n s in c l u d i n g lo c a l (o n - c a rd ) r e g u l a t i o n fo r
e l i mi n a t i o n o f n o i s e a n d d is t ri bu t i o n p r o b l e ms a s so c ia t e d wi t h
s i n g l e -p o i n t re g u la t io n . In a d d it i o n to u se a s f i x e d v o l ta g e
r e g u l a t o r s, t h e s e d e v i c e s c a n b e u s e d wi t h e x t e r n a l c o mp o n e n t s t o
o b t a i n a d ju s t a b l e o u t p u t v o l t a g e s a n d c u rr e n t s .
C o n si d e r a b le e f fo r t wa s e x p e n d e d t o ma k e t h e e n ti r e s e r ie s o f
r e g u l a t o r s e a s y t o u s e a n d mi n i mi z e t h e n u m b e r o f e x t e r n a l
c o m p o n e n t s . It i s n o t n e c e s s a r y t o b y p a s s t h e o u tp u t, a l th o u g h
58
t h i s d o e s i mp r o v e t r a n s i e n t r e s p o n se . I n p u t b y p a ss i n g i s n e e d e d
o n l y i f t h e r e g u la t o r i s l o c a t e d f a r fr o m t h e fi lt e r c a p a c i t o r o f t h e
power supply.
59
CHAPTER 5
SOFTWARE
DESCRIPTION
60
5 .1 Vi su al Ba si c 6 .0
Visual Basic ( Vi s u a l B e gi n n e r s A ll p u r p o se s y mb o l i c
I n st r u c t i o n C o d e ) i s t h e mo st p o p u l a r p r o g r a mmi n g l a n g u a g e fo r
w o rl d ’ s mo s t p o p u l a r o p e r a t in g s y st e m . Vi s u a l B a s ic i s t h e fi r st
l a n g u a g e p e o p l e c o n si d e r wh e n t h e y w a n t r a p i d a p p l i c a t i o n
d e v e l o p me n t fo r the wi n d o w e n v i r o n me n t . Visual B a s ic is
e v o lv e d fr o m t h e o ri g i n a l B AS I C l a n g u a g e , wh i c h i s wi d e l y u s e d
l a n g u a g e . E x i s t in g o b je c t s a r e d r a g g e d & d r o p p e d i n t o t h e p l a c e
i n st e a d o f w r it i n g n u me r o u s c o d e s . Wh i l e wr i ti n g t h e p ro g ra m s ,
w e a r e a b l e t o s e e h o w t h e p r o g r a ms r u n d u ri n g t h e r u n t i me . T h i s
i s g r e a t a d v a n t a g e o v e r o t h e r p r o g r a mmi n g l a n g u a ge . VB is b a s e d
o n a n e v e n t d r i v e n me t h o d mo d e l; i t a l s o h a s a se t o f d e b u g g i ng
t o o l s. T h e p r i ma r y r e a s o n b e h i n d s e l e c ti n g V B w a s b e c a u se t h e
i n t e r fa c e wa s s o li t t l e c o mp a r e d to o th e r t o o l s .
P r o p e r ti e s
T h e p r o p e r t i e s d e sc r i b e t h e a p p e a r a n c e o f t h e G UI c o mp o n e n t .
W h e n a d d in g a c o mp o n e n t , th e Na m e p r o p e r t y sh o u l d b e s e t
i mme d i a t e l y , a c c o rd i n g t o th e t h r e e - l e t t e r mn e mo n i c n a mi n g
c o n v e n t i o n s. T h e p r o p e r t i e s a re d is p l a y e d i n t h e P ro p e r t i e s
W i n d o w i n Na me / Va l u e p a i r s i n al p h a b e t ic a l o rd e r.
Event Procedures
61
A n e v e n t p r o c e d u r e i s a p ie c e o f c o d e t h a t r e sp o n d s t o
e v e n t s t h a t c a n o c c u r fo r t h a t o b je c t . M o st of th e e v e n ts a r e
g e n e ra t e d b y t h e u se r, e n a b l in g t h e m t o d ic ta t e th e o rd e r o f
execution.
5 . 2 . 1 In t r o d u c ti o n
T h i s c h a p t e r d i s c u s s e s h o w Vi s u a l B a si c c a n b e u se d t o a c c e s s
s e ri a l c o mm u n i c a t i o n fu n c t io n s. Wi n d o w s h i d e s mu c h o f t h e
c o m p l e x i t y o f s e r i a l c o m mu n i c a ti o n s a n d a u t o ma t i c a l l y p u t s a n y
r e c e iv e d c h a r a c t e r s i n a re c e i v e b u f fe r a n d c h a r a c t e r s s e n t i n t o a
t r a n s m i s si o n b u f fe r. T h e r e c e iv e b u ff e r c a n b e r e a d b y t h e
p r o g r a m wh e n e v e r it h a s t i me a n d t h e t ra n s mi t b u ff e r i s e mp t i e d
w h e n i t i s fr e e t o se n d c h a ra c t e r s .
5 . 2 . 2 Co m mu n ic a ti o n s c o n t r o l
V i s u a l B a s ic a llo w s ma n y a d d i t io n a l c o mp o n e n t s to b e a d d e d t o
t h e t o o lb o x . T h e M i c r o so ft C o mm. c o mp o n e n t i s u se d t o a d d a
s e ri a l c o m mu n ic a t io n fa c i l it y . In order to use the C o mm s
c o m p o n e n t th e fil e s M S C OM M 1 6 . O CX ( fo r a 1 6- b i t mo d u l e ) o r
M S C O M M 3 2 . O C X ( fo r a 3 2 -b i t m o d u l e ) mu s t b e p r e se n t in t h e
\ W I N D O W S \ S Y S T E M d ir e c to ry . T h e c l a s s n a me i s M S C o mm. T h e
62
c o m mu n i c a ti o n s c o n t ro l p r o v i d e s t h e fo l lo wi n g t w o wa y s fo r
h a n d li n g c o mmu n i c a t io n s
E v e n t -d r i v e n
E v e n t - d ri v e n c o m mu n ic a t io n s i s t h e b e st me t ho d o f h a n d l i n g
s e ri a l c o m mu n i c a t i o n a s i t fr e e s th e c o mp u t e r t o d o o t h e r t h in g s.
T h e e v e n t c a n b e d e fi n e d a s t h e r e c e p t io n o f a c h a r a c t e r , a c h a n g e
i n C D ( c a r r i e r d e t e c t ) o r a c h a n ge i n R T S ( r e q u e s t t o s e n d ). T h e
O n Co m m e v e n t c a n b e u s e d t o c a p t u r e t h e s e e v e n t s . a n d a l s o t o
d e t e c t c o mmu n ic a t i o n s e r r o rs .
P o l li n g
C o m mE v e n t p r o pe r ti e s c a n b e t e st e d t o d e te r m in e i f a n e v e n t o r
a n e r r o r h a s o c c u r r e d . F o r e x a m p le , t h e p r o g r a m c a n l o o p wa i t i n g
f o r a c h a r a c t e r t o b e r e c e i v e d . O n c e i t i s t h e c h a r a c t e r i s re a d
f r o m t h e re c e i v e b u f fe r. T h i s m e t h o d i s n o r ma l ly u s e d w h e n t h e
p r o g r a m h a s t i m e t o p o l l t h e c o m mu n ic a t io n s re c e i v e r o r t h a t a
k n o w n re sp o n s e i s i mm i n e n t .
V i s u a l B a si c u se s t h e s ta n d a r d W i n d o w s d r iv e r s f o r t h e se r i a l
c o m mu n i c a ti o n p o rt s ( su c h a s se r i a l u i . d l l a n d se ri a l . v x d ) . T h e
c o m mu n i c a ti o n c o n t r o l i s a d d e d to t h e a p p l i c a ti o n f o r e a c h p o rt .
T h e p a r a me t e r s ( su c h a s t h e b it r a t e , p a r i ty , a n d so o n ) c a n b e
c h a n g e d b y s e l e c t i n g C o n t ro l P a n e l ? Sy st e m ? D e v i c e M a n a g e r ?
P o r ts (C OM a n d L P T ) ? P o rt S e t t i n g s. T h e s e tt i n g s o f t h e
63
c o m mu n i c a ti o n s p o rt (t h e I R Q a n d th e p o rt a d d r e s s ) c a n b e
c h a n g e d b y s e le c t i n g C o n t ro l P a n e l ? S y s t e m? D e v ic e M a n a g e r?
P o r ts ( C OM a n d L P T ) ? R e so u r c e s fo r I R Q a n d A d d r e ss e s.
P r o p e r ti e s
T h e Co m m c o m p o n e n t i s a d d e d t o a f o r m w h e n e v e r s e r i a l
c o m mu n i c a ti o n s a re r e q u i r e d . By d e f a u l t , th e fi r s t c r e a t e d o b j e c t
i s n a m e d M S Co m m1 ( th e se c o n d i s n a me d M S Co mm 2 , a n d so o n ) .
I t c a n b e se e n th a t t h e ma i n p ro p e rt i e s o f t h e o b j e c t a r e :
C o m mP o r t , DT R E n a b l e , E OF E n a b l e , H a n d sh a k i n g , I n B u ff e r S i z e ,
Index, I n p u t L en , In p u tM o d e , L e ft, Na m e , Nu ll D i s c a r d ,
O u tB u f fe rS i z e , P a r i ty R e p l a c e , R T h r e sh o ld , RT S E n a b l e , S e t t in g s,
S T h r e sh o l d , T a g a n d T o p .
Settings
T h e S e t t i n g s p ro p e r ty se t s a n d r e t u r n s t h e R S - 2 3 2 p a ra m e t e r s,
s u c h a s b a u d r a t e , p a r i t y , t h e n u m b e r o f d a t a b i t , a n d th e n u mb e r
o f st o p b i t s. I ts sy n t a x i s :
[ f o r m.] MS Co m m. S e tt i n g s = s e t S t r [ $]
w h e r e t h e st r S t r i s a st r i n g w h i c h c o n t a i n s t h e R S - 2 3 2 s e t t in g s.
T h i s s tr i n g t a k e s th e fo r m:
" B B BB , P , D , S "
64
where
B BB Bd e fi n e s t h e b a u d ra t e ,
P the parity,
D t h e n u mb e r o f d a t a b i t s , a n d
S t h e n u mb e r o f s t o p b i t s.
T h e fo l lo wi n g l is t s t h e v a li d b a ud r a te s ( d e f a u l t is 9 6 0 0 B a u d ) :
1 1 0 , 3 0 0 , 6 0 0 , 1 2 0 0 , 2 4 0 0 , 9 6 00 , 1 4 4 0 0 , 1 9 2 0 0, 3 8 4 0 0 , 5 6 0 0 0 ,
1 2 8 0 0 0 , 2 5 6 0 00 .
T h e v a l i d p a r i ty v a l u e s a r e ( d e f a ul t is N) : E (E v e n), M (M a rk ) , N
( No n e ), O ( Od d ), S (S p a c e ) .
T h e v a l i d d a t a b it v a l u e s a r e ( d e f a u l t is 8 ) : 4 , 5 , 6, 7 o r 8 .
T h e v a l i d s to p b it v a l u e s a r e ( d e f a u l t is 1 ) . 1 , 1. 5 o r 2 .
A n e x a mp l e o f s e t t i n g a c o n t ro l p o r t t o 4 8 0 0 B a u d , e v e n p a r it y , 7
d a t a b it s a n d 1 st o p b i t i s: Co m1 . S e t t in g s = " 4 8 0 0 ,E , 7 , 1 "
C o m mP o r t
T h e Co m mP o r t p r o p e r t y s e t s a n d r e t u r n s th e c o mmu n ic a t i o n p o rt
n u mb e r . I t s s y n t ax i s:
[ f o r m.] MS Co m m. C o m m P o rt = p o r t Nu m b e r [ %]
w h ic h d e fi n e s t h e p o rt N u mb e r fr o m a v a l u e b e t w e e n 1 a n d 9 9 . A
v a l u e o f 6 8 i s r e t u r n e d i f th e p o r t d o e s n o t e x i s t .
65
PortOpen
[ f o r m.] MS Co m m. P o r tO p e n = [ { T r u e | F a l s e }]
A T ru e s e t t in g o p e n s t h e p o rt , wh i l e a F a l s e c l o se s th e p o rt a n d
c l e a r s th e re c e i ve a n d tr a n s mi t b u f fe r s ( t h i s a u t o m a t ic a l l y h a p p e n s
w h e n a n a p p li c a t io n i s c l o se d ). T h e f o l lo wi n g e x a mp l e o p e n s
c o m mu n i c a ti o n s p o rt n u mb e r 1 ( C OM 1 : ) a t 4 8 0 0 B a u d w i t h e v e n
p a r i t y , 7 d a t a b i ts a n d 1 s t o p b i t:
I n p u t t in g d a t a
T h e t h r e e m a i n p ro p e r ti e s u s e d t o re a d d a t a fr o m t h e r e c e i v e
b u f fe r a r e I n p u t , I n Bu f fe r C o u n t an d I n B u f fe r S i z e .
Input
T h e I n p u t p r o p e r t y r e t u rn s a n d r e m o v e s a s tr i n g o f c h a ra c t e r s
f r o m th e re c e i v e b u f f e r . I t s s y n t a x i s:
[ f o r m.] MS Co m m. I n p u t
To d e t e r mi n e th e n u mb e r of c h a ra c t e r s in the b u ff e r the
I n Bu f fe r Co u n t p r o p e r t y i s t e s t e d (t o b e c o v e re d i n t h e n e x t
66
s e c t i o n ) . S e t t i n g I n p u t L e n t o 0 c a u se s th e I n p u t p r o p e r ty t o re a d
t h e e n ti r e c o n t e n t s o f t h e r e c e i v e b u f f e r.
InBufferSize
T h e In Bu f fe rS i z e p r o p e rt y se t s a n d r e t u r n s t h e m a x i m u m n u mb e r
o f c h a r a c t e r s t h a t c a n b e re c e i v e d i n t h e re c e i v e b u f f e r ( b y
d e f a u l t i t i s 1 0 24 b y t e s ). I t s sy n ta x is :
[ f o r m.] MS Co m mI n B u f f e rS i z e = [ n u mB y t e s %]
T h e s iz e o f th e b u f fe r s h o u l d b e s e t so t h a t i t c a n st o r e t h e
ma x i m u m n u mb e r o f c h a r a c t e r s t h a t w il l b e r e c e iv e d b e fo r e t h e
a p p li c a t io n p ro g r a m c a n r e a d t h e m fr o m t h e b u f f e r .
T h e In B u f fe rC o u n t p ro p e rt y r e t urn s t h e n u m b e r o f c h a r a c t e r s i n
t h e r e c e i v e b u f fe r. I t c a n a l so b e u se d t o c l e a r t h e b u f f e r by
s e t ti n g t h e n u mb e r o f c h a r a c t e r s t o 0 . I ts sy n t a x i s :
[ fo r m. ] M S Co m m In Bu f fe rC o u n t = [ c o u n t % ]
67
CHAPTER 6
METHODOLOGY
68
6 .1 Micro Co ntrol l er
A l g o r i th m
S T E P 1 : S t a r t t h e p ro g ra m
S T E P 2 : C h e c k w h e t h e r r in g s i g n a l i s p r e s e n t o r n ot .
S T E P 3 : I f r i n g si g n a l i s p re s e n t , ma k e te l e p h o n e O F F H O O K a n d
s e n d ‘ Z ’ si g n a l to P e r so n a l Co m p u t e r, e l s e g o t o ST E P 2 .
S T E P 4 : G e t th e D T M F s i g n a l t h ro u g h t h e DT M F d e c o d e r .
S T E P 5 : S e n d t he D T M F d a t a t o th e p c t h ro u g h t h e s e ri a l p o r t a n d
g o t o S T E P 4.
69
6 .2 VISU AL BAS IC
A l g o r i th m
S T E P 1 : S t a r t t h e p ro g ra m
S T E P 2 : C h e c k fo r th e d a t a ‘ Z ’ .
S T E P 3 : I f d a ta is p r e se n t, p l a y t he we l c o m e me s s a g e , e l se g o
t o st e p 2 .
S T E P 4 : P l a y t h e me s s a g e t o e n t e r t h e r o l l n u mb e r .
S T E P 5 : C h e c k w h e t h e r R o ll n u mb e r i s e n t e r e d o r no t .
S T E P 6 : I f y e s, c h e c k t h e d a t a b a s e f o r t h a t r o l l n u m b e r a n d t e l l
t h e r a n k t o u s e r.
70
CHAPTER 7
APPLICATIONS
71
7.1 BANKING & FINANCE
Technological innovations have brought about not just new types of electronic
money, but also new bank-customer relationships. These relationships are fuelling
the demand for more and more innovative banking services such as:
8.2 EDUCATION
Apart from providing an environment for learning, educational establishments are
now improving their quality of service, offering a better level of support to both
students and to the public through:
• Enquiry Hotline
• Library Book Renewal
• Student Registration System
• Student Result Declaration System
8.3 GOVERNMENT
72
8.4 TELECOMMUNICATIONS
In this highly competitive industry, we can help telecom service providers (wire
line or wireless) to develop infrastructure and add value to their services through:
• Prepaid Roaming
• Postpaid Calling Card, Prepaid Calling Card, and Wireless Prepaid (or Mobile
Prepaid)
• Mobile Number Portability
• Number Change Announcement
• Fax Stored-And-Forward Service
• Signaling Protocol Converters
• Telecom Call Center
73
CHAPTER 8
Conclusion
&
Future Enhancement
74
7.1 CONCLUSION
The system designed will be intelligent for interaction and will suitably provide a
good response to the caller who will access it. It will be truly a responsible system
for human mankind. We will make it better than the present scenario system. It
will be digitally accessed and will have a strong data base and can be operated
easily and of low cost. And the future will show that every organization will be
using our system.
In future, the concept of Interactive Voice Response System can be used in various
transport departments like Bus transport, Metro rail, Railways and Airports as the
transport companies not only need to be fast and responsive, but also need to
provide customers with an easily accessible information system providing:
• Information Enquiry
• Schedule Enquiry
• Teleticketing System
So, in near future, all the information regarding routes, timings etc. will be known
through the Interactive Voice Response System.Also, this concept may be
implemented in Cinema halls and Multiplexes where the caller will get to know the
timings of his favourite movies as well as he can book his tickets through this
system.
75
APPENDIX 1
Source Code
76
Microcontroller Code
org 0000h
sjmp power_on
org 0003h
LJMP ISR
org 000bh
LJMP COUNTER
org 0013h
reti
org 001bh
reti
org 0023h
LJMP SERIAL
reti
power_on:
mov ie,#00h
mov ip,#00h
mov p0,#0FFH
MOV P1,#0FFH
MOV P2,#11111011B
MOV P3,#0FFH
77
RAM:
MOV R0,#07FH
CLR:
MOV @R0,#00H
DJNZ R0,CLR
INITIALIZE:
MOV IE,#10010011B
MOV IP,#00010000
MOV TMOD,#26H
MOV SCON,#50H ;SETS SERIAL MODE 1,8-BIT DATA,1 STOP,1 START BIT
SETB TR1
SETB TCON.0
MAIN:
MOV TH0,#100
MOV TL0,#100
SETB TR0
M: SJMP M
DELAY:
MOV 30H,#3
78
RAJ2:
MOV 31H,#23
RAJ1:
MOV 32H,#234
RAJ:
DJNZ 32H,RAJ
DJNZ 31H,RAJ1
DJNZ 30H,RAJ2
RET
ISR:
MOV A,P1
SUBB A,#192 ;WHEN WE RESET DTMF IC ,THEN ALSO IT COMES TO ISR BCOZ IT GETS
AN INTERRUPT
RETI
COUNTER:
MOV SBUF,#'Z'
RETI
79
SERIAL: JB RI,TRANS
CLR TI
RETI
SETB P2.0
CLR RI
RETI
Option Explicit
Lib "winmm.dll" _
Alias "sndPlaySoundA" ( _
As Long
Private Const SND_NOWAIT As Long = &H2000 ' Don't wait if the driver is busy
80
Private Const SND_SYNC As Long = &H0 ' Play synchronously (default)
Private Const SND_FLAGS As Long = SND_SYNC Or SND_NOWAIT ' Combination of two constants
above
MSComm1.RThreshold = 1
MSComm1.InputLen = 1
MSComm1.Settings = "9600,N,8,1"
MSComm1.DTREnable = False
MSComm1.CommPort = 1
MSComm1.PortOpen = True
End Sub
81
Dim Data As String, X As Integer, i As Integer
Static z As Integer
Static y As Integer
Adodc1.Recordset.MoveFirst
X = Adodc1.Recordset.Fields("ASCII").Value
If z = 1 Then
GoTo elec
z=0
ElseIf y = 1 Then
GoTo civ
y=0
End If
82
ElseIf Data = "1" Then
z=1
Adodc1.RecordSource = "CIVIL"
Adodc1.Refresh
y=1
End If
GoTo out
elec:
Do
' For i = 1 To 10
If X = Asc(Data) Then
Select Case X
Case 49
Print X
Case 50
83
Print X
Case 51
Print X
Case 52
Print X
Case 53
Print X
Case 54
Print X
Case 55
Print X
Case 56
Print X
Case 57
Print X
End Select
Exit Do
84
Else
Adodc1.Recordset.MoveNext
X = Adodc1.Recordset.Fields("ASCII").Value
'Print x
End If
'Next i
z=0
Adodc1.Recordset.MoveFirst
GoTo out
civ:
Do
' For i = 1 To 10
If X = Asc(Data) Then
Select Case X
Case 49
Print X
Case 50
85
Print X
Case 51
Print X
Case 52
Print X
Case 53
Print X
Case 54
Print X
Case 55
Print X
Case 56
Print X
Case 57
Print X
End Select
Exit Do
86
Else
Adodc1.Recordset.MoveNext
X = Adodc1.Recordset.Fields("ASCII").Value
'Print x
End If
'Next i
y=0
Adodc1.Recordset.MoveFirst
GoTo out
End If
End Sub
End Sub
Adodc1.Recordset.MoveFirst
87
End Sub
Adodc1.Recordset.MoveLast
End Sub
Adodc1.Recordset.MoveNext
End Sub
Adodc1.Recordset.MovePrevious
End Sub
88
REFERENCES
Websites:
1. http://en.wikipedia.org/wiki/Interactive_voice_response
2. http://web.cmc.net.in/products/ivrs/ivrs.asp
3. http://www.blissit.org/ivrs.htm
4. http://www.kleward.com/ivr_solutions.htm
5.http://en.wikipedia.org/wiki/Special:Search?search=information+on+IVR+syste
m
6. http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6VRG-
4C0RRMJ-
4&_user=7427940&_coverDate=08%2F05%2F2004&_alid=810799566&_rdoc=
6&_fmt=high&_orig=search&_cdi=6234&_docanchor=&view=c&_ct=7&_acct=
C000050221&_version=1&_urlVersion=0&_userid=7427940&md5=58db2884bc
bc7ed43d9119ed01eefe1a
Books:
89