Professional Documents
Culture Documents
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
Block Diagram:
pg. 2
pg. 3
pg. 4
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
Application Software
Operating System
H/W
pg. 6
Control systems:
Network equipment:
Critical systems:
Signal processing:
Robotics:
Computer peripherals:
Wireless systems:
Embedded PCs:
pg. 7
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
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.
pg. 9
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
pg. 10
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).
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
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.
Input/output ports
Interrupt Controls
Oscillatory circuits
pg. 12
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:
pg. 13
pg. 14
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
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.
pg. 16
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
pg. 18
pg. 19
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
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)
697 Hz 1
770 Hz 4
852 Hz 7
941 Hz *
pg. 21
480 Hz
620 Hz
480 Hz
350 Hz
440 Hz
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
European Tones:
Event
425 Hz
----
400 Hz
450 Hz
----
350 Hz
450 Hz
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
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:
pg. 24
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
pg. 26
Applications
Paging systems
Personal computers
pg. 27
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
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
pg. 30
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
pg. 32
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
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
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.
pg. 35