minor project report

39
1 CHAPTER- 1 Introduction 1.1) Aim: To design Dual Tone Multi Frequency signal transmitter and receiver which are capable of sending sequence of numbers at regular intervals in DTMF format to switch ON various devices. 1.2) General Description of Entire System: System consists of one master DTMF code transmitter and one master DTMF code receiver. DTMF transmitter includes keypad, DTMF signal generator, and mixer circuit for modulation, amplifier and a transmission antenna. DTMF receiver includes Receiver antenna, mixer circuit for demodulation, DTMF decoder, and Digital logic to switch on the devices. Advantage is that many devices can be interfaced to one DTMF receiver. When the corresponding DTMF code for a particular device is received by the receiver then that device only responds accordingly. Transmission and Reception of DTMF code will be on the frequency range used in RCIED’s (4 MHz – 12 MHz). 1.3) Working Principle of Entire System: DTMF Keypad DTMF signal generator Mixer Circuit / Modulator Amplifier DTMF signal Decoder Mixer Circuit / Demodulator Filters LOGIC ….……… To different Devices DTMF sig. Antenna Antenna (4 – 12) MHZ DTMF sig. Fig 1.2 Block Diagram of Receiver Fig 1.1 Block Diagram of Transmitter (4 – 12) MHZ

Upload: api-3717961

Post on 14-Nov-2014

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Minor Project Report

1

CHAPTER- 1

Introduction

1.1) Aim:

To design Dual Tone Multi Frequency signal transmitter and receiver which are

capable of sending sequence of numbers at regular intervals in DTMF format to switch

ON various devices.

1.2) General Description of Entire System:

System consists of one master DTMF code transmitter and one master DTMF

code receiver. DTMF transmitter includes keypad, DTMF signal generator, and mixer

circuit for modulation, amplifier and a transmission antenna. DTMF receiver includes

Receiver antenna, mixer circuit for demodulation, DTMF decoder, and Digital logic to

switch on the devices. Advantage is that many devices can be interfaced to one DTMF

receiver. When the corresponding DTMF code for a particular device is received by the

receiver then that device only responds accordingly.

Transmission and Reception of DTMF code will be on the frequency range used

in RCIED’s (4 MHz – 12 MHz).

1.3) Working Principle of Entire System:

DTMF Keypad DTMF signal

generator

Mixer Circuit /

Modulator

Amplifier

DTMF signal Decoder

Mixer Circuit /

Demodulator

Filters

LOGIC

….………

To different Devices

DTMF

sig.

Antenna

Antenna (4 – 12) MHZ

DTMF

sig.

Fig 1.2 Block Diagram of Receiver

Fig 1.1 Block Diagram of Transmitter

(4 – 12) MHZ

Page 2: Minor Project Report

2

1.3.1) Transmitter Circuit:

When the key is pressed in the keypad, DTMF signal generator produces DTMF

signal corresponding to that key. DTMF signal is FM modulated and we set center

frequency ranges from 4MHz – 12MHz. This signal is fed to amplifier and transmitted

through antenna as shown in fig 1.1.

1.3.2) Receiver Circuit:

The working principle of receiver circuit is shown in the fig.1.2. Receiver antenna

receives signal, which passes through filters and gets demodulated to give the original

DTMF signal. This signal is given to DTMF signal decoder and decoded output is passed

through logic, to operate appropriate devices.

1.4) Block Diagram of System Implemented:

For the purpose of demonstration, part of the system is implemented. The system

implemented has wired transmission of DTMF signal between Transmitter and Receiver

as shown in fig 1.3. Controller is used in the transmitter side, instead of keypad for the

generation of sequence of numbers at regular intervals. Controller used in the receiver

side switches ON devices against the device code received. Displays are interfaced to

check the transmitted code.

PIC DTMF Generator

DISPLAY

DTMF Receiver PIC

DEVICES

TRANSMITTER

RECEIVER

Transmission Line

DISPLAY

Fig 1.3 Block Diagram of the system implemented

Page 3: Minor Project Report

3

1.5) Organization of the Report:

Chapter 1: Gives introduction about the complete system and the system

implemented

Chapter 2: Details about the designing of DTMF signal transmitter system and

logic for the generation of sequence of numbers

Chapter 3: Details about the designing of DTMF signal receiver circuit and logic to

switch on the various devices

Chapter 4: Discussion about the results obtained

Page 4: Minor Project Report

4

Chapter 2

DTMF Transmitter

2.1) Introduction:

This Chapter deals with basics of DTMF signal, frequency bands of each key,

keypad interfaced circuit to explain the working principle of DTMF signal generator IC

MV5089. In order to demonstrate the system, PIC is interfaced with MV5089 to generate

the sequence of codes. This chapter also explains the logic implemented in PIC through

flow chart. For the convenient of demonstration 7 segment LED is interfaced with the

transmitter circuit. Finally, explains the entire transmitter side operation with circuit

diagram.

2.2) General Description:

DTMF (Dual Tone Multi Frequency) generation is a composite audio signal of two

tones between the frequency of 697Hz and 1633Hz. The DTMF keypad is arranged such

that each row will have its own unique tone frequency (ranging from 697 Hz – 941 Hz)

and each column will have its own unique tone (ranging from 1209 Hz – 1633Hz).

Representation of the typical DTMF keypad and their associated row/column frequencies

are shown in fig 2.1.

Fig 2.1 Organization of Keypad

Page 5: Minor Project Report

5

Frequency Band Selection for the Low Tone Group and for the High Tone Group is given

in Fig 2.2.

Tone Groups are selected such that both High Tone and Low Tone should not

overlap with each other at the same time each frequency band of one tone group should

not overlap with each other to avoid the deterioration of valuable signal. In addition, it

made easy to design Band pass filters on the receiver side.

2.3) DTMF Signal Generation Using MV5089:

In order to generate DTMF signal, DTMF signal generator IC MV 5089 is used. It

has got 4 column pins and 4 row pins. All the 8 pins are internally pulled high and will

accept the low level signal. A keypad can be interfaced with MV5089 as shown in the fig

2.3. Whenever a particular key is pressed corresponding row and column pins will be

connected to ground. Once the column and rows pins are connected to ground, then the

corresponding HIGH tone and LOW tone will be generated. For example, if the number

‘1’ is pressed in the keypad, the tones 1209Hz and 697Hz will be generated. MV5089

will give DTMF signal at TONE output by combining High Tone and Low Tone.

Fig 2.2 LOW tone and HIGH tone Bands

Page 6: Minor Project Report

6

2.4) Interfacing PIC with MV5089:

Main idea is to Pre- activate the RCIED’s; there many sequences of number

should be generated for various IF Bands. In that context, generating sequence of

numbers through key pad is impossible; to achieve that PIC 16F870 Controller is

interfaced with the DTMF signal generator as shown in fig 2.4.

In this project, to demonstrate the operation of the entire system, three devices are

activated by generating the DTMF signal. Each Device will have unique device code

which of three digits. (Device 1 = 567, Device 2 = 653 Device3 = 521). Of the three

digits of device code, digits are sent one after another. And finally devices will be

activated one by one.

Fig 2.3 Interface of Keypad with MV5089

Page 7: Minor Project Report

7

Main purpose of Controller is to store all the devices code, separate them into

single digit and send them one by one to DTMF signal generator. Finally each digit is

sent to receiver in the form of DTMF signal. For example to activate the DEVICE 1,

Device Code for that is taken 567 and separated into 5, 6, 7 and stored in separate

variables. Send 5 first, followed by 6 and 7.

2.5) Logic Implemented in PIC 16F870

2.5.1) Algorithm:

1) Take one Device code

2) Separate the device code into single digits

3) Store the three single digits in separate variables

4) Send the digits one by one

5) According to the digit, send LOW signals to corresponding Column and Row

RB4 RB5

RB6

RB7

RB0

RB1

RB2

RB3

PIC 16F870

Fig 2.4 PIC Interfaced with MV5089

Page 8: Minor Project Report

8

2.5.2) Flow Chart:

START

Take one Device Code

Separate it into three single digits

& store it separate variables

Send LOW Signal to Corresponding

Column and ROW

if

Send ==3

If

Device ==3

Send +1 NO

YES

Device +1

NO

YES

STOP

Flow chart 2.1 Logic for transmitter circuit

Page 9: Minor Project Report

9

2.6) Display Interfacing:

For the convenient of demonstration, a 7 segment display is interfaced with PIC

through the driver IC 4511. So, whatever number sent to DTMF signal generator, will

also be sent to 7 Segment display. Complete block diagram of Transmitter side is shown

in fig 2.5.

2.7) Working of Transmitter Circuit:

Entire transmitter circuit diagram is shown in the fig.2.6. PIC is interfaced to

MV5089 through PORTB. PORT C of PIC is interfaced with the 7 segment LED driver.

LSBs (RB0-RB4) are used for ROW pins and MSBs (RB4-RB7) are used for COLUMN

pins. PORTB always output FFh, that is, HIGH to all pins, so no number will be

generated. In order to send a particular number, corresponding column and row pins are

made LOW. Once the column and rows pins are made LOW, DTMF generator will send

the corresponding DTMF signal to receiver. At the same time, same number is sent to

LED driver through PORTC of PIC, to display in 7 segment LED. In this way, sequence

of numbers are generated and displayed in 7 segment LED simultaneously.

PIC

16F870 DTMF Signal

Generator

7 seg. LED Driver

Tone out

Fig 2.5 Complete Transmitter System Block Diagram

Page 10: Minor Project Report

10

2.8) Conclusion:

This chapter explained the working of DTMF signal generator, logic implemented

in PIC to send sequence of numbers, interfacing of PIC with DTMF generator and 7

segment LED and finally the description of the entire DTMF transmitter system.

RB7

RB6 RB5

RB4

RB3

RB2

RB1 RB0

RC0

RC1

RC2 RC3

Col4

Col3 Col2

Col1

MV5089

Row1

Row2

Row3 Row4

R1

390

0

A a B b

C c

D d

4511 e f g

330 ohm

330 ohm

330 ohm

330 ohm

330 ohm

330 ohm

330 ohm

7 Segment LED

Fig 2.6 Complete Transmitter System Circuit Diagram

Vdd

TONE O/P

Page 11: Minor Project Report

11

Chapter 3

DTMF Receiver

3.1) Introduction:

This chapter deals with basic concept of DTMF signal decoding, introduce the IC

CM8870 used for the decoding, design of receiver circuit to detect valid DTMF signal,

the way how PIC is interfaced between decoder and the devices to be switched ON, the

logic implemented in PIC through flow chart and finally working of entire receiver

circuit.

3.2) General Description:

On the receiver side, first Low tone and High tone is separated using band-spilt

filter into two discrete signals as shown in fig 3.1.

Then the separated signals are given to the corresponding decoding logic and

depending upon the HIGH tone and LOW tone received digital output will be produced

as shown in fig 3.2.

High Group Filters

Low Group Filters

Digital Filters

Digital Filters

I/P DTMF Signal

Fig 3.1. Separation High & Low tone

Page 12: Minor Project Report

12

3.3) DTMF Signal Receiver Using CM8870:

In order to decode the DTMF signal, DTMF signal receiver CM8870 is

used. Block diagram is shown in fig 3.3 It is having Input operational amplifier

with an option for gain select. This is used in inverting configuration with unity

gain. Min voltage of DTMF signal that can be detected should be not less than

1.5V. If there is any Transmission loss in the signal, then gain of receiver can be

selected accordingly.

Q1, Q2, Q3, Q4 are the decoded output. The signal StD (delayed steering)

gives high signal when the decoded out put is latched

Fig 3.2 Interface of Keypad with MV5089

Page 13: Minor Project Report

13

3.4) DTMF Signal Receiver Design:

Receiver should be designed properly to detect the valid DTMF signal. Timing

Diagram is given fig 3.4 for CM8870 IC.

ESt -> Early Steering Output. Indicates detection of valid tone Frequencies.

St/GT -> Steering INPUT/GUARD TIME OUTPUT. Drives External RC Timing Circuit

StD -> Delayed steering output. Presents logic high when a received tone pair has been registered and the output latch is updated. Returns to logic low when the voltage on

St/GT falls below VTSt.

Fig 3.3 Block diagram of CM8870

Page 14: Minor Project Report

14

T REC = Minimum time required to detect the valid DTMF signal

Typical value is 40ms

T REC = tDP + tGTP:

tDP = Minimum Time required by the IC to detect the Signal

tDP = 14 ms

tGTP = Minimum time required to start conversion after tDP

tGTP = this can be designed by RC circuit such that sum of tGTP & tDP should be

greater than 40ms

here tGTP is designed for 30ms R = 300K C = .1µF

Input op-amp is designed for unity gain by two 100K ohm resistors.

Designed circuit is shown in fig 3.5 and component values are given below the

figure

Fig 3.4. Timing diagram of CM8870

Page 15: Minor Project Report

15

C2 = .1µF

R3 = 300 K ohm

R1 = 100K ohm

R2 = 100K ohm

3.5) Interfacing PIC with Receiver IC:

From the Transmitter, it is going to get three digit codes for three devices.

The purpose of the PIC is to get the sequences of single digit of codes, combine

the single digit code to three digit code of the device. The unique three digit code

for the devices, also stored in the receiver side. If the receiver PIC gets the same

three digit code it will switch ON the device corresponding to that code. The

signal StD of CM8870 is connected to the interrupt pin of the PIC 870

Fig 3.5. Designed Receiver Circuit

Page 16: Minor Project Report

16

3.5.1) Algorithm:

1) On Interrupt, get the decoded code

2) On receiving three codes, combine it to form single three digit code

3) The final three digit code is compared with the pre defined Device

Code stored in PIC

4) If the Code matches switch ON the corresponding device.

3.5.2) Flow Chart

Display: 7-Segment Display is also interfaced in the receiver side to check the received

code

Wait on Interrupt

Get the decoded Code from receiver

If

Receive= =3

Combine three single digits to one

three digit code

If Received Code

== Dev. Code SWITCH ON the DEVICE

If

Device==3

NO

YES

NO

YES

NO

YES

STOP

Flow chart 3.1.Logic to switch on the Devices

Page 17: Minor Project Report

17

3.6) Working of Receiver Circuit:

Complete Receiver circuit diagram is show in the fig 3.6. PORTB of PIC (RB4 -

RB7) is interfaced with CM 8870 to get the decoded output. StD pin of CM8870 is

connected to interrupt to indicate the end of decoding. PORT C is used to switch ON the

devices. PORT A is used to interface the display. When the DTMF receiver receives the

DTMF signal for valid duration, it decodes and gives output at Q1, Q2, Q3, Q4 and

interrupt is given to PIC. Once the PIC is interrupted, it will get the code on MSBs of

PORTB and sends the same number to LED display. As soon as PIC gets the entire code

it will switch on the corresponding device through PORTC.

PIC 16F870

Interrupt (RB0)

RB4 – RB7

PORTA(RA0-RA3)

D

E

V

I

C

E

S

PORT C

330 ohm

330 ohm

330 ohm

330 ohm

330 ohm

330 ohm

330 ohm

a

b ABCD

c d

e 4511 f

g

330 ohm

Fig 3.6. Complete Receiver System Circuit Diagram

Page 18: Minor Project Report

18

3.7) Conclusion:

This chapter dealt with basic DTMF decoding principle, interfacing of PIC

with DTMF signal decoder and devices, explained logic implemented in PIC to

switch ON the devices on receiving correct device code and finally description of

the entire DTMF receiver system.

Page 19: Minor Project Report

19

Chapter 4:

Results and Discussion

4.1) Transmitter:

1) DTMF signals are generated by interfacing PIC with MV5089

DTMF signal for the number 5 and 1 are shown in fig 4.1 and fig 4.2

2) Output of 7 – segment LED is also cross checked with the DTMF signal using

CRO

Fig 4.1 DTMF Signal for Number 5

Fig 4.2 DTMF Signal for Number 1

Page 20: Minor Project Report

20

3) Device Code for Device 1 = 567

Device Code for Device 2 = 653

Device Code for Device 3 = 521

PIC controller on the transmitter side is programmed in such a way that it will

send device code of Device 1 first, followed by Device 2 and Device 3. These codes are

verified by the display interfaced with the transmitter.

After sending the complete set of codes, transmitter will stop sending signals

but for the purpose of demonstration, transmitter will again start to send the signal from

the beginning.

4.2) Receiver:

1) On the receiver side, received DTMF signal is decoded and corresponding

digital code is sent to PIC and decoded code is displayed in 7 – segment LED.

This display is cross checked with transmitter display.

2) PIC Interfaced to get digital code of receiver circuit on interrupt. PIC will

accumulate the codes until it receives three numbers. Once if it receives three

numbers, it will form a device code and check received device code with the

pre defined device code. If it matches with any one of the device code, PIC

will switch ON the device corresponding to that code through PORT C. This

is demonstrated by keeping LEDs in the place of devices.

4.3) Work To Be Done:

In this project, DTMF signal generation and DTMF signal decoding is completed.

Here, DTMF signal transmission and reception is done through wire. In next semester,

DTMF signal transmission and reception will be made wireless and transmitted by having

the center frequencies ranges from 4MHz to 12MHz. Experimental analysis will be done

at different distances for different input power. Final system will be capable of switching

on the remotely located devices

Page 21: Minor Project Report

21

APPENDIX A

PIC Codes for Transmitter and Receiver

TRANSMITTER side Code:

#include <pic.h>

#define delay1U asm("nop");

int devicet1,devicet2,devicet3,i1,i2,i3;

char i=0,led, dnum,send,stop;

void displayportb (int disp){

switch (disp) {

case 1:

PORTB = 0XEE;

PORTC = 0x11;

break;

case 2:

PORTB = 0XDE;

PORTC = 0x22;

break;

case 3:

PORTB = 0XBE;

PORTC = 0x33;

Page 22: Minor Project Report

22

break;

case 4:

PORTB = 0XED;

PORTC = 0x44;

break;

case 5:

PORTB = 0XDD;

PORTC = 0x55;

break;

case 6:

PORTB = 0XBD;

PORTC = 0x66;

break;

case 7:

PORTB = 0XEB;

PORTC = 0x77;

break;

case 8:

PORTB = 0XDB;

PORTC = 0x88;

break;

case 9:

PORTB = 0XBB;

PORTC = 0x99;

break;

}

}

void displayled(int disp_led) {

switch(disp_led){

Page 23: Minor Project Report

23

case 1:

PORTA = 0X0E;

break;

case 2:

PORTA = 0X0D ;

break;

case 3:

PORTA = 0X0B;

break;

}

}

void seperate(int device) {

i1 = i2 = device/10;

i1 = i1 *10;

i1 = device - i1;

i3 = device/100;

i2 = i2 - (i3*10);

i2=i2;

}

void sending() {

//PORTA = 0X3F;

if(send == 1){

displayportb(i1);

send++;

}

else if (send == 2) {

displayportb(i2);

send++;

Page 24: Minor Project Report

24

}

else {

displayportb(i3);

send =1;

dnum++;

}

if(led==4){

led = 1;

}

displayled(led);

led++;

}

void interrupt isr()

{

if(T0IF==1)

{

if(i==0)

{

i=16;

if(stop==0){

if(dnum == 4) {

dnum =1;

}

if(dnum == 1){

seperate(devicet1);

sending();

}

Page 25: Minor Project Report

25

else if(dnum == 2) {

seperate(devicet2);

sending();

}

else if(dnum == 3) {

seperate(devicet3);

sending();

}

stop =1;

}

else{

stop = 0;

PORTB = 0XFF;

PORTA = 0X3F;

}

}

else

{

i--;

}

INTCON =0XE0;

T0IF=0;

}

}

void main()

{

Page 26: Minor Project Report

26

OPTION=0X87;

ADCON1 = 0X06;

dnum =1;

led = 1;

devicet1 = 965;

devicet2 = 356;

devicet3 = 125;

send = 1;

i1=0;

i2=0;

i3=0;

TRISA=0X00;

TRISB=0X00;

TRISC=0X00;

PORTA=0X0F;

PORTB=0XFF;

PORTC=0X00;

INTCON=0XE0;

TMR0=0x00;

while(1)

{

INTCON= 0XE0;

}

}

Page 27: Minor Project Report

27

RECEIVER side Code:

#include <pic.h>

char recnum,receive;

int ir1,ir2,ir3,devcode;

void checkdevice(int device) {

switch(device){

case 0X569:

PORTC = 0X11;

break;

case 0X653:

PORTC = 0X33 ;

break;

case 0X521:

PORTC = 0X77;

break;

}

}

void display7seg (char disp){

switch (disp) {

case 0x10:

PORTA = 0X01;

break;

case 0X20:

PORTA = 0X02;

Page 28: Minor Project Report

28

break;

case 0X30:

PORTA = 0X03;

break;

case 0X40:

PORTA = 0X04;

break;

case 0X50:

PORTA = 0X05;

break;

case 0X60:

PORTA = 0X06;

break;

case 0X70:

PORTA = 0X07;

break;

case 0X80:

PORTA = 0X08;

break;

case 0X90:

PORTA = 0X09;

break;

}

}

void interrupt isr()

{

if(INTF==1)

{

recnum = PORTB & 0XF0;

display7seg(recnum);

Page 29: Minor Project Report

29

if(receive==1){

ir1 = recnum ;

ir1 = ir1*0X10;

}

else if(receive==2)

{

ir2 = recnum;

}

else if(receive==3)

{

receive = 0;

ir3 = recnum/0X10;

devcode = ir1+ir2+ir3;

checkdevice(devcode);

}

INTF =0;

receive++;

}

}

void main()

{

OPTION=0XC0;

ADCON1 = 0X06;

receive=1;

TRISA = 0X00;

TRISB = 0XFF;

TRISC = 0X00;

PORTA = 0XFF;

INTCON=0XD0;

while(1)

Page 30: Minor Project Report

30

{

}

}

APPENDIX B

PIC 16F870:

Pin diagram:

Registers Used in Program

1) ADCON1

Page 31: Minor Project Report

31

2) INTCON

Page 32: Minor Project Report

32

3) OPTION

Page 33: Minor Project Report

33

APPENDIX C

DTMF Signal Generator: MV 5089:

Pin Details:

Block Diagram:

Page 34: Minor Project Report

34

ROW and COLUMN Inputs

Page 35: Minor Project Report

35

APPENDIX – D

DTMF Signal Receiver CM8870:

PIN details:

Functional Block Diagram

Page 36: Minor Project Report

36

Page 37: Minor Project Report

37

Timing Diagram:

Page 38: Minor Project Report

38

Explanation of Symbols

Vin DTMF COMPOSITE INPUT SIGNAL. ESt EARLY STEERING OUTPUT. INDICATES DETECTION OF VALID TONE FREQUENCIES. St/GT STEERING INPUT/GUARD TIME OUTPUT. DRIVES EXTERNAL RC TIMING CIRCUIT. Q1-Q4 4- BIT DECODED TONE OUTPUT. StD DELAYED STEERING OUTPUT. INDICATES THAT VALID FREQUENCIES HAVE BEEN PRESENT/ABSENT

FOR THE REQUIRED GUARD TIME THUS CONSTITUTING A VALID SIGNAL. TOE TONE OUTPUT ENABLE (INPUT). A LOW LEVEL SHIFTS Q1-Q4 TO ITS HIGH IMPEDANCE STATE. tREC MAXIMUM DTMF SIGNAL DURATION NOT DETECED AS VALID tREC MINIMUM DTMF SIGNAL DURATION REQUIRED FOR VALID RECOGNITION tID MAXIMUM TIME BETWEEN VALID DTMF SIGNALS. tDO MAXIMUM ALLOWABLE DROP OUT DURING VALID DTMF SIGNAL. tDP TIME TO DETECT THE PRESENCE OF VALID DTMF SIGNALS. tDA TIME TO DETECT THE ABSENCE OF VALID DTMF SIGNALS. tGTP GUARD TIME, TONE PRESENT. tGTA GUARD TIME, TONE ABSENT.

Page 39: Minor Project Report

39

APPENDIX –E

7 Segment LED Driver: HEF 4511 B

Pin Diagram:

Functional Diagram:

Functional Table: