0% found this document useful (0 votes)
137 views

Mini Project Report On: Home Automation

Uploaded by

Teja Raghu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views

Mini Project Report On: Home Automation

Uploaded by

Teja Raghu
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 73

Mini project

Report On
HOME
AUTOMATION
Acknowledgement:

It is our privilege to express our sincerest regards to our project


coordinator, Mr.Ravindranath Assistant professor,M.TECH, for their valuable inputs,
able guidance, encouragement, whole-hearted cooperation and constructive criticism
throughout the duration of our project.

We deeply express our sincere thanks to our Head of Department Mr.


H.Srinivas for encouraging and allowing us to present the project on the topic “HOME
AUTOMATION “at our department premises for the partial fulfillment of the
requirements leading to the award of B-Tech degree.

We take this opportunity to thank all our lecturers who have


directly or indirectly helped our project. We pay our respects and love to our parents
and all other family members and friends for their love and encouragement throughout
our career. Last but not the least we express our thanks to our friends for their
cooperation and support.
Contents: Page no

 Abstract

 List of Tables
 List of Figures

Chapter 1 Introduction
1.1 Introduction to embedded systems
1.2 Classification of embedded systems
1.3 Characteristics
1.4 Features
1.5 Applications

Chapter: 2 Block diagram of DTMF-8870


2.1 General description
2.2 functional description
2.3 Design consideration

Chapter 3 Power supply


3.1 Circuit diagram
3.2 Control circuit
3.3 Transformer

Chapter4 Components description


4.1 Rectifiers
4.2 Voltage regulator
4.3 Crystal oscillator

Chapter 5 Triac and SCR


5.1 Structures and symbols
5.2 Operation of scr
5.3 Opto-isolator
5.4 ULN2003

Chapter 6 Circuit description


6.1 Ring detection section
6.2Decoding section
6.3Output section

Chapter 7
 KEIL Software
Chapter 8
 Source coding
Chapter 9
 Future aspects

Conclusion
Bibliography
Appendix: A: Data sheet (AT89C2051)

ABSTRACT
Traditionally electrical appliances in a home are controlled via switches that regulate
the electricity to these devices. As the world gets more and more technologically advanced, we
find new technology coming in deeper and deeper into our personal lives even at home. Home
automation is becoming more and more popular around the world and is becoming a common
practice. The process of home automation works by making everything in the house
automatically controlled using technology to control and do the jobs that we would normally
do manually. Home automation takes care of a lot of different activities in the house.

This project we propose a unique System for Home automation utilizing Dual Tone
Multi Frequency (DTMF) that is paired with a wireless module to provide seamless wireless
control over many devices in a house. The block diagram is a shown below. This  user console
has many keys , each corresponding to the device that needs to be activated. The encoder
encodes the user choice and sends via a FM transmitter. The FM receiver receives the
modulated signal and demodulates it and the user choice is determined by the DTMF decoder.
Based upon this the required appliance is triggered.
Chapter 1 Introduction

INTRODUCTION

The aim of the proposed system is to develop a cost effective solution


that will provide controlling of home appliances remotely and enable home security
against intrusion in the absence of homeowner. The system provides availability due to
development of a low cost system. The home appliances control system with an
affordable cost was thought to be built that should be mobile providing remote access
to the appliances and allowing home security. Though devices connected as home and
office appliances consume electrical power. These devices should be controlled as well
as turn on/off if required. Most of the times it was done manually. Now it is a necessity
to control devices more effectively and efficiently at any time from anywhere.

In this system, we are going to develop a cellular phone based


home/office appliance. This system is designed for controlling arbitrary devices, it
includes a cell phone (not included with the system kit, end user has to connect his/her
cell phone to the system) which is connect to the system via head set. To active the
cellular phone unit on the system a call is to be made and as the call is answered, in
response the user would enter a two/three digit password to access the system to
control devices. As the caller press the specific password, it results in turning ON or
OFF specific device. The device switching is achieved by Relays. Security preserved
because these dedicated passwords owned and known by selected persons only. For
instance, our system contains an alarm unit giving the user a remote on/off mechanism,
which is capable of informing up to five different numbers over telephony network
about the nature of the event.

The underlying principle mainly relies up on the ability of DTMF (Double


Tune Multi Frequency) ICs to generate DTMF corresponding to a number or code in
the number pad and to detect the same number or code from its corresponding DTMF.
In detail, a DTMF generator generates two frequencies corresponding to a number or
code in the number pad which will be transmitted through the communication
networks, constituting the transmitter section which is simply equivalent to a mobile

1
set. In the receiver part, the DTMF detector IC, for example IC MT 8870 detects the
number or code represented by DTMF back, through the inspection of the two
transmitted frequencies. The DTMF frequencies representing the number/ codes are
shown below.

Introduction to Embedded System


what is a system?

A system is something that maintains its existence and functions as a whole


through the interaction of its parts. E.G. body, mankind, access control, etc

A system is a part of the world that a person or group of persons during some
time interval and for some purpose choose to regard as a whole, consisting of interrelated
components, each component characterized by properties that are selected as being
relevant to the purpose.

Fig . System Constitutes

Embedded System:

2
We can define an embedded system as “a computing device, built in to a
device that is not a computer, and meant for doing specific computing tasks”.

An embedded system is a special-purpose computer system usually built into a


environment connected to systems through sensors, actuators and other i/o interfaces.

EA should be strapped to VCC for internal program executions. This pin also
receives the 12-volt programming enable voltage (VPP) during Flash programming when
12-volt programming is selected

The Essence:

An embedded system is a MICROCONTROLLER based, software driven,


reliable, real-time control system, autonomous, or human or network interactive,
operating on diverse physical variables and in diverse environments and sold into a
competitive and cost conscious market.

3
Fig . Embedded System

Classification of Embedded systems:

RTS classification:
RTS is one which has to respond to events within a specified deadline

A right answer after the dead line is a wrong answer

4
 Hard Real Time Systems
 Soft Real Time System
"Hard" real-time systems have very narrow response time
Example: Nuclear power system, Cardiac pacemaker.

"Soft" real-time systems have reduced constrains on "lateness" but still must operate
very quickly and repeatable.
Example: Railway reservation system – takes a few extra seconds the data remains
valid.

CHARACTERISTICS:
 Designs are cost-sensitive
 Have real-time performance constraints
 Used with Real-Time Operating Systems (RTOS)
 Software failure can be life-threatening
 May have constraints on power consumption
 Operate over a wide-range of environmental conditions
 Fewer system resources then a desktop system
 All code might be stored in ROM
 Require specialized design tools
 May have on-chip debugging resources

FEATURES:
• Response
• Security
• Availability
• Cost
• Size/Weight
• Survivability
• Maintainability
• Throughput
• Testability
• Low power
• Reliability

5
Safety If A System Is Developed With A Microprocessor, The Designer Has To
Go For External Memory Such As Ram, Rom Or EPROM And Peripherals And Hence
The Size Of The Pcb Will Be Large Enough To Hold All The Required Peripherals. But
The Micro controller Has Got All These Peripheral Facilities On A Single Chip So
Development Of A Similar System With A Micro controller Reduces Pcb Size And Cost
Of The Design.

One Of The Major Difference Between A Micro controller And A


Microprocessor Is That A Controller Often Deals With Bits, Not Bytes As In The Real
World Application, For Example Switch Contacts Can Only Be Open Or Close,
Indicators Should Be Lit Or Dark And Motors Can Be Either Turned On Or Off And So
Forth.

One Of The Major Difference Between A Micro controller And A


Microprocessor Is That A Controller Often Deals With Bits, Not Bytes As In The Real
World Application, For Example Switch Contacts Can Only Be Open Or Close,
Indicators Should Be Lit Or Dark And Motors Can Be Either Turned On Or Off And
So Forth.

Applications of Embedded Systems:

Aerospace and defense electronics: fire control, radar, robotics/sensors, sonar.


Automotive: Auto body electronics, auto power train, auto safety, car information systems.
Broadcast & entertainment: Analog and digital sound products, cameras, DVDs, Set top
boxes, virtual reality systems and graphic products.
Consumer/internet appliances: Business handheld computers, business network
computers/terminals, electronic books, internet smart handheld devices, PDAs.
Data communications: Analog modems, ATM switches, cable modems, XDSL modems,
Ethernet switches, concentrators.
Digital imaging: Copiers, digital still cameras, Fax machines, printers, scanners.

6
Industrial measurement and control: Hydro electric utility research & management traffic
management systems, train marine vessel management systems.
Medical electronics: Diagnostic devices, real time medical imaging systems, surgical devices,
critical care systems.
Server I/O: Embedded servers, enterprise PC servers, PCI LAN/NIC controllers, RAID
devices, SCSI devices.
Telecommunications: ATM communication products, base stations, networking switches,
SONET/SDH cross connect, multiplexer.
Mobile data infrastructures: Mobile data terminals, pagers, VSATs, Wireless LANs,
Wireless phones.

The Micro controller Has Two 16 Bit Timers / Counters Built Within It, Which Makes
It More Suitable To This Application Since We Need To Produces One Accurate Timer
Delays. It Is Even More Advantageous That The Timers Also Act As Interrupt.

7
Chapter 2 Block diagram of DTMF 8870

BLOCK DIAGRAM

DTMF-8870

The following session gives the total description about the DTMF M8870 – 01 and it’s
interfacing to the controller.

General description:

DTMF stands for Dual Tone Multiple Frequency. . It is numbers 0-9 and the *
and the # you press on your push-button telephone. This allows us to use mobile phones
and house push-button phones to act as “remote controls” The idea of turning your air-
conditioner on at home, whilst on the way home from work is only possible with DTMF
phone.

8
Every push-button phone and mobile telephone in the world has a DTMF
keypad. These telephone DTMF keypads are also fitted to many radios which allow
these radios to dial each other up, or into the phone network as they have a DTMF
keypad. An interesting fact for scanner users is that a DTMF decoder is available.

One Frequency from each the ‘high’ and ‘low’ group is assigned to each of the
12 push buttons on your telephone. The four buttons “A, B, C & D” are not used in
telephones, and are found mostly in radios and other devices with DTMF keypads (fig
1).

DTMF keypad

The DTMF Matrix, ignoring the last column (A, B, C, and D) bits is a
telephone keypad. Every time you press a button on any kind of phone these ‘dual
tones’ (1=697Hz+1209Hz) are both heard by you and sent down the line. A DTMF
decoder, of sorts, is in fact part of every telephones circuitry-it needs it, like a decoder,
to recognize the tones.

The M-8870 is a full DTMF Receiver that integrates both band split filter
and decoder functions into a single 18-pin DIP or SOIC package. Manufactured using
CMOS process technology, the M-8870 offers low power consumption (35 mW max)
and precise data handling. Its filter section uses switched capacitor technology for both
the high and low group filters and for dial tone rejection. Its decoder uses digital
counting techniques to detect and decode all 16 DTMF tone The M-8870 is a full
DTMF Receiver that integrates both band split filter and decoder functions into a single
18-pin DIP or SOIC package. Manufactured using CMOS process technology, the M-
8870 offers low power consumption (35 mW max) and precise data handling. Its filter
section uses switched capacitor technology for both the high and low group filters and
9
for dial tone rejection. Its decoder uses digital counting techniques to detect and decode
all 16 DTMF tone pairs into a 4-bit code. Minimal external components required
include a low-cost 3.579545 MHz color burst crystal, a timing resistor, and a timing
capacitor.

Functional description:

M-8870 operating functions include a band split filter that separates the
high and low tones of the 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.

Filter:
The low and high group tones are separated by applying the dual-tone
signal to the inputs of two 6th order switched capacitor band pass filters with
bandwidths that correspond to the 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
smoothes 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 comparator outputs provide full-rail logic swings at the frequencies of
the incoming tones.

Decoder:

The M-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. A complex averaging algorithm is used to protect against tone simulation
by extraneous signals (such as voice) while tolerating small frequency variations. The
algorithm ensures an optimum combination of immunity to talk off and tolerance to
interfering signals (third tones) and noise. 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.

10
Steering Circuit:

Before a decoded tone pair is registered, the receiver checks for valid signal
duration (referred to as character-recognition-condition). This check is performed by an
external RC time constant driven by ESt. A logic high on ESt causes VC to rise as the
capacitor discharges. Provided that signal condition is maintained (ESt remains high)
for the validation period (tGTF), VC reaches the threshold (VTSt) of the steering logic
to register the tone pair, thus latching its corresponding 4-bit code into the output latch
(Q1, Q2, Q3, and Q4). At this point, the GT output is activated and drives VC to VDD.
GT continues to drive high as long as ESt remains high. Finally, after 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 input (OE) to logic state
control high

VDD

FIG : Basic steering circuit.

11
The steering circuit works in reverse to validate the inter digit pause between signals.
Thus, as well as rejecting signals too short to be considered valid, the receiver will tolerate signal
interruptions (dropouts) too short to be considered a valid pause. This capability, together with
the ability to select the steering time constants externally, allows the designer to tailor
performance to meet a wide variety of system requirements.

4. Design considerations:

The design of a DTMF receiving system can generally be broken down


into three functional blocks. The first consideration is the interface to the transmission medium.
This may be as simple as a few passive components to adequately configure the MT8870’s input
stage or as complex as some form of demodulation, multiplexing or analog switching system.
The second functional block is the DTMF receiver itself. This is where the receiving system’s
parameters can be optimized for the specific signal conditions delivered from the "front end"
interface. The third, and perhaps most widely varying function, is the output control logic. This
may be as simple as a 4 to 16 line decoder or a microcontroller, controlling a specific function
for each DTMF code, or as complex as a full blown computer handling system protocols and
adaptively varying the tone receiver’s parameters to adjust for changing signal conditions.
Several currently applied and conceptually designed applications are described subsequently but
first let’s consider the design of a ty8051al input stage

12
FIG : Application diagram

The input to the DTMF is given to the pin 2 (IN-) from any telephone line as shown in the
application diagram figure 4. The DTMF receiver receives the dual tone coming from the
telephone line and decodes the signal. The decoded 4 bit word is given to the outputs Q1, Q2,
Q3, an interrupt process when there is logic high on the StD pin. The figure 5 shows output
logics and Q4 as shown in the fig 4. The StD pin goes high indicating that the value on the out
put pins is updated. The control logic checks continuously for the high pulse on StD pin or
develops for the dual frequencies for the corresponding keys.

13
FIG : M8870 output truth table.

The proven reliability of DTMF signaling has created a vast spectrum of possible
applications. The mother board is provided to develop all these possible applications with DTMF
receiver.

14
FIG : Home DTMF remote control system

. One of these applications is the House hold DTMF remote control system. The
block diagram for this system is as shown in the figure 6. Remote ON/OFF control may
be given to electric appliances such as a slow cooker, exterior lighting and garage heater

15
Chapter 3 Power supply

Power Supply

CIRCUIT DIAGRAM:1

D1 LM7805

1 4 - + 2 1 3
1 2 IN U3 OUT
2 DB106 R1
GND
9V I/P 330E
C1
3

470uF/25V C2 C3

100uF/16V
0.1uF D2
LED

16
Design

The power supplies are designed to convert high voltage AC mains


electricity to a suitable low voltage supply for electronic circuits and other devices. A
power supply can by broken down into a series of blocks, each of which performs a
particular function. A d.c power supply which maintains the output voltage constant
irrespective of a.c mains fluctuations or load variations is known as “Regulated Power
Supply”

Control Circuit:

17
WORKING:

The working of the circuit is quite simple and easily understandable by jus
observing the circuit. The working can be mainly discussed as three parts which are the
supply part, micro-controller part and the isolation part respectively. All these parts
together describe the working of the design of Home automation system.

The supply part/section mainly deals with the supply given to the circuit. Actually
it can be done in two ways i.e., either by giving 230V AC or by using a battery (9V) as
source of supply. Now in this design we are using a 9V battery as source of supply. This
9v is regulated to 5V using a voltage regulator as only 5V is required to drive the
microcontroller. This 5V is also given to the receiver. Actual working of this system
involves an RC5 remote which is used as Transmitter and TSOP1738 as IR receiver. And
here we are designed the system for only 6 applications. So only 6 buttons are used in the
RC5 remote. Each button is given certain address depending on the number of duty
cycles it has for 1ns. When a button is pressed, say 1, the receiver receives the signal
from the RC5 remote and the next operation is done by the micro-controller part.

In micro-controller section, there are mainly 2 parts. They are AT89C2051 micro-
controller and ULN 2003 driver (Darlington transistor). The microcontroller intakes the
received signal from the IR receiver (TSOP 1738). The main use of this controller is that
it recognizes and counts the number of duty cycles the received signal has and then
makes the respective output pin high according to the calculations done by it internally.
For example, let us consider that the button 1 has 1500 duty cycles in 1nS. When this
button is pressed, the transmitter in the remote sends this signal and the receiver receives
the signal. The received signal also contains same number of duty cycles but the micro
controller confirms it with the help of the external timers it has. After confirmation, the
controller makes the first output high. Here both the transmitter and receiver are of
Infrared type. This output is connected to Darlington transistor (ULN 2003) which is used

18
to drive the application. This gives a much higher current gain and also improves the life
of the microcontroller. All the six out puts of micro controller are given as input to the
Darlington transistor/pair IC which improves the gain of those outputs and gives the
respective six outputs. These outputs are connected to the Opto-Isolator which is
discussed in the isolation part.

The Isolation part involves the isolation of the AC and DC i.e., the output from
the controller is DC and the Input to the application required is AC and to make
difference of this nature of supply, an Opto isolator (MOC 3021) is used in between
them. The MOC 3021 IC consists of a The input to the isolator is taken from the
Darlington transistor IC. The pin1 of this Isolator IC is given to the supply or is in High
state and the second pin is grounded. The output from the ULN2003 IC is connected to
the second pin of the MOC 3021 IC which is low. The IC internally consists of a LED
and a DIAC. Whenever the led glows, the DIAC gets triggered and hence fires the gate of
the TRIAC connected to the IC. A feedback resistance is used for this operation.

Let us assume that a bulb is used as application here. One terminal of this bulb is
connected to the AC supply and the other is connected to the TRIAC. When the TRIAC
gets fired the bulb glows. This is the working of the Home Automation System using IR
signal.

Transformer:
A transformer is an electrical device which is used to convert electrical
power from one electrical circuit to another without change in frequency.
Transformers convert AC electricity from one voltage to another with
little loss of power. Transformers work only with AC and this is one of the reasons why
mains electricity is AC. Step-up transformers increase in output voltage, step-down
transformers decrease in output voltage. Most power supplies use a step-down
transformer to reduce the dangerously high mains voltage to a the secondary. There is no

19
electrical connection between the two coils; instead they are linked by an alternating
magnetic field created in the soft-iron core of the transformer. The two safer low voltage.
The input coil is called the primary and the output coil is called secondary. The two lines
in the middle of the circuit symbol represent the core. Transformers waste very little
power so the power out is (almost) equal to the power in. Note that as voltage is stepped
down current is stepped up. The ratio of the number of turns on each coil, called the
turn’s ratio, determines the ratio of the voltages. A step-down transformer has a large
number of turns on its primary (input) coil which is connected to the high voltage mains
supply, and a small number of turns on its secondary (output) coil to give a low output
voltage.

FIG : An Electrical Transformer

Turns ratio = Vp/ VS = Np/NS

Power Out= Power In

VS X IS=VP X IP
Vp = primary (input) voltage
Np = number of turns on primary coil
Ip  = primary (input) current    

20
COMPONENTS USED:

1. Rectifier(IN4007 Diodes)
2. Voltage Regulator
3. TSOP 1738
4. Crystal oscillator
5. Triac bt136
6. Moc 3021
7. ULN 2003.
8. 2051 Uc
9. RTC

21
Chapter 4 Components Description

COMPONENTS DESCRIPTION

1.Rectifier

Rectifier circuits are found in all dc power supplies that operate from an ac
voltage source. They convert the ac input voltage to a pulsating dc voltage. The most
basic type of rectifier circuit is the half-wave rectifier. Although half-wave rectifiers have
some applications, the full-wave rectifiers are the most commonly used type in dc power
supplies. These are two types of full-wave rectifiers:
(1) full-wave center-tapped rectifier
(2) full-wave bridge rectifier
Here in this particular design we are using a bridge rectifier which is discussed as
follows.

Full-wave Bridge Rectifier

The full –wave bridge rectifier uses four diodes, as shown in below figure. When
the input cycle is positive, diodes D1 and D2 are forward-biased and conduct current
through RL. During this time, diodes D3 and D4 are reverse-biased.

22
F

D1
D3
Vin

Vout
D2 D4 + 0

RL
-

During positive half-cycles of the input, D1 and D2 are forward-biased and conduct
current, D3 and D4 are reverse-biased.
When the input cycle is negative as shown in below figure , diodes D3 and D4 are
forward-biased and conduct current in the same direction through RL as during the
positive half-cycle. During the negative half-cycle, D1 and D2 are reverse-biased. A full-
wave rectifier output voltage appears across RL as a result of this action.

- - D3 D1

Vin

D2 Vout
+ + D4 + 0

RL
-

During negative half-cycles of the input, D3 and D4 are forward-biased and conduct
current, D1 and D2 are reverse-biased.
The above two figures explain the full-wave Bridge Rectifier.

The output graph of a full-wave rectifier is as shown below:

23
The diodes used in this rectifier are
IN4007 which is discussed below.

IN4007 Diode

These diodes are used to


convert AC into DC these are used as
half wave rectifier or full wave
rectifier. Three points must he kept in
mind while using any type of diode.

1. Maximum forward current


capacity
2. Maximum reverse voltage
capacity
3. Maximum forward voltage
capacity

24
The number and voltage capacity of some of the important diodes available in the market
are as follows:

 Diodes of number IN4001, IN4002, IN4003, IN4004, IN4005, IN4006 and


IN4007 have maximum reverse bias voltage capacity of 50V and maximum
forward current capacity of 1 Amp.
 Diode of same capacities can be used in place of one another. Besides this diode
of more capacity can be used in place of diode of low capacity but diode of low
capacity cannot be used in place of diode of high capacity. For example, in place
of IN4002; IN4001 or IN4007 can be used but IN4001 or IN4002 cannot be used
in place of IN4007.The diode BY125made by company BEL is equivalent of
diode from IN4001 to IN4003. BY 126 is equivalent to diodes IN4004 to 4006
and BY 127 is equivalent to diode IN4007.

2.Voltage Regulator

A voltage regulator is an electrical regulator designed to automatically


maintain a constant voltage level. It may use an electromechanical mechanism, or passive
or active electronic components. Depending on the design, it may be used to regulate one
or more AC or DC voltages.

With the exception of passive shunt regulators, all modern electronic voltage regulators
operate by comparing the actual output voltage to some internal fixed reference voltage.
Any difference is amplified and used to control the regulation element in such a way as to

25
reduce the voltage error. This forms a negative feedback servo control loop; increasing
the open-loop gain tends to increase regulation accuracy but reduce stability (avoidance
of oscillation, or ringing during step changes). There will also be a trade-off between
stability and the speed of the response to changes. If the output voltage is too low
(perhaps due to input voltage reducing or load current increasing), the regulation element
is commanded, up to a point, to produce a higher output voltage - by dropping less of the
input voltage (for linear series regulators and buck switching regulators), or to draw input
current for longer periods (boost-type switching regulators); if the output voltage is too
high, the regulation element will normally be commanded to produce a lower voltage.
However, many regulators have over-current protection, so entirely stop sourcing current
(or limit the current in some way) if the output current is too high, and some regulators
may also shut down if the input voltage is outside a given range (see also: crowbar
circuits).
The voltage Regulator used in this design is LM 7812.

LM78xx Regulator

The LM78XX series of three terminal regulators is available with several fixed
output voltages making them useful in a wide range of applications. One of these is local
on card regulation, eliminating the distribution problems associated with single point
regulation. The voltages available allow these regulators to be used in logic systems,
instrumentation, Hi-Fi, and other solid state electronic equipment.
Although designed primarily as fixed voltage regulators these devices can be used with
external components to obtain adjustable voltages and currents. The LM78XX series is
available in an aluminum TO-3 package which will allow over 1.0A load current if
adequate heat sinking is provided. Current limiting is included to limit the peak output
current to a safe value. Safe area protection for the output transistor is provided to limit
internal power dissipation.

26
If internal power dissipation becomes too high for the heat sinking
provided, the thermal shutdown circuit takes over preventing the IC from overheating.
Considerable effort was expanded to make the LM78XX series of regulators easy to use
and minimize the number of external components. It is not necessary to bypass the
output, although this does improve transient response. Input bypassing is needed only if
the regulator is located far from the filter capacitor of the power supply.
For output voltage other than 5V, 12V and 15V the LM117 series provides an output
voltage range from 1.2V to 57V.

Features

- Output current in excess of 1A


- Internal thermal overload protection
- No external components required
- Output transistor safe area protection
- Internal short circuit current limit
- Available in the aluminum TO-3 package

Voltage Range

LM7805C 5V
LM7812C 12V
LM7815C 15V

3. TSOP1738 - Infrared Receiver

27
Introduction

TSOP1738 is an Infrared (IR) receiver which is widely used in large number of electronic
products for receiving and demodulating infrared signals. The received demodulated
signals can be easily decoded by a microcontroller. It supports RC5, RC6 code, Sony
format (SIRCS), NEC code, Sharp code, etc.

Specifications

 Continuous data transmission possible (up to 2400 bps)


 High immunity against ambient light
 Photo detector and preamplifier in one package
 Improved shielding against electrical field disturbance
 TTL and CMOS compatibility
 Active low output
 Low power consumption
 Internal filter for PCM freq

28
The datasheet for TSOP1738 is as shown below;

Type fo Typ fo
e
TSOP1730 30 kHz TSOP1733 33KHZ
TSOP1736 36KHZ TSOP1737 36.7KHZ
TSOP1738 38KHZ TSOP1740 40KHZ
TSOP1756 56KHZ

Absolute Maximum Ratings

Tamb=25_c

PARAMETER TEST SYMBOL VALUE UNIT


CONDITIONS
Supply voltage (pin 2) Vs -0.3….6.0 V
Supply current (pin 2) Is 5 mA
Output voltage (pin 3) Vo -0.3….6.0 V
Output current (pin 3) Io 5 mA
Junction Tj 100 *C

29
temperature
Storage Tstg -25….+85 *C
temperature
range
Operating Tamb -25….+85 *C
temperature
range
Power (Tamb<=85*C) Ptot 50 mW
consumption

Basic Characteristics

Tamb=25C

PARAMETER TEST SYMBO MI TYP MA UNIT


CONDITIONS L N X
Supply Vs=5V, Ev=0; Isd 0.4 0.6 1.5 mA
current(Pin2) Vs=5V, Ev=40klx, mA
sunlight Ish 1.0
Supply Vs 4.5 5.5 V
voltage(Pin2)
Transmission Ev=0, IF=400 mA D 35 m
Distance
Output voltage Iosl=0.5mA, Vosl 250 mV
low (pin3) Ee=0.7mW/m2,
F=fo, tp/T=0.4

Irradiance(30-40 Pulse width Ee min 0.3 0.5 mW/m


KHZ) tolerance: 5 2
Tpi-
5/fo<tpo<tpi+6/fo
,
Irradiance(56KHZ Pulse width Ee min 0.4 0.6 mW/m

30
) tolerance: 2
Tpi-
5/fo<tpo<tpi+6/fo
,
Irradiance tpi- Ee max 30 W/m2
5/fo<tpo<tpi+6/fo
Directivity Angle of half Psi ½ +- deg
transmission 45
distance

4. Crystal Oscillators

One of the most important features of an oscillator is its Frequency


Stability, or in other words its ability to provide a constant frequency output under
varying conditions. Some of the factors that affect the frequency stability of an oscillator
include: temperature, variations in the load and changes in the power supply. Frequency
stability of the output signal can be improved by the proper selection of the components
used for the resonant feedback circuit including the amplifier but there is a limit to the
stability that can be obtained from normal LC and RC tank circuits. For very high
stability a quartz crystal is generally used as the frequency determining device to
produce other types of oscillator circuit known generally as Crystal Oscillators.

When a voltage source is applied to a small thin piece of crystal


quartz, it begins to change shape producing a characteristic known as the Piezo-electric
Effect. This piezo-electric effect is the property of a crystal by which an electrical charge
produces a mechanical force by changing the shape of the crystal and vice versa, a
mechanical force applied to the crystal produces an electrical charge. Then, piezo-electric
devices can be classed as transducers as they convert energy of one kind into energy of
another. This piezo-electric effect produces mechanical vibrations or oscillations which
are used to replace the LC tank circuit and can be seen in many different types of crystal

31
substances with the most important of these for electronic circuits being the quartz
minerals because of their greater mechanical strength.

The quartz crystal used in Crystal Oscillators is a very small, thin


piece or wafer of cut quartz with the two parallel surfaces metalized to make the
electrical connections. The physical size and thickness of a piece of quartz crystal is
tightly controlled since it affects the final frequency of oscillations and is called the
crystals "characteristic frequency". Then once cut and shaped the crystal can not be used
at any other frequency. The crystals characteristic or resonant frequency is inversely
proportional to its physical thickness between the two metalized surfaces. A mechanically
vibrating crystal can be represented by an equivalent electrical circuit consisting of low
Resistance, large Inductance and small Capacitance as shown below.

Quartz Crystal

A quartz crystal has a resonant frequency similar to that of a electrically


tuned tank circuit but with a much higher Q factor due to its low resistance, with typical
frequencies ranging from 4kHz to 10MHz. The cut of the crystal also determines how it
will behave as some crystals will vibrate at more than one frequency. Also, if the crystal
is not of a parallel or uniform thickness it have two or more resonant frequencies having
both a fundamental frequency and harmonics such as second or third harmonics.
However, usually the fundamental frequency is more stronger or pronounced than the
others and this is the one used. The equivalent circuit above has three reactive

32
components and there are two resonant frequencies, the lowest is a series type frequency
and the highest a parallel type resonant frequency.

We have seen in the previous tutorials, that an amplifier circuit will


oscillate if it has a loop gain greater or equal to 1 and it has positive feedback. In a
Crystal Oscillator circuit the oscillator will oscillate at the crystals fundamental series
resonant frequency as the crystal always wants to oscillate when a voltage source is
applied to it. However, it is also possible to "tune" a crystal oscillator to any even
harmonic of the fundamental frequency, (2nd, 4th, 8th etc.) and these are known
generally as Harmonic Oscillators while Overtone Oscillators vibrate at odd multiples
of the fundamental frequency, 3rd, 5th, 11th etc). Generally, crystal oscillators that
operate at overtone frequencies do so using their series resonant frequencies.

Chapter 5 Triac and SCR

5. TRIAC

INTRODUCTION

Approvals in their outer aspect, SCR and TRIAC are resembled like many water
drops. To distinguish them, therefore, is impossible, if it is not rerun to the exact
acknowledgment of the acronym and to the ritrovamento of this on a common prontuario.
But the acronyms, today attributed to these semiconductors, are many, too many for
being collections all in a handbook modernized to the capacity of the amateurs. Which,
often, during their activity, are found in embarrassment, because, ignoring the
characteristic electrical workers, they cannot lead those tests that serve to identify the
components and to know their state of efficiency. Here because the idea is risen us to
conceive a simple circuit, of immediate realization, absolutely economic, to entrust our
hobbyist readers, with which they can distinguish, with a sure rapidity, a SCR from a
TRIAC, estimating some, at the same time, the behavior electrical worker, is worth to say

33
the validity works them. But since the principle of operation of the device is based on the
use, from part of the SCR, of average cycle of the alternated voltage, while the TRIAC
works with the entire cycle of the same voltage, alla presentation of the apparatus must
make to precede those theoretical slight knowledge that regulates the way to behave itself
of these particular diode , that by now all know and whose employment is often from we
prescribed for the construction of the many plans that, month for month, come publishes
to you on this periodical.

SCR: STRUCTURES and SYMBOLS

Known also under the name of controlled diode, the SCR inner is composed
from three P-N splices, that they form a semiconductor of P-N-P-N type, similar to two
normal diode  connects to you in series. They finishes relative to the anode makes head
more external the P semiconductor, while the cathode remains connected with the N
semiconductor situated in the opposite part. A1 according to field of P material is
connected the representative electrode of the gate ones, said also "door". The symbol
electrical worker, that it characterizes diode  SCR, is that one represented in figure 1,
while the outer aspect more common than this semiconductor it can be identified with
one of the graphical expressions brought back in figure 2.

DIODE 

34
Fig. 1 - Symbol electrical worker of diode SCR, famous also with the denomination of
controlled diode. With the G letter it comes indicated the electrode of gate, or door,
through which it comes applied to the component the voltage impulse that of it provokes
the conduction (primes). With the letter To the electrode of anode is marked and with the
K that one of cathode.
               
Fig. 2 - These are the two types of diode SCR (silicon-controlled-rectifier) more
commonly findable in commerce and mainly it uses you from the amateurs.

Operation of the SCR

Applying to the anode of the SCR a negative voltage regarding the


cathode, some conduction is not obtained electrical worker, therefore as it happens in a
common semiconductor diode . The SCR can therefore be assimilated to an open switch.
Inverting the polarity of the voltage, the SCR contrarily remains still blocked to how
much happens in a normal diode , in which conduction would be had electrical worker;
but the block remains until does not arrive on gate a positive impulse regarding the
cathode, of such amplitude to put the diode  controlled in complete conduction. And this
commutation happens in a extremely short time, of the order of 0,5 us. As it can
immediately be deduced, this time is the much short one than that one demanded from the
analogous electromechanical systems. Once primed, the SCR remains conductor without
need of some voltage of commando on the gate. conserving this condition also when on
the gate ones they come applies new impulses to you of commando. For turning off the
SCR, that is in order to bring back it to the state of interdiction, two exist arrange: the
voltage between anode can be reduced to zero and cathode, or the anode regarding the
cathode can be made to become negative. In this case the alternated voltage is revealed

35
much useful, because it passes for the zero when it inverts the own polarity to every semi
period. In figure 5 light bulb to filament in alternating current is introduced the example
of a according to electronic interrupting SCR in a circuit of feeding of one. We see of it
hour the behavior theoretical.

Fig. 5 - Theoretical circuit of application of a according to interrupting diode  SCR,


closed or open, of ignition of lamp LP.

In absence of it marks them on the gate ones, the SCR is behaved like a
opened switch, that is it does not lead current and lamp LP remains extinguished. But
when an impulse of voltage to every half-cycle of the alternated voltage is applied, the
switch closes itself and lamp LP is ignited. Not however in the full load of its brightness,
because the SCR is behaved like a normal diode  in series to the circuit, that it straightens
the alternated voltage. In practical, the ignition of the lamp is reduced to 50%. In figure 6
the new condition is illustrated electrical worker of the circuit of figure 5, in which I SCR
transforms in a diode  rectifier of the alternated voltage.

Fig. 6 - The diode  SCR, connected in series with a conductor covered from
alternating current, is behaved like a rectifying element, leaving via free the passage
of the sun positive semi-waves.

OPERATION OF THE TRIAC

36
In figure 7 the theoretical application of a TRIAC, analogous is brought
back to that one of the SCR of figure 5.

Fig. 7 - Example of employment of a TRIAC, as electronic switch, in a circuit of


ignition of one lamp fed in alternating current (C.A).

In absence of tension impulse that in this case, with the exception of


how much it happens in the SCR can be is positive that negative, the TRIAC does not
lead, that is is behaved as an open switch and lamp LP remains extinguished. Applying
instead one small tension, positive or negative, on the gate ones, the TRIAC becomes
conductor and is equivalent to a closed switch. But this time the semiconductor let’s to
cross from both the semi waves of the alternated tension, as it indicates the design of
figure 8.
 

Fig. 8 - Since in the TRIAC two diode  are contained connect to you in ant parallel,
all the semi waves, those positive ones and those negatives of the alternating current
cross the semiconductor.

And that because the inner structure of the TRIAC is


correspondent to that one of two diode  SCR connects to you in parallel, with the
polarity opposite. in ant parallel. but with the electrode of I prime in common.

37
We have said that the TRIAC can be primed applying a tension impulse on its gate
ones. But this auto innesca component when the value of the tension alternated
applied on the two anodes exceeds a sure limit, called tension of breakdown. Making
then to diminish the current and to increase the cargo resistance of the TRIAC, a
point is caught up in which the current it is not more in a position to maintaining in
conduction the semiconductor.
The minimal value of the current that can maintain primed the TRIAC comes
commonly indicated like current of Hold, that is maintenance current.

6. Opto-isolator

An opto-isolator integrated circuit. The "MB 111", manufactured by RFT


("Rundfunk- und Fernmelde-Technik"), contains an infrared LED and silicon photodiode
with an integrated amplifier stage.
This article is about the electronic component. For the optical component, see
optical isolator.

In electronics, an opto-isolator (or optical isolator, optical coupling device,


opt coupler, photo coupler, or photoMOS) is a device that uses a short optical
transmission path to transfer an electronic signal between elements of a circuit, typically
a transmitter and a receiver, while keeping them electrically isolated—since the electrical
signal is converted to a light beam, transferred, then converted back to an electrical
signal, there is no need for electrical connection between the source and destination
circuits. Isolation between input and output is rated at 7500 Volt peak for 1 second for a
typical component costing less than 1 US$ in small quantities.

The opto-isolator is simply a package that contains both an infrared light-


emitting diode (LED) and a photo detector such as a photosensitive silicon diode,
transistor Darlington pair, or silicon controlled rectifier (SCR). The wave-length
responses of the two devices are tailored to be as identical as possible to permit the
highest measure of coupling possible. Other circuitry—for example an output amplifier—

38
may be integrated into the package. An opto-isolator is usually thought of as a single
integrated package, but opto-isolation can also be achieved by using separate devices.

Digital opto-isolators change the state of their output when the input state
changes; analog isolators produce an analog signal which reproduces the input.

Configurations

Schematic diagram of a very simple opto-isolator with an LED and phototransistor. The
dashed line represents the isolation barrier, over which there is no electrical contact.

A common implementation is a LED and a phototransistor in a light-


tight housing to exclude ambient light and without common electrical connection,
positioned so that light from the LED will impinge on the photo detector. When an
electrical signal is applied to the input of the opto-isolator, its LED lights and illuminates
the photo detector, producing a corresponding electrical signal in the output circuit.
Unlike a transformer the opto-isolator allows DC coupling and can provide any desired
degree of electrical isolation and protection from serious overvoltage conditions in one
circuit affecting the other. A higher transmission ratio can be obtained by using a
Darlington instead of a simple phototransistor, at the cost of reduced noise immunity and
higher delay.

With a photodiode as the detector, the output current is proportional to the


intensity of incident light supplied by the emitter. The diode can be used in a photovoltaic
mode or a photoconductive mode. In photovoltaic mode, the diode acts as a current
source in parallel with a forward-biased diode. The output current and voltage are

39
dependent on the load impedance and light intensity. In photoconductive mode, the diode
is connected to a supply voltage, and the magnitude of the current conducted is directly
proportional to the intensity of light. This optocoupler type is significantly faster than
photo transistor type, but the transmission ratio is very low; it is common to integrate an
output amplifier circuit into the same package.

The optical path may be air or a dielectric waveguide. When high noise
immunity is required an optical conductive shield can be integrated into the optical path.
The transmitting and receiving elements of an optical isolator may be contained within a
single compact module, for mounting, for example, on a circuit board; in this case, the
module is often called an optoisolator or opto-isolator. The photo sensor may be a
photocell, phototransistor, or an optically triggered SCR or TRIAC. This device may in
turn operate a power relay or contactor.

Analog opt isolators often have two independent, closely matched


output phototransistors, one of which is used to linearize the response using negative
feedback.

Application

A simple circuit with an opto-isolator. When switch S1 is closed, LED


D1 lights, which trigger phototransistor Q1, which pulls the output pin low. This circuit,
thus, acts as a NOT gate.

40
Among other applications, opto-isolators can help cut down on ground loops,
block voltage spikes, and provide electrical isolation.

 Switched-mode power supplies use optocouplers for mains isolation. As they


work in an environment with much electrical noise and with signals which are not
small, optocouplers with low transmission ratio are preferred.
 Where electrical safety is paramount, optocouplers can totally isolate circuitry
which may be touched by humans from mains electricity.
o Medical equipment often uses optocouplers.
o One of the requirements of the MIDI (Musical Instrument Digital
Interface) standard is that input connections be opto-isolated.
o Oscilloscope and digital millimeters with computer interface.
 Optocouplers are used to isolate low-current control or signal circuitry from
transients generated or transmitted by power supply and high-current control
circuits. The latter are used within motor and machine control function blocks.

7. ULN 2003

In electronics, the Darlington transistor (often called a Darlington pair) is a


compound structure consisting of two bipolar transistors (either integrated or separated
devices) connected in such a way that the current amplified by the first transistor is
amplified further by the second one. This configuration gives a much higher current gain
(written β, hfe, or hFE) than each transistor taken separately and, in the case of integrated
devices, can take less space than two individual transistors because they can use a shared
collector. Integrated Darlington pairs come packaged in transistor-like packages.

41
A Darlington pair can be sensitive enough to respond to the current passed by skin
contact even at safe voltages. Thus it can form the input stage of a touch-sensitive switch.
The datasheet of this transistor is as shown below.

Chapter 6 Circuit Description

CIRCUIT DESCRIPTION

Now let's have a detailed look into the whole circuit section wisely. Before
getting in to the description, for the sake of easiness, let's confirm our aim or let's predict
our expectation regarding its working.

We are supposed to send a code word from the mobile phone, which is the
transmitter and is sending the corresponding DTMF frequencies along. At the receiver
end, i.e. at the land line end we need to detect the code back using our circuitry and it is
to be used for driving the devices, represented by the LEDs.

42
RING DETECTION_SECTION

Refer the circuit diagram of this sectionregarding the need of this section, we
want to use this circuitry in the device mode i.e. to control the device's turn off and turn
on while maintaining the normal functionality and usage of the land line to make and
accept calls. So we must allow sometime for the land line to get into the off hook mode,
also it is necessary to get the landline from on hook mode to off hook mode to enable the
DTMF reception. If the land line is already in the off hook mode, then it won't be able to
receive any signal as in the normal speech communication through networks. So using
this section we are aiming to automatically activate our circuitry after a number of rings
are heard from the landline, while the coupling for automation is done using a relay. Here
we have designed such that the DTMF signals will automatically be coupled to the
Decoding section just after the 6th ring.

Now getting into the detailed analysis, the initial high ring voltage is coupled to a
zener diode circuitry to reduce the voltage level for protection, at the same time
maintaining the enough magnitude for detection using the opto-coupler. See the details in
the circuit diagram. Whenever a ring occurs a sufficient amount of ring voltage is
established across the inputs of the opto-coupler which causes the internal transistor to
conduct and effectively the output 5th and 4th pin to get short. This results in an effective
coupling of input ring voltage to pass through. Now we will exploit this signal to use it as
a clock signal for the decade counter IC 4017, which will produce a high logic level at its
Q5 pin upon reception of the 6th ring, which was changed into a quality clock signal. The
diode-resistor- capacitor network along with the NAND gates of the IC 4093 is used to
shape up the irregular voltage signal obtained at the output of the opto- coupler into a
quality clock pulse for the IC 4017. Because of this, as mentioned earlier, just after the
6th ring the counter 4017 will produce a high level at the Q5 pin till the next clock
occurs. This logic 1 level of Q5 pin is then used to drive the monostable multivibrator
using 555 timer IC through BC 547 transistor coupling. The monostable multivibrator is
designed for a period of about 60 seconds which is the allotted time for the operator to

43
control the device using the palm device he has. Thus the monostable multivibrator will
produce logic 1 level for a period of about 60 seconds at its output which is used to drive
a relay as shown through transistor coupling, which will couple a low resistance in
between the RING and the TIP terminals of the landline, resulting in the manifestation of
a DC loop driving the landline from ON HOOK to OFF HOOK preparing the decoding
section for the reliable reception of the signal transmitted from the mobile phone.
Now, we have to contend with a problem arising from the past counting of the IC
4017. Suppose a fellow called to our landline and cut the phone at the 4th or 5th ring.
After this if somebody calls again then right at the first ring the landline will get into the
OFF HOOK mode contrary to our expectation at the 6th ring. How can we avoid this
error? To solve this, what we have with us is only the RESET pin of IC 4017. So the
solution is that we must reset the IC 4017 every time just after once the 6th ring has
occurred or the decoding section is coupled for decoding.
So for this we use the retrigerrable monostable multivibrator using IC 74LS123
commonly called as the ISS-PULSE-DETECTOR. For this we supply the same clock
pulse of 4017 to the IC74123, which has been designed for a period of more than twice as
long as the duration of a single ring signal, which is about 5 seconds.
The out put from the 4th pin of IC 74123, which is the TOGGLED Q output, is
then supplied to the active high RESET pin of IC 4017. Thus this arrangement will avoid
the past counting nature of IC 4017 by resetting it just after the completion of the 6th ring
and the consequent coupling of the decoding section. Now that we have effectively
coupled the signals from the palm device to the decoding section, let's see how the
decoding section performs the decoding function.

DECODING SECTION

Refer the circuit diagram of this section.when the 1k resistor is


brought across the RING and TIP terminals the landline also brought to OFF
HOOK mode so that the decoding section is now connected to the transmitted signal and
can receive it.

44
The input capacitor-zener-resistor network is meant for both the
protection of the DTMF decoder IC 8870 from comparatively higher ring
voltage and the coupling of the signal to the same IC. Based on the
reference DTMF frequencies the DTMF decoder IC 8870 decodes the binary
equivalent of the keys or numbers in the number pad of the transmitting
mobile phones. The decoding scenario of the IC 8870 can be consolidated
as given below.

KEYS Q4 Q3 Q2 Q1

1 Off Off Off On

2 Off Off On Off

3 Off Off On On

4 Off On Off Off

5 O ff On Off On

6 Off On On Off

7 Off On On On

8 On Off Off O ff

9 On Off Off On

0 On Off On Off

* On Off On On

45
# On On Off On

A On On Off On

B On On On Off

C On On On On

D Off Off Off Off

The output of the DTMF decoder IC 8870 is binary code, which is then fed to the
binary to decimal decoder IC 74HC154 retrieving the original transmitted key or number.
But the IC 74HC154 has active low output pins. So these active low outputs are
converted to active high ones by passing them through NOT gates. Note that here we are
using only five outputs of IC 74HC154 to control four devices represented by LEDs as
an instance.

Specifically the pins we are using are the 13th pin which produces an active
low corresponding to the code *, the 2nd pin which produces an active low
corresponding to the code 1, the 3rd one for the code 2, the 4th one for the code 3 and
finally the 5th one for the code 4. Thus in the decoding section we retrieve back the same
number or code transmitted from the mobile phone.

OUT PUT_ SECTION

Refer the circuit diagram of this section.using the converted active high outputs
of the decoding section we are now supposed to control the TURN OFF and TURN ON
of four LEDs. The output corresponding to the code * from the decoding section is used
to trigger a monostable circuitry in the output section, which is designed to produce a
high pulse at it's output for a period of about 5 seconds. This high pulse

46
with the duration of 5 seconds is used to activate the four tri-state buffers i.e. the ICs
74LS126 enabling the coupling of the respective inputs of the buffers to their respective
outputs. Now with in this 5 second duration we can have our control signals to pass
through the buffers and can be used to control the D flip flops i.e. the ICs 74LS74, which
has been set in the latching mode to get its output toggled upon receiving consequent
clock pulses, thus triggering the turn ON and turn OFF of the devices once the same code
is transmitted for a second time. In a nutshell, the latching mode peration of D flip flops
causes a device to get turn on from off state or vice versa on reception of the code word.
The IC 74LS74 is a positive edge triggered IC. One of the practical limitation we face
here is to create a positive edge at the clock input of the D flip flop IC, using the isolated
pulse coming through the buffer to its output. If we directly apply the pulse to the D flip
flop to work in the latching mode it won't work due to the lack of
establishment of the positive edge to its clock input, resulting from the occurrence of
logic 1 level at the clock input of D flip flop right at the time of biasing or when
connected to the power supply. For this purpose to create a positive edge going from
logic 0 level to logic 1 level we pass the pulse coming out of the buffer through another
NOT gate as shown.
Finally, we need to find out a code which we have to transmit from the mobile
phone so that we can establish a well shaped pulse as clock pulse at the clock input pin of
the D flip flop for it to work in latching mode i.e. to get the LEDs turned on if they were
in the off state and vice versa.

First of all we must activate the buffer in the output section for the predetermined
time by triggering the monostable circuitry there in. So the first symbol in the code word
should be *. Now, we need to transmit a high level through the activated buffer using
another symbol specific to each of the device represented. From the circuit diagram we
can see it can be 1 for the 1st device, 2 for the second one and so on.

Thus by sending *(ordinal number of the device) we can create a low to high
transition at the out of the buffer. But it's not yet been a well defined pulse with both

47
trailing and falling edge. So to get a falling edge we should now send a symbol other than
ordinal number of the device. Let it also be * to have a convenient code. Now, as we
know we use * for triggering the monostable circuitry in the output section we must not
end our code word with *. Other wise, it will cause the triggering input of the monostable
multivibrator to continue in the logic 1 level even after the specified 5
seconds which in turn forces it not to get triggered for a second time on pressing * as
there lacks the transition from low to high level at it's triggering input. Hence we must
end our code word with a symbol other than both * and ordinal number of the device. Let
it be 0. Thus, we got the code word that is to be send for our expected control as * ordinal
number of the device*0. For example, to change the state of first device we have to send
a code-*1*0, for the 2nd one *2*0 etc.
By following the similar logic, it is possible to find some other formats of code
words. For example, the code word * ordinal number of the device 0 is also seeming to
be worthy of.
Thus the whole control procedure can be consolidated as first of all we need to
make a call to the land line, just after the 6th ring it will automatically get on to the OFF
HOOK mode for about 1minutes, during this time we can control the required devices
with code words of specified format with in the installments of 5 seconds.

48
Chapter 7 Keil Software

49
Chapter 8 Source Coding

Source Code:

;///////// DTMF HAS\\\\\\\\\\\

ORG 0000H
MOV P0,#00H
MOV P2,#00H
SWITCH4 EQU P3.0
SWITCH3 EQU P3.1
SWITCH2 EQU P3.2

50
SWITCH1 EQU P3.3

LED1 EQU P1.0 ; FF MODE ,RIGHT MODE


LED2 EQU P1.1 ; BACK MODE
LED3 EQU P1.6 ; BACK MODE
LED4 EQU P1.7 ; FF MODE ,LIFT MODE
LED5 EQU P0.1 ; LAMP , CAM NO/OFF
STOPLED EQU P2.5 ; STOP LAMP
MOV P0,#0ffH
MOV P2,#00H
ACALL DELAY
SJMP MAIN

;;;;;;;;;;;;;;;; MAIN PROG....;;;;;;;;;;;;


MAIN:

JB SWITCH1,NEXT1
JNB SWITCH3,LAMP134
JNB SWITCH2,LAMPOFF
SETB LED2 ; BACK MODE
SETB LED3 ; BACK MODE
CLR STOPLED ; STOPLED OFF
CLR LED1
CLR LED4

51
ACALL DELAY
SJMP MAIN
NEXT1:
JB SWITCH3,NEXT2
JNB SWITCH2,RIGHT
SETB LED1 ; FF MODE
SETB LED4 ; FF MODE
CLR STOPLED ; STOP LED
OFF
CLR LED2
CLR LED3
ACALL DELAY
SJMP MAIN
NEXT2:
JB SWITCH2,NEXT3
JNB SWITCH4,STOP
SETB LED4 ; LIFT MODE
CLR STOPLED ; STOP LED OFF
CLR LED1
CLR LED2
CLR LED3
ACALL DELAY
acJMP MAIN

52
NEXT3:
ACALL DELAY
SJMP MAIN
RIGHT:

SETB LED1 ; RIGHT MODE


CLR STOPLED ; STOP LED OFF
CLR LED4
CLR LED2
CLR LED3
ACALL DELAY
SJMP MAIN
STOP:
SETB STOPLED ; STOP LED ON
CLR LED1
CLR LED2
CLR LED3
CLR LED4
ACALL DELAY
LJMP MAIN
LAMP134:
JNB SWITCH4,LAMPON
ACALL DELAY
LJMP MAIN

53
LAMPON:
SETB LED5
ACALL DELAY ; LAMP , CAM NO
LJMP MAIN
LAMPOFF:
CLR LED5 ; LAMP , CAM OFF
ACALL DELAY
LJMP MAIN
JB SWITCH1,NEXT1
JNB SWITCH3,LAMP134
JNB SWITCHDD,LAMPOFF
SETB LED2 ; BACK MODE
SETB LED3 ; BACK MODE
CLR STOPLED ; STOPLED OFF
CLR LED1
CLR LED4
ACALL DELAY
SJMP MAIN
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DELAYA:
MOV 71H,#0FFH
MOV 72H03H

54
LOOP:
DJNZ 70H,LOOP
DJNZ 71H,LOOP
RET
END
DJNZ 70H,LOOP
DJNZ 71H,LOOP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SOFTWARES:

1. Embedded C

2. Keil IDE

3. Uc-Flash

HARDWARES:
1. Micro controller
2. Power supply
3. DTMF DECODER
4.Appliances
5.Power driver and isolator

CONCLUSION

55
This project presents a dtmf based home appliances controlling. The controller based
on closed loop algorithm is designed and implemented with Atmel MCU in embedded
system the domain.

Experimental work has been carried out carefully.

56
Hence we are controlling 6 home appliances controlling through DTMF technology
effectively. Because now a days GSM technology became very popular,here its very easy to use
for any applications with the help of 8051 controller.In all low end applications now a days we
are using 8051 controllers like industrial automation and data acquisition.

The Remote Automation using Networks [RAN] on test performed exceptionally


well to its capability and accuracy. All the inherent parts of the circuit performed consistently. It
helped us to come out with good judgment. With the features what it inherits, it seems to be
advantageous to the present era.

57
Chapter 9 Future Aspects

Future Scope

The controller we used having the following featurtes like 8 bit 8051
architecture in a tiny 20pin DIP package,128B RAM and 4kB on-chip Flash Program Memory.
For low end applications this controller is very easy to use and at the same time GSM also widely
accepted protocol for mobile communication.

In future for small scale systems 8051 controllers can be widely used along with the help
of GSM technology.

REFERENCES

Text Books:
8051 and Embedded systems BY Mazidi

BIBILOGRAPHY

Website:
www.howstuffworks.com
www.answers.com
www.radiotronix.com

MAGZINES:
Electronics for you
Electrikindia
Let us Go Wireless

58
APPENDIX

2051 Microcontroller:

The 2051 is a 20 pin version of the 8051. It is a low-voltage, high-


performance CMOS 8-bit microcomputer with 2K bytes of Flash programmable and erasable
read only memory. Atmel manufactures the chip using high-density nonvolatile memory
technology. The 2051 and is compatible with the industry-standard MCS-51 instruction set. By
combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel 2051 is a powerful
microcontroller. It provides a very flexible, cost-effective solution to many embedded control
applications.
 
Operational features of the 2051

The 2051 features Compatibility with MCS-51 ™ Products, 2K Bytes of


Reprogrammable Flash Memory with 1,000 Write/Erase Cycles. The operating range of the 2051
is 2.7V to 6V.
Among these features, the 2051 also contains the following features:

Fully Static Operation: 0 Hz to 24 MHz


Two-level Program Memory Lock
128 x 8-bit Internal RAM
15 Programmable I/O Lines
Two 16-bit Timer/Counters
Six Interrupt Sources
Programmable Serial UART Channel
Direct LED Drive Outputs
On-chip Analog Comparator

59
Low-power Idle and Power-down Modes
2051 Pin-out and Description

Pin Description
 
Pin Name:  
                                     Purpose:

VCC                                                               Supplies voltage and power.


 
GND                                                               Ground.
 
Port 1 

Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 toP1.7 provide internal pull-ups.
P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input (AIN0)
and the negative input (AIN1), respectively, of the on-chip precision analog comparator. The
Port 1 output buffers can sink 20mA and can drive LED displays directly. When 1s are written to
Port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are used as inputs and are
externally pulled low, they will source current (IIL) because of the internal pull-ups. Port 1 also
receives code data during Flash programming and verification.

60
 Port 3  
                                                           
Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups.
P3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible as a
general purpose I/O pin. The Port 3 output buffers can sink 20mA. When 1s are written to Port 3
pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins
that are externally being pulled low will source current (IIL) because of the pull-ups.

Port 3 also serves the functions of various special features of the AT89C2051
as listed below:    
                                                             

Port 3 also receives some control signals for Flash programming and verification.

61
 RST
Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin high
for two machine cycles while the oscillator is running resets the device.
Restrictions on Instructions

The AT89C2051 and is the economical and cost-effective member of


Atmel’s family of microcontrollers. Therefore, it contains only 2K bytes of flash program
memory. It is fully compatible with the MCS-51 architecture, and can be programmed using the
MCS-51 instruction set. However, there are a few considerations one must keep in mind when
utilizing certain instructions to program this device. All the instructions related to jumping or
branching should be restricted such that the destination address falls within the physical program
memory space of the device, which is 2K for the AT89C2051. This should be the responsibility
of the software programmer. For example, LJMP 7E0H would be a valid instruction for the
AT89C2051 (with 2K of memory), whereas LJMP 900H would not.

1. Branching instructions:

 LCALL, LJMP, ACALL, AJMP, SJMP, JMP @A+DPTR

 These unconditional branching instructions will execute correctly as long as the programmer
keeps in mind that the destination branching address must fall within the physical boundaries of
the program memory size (locations 00H to 7FFH for the 89C2051). Violating the physical space
limits may cause unknown program behavior.

CJNE [...], DJNZ [...], JB, JNB, JC, JNC, JBC, JZ, JNZ

62
  With these conditional branching instructions the same rule above applies. Again,
violating the memory boundaries may cause erratic execution.
 For applications involving interrupts the normal interrupt service routine address
locations of the 80C51 family architecture have been preserved. 

1. MOVX-related instructions, Data Memory: 

The 2051 contains 128 bytes of internal data memory. Thus, in the 2051 the
stack depth is limited to 128 bytes, the amount of available RAM. External DATA memory
access is not supported in this device, nor is external PROGRAM memory execution. Therefore,
no MOVX [...] instructions should be included in the program. A typical 80C51 assembler will
still assemble instructions, even if they are written in violation of the restrictions mentioned
above. It is the responsibility of the controller user to know the physical features and limitations
of the device being used and adjust the instructions used correspondingly.

63
BLOCK DIAGRAM OF 2051

64
Power-down Mode

65
In the power down mode the oscillator is stopped, and the instruction that invokes
power down is the last instruction executed. The on-chip RAM and Special Function Registers
retain their values until the power down mode is terminated. The only exit from power down is a
hardware reset. Reset redefines the SFRs but does not change the on-chip RAM. The reset
should not be activated before VCC is restored to its normal operating level and must be held
active long enough to allow the oscillator to restart and stabilize.
P1.0 and P1.1 should be set to “0” if no external pull-ups are used, or set to “1” if external pull-
ups are used.
The 2051 is a low voltage (2.7V - 6V), high performance CMOS 8-bit microcontroller with 2
Kbytes of Flash programmable and erasable read only memory (PEROM). This device is
compatible with the industry standard 8051 instruction set and pin-out. The 2051 is a powerful
microcomputer which provides a highly flexible and cost effective solution to many embedded
applications. 

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

Uses of the 2051 Microcontroller:

 The 2051 is used in many applications.

         Controlling 7-segment displays


-         Clocks
        Sensor projects
-         Temperature
Used to Control LCD ( 8051 )

66
67

You might also like