Wireless Device Control Using DTMF
Wireless Device Control Using DTMF
1.1 INTRODUCTION
Being able to achieve reliable long distance communication is an important open area
of research. Today, everyone wants a comfortable lifestyle with everything controlled by just
a press of some buttons. This project intends to make a device which can be used to control
home Appliances by just pressing some buttons of a cell phone. It will use the existing
infrastructure of cell phone networks for communication and device control. This will
eliminate the need of a new infrastructure and detailed technical research.
Currently, the primary mode for wireless communication uses RF (radio frequency). RF is an
obvious choice for communication since it allows more information to be transferred at high
speed and over long distance. However, creating RF network of long range for many simple
applications is an impractical solution. Thus, by using existing RF Network of Cell Phones it
minimizes the cost development and maintenance. It will help in conserving energy as with
help of this device any appliance can be controlled from any distance. It also has application
in Robotics and various other fields which require long distance communication. Here we
designed a system which can be used to control Appliances (maximum of 8) from anywhere
in the world just by pressing some buttons on a cell phone i.e. it is totally DTMF based.
Before DTMF was created, telephone networks used a dialling system called
Decadic (also known as Pulse Dial). The Decadic system was used extensively in modern
telephone networks to dial numbers, which were entered by the telephone companies users.
The Decadic (Pulse Dialling) system used a series of clicks (which could be heard through
the speaker of the phone) to dial the numbers which were dialled via a keypad or rotary dial.
The clicking sounds were actually the connection of the phone line being connected,
disconnected, and reconnected again in a certain pattern. The Decadic (Pulse Dialling) system
was very useful, but was limited to the local exchange connections, requiring an operator to
connect long distance calls.
1
In the late years of 1950, DTMF was being developed at Bell Labs for the purpose
of allowing tone signals to dial long distance numbers, which could be potentially be dialled
not only via standard wire networks, but also via radio links and or satellites.
DTMF was being developed for the future of electronic telecommunications
switching systems, as opposed to the mechanical crossbar systems, which were currently in
use at the time. After DTMF was created, Decadic dialling was made pointless to continue, it
made no sense to continue using that particular dialling system in the equipment circuits
which the telephone exchanges were using at the time. Plans were then made to begin the
manufacture of DTMF controlled switching systems in the communications exchanges and
later standard customer owned telephones were upgraded to using DTMF circuits rather than
Decadic (Pulse Dial). After various tests were performed on the DTMF system throughout
the 1960s (when DTMF became known as Touch-Tone), DTMF was made official, and was
then used as the main telecommunications dialling and switching system, and remains that
way to this day.
1.3 MOTIVATION
“Save Electricity”, this statement motivated us in designing this system. It has been
noticed several times that people are not use to in switching off the lights and fans when they
are leaving their respective places. And later, they realize that they have forgotten to switch
off the lights and fans.
In order to deal with this problem we have designed a system from which one can
operate the lights and fans of his home from a little cell-phone only i.e a DTMF based device
is been introduced which will help in controlling the electric appliances of one’s place. In this
way, this system saves energy as well as brings comfort in life.
1.4 OBJECTIVE
The fundamental requirements for the cell phone based device control system
remained fixed throughout the design process. The goal was to design a system which would
allow the user automated and convenient access to their appliances through a telephone
network. The fundamental objectives of the system include:
Correctly decode DTMF signals from the user2. Correctly decode caller identification
information from the phone line.
Allow the user to automatically switch ON/OFF the devices.
2
1.5 PROJECT OVERVIEW
In this project the system, is controlled by a mobile phone that makes call to the
mobile phone attached to the system in the course of the call, if any button is pressed control
corresponding to the button pressed is heard at the other end of the call. This tone is called
dual tone multi frequency tone (DTMF) microcontroller receives this DTMF tone with the
help of phone stacked in the decoder.
The received tone is processed by the microcontroller with the help of DTMF decoder
CM8870 the decoder decodes the DTMF tone in to its equivalent binary digit and this binary
number is send to the microcontroller, the microcontroller is programmed to take a decision
for any give input and outputs its decision to relay drivers in order to energize or de-energize
the relay for switching purpose.
The mobile that makes a call to the mobile phone stacked on the system acts as a
remote. So this simple project does not require the construction of receiver and transmitter
units. DTMF signalling is used for telephone signalling over the line in the voice frequency
band to the call switching centre. The version of DTMF used for telephone dialling is known
as touch tone. DTMF assigns a specific frequency (consisting of two separate tones) to each
keys that it can easily be identified by the electronic circuit. The signal generated by the
DTMF encoder is the direct algebraic submission, in real time of the amplitudes of two sine
(cosine) waves of different frequencies, i.e., pressing 5 will send a tone made by adding 1336
Hz and 770 Hz to the other end of the mobile. The important components of this system are
DTMF decoder, Microcontroller and relay driver & relay.
A CM8870 series DTMF decoder is used here. All types of the MT8870 series use
digital counting techniques to detect and decode all the sixteen DTMF tone pairs in to a four
bit code output. The built -in dial tone rejection circuit eliminated the need for pre- filtering.
When the input signal given at pin (IN-) single ended input configuration is recognized to be
effective, the correct four bit decode signal of the DTMF tone is transferred to outputs. The
microcontroller used here is a common 8 bit Atmel microcontroller AT89S52.It is a low
power, high-performance CMOS 8-bit microcontroller with 8K bytes of In-System
Programmable (ISP) Flash program memory and 256 bytes of RAM,. It has 32 programmable
input output lines .The resulting architecture is more code efficient. Outputs from port pins of
the microcontroller are fed to inputs IN1 through IN4 to relay. Switch S1 is used for manual
reset.
3
CHAPTER-2
DTMF
4
Each key is uniquely referenced by selecting one of the four low band
frequencies associated with the matrix rows, coupled with selecting one of the four high band
frequencies associated with the matrix columns. The low band frequencies are 697,770, 852,
and 941 Hz, while the high band frequencies are 1209, 1336, 1477, and 1633 Hz. The
frequencies generated on pressing different phone keys are shown in the Table 1.
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 Table2.
1 2 3 697
4 5 6 770
7 8 9 852
* 0 # 941
1209 1336 1477 Frequency (Hz)
5
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. When you press a button in the telephone set keypad, a
connection is made that generates a resultant signal of two tones at the same time. These two
tones are taken from a row frequency and a column frequency. The resultant frequency signal
is called "Dual Tone Multiple Frequency". These tones are identical and unique.
A DTMF signal is the algebraic sum of two different audio frequencies, and can be expressed
as follows:
f(t) = A0sin(2*П*fa*t) + B0sin(2*П*fb*t) + ........... ------->(1)
Where fa and fb are two different audio frequencies with A and B as their peak amplitudes
and f as the resultant DTMF signal. fa belongs to the low frequency group and fb belongs to
the high frequency group.
Each of the low and high frequency groups comprise four frequencies from the various keys
present on the telephone keypad; two different frequencies, one from the high frequency
group and another from the low frequency group are used to produce a DTMF signal to
represent the pressed key.
The amplitudes of the two sine waves should be such that
The frequencies are chosen such that they are not the harmonics of each other. When you
send these DTMF signals to the telephone exchange through cables, the servers in the
telephone exchange identifies these signals and makes the connection to the person you are
calling.
6
CHAPTER-3
DTMF-Decoder
3.1.2 Features
8
Figure 3.2 pin description of 8870
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.3
9
Figure 3.3 Logic table of 8870
3.1.4 Applications
• Telephone switch equipment
• Remote data entry
• Paging systems
• Personal computers
• Credit card systems
CHAPTER 4
MICROCONTROLLER(AT89S52)
10
4.1 AT89S52 MICROCONTROLLER
• Five interrupt lines (two fruits and three external interrupt internal interruptions).
• A serial port with full duplex UART (Universal Asynchronous Receiver Transmitter).
• Maximum speed execution of instructions per cycle is 0.5 at 24 MHz clock frequency. If the
microcontroller clock frequency used is 12 MHz, the speed is 1 instruction execution
11
This section serves to control the entire operation on the microcontroller. This unit is
divided into two parts, the control unit, or CU (Control Unit) and the arithmetic and logic unit
or ALU (Arithmetic Logic Unit) The main function control unit is to take instructions from
memory (fetch) and then translate the composition of these instructions into a simple
collection of work processes (decode), and implement instruction sequence in accordance
with the steps that have been determined the program (execute). Arithmetic and logic unit is
the part that deals with arithmetic operations like addition, subtraction, and logical data
manipulation operations such as AND, OR, and comparison.
This section serves as a communication tool with a single chip device outside the
system. Consistent with the name, I / O devices can receive and provide data to / from a
single chip.There are two kinds of devices I / O is used, ie devices for serial connection
UART (Universal Asynchronous Receiver Transmitter) and device for so-called parallel
relationship with the PIO (Parallel Input Output). Both types of I / O has been available in a
single chip AT89S52.
Software
Single flakes MCS-51 family has a special programming language that is not
understood by other types of single flakes. This programming language known by the name
of the assembler language instruction has 256 devices. However, when this can be done with
microcontroller programming using C language. With the C language, microcontroller
programming easier, because the C language format will be automatically converted into
assembler language with a hex file format. Software on a microcontroller can be divided into
five groups as follows:
This instruction serves to move the data, between registers, from memory to memory,
from registers to memory, and others.
12
2. Arithmetic Instruction
Functions perform logic operations AND, OR, XOR, comparison, shift and complement
data.
4. Branching instructions
Serves to alter the normal sequence of execution of a program. With this instruction, the
programs that are implemented will jump to a particular address.
These instructions set the stack usage, read / write I / O ports, and controlling.
Pin Configuration
AT89S52 microcontroller has 40 pins with a single 5 Volt power supply. The pin 40 is
illustrated as follows:
13
Figure 4.1 Pin description of Microcontroller AT89S52
1. Pin 1 to 8 (Port 1) is an 8-bit parallel port of a two-way (bidirectional) that can be used for
different purposes (general purpose).
3. Pin 10 to 17 (Port 3) is 8-bit parallel port which has a two-way alternate function as
follows:
14
• P3.4 (14): T0 (external input timer / counter 0)
• P3.6 (16): WR (Write, active low) control signal from port 0 write data to memory
and input-output data externally.
• P3.7 (17): RD (Read, active low) control signal of the reading of input-output data
memory external to the port 0.
4. XTAL pin 18 as the second, the output is connected to the crystal oscillator.
5. XTAL pin 19 as the first, high berpenguatan input to the oscillator, connected to the
crystal.
7. Pin 21 to 28 (Port 2) is 8 bits parallel ports in both directions. This port sends the address
byte when accessing external memory is carried on.
8. Pin 29 as the PSEN (Program Store Enable) is the signal used for reading, move the
program the external memory (ROM / EPROM) to microcontroller (active low).
9. Pin 30 as the ALE (Address Latch Enable) to hold down the address for accessing external
memory. This pin also functions as a prog (active low) that is activated when the internal
program flash memory on the microcontroller (on chip).
10. Pin 31 as the EA (External Accesss) to select the memory to be used, the internal program
memory (EA = Fcc) or external program memory (EA = Vss), also serves as Vpp
(programming supply voltage) when programming the internal flash memory on the
microcontroller.
15
12. Pin 40 as Fcc, connected to +5 V as a ration to the microcontroller.
Memory Organization
All single chip in the family division of MCS-51 has the address space to programs and
data. The separation of program memory and data memory allows data to be accessed by a
memory address 8 bits. Even so, the address memory 16 bits of data can be generated through
the DPTR register (Point Data Register). Program memory can only be read can not be
written because it is stored in the EPROM. In this case the EPROM is available in a single
chip AT89S52 for 8 Kbyte
Memory Program
In EPROM 8 Kbytes, if the EA (External Access) high-value, then the program will occupy
the address 0000 H to H 0FFF internally. If EA’s low value, the program will occupy the
address 1000 H to FFFF H to external programs.
Data memory
Internal data memory are mapped as shown below memory space is divided into three blocks
of the 128 down, 128 up, and space SFR (Special Function Register)
16
Under Section 128 bytes of RAM mapped into the 32 bytes are grouped into four banks and
eight registers (R0 to R7).In the next 16 bytes, on the banks of register, form a block of
memory space that can teralamati per bit (bit addressable).These addresses are 00 bits up to
7FHH. All the bytes that are within 128 can be accessed either directly or indirectly. Section
128 above can only be accessed by indirect addressing. Section 128 of the RAM is solely in
the devices have 256 bytes of RAM.
17
CHAPTER 5
RELAY(SPDT)
5.1 INTRODUCTION
A type of relay that can handle the high power required to directly drive an electric motor is
called a contactor. Solid-state relays control power circuits with no moving parts, instead
using a semiconductor device to perform switching. Relays with calibrated operating
characteristics and sometimes multiple operating coils are used to protect electrical circuits
from overload or faults; in modern electric power systems these functions are performed by
digital instruments still called "protective relays".
A simple electromagnetic relay consists of a coil of wire surrounding a soft iron core, an iron
yoke which provides a low reluctance path for magnetic flux, a movable iron armature, and
one or more sets of contacts (there are two in the relay pictured). The armature is hinged to
the yoke and mechanically linked to one or more sets of moving contacts. It is held in place
by a spring so that when the relay is de-energized there is an air gap in the magnetic circuit.
In this condition, one of the two sets of contacts in the relay pictured is closed, and the other
set is open. Other relays may have more or fewer sets of contacts depending on their function.
The relay in the picture also has a wire connecting the armature to the yoke. This ensures
continuity of the circuit between the moving contacts on the armature, and the circuit track on
the printed circuit board (PCB) via the yoke, which is soldered to the PCB.
18
When an electric current is passed through the coil it generates a magnetic field that attracts
the armature, and the consequent movement of the movable contact(s) either makes or breaks
(depending upon construction) a connection with a fixed contact. If the set of contacts was
closed when the relay was de-energized, then the movement opens the contacts and breaks
the connection, and vice versa if the contacts were open. When the current to the coil is
switched off, the armature is returned by a force, approximately half as strong as the
magnetic force, to its relaxed position. Usually this force is provided by a spring, but gravity
is also used commonly in industrial motor starters. Most relays are manufactured to operate
quickly. In a low-voltage application this reduces noise; in a high voltage or current
application it reduces arcing.
When the coil is energized with direct current, a diode is often placed across the coil to
dissipate the energy from the collapsing magnetic field at deactivation, which would
otherwise generate a voltage spike dangerous to semiconductor circuit components. Some
automotive relays include a diode inside the relay case. Alternatively, a contact protection
network consisting of a capacitor and resistor in series (snubber circuit) may absorb the
surge. If the coil is designed to be energized with alternating current (AC), a small copper
"shading ring" can be crimped to the end of the solenoid, creating a small out-of-phase
current which increases the minimum pull on the armature during the AC cycle.
A solid-state relay uses a thyristor or other solid-state switching device, activated by the
control signal, to switch the controlled load, instead of a solenoid. An optocoupler (a light-
emitting diode (LED) coupled with a photo transistor) can be used to isolate control and
controlled circuits.
This relay is similar to a SPST, but pin 30 is switched to either output pin 87A or pin 87. Pin
87A is connected in the unpowered state.
19
Figure 5.1 Basic relay circuit
Here are a couple different circuits that perform the same function...turning on a pair of
driving lights. Let's compare the two circuits.
- The high current going to the lights will pass through the switch. Unless you buy a very
heavy duty switch the switch will eventually fail.
- There will be noticeable (measurable) voltage loss by the time the circuit reaches the lights.
- When hooking up a circuit like this most people will simply tap into the fuse panel or a wire
under the dash. This will usually overload the factory circuit. It might blow a fuse or melt
wire, but more likely will degrade the wire and cause intermittant failures of whatever the
circuit is hooked to.
- The switch is only switching the relay. It draws a very small current which is good for the
switch and whatever power source has been used.
- There will be little or no voltage loss using a relay. A light burns brighter and lasts longer
20
when supplied with proper voltage.
- All the high current is kept between the battery and lights and is properly protected by a
fuse. Building a circuit properly takes more components and time, but will work better, last
longer, and be safer.
This circuit is a small +5V power supply, which is useful when experimenting with
digital electronics. Small inexpensive wall tranformers with variable output voltage are
available from any electronics shop and supermarket. Those transformers are easily available,
but usually their voltage regulation is very poor, which makes then not very usable for digital
circuit experimenter unless a better regulation can be achieved in some way. The following
circuit is the answer to the problem.
This circuit can give +5V output at about 150 mA current, but it can be increased to 1 A
when good cooling is added to 7805 regulator chip. The circuit has over overload and
therminal protection. The capacitors must have enough rating to safely handle the input
voltage feed to circuit. The circuit is very easy to build for example into a piece of veroboard.
1. Unregulated voltage in
2. Ground
21
Figure 5.3 Simple 5 volt power supply
22
CHAPTER 6
WORKING
In this system, there is a control unit/module. The control unit is able to connect to the
cellular network automatically, to receive DTMF and will be able to decode for password
identification and instructions to be sent to the microcontroller. The microcontroller within
the control unit will issue the command to the electrical appliances through a simple control
circuit. while the input from the mobile using a headphone is connected b/w the 0.1uf
capacitor and the ground, DTMF tones can be transferred to the decoder ic (8870) and once
the ic is powered up the o/p can be seen by connecting bulbs at relay 1,2,3 and 4. To operate
some devices remotely as the Mobile phone connected can be called from anywhere in the
world and by pressing the keys the DTMF tones can be transmitted to the receiving end
mobile and hence any device connected can be operated globally.
In order to operate the system you have to make a call to the cell phone attached to the
main circuitry of the project from any other phone. The phone is picked at the receiving end
through auto answer mode (which is in the phone, just enable it). Each number on the cell
phone keypad has a distinct sound (called DTMF tones). This sound is used to identify the
key pressed, using a CM8870 DTMF decoder. Here the sound is firstly preamplified by the
microphone unit. This sound is now fed into the M8870 IC which decodes them in form of
numbers. These decoded numbers are fed into the microcontroller .It checks the code and
energize/de-energize that particular relay for which that signal is send ,in response of which
the switching takes place in the appliance which is connected to it. Like:
23
CHAPTER-7
APPLICATIONS
Since a cell phone based home appliance control system has overcome the limitations
of the range of a normal RF controlled systems (or a manual switch on/off system), it has
endless applications. It can be used by any layman due to its simplistic nature. Also any
commonly available cell phone be used to control this system. These features extend the
scope of this system to a large number of diversified fields. Some of the common applications
have been listed below:
This system of operating devices can be used to control all the appliances at the home
even when you are far away from the home. This increases your control over the
house and makes your home more secured and make these devices more users
friendly. For e.g.-
You can turn off the TV yourself when you don’t want that small children at your
home to watch it (in your absence).
You can open the garage door only to allow some authorized person to take your
vehicles out of our house.
You can automatically open the main door of your house when some of your
workers/relatives come home unexpectedly when you are away at your office.
You can turn your Air Conditioner on when you are about to come back to your home
to find your room already cooled to the desired temperature.
24
CONCLUSION AND FUTURE SCOPE
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 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.
25
REFERENCES
1. “DTMF Based Remote Control System”- R. Sharma, K. Kumar, and S. Viq, IEEE
International Conference ICIT , pp. 2380-2383, December 2006.
2. “Integrated DTMF Receiver”-M.Callahan Jr, IEEE Transactions on communications,
vol. 27, pp. 343-348, February 1979.
3. “A phone based Remote Controller for Home”- I. Coskun and H. Ardam IEEE Trans.
Consumer , vol.44,no. 4,pp. 1291-1297,November 1998
4. SPDT relay- “Mason, C. R., Art & Science of Protective Relaying”, Chapter 2, GE
Consumer & Electrical.
5. “Microcontroller Technology:16F84A”, prentice hall , 7th edition, page32, 2002.
26