Control of Remote Domestic System Using DTMF

ICICI-BME 2009 Proceedings
ICICI-BME 2009 Bandung, Indonesia
Control of Remote Domestic System Using
DTMF
Tuljappa M Ladwa*, Sanjay M Ladwa**, R Sudharshan Kaarthik***, Alok Ranjan Dhara***, Nayan Dalei***
*Author For Correspondence, Department of Electrical Engineering, NIT Rourkela, Orissa-08
**Author For Correspondence, Department of Electronics and Communication Engineering, PES Institute of
Technology, Bangalore-85
*** Department of Electrical Engineering, NIT Rourkela, Orissa-08
email: [email protected] , [email protected]
phone: +91-9880070823,+91-9937169819
Abstract— The human mind always needs information
of interest to control systems of his/her choice. In the
age of electronic systems it is important to be able to
control and acquire information from everywhere.
Although many methods to remotely control systems
have been devised, the methods have the problems
such as the need for special devices and software to
control the system. This paper suggests a method for
control using the DTMF tone generated when the user
pushes mobile phone keypad buttons or when
connected to a remote mobile system. The proposed
work has been done experimentally and has been
verified in real time.
Keywords— DTMF, Data acquisition system, Band
split filters, IC 8870, AT Commands.
I. INTRODUCTION
The remote control technologies have been used in the
fields like factory automation, space exploration, in places
where human access is difficult. As this has been achieved
in the domestic systems partially [1], many corporations
and laboratories are researching the methods which enable
human to control and monitor efficiently and easily in the
house or outdoor. Controlling the domestic system
regardless of time and space is an important challenge. As
the mobile phone enables us to connect with the outside
devices via mobile communication network regardless of
time and space, the mobile phone is a suitable device to
control domestic systems.
This paper proposes a method to control a domestic
system using a mobile phone, irrespective of the phone
model and mobile phone carrier. The system suggested
consists of the mobile phone normally registered in
communication service and a computer that can receive a
call from another phone. Existing methods for control and
monitoring, using mobile phones have usage problems
because the cost and need for continuous control. One of
the disadvantages, being the lack of feedback during the
process. This paper proposes to solve the problems of
existing methods of control that use simple voice call and
SMS. Method proposed uses the DTMF (Dual Tone Multi
Frequency) [2], [3], [4] generated when a keypad button
of the mobile phone is pressed by the user. The mobile
phone user controls the system by sending the DTMF tone
to the access point. Mobile communication network
coverage is larger than that of LANs, thus user can take
advantage of mobile phones to control the system.
II. DTMF BASICS
DTMF is a generic communication term for touch tone
(a Registered Trademark of AT&T). The tones produced
when dialing on the keypad on the phone could be used to
represent the digits, and a separate tone is used for each
digit. However, there is always a chance that a random
sound will be on the same frequency which will trip up the
system. It was suggested that if two tones were used to
represent a digit, the likelihood of a false signal occurring
is ruled out. This is the basis of using dual tone in DTMF
communication.
DTMF dialing uses a keypad with 12/16 buttons. Each
key pressed on the phone generates two tones of specific
frequencies, so a voice or a random signal cannot imitate
the tones. One tone is generated from a high frequency
group of tones and the other from low frequency group.
The frequencies generated on pressing different phone
keys are shown in the Table 1.
Table 1 – Frequencies generated on Key presses
Button
Low
High
Frequency(Hz) Frequency(Hz)
1
697
1209
2
697
1336
3
697
1477
4
770
1209
5
770
1336
6
770
1477
7
852
1209
8
852
1336
9
852
1477
0
941
1209
*
941
1336
#
941
1477
Each row and column of the keypad corresponds to a
certain tone and creates a specific frequency. Each button
lies at the intersection of the two tones as shown in Table
2.
69
1
ICICI-BME 2009 Proceedings
ICICI-BME 2009 Bandung, Indonesia
Table 2 – Row and Column Frequency
Correspondence
1
2
3
697
4
5
6
770
7
8
9
852
*
0
#
941
1209
1336
1477
Frequency(Hz)
When a button is pressed, both the row and column
tones are generated by the telephone instrument. These
two tones will be unique and different from tones of other
keys. So, whenever we say that there is a low and high
frequency associated with a button, it is actually the sum
of two waves is transmitted.
This fundamental principle can be extended to various
applications. DTMF signals can be transmitted over a
radio to switch on or switch off home appliances, flash
lights, motors, cameras, warning systems, irrigation
systems and so on. These encoded data can be stored in a
microcontroller and can be transmitted serially to another
system for processing. Block diagram for the proposed
method is shown in Fig. 1.
of immunity to talk off and tolerance to interfering signals
(third tones) and noise. When the detector recognizes the
simultaneous presence of two valid tones (known as signal
condition), it raises the Early Steering flag (ESt). Any
subsequent loss of signal condition will cause ESt to fall.
IV. SIGNAL CONDITIONING
Before a decoded tone pair is registered, the receiver
checks for valid signal duration (referred to as characterrecognition-condition). This check is performed by an
external RC time constant driven by ESt. A logic high on
ESt causes VC (see block diagram Fig. 3) to rise as the
capacitor discharges. Provided that signal condition is
maintained (ESt remains high) for the validation period
(tGTF), VC reaches the threshold (VTSt) of the steering
logic to register the tone pair, thus latching its
corresponding 4-bit code (see DC Characteristics in Data
Sheet) into the output latch. At this point, the GT output is
activated and drives VC to VDD. GT continues to drive
high as long as ESt remains high. Finally, after a short
delay to allow the output latch to settle, the delayed
steering output flag (StD) goes high, signaling that a
received tone pair has been registered. The contents of the
output latch are made available on the 4-bit output bus by
raising the three-state control input (OE) to logic high.
The steering circuit works in reverse to validate the inter
digit pause between signals. Thus, as well as rejecting
signals too short to be considered valid, the receiver will
tolerate signal interruptions (dropouts) too short to be
considered a valid pause. This capability, together with the
ability to select the steering time constants externally,
allows the designer to tailor performance to meet a wide
variety of system requirements.
The internal clock circuit of 8870 is completed with
addition of external 3.579545 MHz crystal oscillator.
V. ATMEGA 16L MICROCONTROLLER
Figure 1 – Block diagram of the scheme
III. DECODER DESCRIPTION
The decoder used is M-8870. For operating functions
see Fig. 3 – Structure of M-8870. M-8870 includes a band
split filter that separates the high and low tones of the
received pair, and a digital decoder that verifies both the
frequency and duration of the received tones before
parsing the resulting 4-bitcode to the output bus.
The M-8870 decoder uses a digital counting technique
to determine the frequencies of the limited tones and to
verify that they correspond to standard DTMF
frequencies. A complex averaging algorithm is used to
protect against tone simulation by extraneous signals
(such as voice) while tolerating small frequency variations
[6], [7]. The algorithm ensures an optimum combination
Atmega 16L microcontroller manufactured by ATMEL
is used. It is a high performance 8 bit, low power
microcontroller with two eight bit counters, two sixteen
bit counters with pre scale feature, and compare mode,
16Kb of non volatile programmable memory and data
memory, up to 64 Kb of extendable memory with many
more features and modules. It is compatible with the
industry-standard 80C51 instruction set and pin-outs.
VI. STRUCTURE OF PROPOSED WORK
A. Operation of the Circuit
The message is transmitted by calling the second mobile
phone (which is connected to the computer as shown in
the Fig.1) and typing in the desired number
corresponding to the required control effort at the
transmitter end.
When the handset of the phone at the receiver end is
picked up or the phone is picked up automatically by the
use of AT commands, the messages can be typed on the
number pad of the transmitting phone. The receiver end
70
2
ICICI-BME 2009 Proceedings
ICICI-BME 2009 Bandung, Indonesia
comprises of input device, decoder, microcontroller,
computer and a mobile phone.
B. Message Decoding Algorithm
Table 3 – Values at Output Bus for various frequencies
Button
Low
High
Q1 Q2 Q3
Frequency(Hz) Frequency(Hz)
1
697
1209
0
0
0
2
697
1336
0
0
1
3
697
1477
0
0
1
4
770
1209
0
1
0
5
770
1336
0
1
0
6
770
1477
0
1
1
7
852
1209
0
1
1
8
852
1336
1
0
0
9
852
1477
1
0
0
0
941
1209
1
0
1
*
941
1336
1
0
1
#
941
1477
1
1
0
Figure 2- Circuit Diagram
The input section consists of a mobile/landline phone,
condenser microphone and an audio amplifier. For the
decoder section, the underlying concept is DTMF signal
reception and the decoded signal is fed to the
microcontroller through LPT [8]. The microcontroller is
connected to the parallel port of a computer, and is
connected to a relay which performs the required action.
The computer also helps by responding to the input by
playing a suitable audio file representing the status of the
system, which can be heard at the transmitter end
immediately as the key is pressed.
Once the connection is established between the two
phones, whatever phone key is pressed at the transmitting
end, the corresponding DTMF tone is heard in the ear
piece of the receiver phone. The ear piece is connected to
a condenser microphone which picks up the DTMF tone.
Its output is amplified by the audio amplifier and this
output is fed to the DTMF decoder. The DTMF decoder
will give the corresponding BCD value of the tone. As
shown in the circuit (Fig.2), LED 5 acts as a visual
indicator when the valid signal is received by the system.
This output, through a driver circuit is connected to
PORT B of the Atmega 16L microcontroller. This
microcontroller’s output is fed to the relay and parallel
port of the computer to affect the control effort and to
trigger a voice feedback.
Each key press at transmitter end reflects as a BCD value
Q1Q2Q3Q4 at the outputs of 8870 DTMF decoder. The
corresponding values are given in Table 3.
The outputs Q1Q2Q3Q4 are processed by microcontroller
and sent to the relay. The device status which is being
continuously monitored by the computer through parallel
port triggers a voice response [9]. If the device is
discovered to be faulty after the call has been
disconnected, provision has been made to send an SMS to
the transmitting end or any other mobile phone of the
user’s choice (Refer Appendix 3 for microcontroller
program). The user can know the status of the message by
pressing any key which is not assigned to any of the
specific task.
The input to the computer is sensed by the software and
the computer responds by playing a suitable tone already
stored in the computer. The sound file can be a lossless
encoding or any compression format supported by
Windows Media Player. The computer programming is
done in Microsoft Visual Studio 6 (Refer to Appendix 2
for the VB6 codes). The sound file is played and sensed
by the mobile, whose effect can be heard at the other end
by the user.
VII. RESULTS AND DISCUSSION
The DTMF signal waveform is shown in Fig 4. The two
waves can have phase difference of an arbitrary value.
The system is immune to external noise and the ring tone
of the receiver mobile phone. There is a finite probability
that the system turns on or turns off due to ambient noises
like voice, sound arising from door latches etc.
The circuit was built and tested. Refer Fig.5 for the
picture of tested circuit. The device controlled was a
230V / 23W Power Saving Bulb. The mobile phone at the
receiver’s end is controlled by the computer using
hyperterminal and AT commands.
71
3
Q4
1
0
1
0
1
0
1
0
1
0
1
0
ICICI-BME 2009 Proceedings
ICICI-BME 2009 Bandung, Indonesia
Figure 5 - Tested Circuit
Figure 3 Structure of 8870 Decoder [6]
Figure 6 - GUI of the Software
VIII. APPLICATIONS
This setup with a little modification can be adapted to the
following applications.
1) Combination Lock
2) Home Security System
3) Mobile / Wireless Robot control
4) Wireless Radio Control
5) Continuous monitoring of system status
6) Remote Switches
7) Reporting during car accidents
IX. CONCLUSION
Figure 4 - Waveform for Key ‘1’ press [6]
The additional feature included is the continuous
monitoring of the device status by the software whose
GUI is shown in Fig 6. The computer, through the
receiver end mobile phone sends an SMS as soon as fault
is detected in the system.
This paper presents a method to control a domestic
system using the DTMF tone generated by transmitting
telephone instrument when the user pushes the keypad
buttons of the mobile phone connected to the remote
domestic system. This control method uses commercial
mobile communication networks as the path of data
transmission. This enables the user to control the system
continuously by sending the mobile phone DTMF tone.
This system is implemented in the 2G mobile
communication network, so video data cannot be
obtained. Future work includes research on the robot
72
4
ICICI-BME 2009 Proceedings
ICICI-BME 2009 Bandung, Indonesia
control system in the 3G mobile communication
networks. This will facilitate controlling the remote robot,
using the DTMF of mobile phone with video data from
the remote mobile robot’s camera.
XI. APPENDIX
A. Appendix 1 -List of Components used and their
description
1) IC 7805
2) IC 7806
3) Power diodes 4001
4) 230/9-0-9 Transformer
5) Condenser Microphone
6) Audio Amplifier LM 358
7) 3.59 MHz Crystal Oscillator
8) 8870 DTMF Decoder
9) L 293D Driver Chip
10) Atmega 16L Microprocessor
11) Transistor BC 548
12) 6 Volts Relay
13) Comparator LM 324
14) A computer with Parallel Port DB 25
Refer circuit diagram (Fig. 7). IC 7805 and IC 7806 are
positive voltage regulators whose input can be a DC of
average value 7.5 to 16 Volts. They deliver an output of 5
or 6 volts at load at 1A or less. Power diodes 4001 are
used for rectification in a full wave rectifier
configuration. The input to the rectifier is through the
230/9-0-9 transformer. IC 7805 and IC 7806 are
connected in parallel to get 5V and 6V supply separately.
Figure 7 – Rectifier Circuit
The signal picked up by the condenser microphone is
needs to be amplified as the signal power is insufficient
for DTMF decoder 8870 to decode. So, audio amplifier
LM 358 is used to strengthen the signal. The amplified
signal is fed to DTMF decoder 8870 which has the
following features.
The M-8870 is a full DTMF Receiver that integrates both
band split filter and decoder functions into a single 18-pin
DIP or SOIC package. Manufactured using CMOS
process technology, the M-8870 offers low power
consumption (35 mW max) and precise data handling. Its
filter section uses switched capacitor technology for both
the high and low group filters and for dial tone rejection.
Its decoder uses digital counting techniques to detect and
decode all 16 DTMF tone pairs into a 4-bit code. External
component count is minimized by provision of an on-chip
differential input amplifier, clock generator, and latched
tri-state interface bus.
Atmega 16L receives decoded output from 8870 with the
StD signal. Port B is used as input port and port A is used
as output port. This output is fed to the relay through a
buffer. DB 25 port of the computer is connected to the
light detector (LDR) and the relay. The computer is
connected to a speaker to enable instantaneous feedback
to the transmitter mobile.
B. Appendix 2 – VB Program
Dim
Dim
Dim
Dim
Dim
i As Integer
a As Integer
k As Integer
tex As String
l As Integer
Private Sub Command1_Click()
Out Val("&H" + "37A"), 32
If (Val(Text1.Text) = 0) Then
MsgBox "PLEASE ENTER THE LPT ADDRESS",
vbInformation + vbOKOnly, "''Go Mobile''"
End If
If (Val(Text5.Text) = 0) Then
MsgBox "PLEASE ENTER THE COMM ADDRESS",
vbInformation + vbOKOnly, "''Go Mobile''"
End If
If(Val(Text7.Text)=0)Or
(Len(Trim(Text7.Text)) <> 13) Then
MsgBox "PLEASE ENTER THE VALID PHONE NUMBER
TO BE SEND ", vbInformation + vbOKOnly,
"''Go Mobile''"
End If
If (Val(Text5.Text) <> 0) Then
Comm1.CommPort = Val(Text5.Text)
If Comm1.PortOpen = False Then
'OPENING THE PORT
Comm1.PortOpen = True
Comm1.DTREnable = True 'control signal
Comm1.RTSEnable = True 'control signal
Comm1.RThreshold = 1 'control signal
Comm1.InputLen = 1 'to send one character
each time through serial port
Comm1.Output = "ATS0=3" & vbCrLf 'to set
the SMS in text mode and vbcrlf is like
"enter"
we
do
in
hyperterminal
Comm1.PortOpen = False
End If
End If
If
(Val(Text1.Text)
<>
0)
And
(Val(Text5.Text) <> 0) And (Val(Text7.Text)
<> 0) And (Len(Trim(Text7.Text)) = 13) Then
Timer1.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
73
5
ICICI-BME 2009 Proceedings
ICICI-BME 2009 Bandung, Indonesia
MsgBox " READING FROM PARALLEL PORT STOPED
",
vbInformation
+
vbOKOnly,
"''Go
Mobile''"
End Sub
End If
End If
End Sub
C. Appendix 3 – Micro Controller Program
Private Sub Command3_Click()
Load Form2
Unload Form2
End Sub
Private Sub Form_Load()
MsgBox " PLEASE DO NOT RUN THIS PROGRAM IN
LAPI ", vbInformation + vbOKOnly, "''Go
Mobile''"
Out Val("&H" + "37A"), 32
Timer1.Enabled = False
Timer1.Interval = 1
i = 0
a = 0
k = 0
l = 0
tex = "The system has faced fatal error"
End Sub
Private Sub Timer1_Timer()
i = Val(Str(Inp(Val("&H" + Text1.Text))))
a = i And 7
Text6.Text = a
If ((i And 4) = 4) Then
For l = 1 To 10000
Text6.Text = a
Next l
For l = 1 To 10000
Text6.Text = a
Next l
For l = 1 To 10000
Text6.Text = a
Next l
i = Val(Str(Inp(Val("&H" + Text1.Text))))
a = i And 3
Select Case a
Case 0
WindowsMediaPlayer1.URL = "C:\sound\2.WAV"
Case 1
WindowsMediaPlayer1.URL = "C:\sound\3.WAV"
Case 2
WindowsMediaPlayer1.URL = "C:\sound\3.WAV"
Case 3
WindowsMediaPlayer1.URL = "C:\sound\1.WAV"
End Select
End If
If (a = 1) Or (a = 2) Then
k = k + 1
If k = 1 Then
Comm1.CommPort = Val(Text5.Text)
If Comm1.PortOpen = False Then
Comm1.PortOpen = True
Comm1.DTREnable = True
Comm1.RTSEnable = True
Comm1.RThreshold = 1
Comm1.InputLen = 1
Comm1.Output = "AT+CMGF=1" & vbCrLf
End If
Comm1.Output = "AT+CMGS=" & Chr(34) &
Trim(Text7.Text) & Chr(34) & vbCrLf
Comm1.Output = Trim(tex) & Chr(26) & vbCrLf
MsgBox "Message Sent to " & Text7.Text,
vbInformation + vbOKOnly, "Sent"
#include<avr/io.h>
void main (void)
{
unsigned char X,z;
DDRA=0XFF;
DDRB=0X00;
while(1)
{
X=PINB;
X=(0X10)&X;
if(X==(0X10))
{
X=PINB;
z=((0X10)&X);
if(z==(0x10))
{
X=(0X0F)&X;
switch(X)
{
case(1):PORTA=0X0F;
break;
case(2):PORTA=0X00;
break;
}
}
}
}
}
REFERENCES
[1] Yun Chan Cho and Jae Wook Jeon, “Remote Robot
control System based on DTMF of Mobile Phone” IEEE
International Conference INDIN 2008, July 2008.
[2] M J. Callahan, Jr., “Integrated DTMF receiver,”
ZEEE J. Solzd-State Czrcuzts, vol. Sc-14, pp. 85-90, Feb.
1979.
[3] M. Callahan Jr, “Integrated DTMF Receiver,” IEEE
Transactions on communications, vol. 27, pp. 343-348,
Febrary 1979.
[4] R. Sharma, K. Kumar, and S. Viq, “DTMF Based
Remote Control System,” IEEE International Conference
ICIT 2006, pp. 2380-2383, December 2006.
[5] Oppenheim, Alan V. and Schafer, Ronald W. Digital
Signal Processing. Prentice-Hall of India, 1989.
[6] 8870 Datasheet,
http://www.clare.com/datasheets/8870-01.pdf
[7]
Suvad
Selman,
Raveendran
Paramesran,
“Comparative Analysis of Methods Used in the Design of
DTMF Tone Detectors” IEEE International Conference
on Telecommunications and Malaysia International
Conference on Communications, 14-17 May 2007,
Penang, Malaysia.
[8] R.C. Luo, T.M. Chen, and C.C. Yih, “Intelligent
autonomous mobile robot control through the Internet,”
IEEE International Symposium ISIE 2000, vol. 1, pp. 611, December 2000.
[9] LPT, http://en.wikipedia.org/wiki/parallelport
74
6