Professional Documents
Culture Documents
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.
DTMF
Antenna
sig.
(4 – 12) MHZ
DTMF
(4 – 12) MHZ Antenna
sig.
LOGIC
Fig 1.2 Block Diagram of Receiver
….………
To different Devices
1
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.
RECEIVER DEVICES
DISPLAY
2
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
3
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.
4
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.
5
Fig 2.3 Interface of Keypad with MV5089
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.
6
RB4
RB5
RB6
RB7
PIC 16F870
RB0
RB1
RB2
RB3
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.1) Algorithm:
7
2.5.2) Flow Chart:
START
if NO
Send ==3 Send +1
Device +1
NO If
Device ==3
YES
STOP
8
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.
Tone out
PIC DTMF Signal
16F870 Generator
9
Vdd
RB7 Col4
RB6 Col3 TONE O/P
RB5 Col2
R1
RB4 Col1
MV5089 390
RB3 Row1
RB2 Row2
RB1 Row3
RB0 Row4 0
RC0 A a
330 ohm
RC1 B b
330 ohm
RC2 C c
330 ohm
RC3 D d
330 ohm
4511 e
330 ohm
f
330 ohm
g
330 ohm
7 Segment LED
Fig 2.6 Complete Transmitter System Circuit Diagram
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.
10
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.
11
Fig 3.2 Interface of Keypad with MV5089
Q1, Q2, Q3, Q4 are the decoded output. The signal StD (delayed steering)
gives high signal when the decoded out put is latched
12
Fig 3.3 Block diagram of CM8870
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.
13
Fig 3.4. Timing diagram of CM8870
tGTP = this can be designed by RC circuit such that sum of tGTP & tDP should be
greater than 40ms
14
Fig 3.5. Designed Receiver Circuit
C2 = .1µF
R3 = 300 K ohm
R1 = 100K ohm
R2 = 100K ohm
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
15
3.5.1) Algorithm:
Wait on Interrupt
NO
If
Receive= =3
YES
YES
If Received Code
== Dev. Code SWITCH ON the DEVICE
NO
NO
If
STOP
Device==3
YES
Display: 7-Segment Display is also interfaced in the receiver side to check the received
code
16
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 D
E
PORT C V
I
Interrupt (RB0) C
RB4 – RB7
E
S
a PORTA(RA0-RA3)
330 ohm b ABCD
330 ohm c
330 ohm d
330 ohm e 4511
330 ohm f
330 ohm g
330 ohm
330 ohm
17
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.
18
Chapter 4:
4.1) Transmitter:
2) Output of 7 – segment LED is also cross checked with the DTMF signal using
CRO
19
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:
20
APPENDIX A
PIC Codes for Transmitter and Receiver
#include <pic.h>
#define delay1U asm("nop");
int devicet1,devicet2,devicet3,i1,i2,i3;
char i=0,led, dnum,send,stop;
switch (disp) {
case 1:
PORTB = 0XEE;
PORTC = 0x11;
break;
case 2:
PORTB = 0XDE;
PORTC = 0x22;
break;
case 3:
PORTB = 0XBE;
PORTC = 0x33;
21
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){
22
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++;
23
}
else {
displayportb(i3);
send =1;
dnum++;
}
if(led==4){
led = 1;
}
displayled(led);
led++;
}
24
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()
{
25
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;
}
}
26
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;
27
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);
28
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)
29
{
}
}
APPENDIX B
PIC 16F870:
Pin diagram:
1) ADCON1
30
2) INTCON
31
3) OPTION
32
APPENDIX C
Pin Details:
Block Diagram:
33
ROW and COLUMN Inputs
34
APPENDIX – D
PIN details:
35
36
Timing Diagram:
37
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.
38
APPENDIX –E
7 Segment LED Driver: HEF 4511 B
Pin Diagram:
Functional Diagram:
Functional Table:
39