be project fortnight reports on ivrs

27
FORTNIGHT REPORT 1 We have studied the hardware aspect n the different blocks involved in it. The basic blocks of this part of the system consist of: 1. Ring Detector 2. Relay Activation Circuit 3. A DTMF Decoder 4. A Relay Control For DTMF Decoder 5. Microcontroller Ring Detector: The ring detector first detects the incoming signal. A bridge rectifier is connected to the telephone line. This turns the ringing signal (an alternating voltage) into a pulsating direct voltage that is smoothened by the condenser and limited with the aid of zener diodes. The direct voltage across the zener diode is applied to the opto-coupler that forms as the electrical isolation between the two stages. DTMF decoder: The DTMF decoder 8870 performs the function of decoding the digits dialed by the user in their corresponding binary states and thus making them available for processing in the microcontroller. Relay circuits: We are using two relays that will be performing various tasks as follows: Relay to control DTMF decoder: This relay is used to activate and deactivate the 8870 DTMF decoder at variousstrategic points. It activates the DTMF decoder just before the user is about to dial the digit. It deactivates the 8870 DTMF decoder immediately after the user has dialed the digit. Relay to control feedback audio: This relay is used to connect and disconnect the audio feedback line (explained later) with the main telephone line after the response from the user is been received.

Upload: abhishek-nadkarni

Post on 08-Jan-2017

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BE Project Fortnight Reports on IVRS

FORTNIGHT REPORT 1

We have studied the hardware aspect n the different blocks involved in it.

The basic blocks of this part of the system consist of:

1. Ring Detector

2. Relay Activation Circuit

3. A DTMF Decoder

4. A Relay Control For DTMF Decoder

5. Microcontroller

Ring Detector:

The ring detector first detects the incoming signal. A bridge rectifier is connected to the

telephone line. This turns the ringing signal (an alternating voltage) into a pulsating

direct voltage that is smoothened by the condenser and limited with the aid of zener

diodes. The direct voltage across the zener diode is applied to the opto-coupler that

forms as the electrical isolation between the two stages.

DTMF decoder:

The DTMF decoder 8870 performs the function of decoding the digits dialed by the user

in their corresponding binary states and thus making them available for processing in the

microcontroller.

Relay circuits:

We are using two relays that will be performing various tasks as follows:

Relay to control DTMF decoder:

This relay is used to activate and deactivate the 8870 DTMF decoder at variousstrategic

points. It activates the DTMF decoder just before the user is about to dial the digit. It

deactivates the 8870 DTMF decoder immediately after the user has dialed the digit.

Relay to control feedback audio:

This relay is used to connect and disconnect the audio feedback line (explained later)

with the main telephone line after the response from the user is been received.

Page 2: BE Project Fortnight Reports on IVRS

Relay activation circuit:

This forms the heart of the relay circuits as it controls the functioning of relay

according to the inputs it receives from the microcontroller.

Microcontroller to telephone (via Voice chip)

The basic blocks of this part are

1. Microcontroller

2. Voice chip

Microcontroller: this is brain of this part. In this part triggers the appropriate channels i.e

the message in the voice chip based on the instant the receiver is lifted and based on the

response of the user.

Voice chip: this forms the heart of this module (definitely of the circuit as well). The

voice chip along with its external circuitry has the provision to work in the two message,

four message or the eight message mode. This circuitry has a microphone which enables

the storing of any message by directly introducing the speech signal. The proper method

of storing the signal can be obtained from the data sheet of the voice chip included later.

The audio output can be directly taken from the bridge and is given to the telephone wire

itself. Since the obtained audio signal is a very low amplitude signal, it does not interfere

with the normal working of the telephone line.

MICROCONTROLLER TO TELEPHONE (VIA COMPUTER)

The basic blocks of this part of the system consist of:

1. Signal Converter

2. Computer

3. Isolation Transformer

4. Microcontroller

Signal converter:

The function of this block is to convert the output of the microcontroller into the

signal that is compatible enough to be input of the computer. This is done by using

max 232 chip and RS 232 cables. The signal at the output of the microcontroller is of

the range of 0v to 5v. It is converted into a signal in the range of –12v to +12v to be

input to the PC.

Page 3: BE Project Fortnight Reports on IVRS

Computer:

The computer performs the function of sending the proper wave file according to the

input it receives from the microcontroller. There are various respective wave files

stored in its memory which are according to the output depending on the user request.

Isolation transformer:

This is the very important block as it isolates the computer with the high voltage

telephone line (having a potential difference of –60v). The isolation transformer used

is 1:1 600 ohms. The primary is connected to the output of the computer and the

secondary is connected to the feedback telephone line and controlled by relay circuits

(mentioned earlier).

Microcontroller:

This forms the heart of our entire INTERACTIVE VOICE RESPONSE SYSYTEM.

It is a common block to both the parts. It accepts a suitable signal from ring detector

circuit and triggers the relay activation circuit.

It also accepts the output of 8870 DTMF decoder and processes it and gives the

suitable signal to the computer. It controls the working of various functional blocks

and co-ordinates the operation.

Page 4: BE Project Fortnight Reports on IVRS

FORTNIGHT REPORT 2

Here we have studied different flowcharts describing the working of our project.

Ring Signal

detected?

Start

Ring

Continue?

Wait for 10 seconds

Deactivate DTMF

decoder by relay ckt.

Wait for user response

Establish a

dedicated line

Activate Relay to ans.

Pass the audio via the

isolation transformer.

Call terminate

Continue? Yes

No

No

No

Yes

Yes

Stop

Page 5: BE Project Fortnight Reports on IVRS

Algorithm ( System End )

Step 1 : Dial the number for the Interactive Voice Response System.

Step 2 : Check for the received signal.

Step 3 : If Busy Tone then go to step 4 else go to step 5.

Step 4 : Terminate the call check for redial. If yes go to step 4 if no go to step

10.

Step 5 : Wait for call to be answered.

Step 6 : On being answered dial for the language in which to be answered.

Step 7 : Choose the service for the required information.

Step 8 : Check if you want to continue. If yes go to step 7, if no go to step 9.

Step 9 : Terminate the call.

Step 10 : Stop the system.

Page 6: BE Project Fortnight Reports on IVRS

Flow Chart ( User End )

YES

YES NO

Start

Dial the Number.

Check the

signal

Dial for

Language.

Wait to be

answered.

Ringing

Signal

Call

Terminate

Busy Tone

Stop

Redial?

Choose for

the service.

Continue?

Call

Terminate

Stop

NO

Page 7: BE Project Fortnight Reports on IVRS

Algorithm ( User End )

Step 1 : Check if the ringing signal is present in the telephone line.

Step 2 : If ringing signal is present then wait for 10 seconds, & go to step 3 or else go to

step 1.

Step 3 : If ring continues then activate the relay or else go to step 1.

Step 4 : Establish a dedicated line connection.

Step 5 : Wait for the response of the caller.

Step 6 : Deactivate the DTMF decoder by relay control circuit to save the decoder from

getting false input.

Step 7 : Pass the audio signal via the isolation transformer.

Step 8 : Check if the signal is continued. If yes go to step 3 else go to step 7.

Step 9 : Terminate the call.

Step 10 : Stop the system.

Page 8: BE Project Fortnight Reports on IVRS

FORTNIGHT REPORT 3

Here we have studied the IC description of microcontroller – 89S52 and DTMF

decoder 8870

Microcontroller - 89S52

Pin Diagram of 89S52

Page 9: BE Project Fortnight Reports on IVRS

Internal Block Diagram of 89S52

Page 10: BE Project Fortnight Reports on IVRS

Usage in our Circuit

The 89s52 is a microcontroller which has in system programming (ISP) which we

found very useful during the testing stage of our circuit.

Since in ISP the memory of the microcontroller is not formatted once the program

is tested, hence we need not re-program the chip again and again.

The primary job of the microcontroller is to trigger the voice channel based on the

appropriate input received.

The input to the microcontroller is at P1.0, P1.1, P1.2, P1.3 which comes from pin

no. 11,12,13,14 of 8870 respectively.

On receiving the input the microcontroller processes it and triggers the voice

channel of the secondary PCB giving an active low signal at pin no P.20, P2.1,

p2.2 ,P.2.3 according to the input.

Another additional function of the microcontroller is to start a delay of 10s which

will be taking care of the instant of false triggering due to error in the line.

Page 11: BE Project Fortnight Reports on IVRS

Features & Application

• Compatible with MCS®-51 Products

• 8K Bytes of In-System Programmable (ISP) Flash Memory

– Endurance: 1000 Write/Erase Cycles

• 4.0V to 5.5V Operating Range

• Fully Static Operation: 0 Hz to 33 MHz

• Three-level Program Memory Lock

• 256 x 8-bit Internal RAM

• 32 Programmable I/O Lines

• Three 16-bit Timer/Counters

• Eight Interrupt Sources

• Full Duplex UART Serial Channel

• Low-power Idle and Power-down Modes

• Interrupt Recovery from Power-down Mode

• Watchdog Timer

• Dual Data Pointer

• Power-off Flag

• Fast Programming Time

• Flexible ISP Programming (Byte and Page Mode)

• Green (Pb/Halide-free) Packaging Option

Page 12: BE Project Fortnight Reports on IVRS

DTMF Decoder - 8870

Pin Diagram of 8870

Page 13: BE Project Fortnight Reports on IVRS

Internal Block Diagram of 8870

Usage in our circuit:

The DTMF decoder is basically used to understand what the user wishes to receive. The

input to the DTMF decoder is a tone which has a specialized frequency which intern

depends upon the number punched in by the user on the telephone keypad. Thus at the

input of the DTMF decoder is a tone with a particular voltage level. The basic job of the

DETMF decoder is to convert the input it has received into binary format. In our circuit

the tone is decoded into the binary format and made available to the microcontroller on

pin number 11,12,13,14 with 11 being the LSB and 14 being the MSB.

Page 14: BE Project Fortnight Reports on IVRS

FORTNIGHT REPORT 4

Here we have studied various software aspect with the flowchart and the program

based on it.

Basic Block Diagram of S/W

Start

Initialization

Wait for user response

Call delay of 10 sec

Message played accordingly

Relay 2 & 1 disconnected

Stop

Yes

No

No

Yes

P2.5 high ?

P2.5 high ?

Count the no. of high & low pulses

Relay 1 & 2 is connected and

welcoming message is played

Page 15: BE Project Fortnight Reports on IVRS

Description of S/W Block

The first step in our program is the initialization of RAM loations, vector

addresses and interrupts initialization.

The second step in our program is the start of the main program in which

initially P2.5 is monitored by the microcontroller.

Once the P2.5 goes high the program counts the total number of active high

and active low signal at this pin.

Next in the program a delay of 10s is started.

At the end of the 10s delay if P2.5 is still high relay1 and relay2 are connected

and the welcoming message is played.

Otherwise the program is terminated and the program once again monitors

P2.5 until it goes high.

After first message is played the system waits for user response to play the

remaining messages accordingly.

At the end of program relay1 and relay2 are disconnected and the program

stops.

Page 16: BE Project Fortnight Reports on IVRS

Software Code

org 0000h

Begin: ajmp start

org 0003h

ajmp Terminate

reti

org 000bh

reti

org 0013h

reti

org 001bh

reti

org 0023h

reti

start: mov a,#00h ;Disable interrupt

mov ie,a

clr a ;Clear the contents of Internal RAM

mov r0,#7fh

clrit: mov @r0,a

djnz r0,clrit

mov sp,#30h ;Initialize Stack Pointer

mov psw,#00h ;Select Bank Zero

clr P1.4

clr P3.5

call delay1

mov P2,#0ffh

mov r7,#05h

Here: jb P2.5,Space ;Ring detection

sjmp Here

Space: jnb P2.5,Space2

sjmp space

Space2: djnz r7,Here

call delay10

Page 17: BE Project Fortnight Reports on IVRS

Timer1: mov a,#81h

mov ie,a ;Enable interrupt

CALL delay

setb P1.4 ;Relay1 connected

setb P3.5 ;Relay2 connected

clr P2.0 ;Welcome message

clr P3.6

call delay1

setb P2.0

CALL delay10 ; Delay of 10 sec

clr P3.5

setb P3.6

Repeat: setb P1.0

setb P1.1

setb P1.2

setb P1.3

CAll delay5

mov a,P1

ANL a,#0fh ;mask except P1.0 to P1.3

cjne a,#00h,Next1

clr P1.4

clr P2.5

ajmp Begin ;Call terminate

Next1: cjne a,#01h,Next2

setb P3.5

clr P2.1 ;Message1 play

clr P3.7

call delay1

setb P2.1

CALL delay10

setb P3.7

clr P3.5

Page 18: BE Project Fortnight Reports on IVRS

clr P1.0

sjmp Repeat

Next2: cjne a,#02h,Next3

setb P3.5

clr P2.2 ;Message2 play

clr P3.3

call delay1

setb P2.2

CALL delay10

setb P3.3

clr P3.5

clr P1.1

sjmp Repeat

Next3: setb P3.5

clr P2.3 ;Error message play

call delay1

setb P2.3

CALL delay10

clr P3.5

clr P1.0

clr P1.1

clr P1.2

clr P1.3

sjmp Repeat

Terminate: setb P2.5

ajmp Begin

Terminate1: clr P1.4

setb P2.5

ajmp Begin

delay10: mov r0,#07h

loop4: mov r1,#50h

loop3: mov r2,#80h

Page 19: BE Project Fortnight Reports on IVRS

loop2: mov r3,#40h

loop1: djnz r3,loop1

djnz r2,loop2

djnz r1,loop3

djnz r0,loop4

ret

delay5: mov r0,#05h

loop41: mov r1,#50h

loop31: mov r2,#80h

loop21: mov r3,#40h

loop11: djnz r3,loop11

djnz r2,loop21

djnz r1,loop31

djnz r0,loop41

ret

delay1: mov r0,#02h

loop411: mov r1,#50h

loop311: mov r2,#80h

loop211: mov r3,#40h

loop111: djnz r3,loop111

djnz r2,loop211

djnz r1,loop311

djnz r0,loop411

ret

Once the PCB was ready and the component mounting was done we started testing

smaller test programs in order to reach the final program. We faced the following

problems and found the solutions after logically pondering over it.

1. While using 89C51 the program was erased from the RAM after every single test.

Hence we switched over to 89S52 which has ISP

capabilities

2. The grounding of various nodes in the PCB was not proper. We took the help of

multimeter to identify those nodes and ground them accordingly.

3. The ring detector circuit was not working properly. After extensive research on

the internet we found the ring detector circuit that employed 6N139 as the

optocoupler.

Page 20: BE Project Fortnight Reports on IVRS

4. Audio not reaching the telephone handset. The problem lied in the mismatching

of the resistance of primary and secondary that was supposed to be 600ohms.

5. Relay not getting 12V. This was the mistake of the PCB manufacturer who did

not provide a connection. Hence we had to use a jumper.

6. Audio not properly audible. The solution lied in the proper tunning of the

potentiometer which dealt with the sampling rate and the volume control.

7. Automatic triggering of the voice chip. The ground pin of the port2 was

connected hence it received active low trigger ring throughout the duration for

which the system was on.

8. The DTMF was not working properly i.e no input at the DTMF decoder. We used

10nf polyester capacitors instead of 470uf ceramic capacitors.

9. While testing the PCB we faced many problems which had the solution in proper

and tight connections with the PCB.

Page 21: BE Project Fortnight Reports on IVRS

FORTNIGHT REPORT 5

Here we have found out the cost and quantity of the various components used in our

project.

Components used in a circuit :

ICs:

1. 89S52 ( 1 )

2. 8870 ( 1 )

3. APR9600 ( 1 )

4. 4047 ( 1 )

5. 6N139 ( 1 )

6. LM7805 ( 1 )

7. LM7812 ( 1 )

8. 7400 ( 1 )

9. MAX 232 ( 1 )

Crystal Oscillators:

1. 12 MHz ( 1 )

2. 3.474545 MHz ( 1 )

Transistors:

1. BC 547 ( 3 )

2. BC 516 ( 1 )

3. 2N2095 ( 1 )

Diodes:

1. IN4007 ( 5 )

2. IN4148 ( 3 )

3. Zenner diodes ( 3 )

4. LEDs ( 7 )

Page 22: BE Project Fortnight Reports on IVRS

Resistors:

1. 390 ohm ( 1 )

2. 470 ohm ( 1 )

3. 560 ohm ( 3 )

4. 820 ohm ( 1 )

5. 1 k ( 1 )

6. 1.2 k ( 3 )

7. 2.7 k ( 2 )

8. 4.7 k ( 2 )

9. 8.2 k ( 2 )

10. 10 k ( 5 )

11. 22 k ( 2 )

12. 39 k ( 1 )

13. 56 k ( 7 )

14. 100 k ( 1 )

15. 270 k ( 1 )

16. 1 M ( 1 )

17. 4.7 M ( 1 )

Capacitor:

1. 47 pf ( 2 )

2. 10 nf ( 5 )

3. 100 nf ( 13 )

4. 4.7 uf ( 2 )

5. 10 uf ( 3 )

6. 22 uf ( 2 )

7. 30 uf ( 2 )

8. 1 uf ( 3 )

9. 2.2 uf ( 1 )

Transformer:

1. 9-0-9V ( 1 )

2. 15-0-15V ( 1 )

Other components:

1. Switches ( 9 )

2. Relays (12 V/ ) ( 2 )

3. Power connectors ( 2 )

4. RJ 11 ( 2 )

Page 23: BE Project Fortnight Reports on IVRS

Cost of components: ICs : Rs. 324

crystal oscillators: Rs. 108

Transistors: Rs. 81

Diodes: Rs. 45

Resistors: Rs. 37

Capacitors: Rs. 44

Transformer: Rs. 63

Other: Rs. 441

Cost of the circuit:

Cost of the components : Rs. 1143

Cost of the PCB : Rs. 1440

Labour cost :

*TOTAL COST : Rs. 2583

Page 24: BE Project Fortnight Reports on IVRS

FORTNIGHT REPORT 6

Future Development

The primary PCB of our circuit has a very important application which can enhance its

real time operation. That is presence of the serial port for a serial communication with the

computer through COM ports. In this application the value of the number punched in by

the user is serially transmitted via MAX232 chip to the computer where it is processed

and a suitable wave file is triggered by a software program preferably written using

VISUAL BASICV6.0. the wave file which is played can be stored in the hard disk of the

computer and can be accessed by the program using the concept of uniform resource

locator (URL). Since the memory of the computer is huge a large number of speech

messages can be stored and played by a media player. The output from the computer can

be directly connected to the telephone line via audio transformer which is also called as

an isolation transformer.

The various nuances of serial communication is mentioned below:

Asynchronous mode of data transmission

In asynchronous transmissions, the link does not include a clock line because each end of

the link provides its own clock. Each transmitted byte includes a start bit to synchronize

the clocks followed by the eight bits of data (LSB first) and one or more stop bits to

signal the end of the transmitted word. The RS232 ports on PCs use asynchronous

formats to communicate with modems and other devices.

Data formats

Data bits in serial transmission may be in binary, hex or text format.

Binary data

With binary data, the receiver interprets a received byte as a binary number with a value

from 0 – 255. The bits are conventionally numbered 0 through 7 with each bit

representing the bit's value (0/1) multiplied by the power of two.

Page 25: BE Project Fortnight Reports on IVRS

Text data

It is used in links which need to send messages or files containing text. A link may also

send binary data encoded as text. To send text the program uses a code that assigns a

numeric value to each text character. There are several coding conventions, ASCII being

the most common, which consists of 128 codes requiring only 7 data bit, and the 8th bit

may be a parity bit. The ASCII text format is used by Visual Basic's MSComm control.

ASCII HEX

We can use text to transfer binary data, by expressing the data in ASCII HEX format.

Each byte is represented by a pair of ASCII codes that represent the byte's two

hexadecimal characters. This format can represent any value using only the ASCII codes.

Instead of sending one byte to represent a value from 0 – 255 the sending device sends

two, one for each character in the HEX number that represents the byte. The receiving

computer treats it like ordinary text. After a computer receives the values it can process

or use the data any way it wants, including converting it back to binary data

RS 232 C Standard

RS-232 is a “complete” standard. This means that the standard sets out to ensure

compatibility between the host and peripheral systems by specifying

1) Common voltage and signal levels,

2) Common pin wiring configurations, and

3) A minimal amount of control information between the host and peripheral systems.

Unlike many standards which simply specify the electrical characteristics of a given

interface, RS-232 specifies electrical, functional, and mechanical characteristics in order

to meet the above three criteria.

Electrical Characteristics

The electrical characteristics section of the RS–232 standard includes specifications on

voltage levels, rate of change of signal levels, and line impedance.

Functional Characteristics

RS–232 has defined the function of the different signals that are used in the interface.

These signals are divided into four different categories: common, data, control, and

timing.

Page 26: BE Project Fortnight Reports on IVRS

Mechanical Interface Characteristics

The third area covered by RS–232 concerns the mechanical interface. In particular, RS–

232 specifies a 25–pin connector. This is the minimum connector size that can

accommodate all of the signals defined in the functional portion of the standard.

Types of Connectors

VISUAL BASICS :

VB is preferred as the programming language because of its following features:

Based on basic language

Programming objects and events:

The visual forms and objects like list boxes and radio buttons that one uses on the

form, help to interact with the application in order to find out the flow of the

program. The forms and object perform specified action when an event occurs.

This is known as Event Driven Programming.

A quick and easy way to develop applications :

The tool provided by VB helps to reduce development time. It is faster to create

application using the tools available.

A quick editing, testing and debugging.

Full array of mathematical string handling and graphic functions.

Sequential and random access files support.

Powerful database access tools.

Page 27: BE Project Fortnight Reports on IVRS

Internet features.

ActiveX support.

Package and deployment wizard makes distributing the application samples.