1. INTRODUCTION
2. BLOCK DIAGRAM
2.1 .Elements required
3. CIRCUIT DIAGRAM
4. DTMF DECODER
4.1 .Keypad
4.2 .DTMF keypad frequencies
4.3. Working
5. MICROCONTROLLER – AT89C51
5.1 .Introduction to microcontroller
5.2 .Microcontroller
5.3 .Microcontroller devices
5.4 .Microcontroller vs Microprocessor
5.5 .Advantages of microcontrollers
5.6 .Types of 8051 microcontroller
5.7 .Microcontroller – at89c51
5.7.1 .Description
5.7.2. Features
5.8 .why we go for at89c51
5.9 .Features of at89c51
5.10 .Pin description
5.11 .Input – Output (i/O) PORTS
5.12 .Pins which we used in our project
5.13 .Memory in 8051 Microcontroller
1
5.14. Register Banks
5.14.1 .General Purpose registers
5.14.2. SFR Registers (Special Function Registers)
5.15 .TIMERS
5.16. PROGRAM
6. DRIVER CIRCUIT
6.1. Advantages
7. INVERTER
8. RELAYS
8.1 .Choosing a relay
9. POWER SUPPLY
9.1. Introduction-:
9.2 .Description:
9.21 .Transformer-:
9.33. Filtering unit-:
9.34. Regulators-:
9.4. Technical details:-
9.5 .Advantages:-
CONCLUSION
1. INTRODUCTION
2
This Project “TELEPHONE BASED ELECTRICAL
DEVICE CONTROL” is used to control the devices in home as well as in
industries, Banks, and also in Remote areas. Conventionally, wireless-
controlled appliances use RF circuits, which have the drawbacks of limited
working range, limited frequency range and limited control. Use of a
mobile phone for device control can overcome these limitations. It provides
the advantages of robust control, working range as large as the coverage
area of the service provider, no interference with other controllers and up to
twelve controls.
In this project, we control home appliances either AC Device
or DC Device controlled by a mobile phone that makes a call to the mobile
phone attached to the control board. In the course of a call, if any button is
pressed, a tone corresponding to the button pressed is heard at the other end
of the call. This tone is called ‘dual-tone multiple-frequency’ (DTMF) tone.
The controller perceives this DTMF tone with the help of the phone stacked
in the control board and operate.
In our project the main part consists of Embedded systems in
general Embedded systems are a system is which performs a specific or a
pre-defined task. It is the combinations of hardware and software. It is
nothing but a computer inside a product. It is a programmable hardware
design nothing but an electronic chip. A general-purpose definition of
embedded systems is that they are devices used to control, monitor or assist
the operation of equipment, machinery or plant. “Embedded” reflects the
fact that they are an integral part of the system. In many cases their
embedded ness may be such that their presence is far from obvious to the
casual observer and even the equipment for sometime before being able to
conclude that an embedded control system was involved in its functioning.
At the other extreme a general-purpose computer may be used to control
the operation of a large complex processing plant, and its presence will be
obvious.
3
2. BLOCK DIAGRAM
DEVICE 1
DEVICE 2
RELAYS
DEVICE 3
DTMF
DECODER RELAYS
DRIVER DEVICE 4
8051
UNIT
Controller
RELAYS
FIG 2.1
RELAYS
2.1 ELEMENTS-REQUIERD:
1. DTMF-decoder (MT8870)
2. Inverter (74LS04)
3. Microcontroller (AT89C51)
4. Driver (ULN2003)
5. Relays (4)
6. Devices (4)
7. Power supply
4
3. CIRCUIT DIAGRAM
FIG 3.1
FIG3.2
5
4. DTMF DECODER
Dual tone multi-frequency (DTMF) signaling is used for telephone
signaling over the line in the voice –frequency band to the call switching
center.
4.1 KEYPAD
The DTMF keypad is laid out in a 4*4 matrix, with each row representing a
low frequency and column representing a high frequency.
The original keypads had levers inside, so each button activated two
contacts. The multiple tones are the reason for calling the system
multifrequency. These tones are then decoded by switching center to
determine which key was pressed.
For example, pressing a single key such as ‘1’ will send a sinusoidal tone of
the frequencies 697 Hz and 1209 Hz.
The decoder used here is MT 8870. This IC takes DTMF signal coming via
telephone and converts this signal into respective BCD number it uses same
oscillator frequency used in the remote section so same crystal oscillator
with frequency of 3.85 Hz is used in this IC.
6
4.3 WORKING
The MT 8870 is full DTMF receiver that integrates both band
split filter and decoder functions into a single 18-pin DIP. Its filter section
uses switched capacitor technology for both 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. Minimal external
components required include a low-cost 3.579545 MHz crystal, a timing
resistor, and a timing capacitor. The MT-8870-02 can also inhibit the
decoding of fourth column digits.
MT 8870 operating functions includes a band split filter that
separates the high and low tones of received pair and a digital decoder that
verifies both the frequency and duration of the received tones before
passing the resulting 4-bit code to the output bus.
The low and high group tones are separated by applying the
dual tone signal to the inputs of two 6th order switched capacitor bands
enclosing the low and high group tones. The filter also incorporates notches
at 350 and 440 Hz, providing excellent dial tone rejection. Each filter
output is followed by a single-order switched capacitor section that
smoothens the signals prior to limiting. Signal limiting is performed by high
gain comparators provided with hysteresis to prevent detection of unwanted
low-level signals and noise.
The MT-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. 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. Before a decoded tone pair is registered, the receiver
checks for valid signal duration (referred to as character- recognition-
condition).
7
This check is performed by an external RC time constant driven by ESt. 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. Inhibit mode is
enabled by a logic high input to pin 5 (INH). It inhibits the detection of
1633 Hz.
The input arrangement of the MT-8870 provides a differential input
operational amplifier as well as a bias source (VREF) to bias the inputs at
mid-rail. Provision is made for connection of a feedback resistor to the op-
amp output (GS) for gain adjustment.
The internal clock circuit is completed with the addition of a standard
3.579545 MHz crystal. The output code will remain the same as the
previous detected code. On the M- 8870 models, this pin is tied to ground
(logic low).
8
5. MICROCONTROLLER – AT89C51
9
In-system reprogramming via serial port.
128 bytes fast access scratchpad RAM
Two 16 bit general-purpose timer/counters
Five interrupts with two external
Dedicated memory bus, preserving four 8-bit ports for general
purpose I/O
Power-fail reset
Early warning power-fail interrupts.
Watchdog timer.
5.2 MICROCONTROLLER:
10
A BLOCK DIAGRAM OF MICROCONTROLLER
(EXPANDED)
INTERNA
INTERNAL
L
RAM INTERNAL
CIRCUITS
ROM CLOCK
STACK
CIRCUIT
POINTER
PROGRAM COUNTER
11
A microcontroller is meant to be more self-contained and
independent, and functions as a tiny, dedicated computer than
microprocessor.
The microcontroller may function as a computer with addition of
external digital parts; the microprocessor must have many additional parts
to be operational.
12
5.7 MICROCONTROLLER – AT89C51
5.7.1 Description:
The AT89C51 is a low-power, high-performance CMOS 8-bit
microcomputer with 4K bytes of Flash programmable and erasable read
only memory (PEROM). The device is manufactured using Atmel’s high-
density non-volatile memory technology and is compatible with the
industry-standard 80C51 and 80C52 instruction set and pin out. The on-
chip Flash allows the program memory to be reprogrammed in-system or
by a conventional non-volatile memory programmer. By combining a
versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is
a powerful microcomputer, which provides a highly flexible and cost-
effective solution to many embedded control applications. The AT89C51
provides the following standard features: 4K bytes of Flash, 128 bytes of
RAM, 32 I/O lines, two 16-bit timer/counters, a six-vector two-level
interrupt architecture, a full-duplex serial port(UART) which operates at
11.0592 MHz, on-chip oscillator, and clock circuitry. In addition, the
AT89C51 is designed with static logic for operation down to zero frequency
and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM; timer/counters, serial port, and
interrupt system to continue functioning. The Power-down mode saves the
RAM contents but freezes the oscillator, disabling all other chip functions
until the next hardware reset
5.7.2 Features:
13
8 bit 8051-compatible microcontroller adapts to task at hand.
• 8 or 32 k bytes of non-volatile RAM for program and /or data
memory storage.
• Initial downloading software in end system via on chip serial port.
• Capable of modifying its own program and/or date memory in end
use.
1. It is a 8-bit microcontroller.
2. It has a flash memory of 4KB for storing the program.
3. It has RAM of 128 bytes.
4. It has 32 I/O ports.
- Timer 0
- Timer 1
15
-4 pre-programmed interrupt (Timer0, Timer1, Serial interrupt, Reset
interrupt).
11. Wide range of frequency of operation (0 to 24 MHz).
12. It will operate on 5V dc supply.
13. It can support maximum of 500mA of current.
PINOUT DIAGRAM
16
FIG 5.2
Microcontroller Pin Diagram.
1–8: Port 1:
Each of these pins can be used as either input or output. Also
pins 1 and 2 (P1.0 and P1.1) have special functions associated with Timer
2.
9: Reset Signal:
High logical state on this input halts the MCU and clears all the
registers. Bringing this pin back to logical state zero starts the program
anew as if the power had just been turned on. In another words, positive
voltage impulse on this pin resets the MCU. Depending on the device's
purpose and environs, this pin is usually connected to the push-button,
reset-upon-start circuit or a brown out reset circuit. The image shows one
simple circuit for safe reset upon starting the controller.
10-17: Port 3:
As with Port 1, each of these pins can be used as universal input
or output. However, each pin of Port 3 has an alternative function:
Pin 11:
17
TXD - Serial output for asynchronous communication or clock
output for synchronous communication
FIG 5.3
Clock Circuit
18
Pin 20: GND: Ground
19
internal memory. This means that even if there is a program loaded in the
MCU it will not be executed, but the one from the external ROM will be
used instead. Conversely, bringing the pin to the high logical state causes
the controller to use both memories, first the internal, and then the external
(if present).
Port 0
Port 0 has two fold role: if external memory is used, it contains the lower
address byte (A0-A7), otherwise all bits of the port are either input or
output. Another feature of this port comes to play when it has been
designated as output. Port 0 lacks the "pull up" resistor (resistor with +5V
on one end). Therefore, to get one (5V) on the output, external "pull up"
resistor needs to be added for connecting the pin to the positive pole.
Port 1
This is "true" I/O port, devoid of dual function characteristic for
Port 0. Having the "pull up" resistor, Port 1 is fully compatible with TTL
circuits.
20
Port 2
When using external memory, this port contains the higher address
byte (addresses A8–A15). Otherwise, it can be used as universal I/O port.
Port 3
Beside its role as universal I/O port, each pin of Port 3 has an
alternate function. In order to use one of these functions, the pin in question
has to be designated as input, i.e. the appropriate bit of register P3 needs to
be set. From a hardware standpoint, Port 3 is similar to 0.
The 8051 has three very general types of memory. The memory
types are illustrated in the following figure: On-Chip Memory, External
Code Memory, and External RAM.
21
FIG 5.4
Memory Block Diagram.
22
The 8051, being a communications-oriented microcontroller, gives
the user the ability to access a number of bit variables. These variables may
be either 1 or 0. There are 128 bit variables available to the user, numbered
00h through 7Fh.
5.15 TIMERS:
The 8051 comes equipped with two timers, both of which may be
controlled, set, read, and configured individually. The 8051 timers have
three general functions:
1) Keeping time and/or calculating the amount of time between events,
2) Counting the events themselves, or
3) Generating baud rates for the serial port.
23
24
5.16 PROGRAM:
#include<reg51.h>
Sbit relay1 = p2^0;
Sbit realy2 =p2^1:
Sbit relay3 =p2^2;
Sbit relay4 = p2^3;
Void main(void)
{
Unsigned int k, h;
P0 = 0*00;
P2=0*00;
While (1)
{
K = ~p0 ;
h= k;
switch (h)
{
Case 0*01 ;
{
Relay1 = 1;
Break:
}
Case 0*02 ;
{
Relay1 = 0;
25
Break:
}
Case 0*03 ;
{
Relay2 = 1;
Break:
}
Case 0*04 ;
{
Relay2 = 0;
Break:
}
Case 0*05 ;
{
Relay3 = 1;
Break:
}
Case 0*06 ;
{
Relay3 = 0;
Break:
}
Case 0*07 ;
{
Relay4 = 1;
Break:
}
Case 0*08 ;
{
26
Relay4 = 0;
Break:
}
Case 0*09 ;
{
P2= 0*00;
Break:
}
Case 0*0a ;
{
P2 = 0*FF;
Break:
}
}
}
}
27
6. DRIVER CIRCUIT
The driver circuit used here is ULN 2003; it is a 16-bit Ic, having 7 input
and 7 output pins. Outputs are complements of input.
It supports two amps of current. Gives inverted output. It is of
DARLINGTON pair amplifier.
6.1 Advantages
It amplifies current (it can support upto 1-2A), consisting of 7
darlington pairs.
Back EMF protection for the microcontroller.
FIG 6.1
A-Darlington pair of amplifier Darlington pair
I-Inverter
28
7. INVERTER
A 74LS04 inverter is used in the project, which is connected between DTMF decoder and
microcontroller.
This circuit is used to invert the signal obtained from DTMF to avoid the changes in output
obtained from it.
And now the program in the microcontroller is compiled as per the inverted output to perform
the required task.
29
8. RELAYS
A relay is an electrically operated switch. Current flowing through the coil of the
relay creates a magnetic field which attracts a lever and changes the switch contacts. The coil
current can be on or off so relays have two switch positions and they are double throw
(changeover) switches.
Relays allow one circuit to switch a second circuit which can be completely
separate from the first. For example a low voltage battery circuit can use a relay to switch a
230V AC mains circuit. There is no electrical connection inside the relay between the two
circuits, the link is magnetic and mechanical.
The coil of a relay passes a relatively large current, typically 30mA for a 12V
relay, but it can be as much as 100mA for relays designed to operate from lower voltages.
Most ICs (chips) cannot provide this current and a transistor is usually used to amplify the
small IC current to the larger value required for the relay coil. The maximum output current
for the popular 555 timer IC is 200mA so these devices can supply relay coils directly
without amplification.
Relays are usuallly SPDT or DPDT but they can have many more sets of switch
contacts, for example relays with 4 sets of changeover contacts are readily available. For
further information about switch contacts and the terms used to describe them please see the
page on switches.
Most relays are designed for PCB mounting but you can solder wires directly to the
pins providing you take care to avoid melting the plastic case of the relay.
The supplier's catalogue should show you the relay's connections. The coil will be
obvious and it may be connected either way round. Relay coils produce brief high voltage
'spikes' when they are switched off and this can destroy transistors and ICs in the circuit. To
prevent damage you must connect a protection diode across the relay coil.
30
The animated picture shows a working relay with its coil and switch contacts. You
can see a lever on the left being attracted by magnetism when the coil is switched on. This
lever moves the switch contacts. There is one set of contacts (SPDT) in the foreground and
another behind them, making the relay DPDT.
The relay's switch connections are usually labelled COM, NC and NO:
COM = Common, always connect to this, it is the moving part of the switch.
NC = Normally Closed, COM is connected to this when the relay coil is off.
NO = Normally Open, COM is connected to this when the relay coil is on.
Connect to COM and NO if you want the switched circuit to be on when the relay coil is on.
Connect to COM and NC if you want the switched circuit to be on when the relay coil is off.
8.1 Choosing a relay
You need to consider several features when choosing a relay:
Physical size and pin arrangement
If you are choosing a relay for an existing PCB you will need to ensure that its dimensions
and pin arrangement are suitable. You should find this information in the supplier's catalogue.
Coil voltage
The relay's coil voltage rating and resistance must suit the circuit powering the relay coil.
Many relays have a coil rated for a 12V supply but 5V and 24V relays are also readily
available. Some relays operate perfectly well with a supply voltage which is a little lower
than their rated value.
Coil resistance
The circuit must be able to supply the current required by the relay coil. You can use Ohm's
law to calculate the current: Relay coil current = supply voltage
coil resistance
Switch ratings (voltage and current)
The relay's switch contacts must be suitable for the circuit they are to control. You will need
to check the voltage and current ratings. Note that the voltage rating is usually higher for AC,
for example: "5A at 24V DC or 125V AC".
Switch contact arrangement (SPDT, DPDT etc)
31
Most relays are SPDT or DPDT which are often described as "single pole changeover"
(SPCO) or "double pole changeover" (DPCO). For further information please see the page on
switches.
Protection diodes for relays
Transistors and ICs (chips) must be protected from the brief high voltage 'spike' produced
when the relay coil is switched off. The diagram shows how a signal diode (eg 1N4148) is
connected across the relay coil to provide this protection. Note that the diode is connected
'backwards' so that it will normally not conduct. Conduction only occurs when the relay coil
is switched off, at this moment current tries to continue flowing through the coil and it is
harmlessly diverted through the diode. Without the diode no current could flow and the coil
would produce a damaging high voltage 'spike' in its attempt to keep the current flowing.
Reed relays consist of a coil surrounding a reed switch. Reed switches are normally operated
with a magnet, but in a reed relay current flows through the coil to create a magnetic field and
close the reed switch.
Reed relays generally have higher coil resistances than standard relays (1000 for example)
and a wide range of supply voltages (9-20V for example). They are capable of switching
much more rapidly than standard relays, up to several hundred times per second; but they can
only switch low currents (500mA maximum for example).
The reed relay shown in the photograph will plug into a standard 14-pin DIL socket ('chip
holder').
For further information about reed switches please see the page on switches.
Relays and transistors compared
Like relays, transistors can be used as an electrically operated switch. For switching small DC
currents (< 1A) at low voltage they are usually a better choice than a relay. However
transistors cannot switch AC or high voltages (such as mains electricity) and they are not
usually a good choice for switching large currents (> 5A). In these cases a relay will be
needed, but note that a low power transistor may still be needed to switch the current for the
relay's coil! The main advantages and disadvantages of relays are listed below:
32
Relay diagram(FIG 8.1)
33
9. POWER SUPPLY
9.1 INTRODUCTION-:
In this fast moving world we deliberately need a proper power source which
will be apt for a particular requirement. All the electronic components starting
from diode to IC’s only work with a DC supply ranging from 5V to 12V.We
are utilizing for the same, the cheapest and commonly available energy source
of 230V-50Hz and stepping down, rectifying, filtering and regulating the
voltage. . Microcontroller operates at +5v DC and also for other ICs and
displays. A 220v ac to 12-0-12v transformer is used and for rectification, four
diodes IN4007 are connected for rectification of the step down ac supply.
Filter capacitor of 1000Uf is used. It is regulated to +5v using a regulator
7805. 0.1 UF capacitor is used for filtration of high frequency noise.
9.2 DESCRIPTION:
34
9.21 TRANSFORMER-:
A bridge rectifier coupled with a step down transformer is used for our design.
The voltage rating of transformer used is 0-12V and the current rating is
500mA. When AC voltage of 230V is applied across the primary winding an
output AC voltage of 12V is obtained. One alteration of input causes the top of
transformer to be positive and the bottom negative. The next alteration will
temporarily cause the reverse.
9.22 RECTIFIER-:
In the power supply unit, rectification is normally achieved using a solid state
diode. Diode has the property that will let the electron flow easily at one
direction at proper biasing condition. Bridge rectifiers of 4 diodes are used to
achieve full wave rectification. Two diodes will conduct during the negative
cycle and the other two will conduct during the positive half cycle.
9.34 REGULATORS-:
The voltage regulators play an important role in any power supply unit. The
primary purpose of a regulator is to aid the rectifier and filter circuit in
providing a constant DC voltage to the device. Power supplies without
regulators have an inherent problem of changing DC voltage values due to
35
9.4 TECHNICAL DETAILS:-
9.5ADVANTAGES:-
36
CONCLUSION
Telephone will allow communication anywhere, any time and with anyone. The
functional architecture of telephone employing intelligent networking principles, and its
ideology, which provides a vast region of controlled communication. The development of
telephone is the first step towards a true personal communication system that enough
standardization to ensure compatibility, but still allows manufactures and operators freedom,
has been widely adopted in the development of future wireless systems.
37
BIBLIOGRAPHY
REFERENCES:
BOOKS:
1. MICRO CONTROLLERS BY
RAMESH.S.GAONKR
2. DATA SHEETS OF VARIOUS IC’S
3. 8051 MANUAL
WEB SITE:
1. WWW.CHIP.COM
2. WWW.GOOGLEARCH.COM
3. WWW.EMBEDDEDSYSTEMS.COM
38
39