You are on page 1of 35

Mobile Based controlling of Home appliances using DTMF

1. INTRODUCTION
Automation is controlling of light, climate, doors and window shutters, ac and
many more home appliances which we can control manually in our daily life. In this
project we are using at AT89S52 interfaced with relay for controlling the equipments in
the home through DTMF. This automation system can also be used for industrial
applications with small modifications.
The aim of the proposed system is to develop a cost effective solution that
will provide controlling of home appliances remotely and enable home security against
intrusion in the absence of homeowner. The system provides availability due to
development of a low cost system. The home appliances control system with an
affordable cost was thought to be built that should be mobile providing remote access to
the appliances and allowing home security. Though devices connected as home and
office appliances consume electrical power. These devices should be controlled as well as
turn on/off if required. Most of the times it was done manually. Now it is a necessity to
control devices more effectively and efficiently at anytime from anywhere. In this
system, we are going to develop a cellular phone based home/office appliance. This
system is designed for controlling arbitrary devices, it includes a cell phone (not included
with the system kit, end user has to connect his/her cell phone to the system) which is
connect to the system via head set. To active the cellular phone unit on the system a call
is to be made and as the call is answered, in response the user would enter a two/three
digit password to access the system to control devices. As the caller press the specific
password, it results in turning ON or OFF specific device. The device switching is
achieved by Relays. Security preserved because these dedicated passwords owned and
known by selected persons only. For instance, our system contains an alarm unit giving
the user a remote on/off mechanism, which is capable of informing up to five different
numbers over telephony network about the nature of the event. The underlying principle
mainly relies up on the ability of DTMF (Double Tune Multi Frequency) ICs to generate
DTMF corresponding to a number or code in the number pad and to detect the same
number or code from its corresponding DTMF. In detail, a DTMF generator generates
two frequencies corresponding to a number or code in the number pad which will be

pg. 1

Mobile Based controlling of Home appliances using DTMF

transmitted through the communication networks, constituting the transmitter section


which is simply equivalent to a mobile set. In the receiver part, the DTMF detector IC,
for example IC HT9170 detects the number or code represented by DTMF back, through
the inspection of the two transmitted frequencies.

Block Diagram:

pg. 2

Mobile Based controlling of Home appliances using DTMF

2. INTRODUCTION TO EMBEDDED SYSTEMS


Each day, our lives become more dependent on 'embedded systems', digital
information technology that is embedded in our environment. More than 98% of
processors applied today are in embedded systems, and are no longer visible to the
customer as 'computers' in the ordinary sense. An Embedded System is a special-purpose
system in which the computer is completely encapsulated by or dedicated to the device or
system it controls. Unlike a general-purpose computer, such as a personal computer, an
embedded system performs one or a few pre-defined tasks, usually with very specific
requirements. Since the system is dedicated to specific tasks, design engineers can
optimize it, reducing the size and cost of the product. Embedded systems are often massproduced, benefiting from economies of scale. The increasing use of PC hardware is one
of the most important developments in high-end embedded systems in recent years.
Hardware costs of high-end systems have dropped dramatically as a result of this trend,
making feasible some projects which previously would not have been done because of
the high cost of non-PC-based embedded hardware. But software choices for the
embedded PC platform are not nearly as attractive as the hardware.
Typically, an embedded system is housed on a single microprocessor board with
the programs stored in ROM. Virtually all appliances that have a digital interface -watches, microwaves, VCRs, cars -- utilize embedded systems. Some embedded systems
include an operating system, but many are so specialized that the entire logic can be
implemented as a single program.
Physically, Embedded Systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the
systems controlling nuclear power plants.
In terms of complexity embedded systems can range from very simple with a single
microcontroller chip, to very complex with multiple units, peripherals and networks
mounted inside a large chassis or enclosure.

pg. 3

Mobile Based controlling of Home appliances using DTMF

Definition of an Embedded System:


Embedded system is defined as, for a particular/specific application implementing
the software code to interact directly with that particular hardware what we built.
Software is used for providing features and flexibility, Hardware = {Processors, ASICs,
Memory} is used for Performance (& sometimes security)
There are many definitions of embedded system but all of these can be combined
into a single concept. An embedded system is a special purpose computer system that is
used for particular task.
Features of Embedded Systems:
The versatility of the embedded computer system lends itself to utility in all kinds of
enterprises, from the simplification of deliverable products to a reduction in costs in their
development and manufacture. Complex systems with rich functionality employ special
operating systems that take into account major characteristics of embedded systems.
Embedded operating systems have minimized footprint and may follow real-time
operating system specifics.
The special computers system is usually less powerful than general-purpose systems,
although some expectations do exist where embedded systems are very powerful and
complicated. Usually a low power consumption CPU with a limited amount of memory is
used in embedded systems. Many embedded systems use very small operating systems;
most of these provide very limited operating system capabilities.
Since the embedded system is dedicated to specific tasks, design engineers can optimize
it, reducing the size and cost of the product, or increasing the reliability and performance.
Some embedded systems are mass-produced, benefiting from economies of scale.
Some embedded systems have to operate in extreme environment conditions such as very
high temperature & humidity.

pg. 4

Mobile Based controlling of Home appliances using DTMF

For high volume systems such as portable music players or mobile phones, minimizing
cost is usually the primary design consideration. Engineers typically select hardware that
is just good enough to implement the necessary functions.
For low volume or prototype embedded systems, general purpose computers may be
adapted by limiting the programs or by replacing the operating system with a real-time
operating system.
Characteristics of Embedded Systems:
Embedded computing systems generally exhibit rich functionality-complex functionality
is usually the reason for introducing CPUs into the design. However, they also exhibit
many non-functional requirements that make the task especially challenging:
Real-time deadlines that will cause system failure if not met;
Multi-rate operation;
In many cases, low power consumption;
Low manufacturing cost, which often means limited code size.
Workstation programmers often concentrate on functionality. They may consider the
performance characteristics of a few computational kernels of their software, but rarely
analyze the total application. They almost never consider power consumption and
manufacturing cost. The need to juggle all these requirements makes embedded system
programming very challenging and is the reason why embedded system designers need to
understand computer architecture.

pg. 5

Mobile Based controlling of Home appliances using DTMF

Overview of an Embedded System Architecture:


Every Embedded system consists of a custom-built hardware built around a central
processing unit. This hardware also contains memory chips onto which the software is
loaded.

Application Software

Operating System
H/W

Fig 2.1 Embedded System Architecture


The operating system runs above the hardware and the application software runs above
the operating system. The same architecture is applicable to any computer including
desktop computer. However these are significant differences. It is not compulsory to have
an operating system in every embedded system. For small applications such as remote
control units, air conditioners, toys etc.

pg. 6

Mobile Based controlling of Home appliances using DTMF

Applications of Embedded Systems:


Some of the most common embedded systems used in everyday life are
Small embedded controllers:

8-bit CPUs dominate, simple or no operating system


(e.g., thermostats)

Control systems:

Often use DSP chip for control computations


(e.g., automotive engine control)

Distributed embedded control: Mixture of large and small nodes on a real-time


Embedded networks
(e.g., cars, elevators, factory automation)
System on chip:

ASIC design tailored to application area


(e.g., consumer electronics, set-top boxes)

Network equipment:

Emphasis on data movement/packet flow


(e.g., network switches; telephone switches)

Critical systems:

Safety and mission critical computing


(e.g., pacemakers, automatic trains)

Signal processing:

Often use DSP chips for vision, audio, or other signal


Processing (e.g., face recognition)

Robotics:

Uses various types of embedded computing (especially


Vision and control) (e.g., autonomous vehicles)

Computer peripherals:

Disk drives, keyboards, laser printers, etc.

Wireless systems:

Wireless network-connected sensor networks and


Motes to gather and report information

Embedded PCs:

Palmtop and small form factor PCs embedded

pg. 7

Mobile Based controlling of Home appliances using DTMF

3. POWER SUPPLY MODULE

STEP DOWN TRANSFORMER


BRIDGE RECTIFIER WITH FILTER
VOLTAGE REGULATORS

Transformer:
Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is
AC. Step-up transformers increase voltage, step-down transformers reduce voltage.
A step down power transformer is used to step down the AC voltage from the line voltage
Of 110 VAC or 220 VAC i.e., it converts higher voltage at the input side to a lower
voltage at the output.

3.1 Transformer

pg. 8

Mobile Based controlling of Home appliances using DTMF

Rectifier:
There are several ways of connecting diodes to make a rectifier to convert AC to DC. The
bridge rectifier is the most important and it produces full-wave varying DC

3.2 Rectifier

Filter:
Filtering is performed by a large value electrolytic capacitor connected across the DC
supply to act as a reservoir, supplying current to the output when the varying DC voltage
from the rectifier is falling. The diagram shows the unfiltered varying DC (dotted line)
and the filtered DC (solid line). The capacitor charges quickly near the peak of the
varying DC, and then discharges as it supplies current to the output.

3.3 filter and its characteristics


Typically 1000 f capacitor is used in microcontroller of 8051.

pg. 9

Mobile Based controlling of Home appliances using DTMF

Regulator:
This is a simple DC regulated supply project using 7805 voltage regulator to obtain a
variable DC voltage range from 5V to 15V

3.4 regulator

Pin out of the 7805 regulator IC.


1. Unregulated voltage in
2. Ground
3. Regulated voltage out
If you need other voltages than +5V, you can modify the circuit by replacing the 7805
chips with another regulator with different output voltage from regulator 78xx chip
family. The last numbers in the chip code tells the output voltage. Remember that the
input voltage must be at least 3V greater than regulator output voltage to otherwise the
regulator does not work well.
Crystal Oscillator:
The 8051 uses the crystal for precisely that: to synchronize its operation. Effectively, the
8051 operates using what are called "machine cycles." A single machine cycle is the
minimum amount of time in which a single 8051 instruction can be executed. Although
many instructions take multiple cycles. 8051 has an on-chip oscillator. It needs an
external crystal that decides the operating frequency of the 8051. The crystal is connected
to pins 18 and 19 with stabilizing capacitors. 12 MHz (11.059MHz) crystal is often used
and the capacitance ranges from 20pF to 40pF.

pg. 10

Mobile Based controlling of Home appliances using DTMF

A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes one
machine cycle to execute, it will take 12 pulses of the crystal to execute. Since we know
that we can calculate how many instruction cycles the 8051 can execute per second:
11,059,000 / 12 = 921,583
11.0592 MHz crystals are often used because it can be divided to give you exact clock
rates for most of the common baud rates for the UART, especially for the higher speeds
(9600, 19200).

3.5 Crystal oscillator

Reset:
RESET is an active High input When RESET is set to High, 8051 goes back to the power
on state. The 8051 is reset by holding the RST high for at least two machine cycles and
then returning it low. Initially charging of capacitor makes RST High, When capacitor
charges fully it blocks DC.

pg. 11

Mobile Based controlling of Home appliances using DTMF

4. 8051 Microcontroller
The Intel 8051 is an 8-bit microcontroller which means that most available operations are
limited to 8 bits. There are 3 basic sizes of the 8051:
Short
Standard
Extended
The Short and Standard chips are often available in DIP (dual in-line package) form, but
the extended 8051 models often have a different form factor, and are not "drop-in
compatible. All these things are called 8051 because they can all be programmed using
8051 assembly language, and they all share certain features (although the different
models all have their own special features). Intel refers to it as MCS 51.A microcontroller
also called an embedded controller because the microcontroller and its support circuits
are often built into, or embedded in, the devices they control. A microcontroller internally
consists of all features required for a computing system and functions as a computer
without adding any external digital parts in it.

A microcontroller basically contains one or more following components:

Central processing unit(CPU)

Random Access Memory)(RAM)

Read Only Memory(ROM)

Input/output ports

Timers and Counters

Interrupt Controls

Analog to digital converters

Digital analog converters

Serial interfacing ports

Oscillatory circuits

pg. 12

Mobile Based controlling of Home appliances using DTMF

4.1 Architecture
8051 is available in different memory types:
UV - EPROM
FLASH
NV RAM
Some of the features that have made the 8051 popular are:

4 KB on chip program memory.


128 bytes on chip data memory (RAM).
4 register banks.
128 user defined software flags.
8-bit data bus
16-bit address bus
32 general purpose registers each of 8 bits.

pg. 13

Mobile Based controlling of Home appliances using DTMF

16- Bit timers (usually2, but may have more, or less).

3 internal and 2 external interrupts.

Bit as well as byte addressable RAM area of 16 bytes.

Four 8-bit ports (short models have two 8-bit ports).

16-bit program counter and data pointer.

1 Microsecond instruction cycle with 11.0592 MHz Crystal.

A microcontroller is capable of handling Boolean functions.

Higher speed and performance.


Easy to design with low cost and small size.

8051 PIN DIAGRAM:

4.2 Pin Diagram of 8051 Microcontroller

pg. 14

Mobile Based controlling of Home appliances using DTMF

Pin Description of 8051:


PIN 9: PIN 9 is the reset pin which is used to reset the microcontrollers internal
registers and ports upon starting up.
PINS 18 &19: The 8051 has a built-in oscillator amplifier hence we need to only
connect a crystal at these pins to provide clock pulses to the circuit.
PIN 40 and 20: Pin 40 and 20 are VCC and ground respectively. The 8051 chip needs
+5V, 500mA to function properly, although there are lower powered versions.
PIN 31: As described in the features of the 8051, this chip contains a built-in flash
memory. In order to program this we need to supply a voltage of +12V at pin 31. If
external memory is connected then PIN 31, all called EA/VPP, should be connected to
ground to indicate the presence of external memory.
PIN 30: PIN 30 is called ALE (address latch enable), which is used when multiple
memory chips are connected to the controller and only one of them needs to be selected.
PIN 29:

PIN 29 is called PSEN. This is "program store enable". In order to use the

external memory it is required to provide the low voltage (0) on both PSEN and EA pins.

PORTS:
PORT P1 (Pins 1 to 8): The port P1 is a general purpose input /output port which can be
used for a variety of interfacing tasks. The Port 1output buffers can sink/source four TTL
inputs. When 1s are written to portn1 pins are pulled high by the internal pull-ups and can
be used as inputs.
PORT P3 (Pins 10 to 17): Port P3 acts as a normal I/O port, but Port P3 has additional
functions such as,
serial transmit
receive pin

pg. 15

Mobile Based controlling of Home appliances using DTMF

PORT P2 (pins 21to28): Port P2 can also be used as a general purpose 8 bit port when
no external memory is present, but if external memory access is required then Port P2
will act as an address bus in conjunction with PORT P0 to access external memory. Port
P2 acts as A8-A15.
PORT P0 (pins32 to39) Port P0 can be used as a general purpose 8 bit port when no
external memory is present , but if external memory access is required then Port P0 acts
as a multiplexed address and data bus that can be used to access external memory.
PORT P10: Asynchronous communication input or Serial synchronous communication
output.

Oscillator Circuit:
The oscillator circuit usually runs around12MHz, although the 8051 is capable of running
at a maximum of 40MHz. Each machine cycle in the 8051 is 12 clock cycles, giving an
effective cycle rate at 1MHz to 3.33MHz. The oscillator circuit generates the clock pulses
so that all internal operations are synchronized.

Data and Program Memory:


The 8051 Microcontroller can be programmed in PL/M, 8051 Assembly, C and a number
of other high-level languages. Many compilers even have support for compiling C++ or
an 8051.Program memory in the 8051 is read-only, when stored on EEPROM or flash,
the program memory can be rewritten when the microcontroller is in the special
programmer circuit.

Program Start Address:


The 8051 starts executing program instructions from address 0000 in the program
memory. The A register is located in the SFR memory location 0xE0. The A register
works in a similar fashion to the AX register of x86 processors. The A register is called
the accumulator and by default it receives the result of all arithmetic operation.

pg. 16

Mobile Based controlling of Home appliances using DTMF

Special Function Register:


The SFR is the upper are of addressable memory, from address 0x80 to 0xFF. A, B,
PSW, DPTR are called SFR. This area of memory cannot be used for data or program
storage, but is instead a series, of memory-mapped ports and registers. All port input and
output can therefore be performed by memory move operations on specified addresses in
the SFR.

General Purpose Registers:


The 8051 has 4 selectable banks of 8 addressable 8-bit registers, R0 to R7 .This means
that there are essentially 32 available general purpose register ,although only 8 (one
bank) can be directly accessed at a time. To access the other banks, we need to change
the current bank number in the flag register.

A and B Registers:
The A register is located in the SFR memory location 0xE0. The A register works in a
similar fashion to the AX register of x86 processors. The A register is called
the accumulator. The B register is used in a similar manner, except that it can receive the
extended answers from the multiply and divide operations.

pg. 17

Mobile Based controlling of Home appliances using DTMF

5. Dual-tone multi-frequency signaling (DTMF)


Dual-tone multi-frequency signaling (DTMF) is used for telecommunication
signaling over
analog
telephone
lines
in
the
voice-frequency
band
between telephone handsets and other communications devices and the switching center. The
version of DTMF that is used in push-button telephones for tone dialing is known as TouchTone. It was first used by AT&T in commerce, using that name as a registered trademark.
DTMF is standardized by ITU-T Recommendation It is also known in the UK as MF4.
Other multi-frequency systems are used for internal signaling within the telephone
network.
The Touch-Tone system, using the telephone keypad, gradually replaced the use of rotary
dial starting in 1963 ,and since then DTMF or Touch-Tone became the industry standard
for both cell phones and landline service.

Multi Frequency Signaling:


Prior to the development of DTMF, automated telephone systems employed pulse
dialing (Dial Pulse or DP in the U.S.) or loop disconnect (LD) signaling to dial numbers.
It functions by rapidly disconnecting and re-connecting the calling party's telephone line,
similar to flicking a light switch on and off. The repeated interruptions of the line, as
the dial spins, sounds like a series of clicks. The exchange equipment interprets these dial
pulses to determine the dialed number. Loop disconnect range was restricted by
telegraphic distortion and other technical problems[which?] , and placing calls over longer
distances required either operator assistance (operators used an earlier kind of multifrequency dial) or the provision of subscriber trunk dialing equipment.
Multi-frequency signaling is a group of signaling methods that use a mixture of
two pure tone (pure sine wave) sounds. Various MF signaling protocols were devised by
the Bell System and CCITT. The earliest of these were for in-band signaling between
switching centers, where long-distance telephone operators used a 16-digit keypad to
input the next portion of the destination telephone number in order to contact the next
downstream long-distance telephone operator. This semi-automated signaling and
switching proved successful in both speed and cost effectiveness. Based on this prior

pg. 18

Mobile Based controlling of Home appliances using DTMF

success with using MF by specialists to establish long-distance telephone, Dual-tone


multi-frequency (DTMF) signaling was developed for the consumer to signal their own
telephone-call's destination telephone number instead of talking to a telephone operator.
AT&Ts Compatibility Bulletin No. 105 described the product as "a method for
pushbutton signaling from customer stations using the voice transmission path." In order
to prevent consumer telephones from interfering with the MF-based routing and
switching between telephone switching centers, DTMF's frequencies differ from all of
the pre-existing MF signaling protocols between switching centers: MF/R1, R2, CCS4,
CCS5, and others that were later replaced by SS7 digital signaling. DTMF, as used
in push-button telephone tone dialing, was known throughout the Bell System by the
trademark Touch-Tone. This term was first used by AT&T in commerce on July 5, 1960
and then was introduced to the public on November 18, 1963, when the first push-button
telephone was made available to the public. It was AT&T's registered trademark from
September 4, 1962 to March 13, 1984, and is standardized by ITU-T Recommendation. It
is also known in the UK as MF4.
Other vendors of compatible telephone equipment called the Touch-Tone feature Tone
dialing or DTMF, or used their own registered trade names such as the Digitone of
Northern Electric (now known as Nortel Networks).
The DTMF system uses eight different frequency signals transmitted in pairs to represent
16 different numbers, symbols and letters - as detailed below.
As a method of in-band signaling, DTMF tones were also used by cable
television broadcasters to indicate the start and stop times of local commercial insertion
points during station breaks for the benefit of cable companies. Until better out-of-band
signaling equipment was developed in the 1990s, fast, unacknowledged, and loud DTMF
tone sequences could be heard during the commercial breaks of cable channels in the
United States and elsewhere.
The engineers had envisioned phones being used to access computers, and surveyed a
number of companies to see what they would need for this role. This led to the addition
of the number sign(#, sometimes called 'octothorpe' or 'pound' in this context - 'hash' or
'gate' in the UK) and asterisk or "star" (*) keys as well as a group of keys for menu
selection: A, B, C and D. In the end, the lettered keys were dropped from most phones,
and it was many years before these keys became widely used for vertical service
codes such as *67 in the United States of America and Canada to suppress caller ID.

pg. 19

Mobile Based controlling of Home appliances using DTMF

Public payphones that accept credit cards use these additional codes to send the
information from the magnetic strip.
The U.S. military also used the letters, relabeled, in their now defunct Autovon phone
system. Here they were used before dialing the phone in order to give some calls priority,
cutting in over existing calls if need be. The idea was to allow important traffic to get
through every time. The levels of priority available were Flash Override (A), Flash (B),
Immediate (C), and Priority (D), with Flash Override being the highest priority. Pressing
one of these keys gave your call priority, overriding other conversations on the network.
Pressing C, Immediate, before dialing would make the switch first look for any free lines,
and if all lines were in use, it would disconnect any non-priority calls, and then any
priority calls. Flash Override will kick every other call off the trunks between the origin
and destination. Consequently, it was limited to the White House Communications
Agency.
Present-day uses of the A, B, C and D keys on telephone networks are few, and exclusive
to network control. For example, the A key is used on some networks to cycle through
different carriers at will (thereby listening in on calls). Their use is probably prohibited
by most carriers. The A, B, C and D tones are used in amateur radio phone patch and
repeater operations to allow, among other uses, control of the repeater while connected to
an active phone line.
DTMF tones are also used by some cable television networks and radio networks to
signal the local cable company/network station to insert a local advertisement or station
identification. These tones were often heard during a station ID preceding a local ad
inserts. Previously, terrestrial television stations also used DTMF tones to shut off and
turn on remote transmitters.
DTMF signaling tones can also be heard at the start or end of some VHS (Video Home
System) cassette tapes. Information on the master version of the video tape is encoded in
the DTMF tone. The encoded tone provides information to automatic duplication
machines, such as format, duration and volume levels, in order to replicate the original
video as closely as possible.
DTMF tones are sometimes used in caller ID systems to transfer the caller ID
information, however in the USA only Bell 202 modulated FSK signaling is used to
transfer the data.
A DTMF can be heard on most Whelan Outdoor Warning systems.

pg. 20

Mobile Based controlling of Home appliances using DTMF

5.1 wave form generation


1209 Hz on 697 Hz to make the 1 tone
Main article: Telephone keypad

The DTMF keypad is laid out in a 44 matrix, with each row representing
a low frequency, and each column representing a high frequency. Pressing a single key
(such as 1) will send a sinusoidal tone for each of the two frequencies (697 and
1209 hertz (Hz)). The original keypads had levers inside, so each button activated two
contacts. The multiple tones are the reason for calling the system multi frequency.
DTMF keypad frequencies (with sound clips)

1209 Hz 1336 Hz 1477 Hz 1633 Hz

697 Hz 1

770 Hz 4

852 Hz 7

941 Hz *

pg. 21

Mobile Based controlling of Home appliances using DTMF

Special tone frequencies:


National telephone systems define additional tones to indicate the status of lines,
equipment, or the result of calls with special tones. Such tones are standardized in each
country and may consist of single or multiple frequencies. Most European countries use a
single precise frequency of 425Hz, where the United States uses a dual frequency system.
Event

Low frequency High frequency

Busy signal (US)

480 Hz

620 Hz

Ring back tone (US) 440 Hz

480 Hz

350 Hz

440 Hz

Dial tone (US)

The tone frequencies, as defined by the Precise Tone Plan, are selected such
that harmonics and inter modulation products will not cause an unreliable signal.
No frequency is a multiple of another, the difference between any two frequencies does
not equal any of the frequencies, and the sum of any two frequencies does not equal any
of the frequencies. The frequencies were initially designed with a ratio of 21/19, which is
slightly less than a whole tone. The frequencies may not vary more than 1.8% from their
nominal frequency, or the switching center will ignore the signal. The high frequencies
may be the same volume as or louder than the low frequencies when sent across the
line. The loudness difference between the high and low frequencies can be as large as
3 decibels (dB) and is referred to as "twist." The duration of the tone should be at least 70
ms, although in some countries and applications DTMF receivers must be able to reliably
detect DTMF tones as short as 45ms.

pg. 22

Mobile Based controlling of Home appliances using DTMF

European Tones:
Event

Low frequency High frequency

Busy signal (Most of Europe)

425 Hz

----

Ring back tone (UK & Ireland)

400 Hz

450 Hz

Ring back tone (Most of Europe) 425 Hz

----

Dial tone (UK)

350 Hz

450 Hz

Dial tone (Most of Europe)

425 Hz

----

As with other multi-frequency receivers, DTMF was originally decoded by tuned filter
banks. Late in the 20th century most were replaced with digital. DTMF can be decoded
using the Goertzel algorithm.

pg. 23

Mobile Based controlling of Home appliances using DTMF

6. DTMF Decoder
HT9170 is the series of Dual Tone Multi Frequency (DTMF) receivers. They employ
digital counting techniques to detect and decode the 16 DTMF tones into 4 bit output
code.
HT9170 series receivers do not require any external filters as they use highly accurate
switched capacitor filters for filtering low and high frequency signals from the DTMF
tones. They also support power down (PWDN) and inhibit (INH) modes. PWDN mode is
used to power off the crystal, while INH mode to inhibit the A, B, C & D DTMF tones.
The clock is provided by a 3.58 MHz crystal.
In simple terms, HT9170 IC detects and decodes the 16 DTMF tones into 4 bit output. In
case the tones are not detected, the four output bits remain low. The DV pin goes high on
detection of a valid tone.
Pin Diagram:

6.1 DTMF decoder pin diagram

pg. 24

Mobile Based controlling of Home appliances using DTMF

Pin Description:
Pin No
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Function
Operational amplifier non-inverting input
Operational amplifier inverting input
Operational amplifier output terminal
Reference voltage output terminal
Active high. It inhibits the detection of tones
corresponding to A, B, C and D. It is internally pulled
down.
Active high. It leads the chip to power down mode and
inhibits the oscillator. It is internally pulled down
Connection for standard 3.579545 MHz crystal
Ground (0V)
Active high; Enables output D0-D3
Output terminals
Data valid. It goes high on reception of valid DTMF
signal; otherwise remains low
Early steering output
Tone acquisition time and release time can be set by
using external resistor and capacitor
Supply voltage; 5V (2.5V-5.5V)

Name
VP
VN
GS
VREF
INH
PWDN
X1
X2
VSS
OE
D0
D1
D2
D3
DV
EST
RT/GT
VDD

pg. 25

Mobile Based controlling of Home appliances using DTMF

Functional Description of Decoder 9170


DTMF decoder includes a digital decoder that verifies both the duration and the
frequency of the received tones passing the resulting code to the output bus and a band
split filter that separates the tones (low & high) of the received pair.
Filter
The dual tone signal to the inputs of two switched capacitor band pass filters with
bandwidths are applied, that corresponds to the bands enclosing the low and high group
tones, the low and high group tones are separated. Filter provides an excellent dial tone
rejection and at freq 350 and 440Hz incorporates notches. The output of each filter is
followed by a section of single order switched capacitor that smoothens the signal prior to
limiting. High gain comparator are provided with hysteresis is performed by signal
limiting and to detect noise and unwanted low level signals. The frequencies of the
incoming tone from the comparator outputs are full-rail logic.
Decoder
To determine the limited tone frequencies and to verify that they correspond to the
standard DTMF frequency the decoder uses a digital counting technique. While tolerating
the variations of small frequencies, the tone simulation by extraneous voice signals a very
complex averaging algorithm is used. To tolerate and to take off the noise and the
interfacing signals the algorithm guarantee an optimum combination of immunity. The
early steering flag (Est.) raises when the simultaneous presence of two signal conditions
or tones when recognized by the detector. Est. will fall when there is any signal condition
is subsequently losses.
Features of DTMF Receiver HT-9170

Dial Tone Suppression

Low power Consumption

Single 5 volt Power Supply

Inexpensive 3.58MHz Time Base

Adjustable Acquisition and Release Times

Central Office Quality and Performance

Power-down and Inhibit Modes

pg. 26

Mobile Based controlling of Home appliances using DTMF

Applications

Telephone switch equipment

Remote data entry

Paging systems

Personal computers

Credit card system.

pg. 27

Mobile Based controlling of Home appliances using DTMF

7. Software Design
KEIL u-vision is the name of a software dedicated to the development and
testing of a family of microcontrollers based on 8051 technology, which we are going to
use along this tutorial. Most versions share merely the same interface, this tutorial uses
KEIL C51 u-Vision 4 with the C51 compiler.
To create project, write and test the source code and also create hex file, follow the
following steps:
Open Kiel and Start a new project:

You will prompted to choose a name for your new project, chose a name and click
save. The following window will appear, where you will be asked to select a device for
Target Target 1:

From the list, select ATMEL and chose your microcontroller .The AT89s52 will be
called your Target device, which is the final destination of your source code. You will
be asked whether to copy standard 8051 startup code click no.
Click File, New and similar to the following window should appear. The blank space
where your code should be written.

pg. 28

Mobile Based controlling of Home appliances using DTMF

Now, You have to click File ,Save as and chose a file name for code ending with the
extension .c and click save. Then you have to add this file to your project work
space as shown in the following screen:

After right-clicking on source group 1, click on Add files to group, then you will be
prompted to browse the file to add to source group 1, chose the file that you just
saved and add it to the source group. You will notice that the file is added to the project
tree at the left. In some versions of this software you have to turn ON manually the option
to generate HEX files. make sure it is turned ON, by right-clicking on target 1,Options
for target target 1, then under the output tab, by checking the box generate HEX file.
This step is very important as the HEX file is the compiled output of your project that is
going to be transferred to the microcontroller.
You can then start to write the source code in the window then before testing your
source code, you have to compile your source code, and correct eventual syntax errors. In
KEIL IDE, this step is called rebuild all targets.

Code:
#include <reg52.h>
#define dtmf P1
sbit light= P0^0;

pg. 29

Mobile Based controlling of Home appliances using DTMF

sbit fan= P0^1;


void main()
{
int k;
P0=0x00;
while(1)
{
k=P1;
if(k==0xF1||k==0X01)
{
light=1;
}
if(k==0xF3||k==0X03)
{
light=0;
}
if(k==0xF2||k==0x02)
{
fan=1;
}
if(k==0xF4||k==0X04)
{
fan=0;
}
if(k==0xF5||k==0X05)
{
fan=1;
light=1;
}
if(k==0xF6||k==0X06)
{
fan=0;
light=0;
}
}
}

pg. 30

Mobile Based controlling of Home appliances using DTMF

8. Relay
A relay is an electrically operated switch. Many relays use an electromagnet
to operate a switching mechanism, but there operating principles are also used. Relays
find applications where it is necessary to control a circuit by a low-power signal, or
where several circuits must be controlled by one signal. The first relays were used in long
distance telegraph circuits, repeating the signal coming in from one circuit and retransmitting it to another. Relays found extensive use in telephone exchanges and early
computers to perform logical operations. 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 triggered by
light 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 "protection relays".
Solid-state relay:
A solid state relay (SSR) is a solid state electronic component that provides a similar
function to an electromechanical relay but does not have any moving components,
increasing long-term reliability. With early SSR's, the tradeoff came from the fact that
every transistor has a small voltage drop across it. This voltage drop limited the amount
of current a given SSR could handle. As transistors improved, higher current SSR's, able
to handle 100 to 1,200 Amperes, have become commercially available. Compared to
electromagnetic relays, they may be falsely triggered by transients.
Relay interfacing with 8051:
Relays are devices which allow low power circuits to switch a relatively high
Current/Voltage ON/OFF. For a relay to operate a suitable pull-in & holding current
should be passed through its coil. Generally relay coils are designed to operate from a
particular voltage often its 5V or 12V. The function of relay driver circuit is to provide
the necessary current (typically 25 to 70ma) to energize the relay coil.

pg. 31

Mobile Based controlling of Home appliances using DTMF

8.1 Relay interfacing with 8051


Figure shows the basic relay driver circuit. As you can see an NPN transistor BC547 is
being used to control the relay. The transistor is driven into saturation (turned ON) when
a LOGIC 1 is written on the PORT PIN thus turning ON the relay. The relay is turned
OFF
A diode (1N4007/1N4148) is connected across the relay coil, this is done so as to protect
the transistor from damage due to the BACK EMF generated in the relay's inductive coil
when the transistor is turned OFF. When the transistor is switched OFF the energy stored
in the inductor is dissipated through the diode & the internal resistance of the relay coil.
As you can see we have used a pull up resistor at the base of the transistor. AT8951/52/55
has an internal pull up resistor of 10k so when the pin is pulled high the current flows
through this resistor so the maximum output current is 5v/10K = 0.5ma, the DC current
gain of BC547 is 100 so the maximum collector current we can get is 0.5ma x 100 =
50ma, but most of the relays require more than 70ma-130ma current depending on the
relay that we have used, 0.5ma of base current is not suitable enough for turning ON the
relay, so we have used an external pull up resistor. When the controller pin is high current
flows through the controller pin i.e. 5v/10k=0.5ma as well as through the pull up resistor.
We have used 4.7k pull up resistor so 5v/4.7k=1.1ma so maximum base current can be
0.5ma + 1.1ma=1.6ma i.e. collector current =1.6ma x 100 = 160ma which is enough to
turn ON most of the relays.

pg. 32

Mobile Based controlling of Home appliances using DTMF

9. Advantages & Dis-advantages


Advantages:
1. By using DTMF technology, cost of the system is very low.
2. The system is not complex.
3. The home automation is ubiquitous.
4. Home automation is possible from any remote areas with minimum signal
strength.
5. Wide range of usage in industries and home automation.
6. By little modifications, we can detect the intrusions.

Disadvantages:
1. The receiver must reside in a location where a signal with sufficient strength can
be obtained
2. The only person who can communicate with the control module is the person who
will be successfully authenticated
3. Only devices with electrical controlling input ports will be possible targets for
controlling.
4. In this system there is feedback facility to the user.

pg. 33

Mobile Based controlling of Home appliances using DTMF

10. Conclusion
Mobile phones have become an indispensable part of our life. Our system uses a
controller and a cellular phone for its operations. The systems can be used as a test bed
for any application that requires on-off switching based applications. Wireless controlled
home appliances in the comforts of any environment will revolutionize our way of living.
Controlling appliances remotely by a cell phone will one day become a reality and one
should give thanks to the capabilities of HACS. HACS might one day become a standard
system in the new homes to come.

pg. 34

Mobile Based controlling of Home appliances using DTMF

11. References
1. Data communications (DTMF technology) WAYNE TOMASI
2. Yun Chan Cho and Jae Wook Jeon, Remote Robot control System based on DTMF of
3.
4.
5.
6.

Mobile Phone IEEE International Conference INDIN 2008, July 2008.


M J. Callahan, Jr., Integrated DTMF receiver, ZEEE J. Solzd-State Czrcuzts, vol. Sc14, pp. 85-90, Feb. 1979.
M. Callahan Jr, Integrated DTMF Receiver, IEEE Transactions on communications,
vol. 27, pp. 343-348, February 1979.
R. Sharma, K. Kumar, and S. Viq, DTMF Based Remote Control System, IEEE
International Conference ICIT 2006, pp. 2380-2383, December 2006.
Oppenheim, Alan V. and Schafer, Ronald W. Digital Signal Processing. Prentice-Hall of
India, 1989.

pg. 35

You might also like