Anda di halaman 1dari 39

LIST OF CONTNTS

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

8.2 .Advantages of a relay

8.3 .Disadvantages of 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

These are the elements which are used in our project.

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.

4.2 DTMF KEYPAD FREQUENCIES

1209 Hz 1336 Hz 1477 Hz 1633 Hz


667 Hz 1 2 3 A
770 Hz 4 5 6 B
852 Hz 7 8 9 C
941 Hz * 0 # D

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

5.1 Introduction to Microcontroller:


The secure microcontroller family is a line of 8051-
compatile device that use non-volatile (NV) RAM rather than ROM for
program storage. NV RAM allows the design of a soft microcontroller that
provides many unique features for embedded system designers. The
enhanced security features employed by the secure microcontroller family
protect the user-application software against piracy and tempering. These
devices offer varying degrees of security, ranging from simple access
prevention to a full encryption of program and date memory of the device.
Attempts to gain access to protected information result in the self-
destruction of all data.
The secure microcontroller family is the heart of a wide
range of critical applications such as electronic banking, commercial
transactions, and pay-TV access control, or any application that requires the
protection of proprietary software and algorithms. The secure
microcontroller family is divided between chips and modules. The chips are
monolithic microprocessors that connect to a standard SRAM and lithium
battery in a preassembled, pretested module. Depending on the special
configuration, modules are available in either encapsulated DIP or SIMM
module format.
In Addition to NV RAM, Dallas semiconductors offer a
number of peripherals that simply reduce the cost of embedded systems.
Although the specific features of each chip or module vary, all devices offer
the following basic features set:

 100% code-compatible with 8051


 Directly addresses 64 KB program/64KB data memory.
 Nonvolatile memory control circuitry.
 10-years data retention in the absence of power

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:

A microcontroller is an integrated chip with minimum


required devices. The microcontroller includes a CPU: ALU, PC,SP and
registers, RAM, ROM, I/O ports, and timers like a standard computer, but
because they are designed to execute only a single specific task to control a
single system, they are much smaller and simplified so that they can include
all the functions required on a single chip.

5.3 Most microcontrollers will also combine other devices


such as:

 A Timer module to allow the microcontroller to perform tasks for


certain time periods.
 A serial I/O port to allow data to flow between the microcontroller
and other devices such as a PC or another microcontroller.
 An ADC to allow the microcontroller to accept analogue input data
for processing
.

10
A BLOCK DIAGRAM OF MICROCONTROLLER
(EXPANDED)

ALU TIMER/COUNTER I/O


PORTS
ACCUMULATOR
I/O
REGISTERS PORTS

INTERNA
INTERNAL
L
RAM INTERNAL
CIRCUITS
ROM CLOCK
STACK
CIRCUIT
POINTER
PROGRAM COUNTER

Functional Block Diagram of Microcontroller


FIG 5.1

5.4 MICROCONTROLLER V/s MICROPROCESSOR

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.

 Most microprocessors have many operational codes (op-codes) for


moving data from external memory to the CPU; microcontrollers may have
one or two.
 Microcontrollers are designed by using CMOS (complementary metal
oxide semiconductor) technology, an efficient fabrication technique that
uses less power and is more immune to power spikes than other techniques.

5.5 ADVANTAGES OF MICROCONTROLLERS


Their powerful, cleverly chosen electronics is able to
control a variety of processes and devices (industrial automatics, voltage,
temperature, engines, etc) independently or by means of I/O instruments
such as switches, buttons, sensors, LCD screens, relays etc.

5.6 TYPES OF 8051 MICROCONTROLLER


The 8051 has the widest range of variants of any
embedded controller on the market. The smallest device is the Atmel
89c1051, a 20 Pin FLASH variant with 2 timers, UART, 20mA. The
fastest parts are from Dallas, with performance close to 10 MIPS! The
most powerful chip is the Infineon Technologies 80C517A, with 32 Bit
ALU, 2 UARTS, 2K RAM, PLCC84 package, 8 x 16 Bit PWMs, and
other features.

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.

 Crash proof operation:


• Maintains all non-volatile resources for 10 years in the absence of
VCC
• Power-Fail Reset.
• Early Warning power-Fail Interrupt.
• Watchdog Timer.

 Software security feature:


• Executes encrypted software to prevent unauthorized disclosure.
 On-chip, full-duplex serial I/O ports.
 Two on-chip timer/events counter
 32 parallel I/O lines.
 Compatible with industry standard 8051 instruction set and pinout.
 Optional permanently powered real timer clock.

5.8 Why we go for AT89C51?


The AT89C51 is a low power, high performance CMOS 8-bit
microcontroller with 4Kbytes of Flash programmable and erasable read
only memory (PEROM). This device is compatible with the industry
standard 8051 instruction set and pinout. The on-chip Flash allows the
program memory to be quickly reprogrammed using a non-volatile memory
programmer such as the PG302 (with the ADT87 adapter). By combining
an industry standard 8 bit cpu with flash on a monolithic chip, the 8951 is a
14
powerful microcomputer which provides a highly flexible and cost effective
solution to many embedded control applications.

5.9 Features of AT89C51:

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.

-Port 0 (pin 39 to pin 32).


-Port 1 (pin 1 to pin 8).
-Port 2 (pin 21 to pin 28).
-Port 3 (pin 10 to pin 17).

5. It has four register banks.


6. It has two 16-bit timers.

- Timer 0
- Timer 1

7. It has full duplex asynchronous serial port.


8. It can support up to 64KB of external memory with the help of PC and
DPTR.
9. It has 16-bit address bus.
10. Six interrupts with two priority levels
-2 general purpose interrupts (INT0, INT1).

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.

In addition, the 89C51 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.

PINOUT DIAGRAM

16
FIG 5.2
Microcontroller Pin Diagram.

5.10 PIN DESCRIPTION:

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 10: RXD –


Serial input for asynchronous communication or serial output for
synchronous communication.

Pin 11:

17
TXD - Serial output for asynchronous communication or clock
output for synchronous communication

Pin 12: INT0 - Input for interrupt 0

Pin 13: INT1 - Input for interrupt 1

Pin 14: T0 - Clock input of counter 0

Pin 15: T1 - Clock input of counter 1

Pin 16: WR - Signal for writing to external (add-on) RAM memory

Pin 17: RD - Signal for reading from external RAM memory

Pin 18-19: X2 and X1:


Input and output of internal oscillator. Quartz crystal controlling the
frequency commonly connects to these pins. Capacitances within the
oscillator mechanism (see the image) are not critical and are normally about
30pF.

FIG 5.3

Clock Circuit
18
Pin 20: GND: Ground

Pin 21- 28: Port 2:


If external memory is not present, pins of Port 2 act as
universal input/output. If external memory is present, then these pins serve
as the location of the higher address byte, i.e. addresses A8 – A15. It is
important to note that in cases when not all the 8 bits are used for
addressing the memory (i.e. memory is smaller than 64kB), the rest of the
unused bits are not available as input/output.

Pin 29: PSEN:


MCU activates this bit (brings to low state) upon each reading
of byte (instruction) from program memory. If external ROM is used for
storing the program, PSEN is directly connected to its control pins.

Pin 30: ALE:


Before each reading of the external memory, MCU sends the
lower byte of the address register (addresses A0 – A7) to port P0 and
activates the output ALE. External register (74HCT373 or 74HCT375
circuits are common), memorizes the state of port P0 upon receiving a
signal from ALE pin, and uses it as part of the address for memory chip.
During the second part of the mechanical MCU cycle, signal on ALE is off,
and port P0 is used as Data Bus. In this way, by adding only one cheap
integrated circuit, data from port can be multiplexed and the port
simultaneously used for transferring both addresses and data.

Pin 31: EA:


Bringing this pin to the logical state zero designates the ports
P2 and P3 for transferring addresses regardless of the presence of the

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).

Pin 32-39: Port 0:


Similar to Port 2, pins of Port 0 can be used as universal
input/output, if external memory is not used. If external memory is used, P0
behaves as address output (A0 – A7) when ALE pin is at high logical level,
or as data output (Data Bus) when ALE pin is at low logical level.

Pin 40: VCC: Power +5V

5.11 INPUT – OUTPUT (I/O) PORTS


Every MCU from 8051 family has 4 I/O ports of 8 bits each.
This provides the user with 32 I/O lines for connecting MCU to the
environs.

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.

5.12 Pins which we used in our project


In this project we are using port 0 as an input port and port 2 as an
output port. Pin 9 is connected to an external resister of 10k. pin 40 and 31
are connected to a 15 voltage input. A capacitor is connected between two
pins they are pin 9 and pin 40, pin 30. A crystal oscillator is connected
between the pins 18 and 19. A 33pf capacitor is connected to pin 20 and
ground.

5.13 Memory in 8051 Microcontroller:

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.

On-Chip Memory refers to any memory (Code, RAM, or other) that


physically exists on the microcontroller itself. External Code Memory is
code (or program) memory that resides off-chip. This is often in the form of
an external EPROM. External RAM is RAM memory that resides off-chip.
This is often in the form of standard static RAM or flash RAM.
During the runtime, microcontroller uses two different types of
memory: one for holding the program being executed (ROM memory), and
the other for temporary storage of data and auxiliary variables (RAM
memory).

5.13.1 ROM memory


In this MCU contain 4 kilobytes of the flash memory on the chip. It
is of EEPROM. We can use 12v to program MCU. This option is cost-
effective only for large series. The main purpose of ROM is to store the
programs to be executed.

5.13.2 RAM memory


RAM is used for storing temporary data and auxiliary results
generated during the runtime. Apart from that, RAM comprises a number of
registers: hardware counters and timers, I/O ports, buffer for serial
connection, etc. With older versions, RAM spanned 256 locations, while
new models feature additional 128 registers. First 256 memory locations
form the basis of RAM (addresses 0 – FFh) of every 8051 MCU. Locations
that are available to the user span addresses from 0 to 7Fh.
Main purpose of RAM is to provide synchronization between
ROM and CPU so as to increase the speed of microcontroller.

5.13.3 Bit Memory

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.13.4 Special Function Register (SFR) Memory


Special Function Registers (SFRs) are areas of memory that control
specific functionality of the 8051 processor. It may appear that SFR is part
of Internal Memory. However, when using this method of memory access
(its called direct address), any instruction that has an address of 00h through
7Fh refers to an Internal RAM memory address; any instruction with an
address of 80h through FFh refers to an SFR control register.

5.14 Register Banks


5.14.1 General Purpose registers:
The 8051 uses 8 "R" registers which are used in many of its
instructions. These "R" registers are numbered from 0 through 7 (R0, R1,
R2, R3, R4, R5, R6, and R7). These registers are generally used to assist in
manipulating values and moving data from one memory location to another.

5.14.2 SFR Registers (Special Function Registers)


SFR registers can be seen as a sort of control panel for managing
and monitoring the microcontroller.

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.

Generally microcontrollers support current upto 500 MA but some motors


require 600 MA. In order to achive this we need current amplification.

ULN2003 circuit diagram:

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.

A power supply of 5V is required for this circuit.

PIN DIGRAM OF INVERTER (FIG7.1)

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)

8.2 Advantages of relays:


 Relays can switch AC and DC, transistors can only switch DC.
 Relays can switch high voltages, transistors cannot.
 Relays are a better choice for switching large currents (> 5A).
 Relays can switch many contacts at once.
8.3 Disadvantages of relays:
 Relays are bulkier than transistors for switching small currents.
 Relays cannot switch rapidly (except reed relays), transistors can switch many times
per second.
 Relays use more power due to the current flowing through their coil.
 Relays require more current than many chips can provide, so a low power transistor
may be needed to switch the current for the relay's coil.

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.

CIRCUIT DIAGRAM OF POWER SUPPLY(FIG9.1)

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.33 FILTERING UNIT-:


Filter circuit which is usually a capacitor acts as a surge arrester always
follows the rectifier unit. This capacitor is also called as a decoupling capacitor
or a bypass capacitor, is used not only to short the ripple with frequency to
ground but also leave the frequency of the DC to appear at the outpu

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

variations in the load or due to fluctuations in the AC line voltage. With a


regulator connected to DC output, the voltage can be maintained within a close
tolerant region of the desired output. IC 7805 and 7812 regulators are used in
this project for providing a DC voltage of +5V and +12V respectively.

35
9.4 TECHNICAL DETAILS:-

 Transformer : 230/12 volts step down transformer, 1 ampere


 Diodes : IN 4007
 Voltage regulators : 78L Series
 7812 : The 7812 supplies 12 volts at 2 amp maximum with an input of
13- 25 volts
 7805: The 7805 supplies 5 volts at 1 amp maximum with an input of
7-25 volts
 Electrolytic Capacitors: 100pF, 330pF and 100µF, power rating of
25V.

9.5ADVANTAGES:-

 Gives a well regulated +12V and +5V output voltages


 Built in overheating protection shuts down output when regulator IC
gets too hot.
 Very stable output voltages, reliable operation
 The circuit has overload and thermal protection.

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.

We successfully designed and implemented “TELEPHONE BASED


CONTROL OF ELECTRICAL DEVICE” prototype using telephone. This service can be
further expanded to household and industrial services on slight modifications.

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

Anda mungkin juga menyukai