You are on page 1of 39

Telephone Controlled Switch

INTRODUCTION
Long distance computer communication has become a challenge of the

present day technology. Recently these computer communication networks are also

termed as information networks. Presently there are many information services for

information exchange like Teletex, Electronics mail, Video teleconferencing, Facsimile

transmission (FAX), which are quit efficient but expensive too.

But there could be a situation where the terminal from which we want to

down load or upload few lines or files or say information, may be “OFF” from the

mains. Thus all the technologies are failed. And this is, where our project “Telephone

Controlled Switch” comes into picture.

To establish an interactive link with such a terminal ( which may be

placed anywhere in the world ), we have to put the mains “ON” and then communicates

with it using Modems on a telephone network. To materialize such a system we would

require some circuitry which would receive commands on telephone line and can switch

mains load “ON” or “OFF” ( i.e. the “Telephone Controlled Switch”).

The two major parts of the system are, the hardware configuration and

software design. In the subsequent section we will deal with each block as well as the

required software in detail.

Our project is to eliminate the problem by using such a circuitry, which

can switch the remote terminal ON/OFF without anybody being present at the remote

location. This aim is achieved by using TCS (Telephone Controlled Switch).

S.S.G.M.C.E., Shegaon. 1
Telephone Controlled Switch

The TCS (Telephone Controlled Switch) designed here is capable of

controlling up to eight main powered loads with the aid of commands received via

telephone. Any tone-dialing (DTMF) telephone set or hand-held tone dialer may be

used to send commands to the switching unit and remotely control a wide range of

mains appliances in and around home, factories, industries etc. This system is designed

to have a personal access code and with system feedback facility.

S.S.G.M.C.E., Shegaon. 2
Telephone Controlled Switch

SYSTEM BLOCK DIAGRAM AND OPERATION

S.S.G.M.C.E., Shegaon. 3
Telephone Controlled Switch

OPERATION:

The circuit is connected to the telephone network just like any normal

telephone set. On being called, the circuit waits for predetermined number of ring

signals and then answers the call (electrically it lifts the receiver). Next it waits for

preprogrammed system access code, which the caller must transmit with the DTMF

keypad on his telephone.

The unit is capable of switching up to light loads ON and OFF. By

virtue of relays, high voltage and currents may be switched, so that loads may include

mains powered ones. Reception of correct system access code is acknowledged with a

short tone, which the caller can here.

UNITS OF TCS :

Ring detector Unit:

The ring detector Unit consists of a diode bridge, voltage controllers, an

opto-coupler, Voltage and some other components. The main function of this unit is to

detect a ringing signal and rectifies it. This rectified signal interrupts controller.

Switching Unit: -

The switching unit consists of a double pole double throw relay the .

This unit switches the in coming Telephone line to the DTMF decoder after call is

detected.

S.S.G.M.C.E., Shegaon. 4
Telephone Controlled Switch

DTMF decoder Unit : -

This unit consists of a DTMF decoder IC 8870. Which receives signals

from the tone pair and generates a 4-bit code recording to the received input. These 4-

bit code are given to the µ controller unit.

Micro controller Unit: -

This unit is the heart of all the circuitry. The unit controls all the

operation performed by the ICS. This unit is composed of 89CSI µ controller.

Assurance tone generator Unit :-

For the feedback purpose to confirm about device status to person at

remote location, musical IC UM 66 is used as assurance tone generator.

Driver Unit :-

This unit consists of driver transistor and current limiting resistor. These

transistors switches ON & OFF & controls the corresponding relays ON & OFF. This

unit receives control signals from the part 2 of µ controller.

Relay Unit: -

This unit consists of 7 relays ( single pole double through ) (12 v/2

Sov/5A). These relays are driver ON or OFF by driver unit & thus it switches the mains

line ON or OFF & thus the load. The relay having different rating can be used

recording to the desired application.

Power supply Unit :-

The power supply of the telephone controlled switch is conventional &

based on fixed voltage regulators. The 12 V & 5V supply Voltages used for the relay

S.S.G.M.C.E., Shegaon. 5
Telephone Controlled Switch

section & digital sections respectively are derived from a single mains transformer with

a secondary voltage of ISV.

WORKING :

The incoming call is detected by the ring detector unit, during this period

the relay in switching unit is OFF. When the call is detected, the ring detector unit gives

the U controller unit a logic low pulse. As per the time delay specified in the U

controller programming, micro controller waits for about 15-20 seconds. During this

period if anyone pick-up the hand set of telephone set, U controller stops working and

telephone set can be used in usual way. If no one pick up hand set then U controller

unit gives the logic high pulse to the switching unit, thus the relay in the switching unit

is made ON & thus the incoming telephone line is connected to the DTMF decoder.

The DTME recorder receives the signals from the line and converts it into equivalent 4

bit code. These codes are given to the U controller unit. The U controller unit uses

these code to perform required operation using the software from the memory unit.

When a line on the port 2 goes low the driver transistor is switched OFF and thus the

corresponding relay and the load. If the line on Port 2 is made logic high, the

corresponding driver transistor is switched ON and thus the relay and the load.

Thus the TCS can be used to switch the mains ON and OFF from a

remote location.

S.S.G.M.C.E., Shegaon. 6
Telephone Controlled Switch

Circuit Diagram of TCS

S.S.G.M.C.E., Shegaon. 7
Telephone Controlled Switch

CIRCUIT DIAGRAM EXPLANATION

The heart of the circuit diagram, given in fig 1 is formed by an 89C51

micro controller. The section sits between a telephone interface circuits and power

switching interface. An integrated DTMF decoder type M-8870 decodes the tone

dialing code receives via telephone line.

The telephone line interface consists of two parts :-

One is detect ring signal that unables the unit to answer the call at the

right moment and another to receive and transmit via the telephone line.

Initially, relay RL5 is in turn off condition, so telephone line is connected

to ringing section through relay contact RL5. Due to this, ringing signal of 120V a.c. is

rectified by diode full wave bridge rectifier circuit & d.c. is available across C4.

The ringing signal detector is relatively simple. A bridge rectifier, D 1 –

D4 connected to the telephone lines turns the ringing signal into pulsating direct voltage,

which is smoothed by C4 and limited to 15 V with the aid of Zener diode D. The direct

voltage across diode D supplies the LED in optocoupler IC. During the ringing signal,

the collector of phototransistor in optocoupler (pin 5) is at ground potential. The micro

controller IC interrogates the state of optocoupler O/P signal via. Port line p 3.3 and

micro controller counts time delay stored in software ( about 15 to 25 sec.). In that time

delay, if any one picks up the handset micro controller stops its working and telephone

set can be used as usual way. Otherwise, after the completion of time delay micro

controller turns ON relay RL5 by setting bit P3.7 .

S.S.G.M.C.E., Shegaon. 8
Telephone Controlled Switch

As soon as the relay is turn ON telephone line is connected to decoder IC

8870 and musical tone is generated by IC lim66. This musical tone heard by remote

location person indicates that micro controller is ready for ON/OFF the mains power of

any load.

DTMF 8870 IC can response only tone frequency not pulse frequency.

All command reach the unit via telephone line in the Form of DTMF codes generated

on telephone set with a tone dialing keypad. This received DTMF signals are

capacitively coupled to the decoder IC. The external components that enable the

M8870 DTMF decoder to operate reliably are limited to Four resistors, a capacitor and

a quartz crystal. The four decoder outputs Q1 – Q4 supply a bit pattern that corresponds

to the received DTMF number. This 4 bit DTMF code is applied to the micro controller

via port lines P1.0 to P1.3 and stored in register. After receiving the access code of the

device, micro controller compares this code with look up table feed in internal EE

PROM OF Micro controller IC. Accordingly, high or low signal is sent to the relay

driver circuit to make corresponding device ON or OFF.

After this, assurance tone is generated which is feedback to user, to

indicate confirmation of operation.

POWER SUPPLY

+ DC
Transformer Rectifier Filter Regulator
~ _ O/P

Block diagram of Power supply

S.S.G.M.C.E., Shegaon. 9
Telephone Controlled Switch

Design of Power Supply

Since a power supply is vital part of all electronic system. It’s discussion

is necessary. Most digital IC’s including µcontroller and DTME ICS operate on +5V

supply and relays operate on 12V supply. So we are presenting the power supply design

of required specifications. The basic block diagram is as above.

The schematic dia. of circuit is as shown. According to it, 15-0-15 step

down transformer is used to get 12 V supply. These o/p of secondary are given to

bridge rectifiers which converts sine i/p into full wave rectified o/p. The filler

capacitors at the o/p of bridge rectifiers are charged to the peak value of rectified o/p

voltage whenever the diodes are forward biased during entire cycle of i/p waveform, the

voltage across filter capacitor is pulsating de that is combination of dc and ripple

voltage from pulsating dc Voltage, a regulated de Voltage is extracted by regulator IC

7805.

Assuming drop across each diode as bridge rectifier is 0.7 V. Hence

voltage at o/p of bridge rectifier is nearly equal to 12V.

This 12 V supply is used to power the relays used.

S.S.G.M.C.E., Shegaon. 10
Telephone Controlled Switch

As shown in fig. IC 7805 is a +5 V regulator and delivers o/p current in

excess of 1A.

The i/p voltage required for this IC is 12 V.

The 12 V o/p from bridge rectifier is fed to i/p pin of 7805.

This regulator gives a regulated power supply of 5V.

The capacitor at the o/p of 7805 IC helps to improve transient response.

Thus we are getting two power supply of +5V & +12 V from given

circuit design.

LIST OF COMPONENTS :

IC’s

IC1 → 89C51

IC2 → 8870

IC3 → MCT2E

IC4 → UM66

Crystal Oscillators

X1 → 12 MHz

X2 → 3.768 MHz

Transistors

Q1, Q2, Q3, Q4 → BEL 187

Q6 → BC 547

Q5 → SL 100

S.S.G.M.C.E., Shegaon. 11
Telephone Controlled Switch

Resistors :

R2, R3, R4, R5 → 9,7 KΩ

R7 → 7.9 KΩ

R6 → 7.9 KΩ

R12 → 39 KΩ

R13 → 62 KΩ

R18 → 100 KΩ

R19 → 300 KΩ

R1 → 10 KΩ

R11 → 680 KΩ

Capacitors :

C1 → 10 µF

C2, C3 → 22 pF

C5, C6 → 0.01 µF

C7, C8 → 0.1 µF

S.S.G.M.C.E., Shegaon. 12
Telephone Controlled Switch

MICRO CONTROLLER UNIT :

Micro controller IC 89C51 is heart of our project. We select this micro

controller IC for our project for following numbers of advantages :

1) Internal 64 K bytes of electrically erasable programmable read only memory for

feeding program, so that there is no need of external EPROM.

2) Four 8 bit i/p o/p ports. Out of which we use one port to read output of DTMF

decoder and other ports is used to connect relay for operating devices through it.

3) Operating voltage of 3.5 V to 6 V d.c. which is easily available by using voltage

regulator IC.

4) Internal 128 byte RAM to store temporary storage of data. In which we can feed

program to turn on/off relays.

5) Two 16 bits timer / counter are present for timing and counting purpose.

6) 4 external and 2 internal interrupts are available.

ATMEL AT89C51 PINOUT AND DESCRIPTION

The AT89C51 is a low power, high performance CMOS 8-bit micro

controller with 4Kbytes of Flash programmable and erasable read only memory

(PEROM). This device is compatible with the industry standard 8051 instruction set and

pinout.

S.S.G.M.C.E., Shegaon. 13
Telephone Controlled Switch

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

S.S.G.M.C.E., Shegaon. 14
Telephone Controlled Switch

PIN DESCRIPTION

Vcc
Supply Voltage
Gnd
Ground
Port 0
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port

each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be

used as high-impedance inputs.

Port 0 may also be configured to be the multiplexed lowered

address/data bus during accesses to external program and data memory. In this mode P0

has internal pullups.

Port 0 also receives the code bytes during Flash programming, and

outputs the code bytes during program verification. External pull-ups are required

during program verification.

Port 1

Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The port 1

outputs buffers can sink/source four TTL inputs. When 1s are written to port 1 pins they

are pulled high by the internal pull-ups and can be used as inputs. As inputs, port 1 pins

that are externally being pulled low will source current (IIL) because of the internal

pullups.

Port 1 also receives the low-order address bytes during Flash

programming and verification.

S.S.G.M.C.E., Shegaon. 15
Telephone Controlled Switch

Port 2

Port 2 is an 8-bit bidirectional I/O port with internal pullups. The port 2

output buffers can sink / source four TTL inputs. When 1s are written to port 2 pins they

are pulled high by the internal pullups and can be used as inputs. As inputs, Port 2 pins

that are externally being pulled low will source current (IIL) because of the internal

pullups.

Port 2 emits the high-order address byte during fetches from external

program memory and during accesses to external data memory that use 16-bit addresses

(MOVX @ DPTR). In this application it uses strong internal pullups when emitting 1s.

During accesses to external data memory that use 8-bit addresses (MOVX @ RI). Port 2

emits the contents of the P2 Special Function Register.

Port 2 also receives the high order address bits and some control signals

during Flash programming and verification.

Port 3

Port 3 is an 8-bit bidirectional I/O port with internal pullups. The port 3

output buffers can sink/source four TTL inputs. When 1s are written to port 3 pins they

are pulled high by the internal pullups and can be used as inputs. As inputs, Port 3 pins

that are externally being pulled low will source current (IIL) because of the pullups.

Port 3 also receives some control signals for flash programming and

verification.

S.S.G.M.C.E., Shegaon. 16
Telephone Controlled Switch

RST

Reset input. A high on this pin for two machines cycles while the

oscillator is running resets the device.

ALE/ PROG

Address Latch Enable output pulses for latching the low byte of the

address during accesses to external memory. This pin is also the program pulse input

(PROG) during Flash programming.

In normal operation ALE is emitted at a constant rate of 1/6 the oscillator

frequency, and may be used for external timing or clocking purposes. Note, however

that one ALE pulse is skipped during each access to external Data Memory.

If desired, ALE operation can be disabled by setting bit 0 of SFR

location BEH. With the bit set, ALE is active only during a MOVX or MOVC

instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no

effect if the micro controller is in external execution mode.

PSEN

Program Store Enable is the read strobe to external program memory.

When the AT89C51 is executing code from external program memory,

PSEN is activated twice each machine.

Cycle, except that two PSEN activations are skipped during each access

to external data memory.

S.S.G.M.C.E., Shegaon. 17
Telephone Controlled Switch

EA /Vpp

External Access Enable EA must be strapped to GND in order to enable

the device to fetch code from external program memory locations starting at 0000H up

to FFFFH. Note, however, that if lock bit 1 is programmed. Ea will be internally latched

on reset.

EA should be strapped to Vcc for internal program executions.

This pin also receives the 12-volt programming enable voltage (Vpp)

during Flash programming, for parts that require 12-volt Vpp.

XTAL1

Input to the inverting oscillator amplifies and input to the internal clock

operating circuit.

XTAL2

Output from the inverting oscillator amplifier.

In micro controller programming , we are using two special function

reg. i.e. TCON & IE reg.

THE TIMER CONTROL (TCON) SPECIAL FUNCTION REGISTER

7 6 5 4 3 2 1 0
TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0

Bit Symbol Function


7 TF1 Timer 1 Overflow flag. Set when timer rolls from all 1s to 0.
Cleared when processor vectors to execute interrupt service
routine located at program address 001Bh.
6 TR1 Timer 1 run control bit. Set to 1 by program to enable timer to
control; cleared when processor vector to execute interrupt
service routine located at program address 000Bh.

S.S.G.M.C.E., Shegaon. 18
Telephone Controlled Switch

5 TF0 Timer 0 Overflow flag. Set when timer rolls from all 1s to 0.
Cleared when processor vectors to execute interrupt service
routine located at program address 000Bh.
4 TR0 Timer 0 run control bit. Set to 1 by program to enable timer to
count; cleared to 0 by program to halt timer.
Does not reset timer.
3 IE1 External interrupt 1 Edge flag. Set to 1 when a high-to-low edge
signal is received on port 3 pin 3.3 ( INT1 ).Clear when processor
vectors to interrupt service routine located at program address
0013h. Not related to timer operations.
2 IT1 External interrupt 1 signal type control bit. Set to 1 by program to
enable external interrupt 1 to be triggered by a falling edge
signal.
Set to 0 by program to enable a low-level signal on external
interrupt 1 to generate an interrupt.
1 IE0 External interrupt 0 Edge flag. Set to 1 when a high-to-low edge
signal is received on port 3 pin 3.2 ( INT0 ). Cleared when
processor vectors to interrupt service routine located at program
address 0003h. Not related to timer operations.
0 IT0 External interrupt 0 signal type control bit. Set to 1 by program to
enable external interrupt 0 to be triggered by a falling edge
signal.
Set to 0 by program to enable a low-level signal on external
interrupt 0 to generate an interrupt.

Hence TCON register becomes :

7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 1 = 01H

THE INTERRUPT ENABLE (IE) SPECIAL FUNCTION REGISTER

7 6 5 4 3 2 1 0
EA - ET2 ES ET1 EX1 ET0 EX0

Bit Symbol Function


7 EA Enable interrupts bit. Cleared to 0 by program to disable all
interrupts; set to 1 to permit individual interrupts to be enabled by
their enable bits.
6 - Not implemented.
5 ET2 Reserved for future use.
4 ES Enable serial port interrupt. Set to 1 by program to enable serial

S.S.G.M.C.E., Shegaon. 19
Telephone Controlled Switch

port interrupt; cleared to 0 to disable serial port interrupt.


3 ET1 Enable timer 1 overflow interrupt. Set to 1 by program to enable
timer 1 overflow interrupt; cleared to 0 to disable timer 1
overflow interrupt.
2 EX1 Enable external interrupt 1. Set to I by program to enable INT1
interrupt; cleared to 0 to disable INT1 interrupt.
1 ET0 Enable timer 0 overflow interrupt. Set to 1 by program to enable
timer 0 overflow interrupt: cleared to 0 to disable timer 0
overflow interrupt.
0 EX0 Enable external interrupt 0. Set to I by program to enable INT0
interrupt; cleared to 0 to disable INT0 interrupt.
Hence, IE register becomes
7 6 5 4 3 2 1 0
1 0 0 0 0 0 0 1 = 81H

DECODER IC 8870

In a day to day life, you normally come across telephone set. Previously,

in olden days, cross-bar and strowger exchange were used. But due to advancement in

electronics, we come across Electronic exchange, in this type of exchange we use

DTMF signaling. Now-a-days DTMF type telephone sets are used world wide. The

main advantages are listed as follows, for using DTMF signaling:

1) DTMF offers a high dialing speed over, conventional rotary telephone sets.

2) DTMF signaling is also used in applications requiring interactive control such as in

voice mail, e-mail, telephone banking and ATM machines.

S.S.G.M.C.E., Shegaon. 20
Telephone Controlled Switch

Generation of DTMF frequencies:

Dual-tone-multi-frequency (DTMF, also known as touch-tone) are the

audible sounds you hear when you press keys on your phone.

Touch-tone is familiar to many (telephone), it is a mature technology,

and readily available with off-the-shelf, single-chip, low-cost components. For these

reasons DTMF is often used in remote control applications that typically use telephones

In DTMF there are 16 distinct tones. Each tone is the sum of two

frequencies: one from a low and one from a high frequency group. There are four

different frequencies in each group.

Phone only uses 12 of the possible 16 tones. On the telephone keypad ,

there are only 4 rows (R1, R2, R3 and R4) and 3 columns (C1, C2 and C3). The rows

and columns select frequencies from the low and high frequency group respectively.

The exact value of the frequencies are listed in Table 3 below:

TELEPHONE KEYPAD IN DTMF DIALING

S.S.G.M.C.E., Shegaon. 21
Telephone Controlled Switch

TABLE 3: DTMF Row/Column Frequencies


LOW-FREQUENCIES
ROW # FREQUENCY (HZ)
R1: ROW 0 697
R2: ROW 1 770
R3: ROW 2 852
R4: ROW 3 941
HIGH-FREQUENCIES
COL # FREQUENCY (HZ)
C1: COL 0 1209
C2: COL 1 1336
C3: COL 2 1477
C4: COL 3 1633
C4 not used in phones

Each key is specified by its row and column locations. For example the

"2" key is row 0 (R1) and column 1 (C2). Thus using the above table, "2" has a

frequency of 770 + 1336 = 2106 Hz The "9" is row 2 (R3) and column 2 (C3) and has a

frequency of 852 + 1477 = 2329 Hz.

The following graph is a captured screen from an oscilloscope. It is a

plot of the tone frequency for the "1" key:

S.S.G.M.C.E., Shegaon. 22
Telephone Controlled Switch

You can see that the DTMF generated signal is very distinct and clear.

The horizontal axis is in samples. The frequency of the tone is about 1900 Hz - close to

the 1906 Hz predicted by Table 3 (697+1209).

Generation of DTMF Coding

OPTOCOUPLER IC MCT2E

Optocoupler basics :

An LED is a light-generating device, and a phototransistor is a light-

sensitive device. Consequently, if the two devices are mounted close together in a single

light-excluding package so that the LED light can fall on the phototransistor face, as

shown in Figure 1, and the device is then connected into the circuit of Figure 2, it will

be found that the conduction current of Q1 can be controlled via the conduction current

S.S.G.M.C.E., Shegaon. 23
Telephone Controlled Switch

of the LED, even though the two devices are physically separated. Such a package is

known as an optocoupler, since the input (the LED) and the output (the phototransistor)

devices are optically coupled.

Fig. 1

Thus, in Figure.2 when SW1, is open no current flows in the LED, so no

light falls on the face of Q1 , so Q1 is virtually open-circuit and zero voltage is

developed across output resistor R2. When SW1, is closed, current flows through the

LED via R1, and the resulting light falls on Q, face, causing the phototransistor to

conduct and generate an output voltage across R2.

S.S.G.M.C.E., Shegaon. 24
Telephone Controlled Switch

Fig. 2

Note that the simple optically-coupled circuit of Fig 2 can be used with

digital input/output signals only, but that in practice the circuit can easily be modified

for use with analogue input/output signals.

The most important point to note about the optocoupler device of Figure

1 is that a circuit connected to its input can be electrically fully isolated from the output

circuit, and that a potential difference of hundreds or thousands of volts can safely exist

between these two circuits without adversely influencing the optocoupler action. This

isolating characteristic is the main attraction of this type of optocoupler device, which is

generally known as an isolating optocoupler.

Typical isolating optocoupler applications include low-voltage to high-

voltage (or vice versa) signal coupling; interfacing of a computer output signal to

external electronic circuitry or electric motors, etc.; interfacing of ground-referenced

low-voltage circuitry to floating high-voltage circuitry driven directly from the mains

AC power lines, etc. Optocouplers can also be used to replace low-power relays and

pulse transformers in many applications.

Electrical characteristics of optocoupler :

Transfer ratios:

One of the most important parameters of an optocoupler device is its

optocoupling efficiency, and to maximize these parameters and the phototransistor

(which usually operate in the infra-red range) are always closely matched spectrally.

S.S.G.M.C.E., Shegaon. 25
Telephone Controlled Switch

The most convenient way of specifying optocoupling efficiency is to

quote the output-to-input current transfer ratio (CTR) of the device, i.e. the ratio the

output current (Ic) measured at the collector of the phototransistor, to the input current

(If) flowing into the LED. Thus. CTR = IC/IF. In practice, CTR may be expressed as a

simple figure such as 0.5, or (by multiplying this figure by 100) as a percentage figure

such as 50%.

Fig. 3

Simple isolating optocouplers with single-transistor output slaws have

typical CTR values in the range 20% to 100%; the actual CTR value depends (among

other things) on the input and output current values of the device and on the supply

voltage value of the optotransistor. Figure 3 shows three typical sets of output / input

currents obtained by different Vc values.

Other parameters :

Other important optocoupler parameters include the following.

Isolating Voltage :

This is the maximum permissible DC potential that can be allowed to

exist between the input and output circuits. Typical values vary from 500V to 4kV.

S.S.G.M.C.E., Shegaon. 26
Telephone Controlled Switch

VCE(MAX) :

This is the maximum allowable DC voltage that can be applied across

the output transistor. Typical values vary from 20V to 80 V.

IE(MAX) :

This is the maximum permissible DC current that can be allowed to flow

in the input LED. Typical values vary from 40 mA to 100 mA.

Bandwidth :

This is the typical maximum signal frequency (in kilohertz) that can be

usefully passed through the optocoupler when the device is operated in its normal mode.

Typical values vary from 20 kHz to 500 kHz, depending on the type of device

construction.

Practical optocouplers :

Optocouplers arc produced by several different manufacturers. They are

available in a limited number of basic forms, but are retailed under a vast number of

different type numbers. Rather than list all of these types individually, we will simply

look here at typical examples of these devices.

S.S.G.M.C.E., Shegaon. 27
Telephone Controlled Switch

Fig. 4

Practical optocoupler devices are available in six basic forms. Four of

these devices are isolating optocouplers, and the remaining two are the slotted

optocoupler and the reflective optocoupler. The simple isolating optocoupler (Figure 4)

uses a single phototransistor output stage and is usually housed in a six-pin package,

with the base terminal of the phototransistor externally available. In normal use the base

is left open circuit, and under this condition the optocoupler has a minimum CTR value

of 20 % and a useful bandwidth of 300 kHz. The phototransistor can however be

converted to a photodiode shorting the base (Pin 6) and emitter (Pin 4) terminals

together; under these condition the CTR values falls to above 0.2 % but the band width

rises to about 30 MHz.

RELAY :-

In our project we can use relay as electronic switch to turn ON & OFF

load.

S.S.G.M.C.E., Shegaon. 28
Telephone Controlled Switch

Just like the normal electrical fitting neutral is connected directly bulb

(or load) and phase connected through switch as shown in fig. b when switch is press ph

is provided to bulb glow.

Some process we provided N directly to device (bulb) and ph connected

to common point connect switch Nc (normally close) point so Ph is not provided to bulb

and ckt is incomplete so bulb is off but when we set bit (i.e. base of T1) of micro

controller transistor T1 conduct and current flowing through coil of Relay and coil get

energize so it produce magnetic field across it and pick common point toward NO

(normally) open position) so Ph is connected to bulb an its turn ON. Like this we can

turn ON and OFF oil devices through relay.

In our project ,two types of relays are being used. i.e. SPDT & DPDT

RELAYS A relay makes use of the electric field generated around a conductor carrying

an electric current.

In a relay thin wire is wound around a soft iron core to become a

powerful "electro-magnet". As current flows though the coil a metal 'arm' is attracted by

the magnetic field generated by the coil.

S.S.G.M.C.E., Shegaon. 29
Telephone Controlled Switch

This relay would be described as Single


A Single Pole, Double Throw - SPDT
Pole, Single Throw - SPST (see below).
12 volt relay.

Switch contacts are arranged on the 'arm' so that when the arm moves it

causes the switches to either open, or close. On some relays, as one switch opens

another closes. This type of relay is called a "double throw" type. A relay may have

two 'arms' that move at the same time. This type of relay is called a "double pole" type.

SPDT DPDT
Single Pole, Double Throw Double Pole Double Throw

Back emf

S.S.G.M.C.E., Shegaon. 30
Telephone Controlled Switch

When current to the coil is switched off the magnetic field around the

coil collapses very quickly. This can cause a phenomenon called "Back emf" where a

very high voltage 'spike' is produced of opposite polarity to the current originally

driving the coil. This 'reverse voltage' spike can damage other components used in the

interface.

To avoid this problem a 'signal' diode is connected across the coil of the

relay so that any Back emf is safely 'shorted' out and never reaches the rest of the

components.

Flow chart for program.

START

Initialize port P1 and P0


as I/P, O/P port.

Detect arrival
of ringing
signal at
printing if yes
S.S.G.M.C.E., Shegaon. then 31
Telephone Controlled Switch

Turn ON buzzer and


telephone relay so that
telephone line connected
to DTMF decodes and
wait20 sec

No

Is 20 sec.
Complete ?
Yes

Turn off Buzzer and


generate assurance tone for A
person at remote location

Detect if IN to
pin high i.e. data
is available at
O/P of DTMP
decoder

Read the no. and store no


in memory location

S.S.G.M.C.E., Shegaon. 32
Telephone Controlled Switch

Is store no is No
compare with
device 1 no
Yes

Complement position
Is store no is No
of device 1
compare with
device 2 no

D Yes

Generate assurance Complement


tone for 5 sec. position of Is store no is
device 2 compare with
C
device 3 no

END

Complement
position of
device 3

Is store no No
compare with A
device 4 no.

Yes

Complement
position of
device 4

S.S.G.M.C.E., Shegaon. 33
Telephone Controlled Switch

PROGRAM FOR TELEPHONE CONTROL SWITCH


ORG 0000H;start program execution from starting memory;
;location 0000H
JMP START; jump on program start subroutine.
THIS SUBROUTINE COMES IN PICTURE WHEN DATA IS AVAILABLE AT

DTMF DECODER O/P (i.e. WHEN INTO OCCURES )

ORG 0003H ;this is reserve interrupt memory location;


;for INTO interrupt
MOV A,P1 ;move data from port p1 to accumulator
;i.e. store first digit.
DJNZ R7, RE ;decrement r7 register by 1for detection

S.S.G.M.C.E., Shegaon. 34
Telephone Controlled Switch

;of first or second digit.


ADD A,R6 ;if this is second digit then add first digit
;with second so that complete no. si store in accumulator
;for comparison
CJNE A, # 35 H, NEXT; compare receive no. with first device no.
CPL P2,7;if comparison is equal complement device
SETB 21H;set bit 21h for assurance tone generation
NEXT : CJNE A,#36H,NEXT1; compare receive no. with second device no
CPL P2.6; if comparison is equal complement device
SETB 21H; set bit 21h for assurance tone generation.
NEXT1: CJNE A, #37H, NEXT2;compare receive no. with third device no.
CPL P2.6;if comparison is equal complement device
SETB 21H; set bit 21h for assurance tone generation.
NEXT2: CJNE A, #38H,RE;compare receive no. with fourth device no.
CPL P2.4;if comparison is equal complement device
SETB 21H; set bit 21h for assurance tone generation.
RE: SWAP A
MOV R6, A; store first no. in R6 register.
RETI ; return from interrupt
START: MOV P1, #FFH ; initialize port p1 and p3
MOV P2, #0FH
MOV R7, #02H
MOV R2, #20H
CLR 21H
LOOP: JNB P3.3,SOUND ; detect if ringing signal is detected
; at pin p3.3 it yes then jump on sound
JMP LOOP ;if no then jump on loop so that program
;continuously detect ringing signal
THIS SUBROUTINE TURN ON BUZZER AFTER DETECTING RINGING SIGNAL
AND TURN ON TELEPHONE RELAY.

S.S.G.M.C.E., Shegaon. 35
Telephone Controlled Switch

SOUND : SETB P3.6 ;Turn on buzzer


CALL DELAY2;Call delay
CLR P3.6;After completing delay turn off buzzer
SETB P3.7;generate assurance tone
CALL DELAY;call delay
CLR P0.7;turn of assurance tone
MOV TCON,#01H;set INTO as low to high trigger pulse
MOV IE,#81H;enable INTO by moving data 81H in interrupt
;enable register
WAIT: JB 21H, MUSIC;generate assurance tone if relay is operate
JMP WAIT; other wise wait for relay operate.
THIS SUBROUTINE GENERATE ASSURANCE TONE BY TURING ON MUSICAL
IC
MUSIC: SETB P0.7;turn on musical IC
CALL DELAY;call delay subroutine
CLR p0.7 ;turn off musical IC
JMP WAIT ;jump on wait
THIS IS DELAY SUROUTINE
DELAY: MOV R0,#FFH ;mov R0 register with data FFH
S1 : MOV R1,#FFH;mov R1 register with data FFH
S: DJNZ R1,S ;decrement and jump if R1 is not zero
DJNZ R0,S1 ;decrement and jump if R0 is not zero
RET ;return from subroutine

S.S.G.M.C.E., Shegaon. 36
Telephone Controlled Switch

Applications

1) IN LONG DISTANCE COMPUTER COMMUNICATION :

In such system the information from the remote terminal can be

accessed, using modem and Telephone line. There could be a situation where the

terminal from which we want to down load or upload information may be off from the

mains. In such situations dater transfer cannot be possible. This situation can be

avoided by replacing local switch by TCS. When terminal is off from mains, this mains

can be switched ON using TCS and thus data can be transmitted to modems. A modem

translates information produced by computer into impulses that can be send over regular

telephone line. At the other end of line, another modem receives these impulses and

S.S.G.M.C.E., Shegaon. 37
Telephone Controlled Switch

translates them back into signal that can be understood by computer. Thus TCS can be

useful in dong distance computer.

2) IN INDUSTRIES OR PLANTS :

Where the mains switching is required in extreme conditions such as

high conditions (temperatures), under pressure, gaseous condition or extremely cool

conditions, where human interpretation is not possible.

3) IN SATELLITE COMMUNICATION :

When the satellite is set up initially the TCS can be used to switch its

various functions. On such as amplifiers, Transponders etc and get acknowledge even

in difficulty.

4) The most practical example of this system is “Horoscope on telephone”. In this the

record of particular ‘Rashi’ is switched ON by dialing particular number after the

telephone number.

5) In Fax machine, the Fax machine is required to keep On constant to receive messages

at any time TCS system can be used to switch the Fax machine whenever required and

not at all the time. Thus considerably saving power.

6) Similarly in Multi Access Rural Radio System (used in rural area for telephone

communication). Where the no. of calls are quite low and power requirement is high

and can be switched ON and OFF using TCS.

LIMITATIONS :

1) The main limitation of the circuit is that there is no local control over switching.

S.S.G.M.C.E., Shegaon. 38
Telephone Controlled Switch

2) The reliability of the circuit is limited by the link via the exchange i.e. the

telephone line should be available on being called.

3) Although small, but continue requirement of power to the circuitry.

BIBLIOGRAPHY

BOOKS

1) Micro controller : The 8051 µcontroller by Kenneth J. Ayala.

2) Voltage regulator manual: National semiconductors.

3) Opto Electronics Circuit Manual by R.M. Marstan, page no. 109 to 115.

4) Elektor Magazine, by Karel Walraven, vol. 2001/207, June 2001.

WEB SITES

www.Atmel.com

www.Teltone.com.

S.S.G.M.C.E., Shegaon. 39

You might also like