Embedded System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

CHAPTER 1

INTRODUCTION

1.1 Background
An Embedded System is a combination of computer hardware and software, and
perhaps additional mechanical or other parts, designed to perform a specific function. A
good example is the microwave oven. Almost every household has one, and tens of
millions of them are used everyday, but very few people realize that a processor and
software are involved in the preparation of their lunch or dinner.
This is in direct contrast to the personal computer in the family room. It too is
comprised of computer hardware and software and mechanical components (disk drives,
for example). However, a personal computer is not designed to perform a specific
function rather; it is able to do many different things. Many people use the term general-
purpose computer to make this distinction clear. As shipped, a general-purpose computer
is a blank slate; the manufacturer does not know what the customer will do wish it. One
customer may use it for a network file server another may use it exclusively for playing
games, and a third may use it to write the next great American novel.

Frequently, an embedded system is a component within some larger system. For


example, modern cars and trucks contain many embedded systems. One embedded
system controls the anti-lock brakes, other monitors and controls the vehicle's emissions,
and a third displays information on the dashboard. In some cases, these embedded
systems are connected by some sort of a communication network, but that is certainly not
a requirement.

At the possible risk of confusing you, it is important to point out that a general-
purpose computer is itself made up of numerous embedded systems. For example, my
computer consists of a keyboard, mouse, video card, modem, hard drive, floppy drive,
and sound card-each of which is an embedded system. Each of these devices contains a
processor and software and is designed to perform a specific function. For example, the
modem is designed to send and receive digital data over analog telephone line. That's it
and all of the other devices can be summarized in a single sentence as well.
1
If an embedded system is designed well, the existence of the processor and
software could be completely unnoticed by the user of the device. Such is the case for a
microwave oven, VCR, or alarm clock. In some cases, it would even be possible to build
an equivalent device that does not contain the processor and software. This could be done
by replacing the combination with a custom integrated circuit that performs the same
functions in hardware. However, a lot of flexibility is lost when a design is hard-cooled in
this way. It is much easier, and cheaper, to change a few lines of software than to
redesign a piece of custom hardware.

Real Time Systems:


One subclass of embedded is worthy of an introduction at this point. As
commonly defined, a real-time system is a computer system that has timing constraints.
In other words, a real-time system is partly specified in terms of its ability to make
certain calculations or decisions in a timely manner. These important calculations are said
to have deadlines for completion. And, for all practical purposes, a missed deadline is just
as bad as a wrong answer.
The issue of what if a deadline is missed is a crucial one. For example, if the real-
time system is part of an airplane's flight control system, it is possible for the lives of the
passengers and crew to be endangered by a single missed deadline. However, if instead
the system is involved in satellite communication, the damage could be limited to a single
corrupt data packet. The more severe the consequences, the more likely it will be said
that the deadline is "hard" and thus, the system is a hard real-time system. Real-time
systems at the other end of this discussion are said to have "soft" deadlines.
All of the topics and examples presented in this book are applicable to the
designers of real-time system who is more delight in his work. He must guarantee reliable
operation of the software and hardware under all the possible conditions and to the degree
that human lives depend upon three system's proper execution, engineering calculations
and descriptive paperwork.

2
Application Areas
Nearly 99 per cent of the processors manufactured end up in embedded systems.
The embedded system market is one of the highest growth areas as these systems are
used in very market segment- consumer electronics, office automation, industrial
automation, biomedical engineering, wireless communication, data communication,
telecommunications, transportation, military and so on.

1.Consumer appliances:
At home we use a number of embedded systems which include digital camera,
digital diary, DVD player, electronic toys, microwave oven, remote controls for TV and
air-conditioner, VCO player, video game consoles, video recorders etc. Today’s high-
tech car has about 20 embedded systems for transmission control, engine spark control,
air-conditioning, navigation etc. Even wristwatches are now becoming embedded
systems. The palmtops are powerful embedded systems using which we can carry out
many general-purpose tasks such as playing games and word processing.

2.Office automation:
The office automation products using em embedded systems are copying
machine, fax machine, key telephone, modem, printer, scanner etc.

3.Industrial automation:
Today a lot of industries use embedded systems for process control. These include
pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and
transmission. The embedded systems for industrial use are designed to carry out specific
tasks such as monitoring the temperature, pressure, humidity, voltage, current etc., and
then take appropriate action based on the monitored levels to control other devices or to
send information to a centralized monitoring station. In hazardous industrial environment,
where human presence has to be avoided, robots are used, which are programmed to do
specific jobs. The robots are now becoming very powerful and carry out many interesting
and complicated tasks such as hardware assembly.

3
4.Medical electronics:
Almost every medical equipment in the hospital is an embedded system. These
equipments include diagnostic aids such as ECG, EEG, blood pressure measuring
devices, X-ray scanners; equipment used in blood analysis, radiation, colonscopy,
endoscopy etc. Developments in medical electronics have paved way for more accurate
diagnosis of diseases.

5.Computer networking:
Computer networking products such as bridges, routers, Integrated Services
Digital Networks (ISDN), Asynchronous Transfer Mode (ATM), X.25 and frame relay
switches are embedded systems which implement the necessary data communication
protocols. For example, a router interconnects two networks. The two networks may be
running different protocol stacks. The router’s function is to obtain the data packets from
incoming pores, analyze the packets and send them towards the destination after doing
necessary protocol conversion. Most networking equipments, other than the end systems
(desktop computers) we use to access the networks, are embedded systems.

6.Telecommunications:
In the field of telecommunications, the embedded systems can be categorized as
subscriber terminals and network equipment. The subscriber terminals such as key
telephones, ISDN phones, terminal adapters, web cameras are embedded systems. The
network equipment includes multiplexers, multiple access systems, Packet Assemblers
Dissemblers (PADs), sate11ite modems etc. IP phone, IP gateway, IP gatekeeper etc. are
the latest embedded systems that provide very low-cost voice communication over the
Internet.

7.Wireless technologies:
Advances in mobile communications are paving way for many interesting
applications using embedded systems. The mobile phone is one of the marvels of the last
decade of the 20’h century. It is a very powerful embedded system that provides voice

4
communication while we are on the move. The Personal Digital Assistants and the
palmtops can now be used to access multimedia services over the Internet.

8.Security:
Security of persons and information has always been a major issue. We need to
protect our homes and offices; and also the information we transmit and store.
Developing embedded systems for security applications is one of the most lucrative
businesses nowadays. Security devices at homes, offices, airports etc. for authentication
and verification are embedded systems. Encryption devices are nearly 99 per cent of the
processors that are manufactured end up in~ embedded systems. Embedded systems find
applications in . every industrial segment- consumer electronics, transportation, avionics,
biomedical engineering, manufacturing, process control and industrial automation, data
communication, telecommunication, defense, security etc. Used to encrypt the data/voice
being transmitted on communication links such as telephone lines. Biometric systems
using fingerprint and face recognition are now being extensively used for user
authentication in banking applications as well as for access control in high security
buildings.

9.Finance:
Financial dealing through cash and cheques are now slowly paving way for
transactions using smart cards and ATM (Automatic Teller Machine, also expanded as
Any Time Money) machines. Smart card, of the size of a credit card, has a small micro-
controller and memory; and it interacts with the smart card reader! ATM machine and
acts as an electronic wallet. Smart card technology has the capability of ushering in a
cashless society. Well, the list goes on. It is no exaggeration to say that eyes wherever
you go, you can see, or at least feel, the work of an embedded system.

Uses of microcontrollers
Like all good things, this powerful component is basically very simple. It is made by
mixing tested and high- quality "ingredients" (components) as per following receipt:

1. The simplest computer processor is used as the "brain" of the future system.
2. Depending on the taste of the manufacturer, a bit of memory, a few A/D
converters, timers, input/output lines etc. are added
5
3. All that is placed in some of the standard packages.
4. A simple software able to control it all and which everyone can easily learn about
has been developed.
On the basis of these rules, numerous types of microcontrollers were designed and
they quickly became man's invisible companion. Their incredible simplicity and
flexibility conquered us a long time ago and if you try to invent something about them,
you should know that you are probably late, someone before you has either done it or at
least has tried to do it.
The following things have had a crucial influence on development and success of the
microcontrollers:
 Powerful and carefully chosen electronics embedded in the microcontrollers can
independently or via input/output devices (switches, push buttons, sensors, LCD
displays, relays etc.), control various processes and devices such as industrial
automation, electric current, temperature, engine performance etc.
 Very low prices enable them to be embedded in such devices in which, until
recent time it was not worthwhile to embed anything. Thanks to that, the world is
overwhelmed today with cheap automatic devices and various “smart” appliances.
 Prior knowledge is hardly needed for programming. It is sufficient to have a PC
(software in use is not demanding at all and is easy to learn) and a simple device
(called the programmer) used for “loading” ready-to-use programs into the
microcontroller.
So, if you are infected with a virus called electronics, there is nothing left for you to do
but to learn how to use and control its power.

Importance of micro controller


Even though there is a large number of different types of microcontrollers and
even more programs created for their use only, all of them have many things in common.
Thus, if you learn to handle one of them you will be able to handle them all. A typical
scenario on the basis of which it all functions is as follows:

1. Power supply is turned off and everything is still…the program is loaded into the
microcontroller, nothing indicates what is about to come…
6
2. Power supply is turned on and everything starts to happen at high speed! The
control logic unit keeps everything under control. It disables all other circuits
except quartz crystal to operate. While the preparations are in progress, the first
milliseconds go by.
3. Power supply voltage reaches its maximum and oscillator frequency becomes
stable. SFRs are being filled with bits reflecting the state of all circuits within the
microcontroller. All pins are configured as inputs. The overall electronis starts
operation in rhythm with pulse sequence. From now on the time is measured in
micro and nanoseconds.
4. Program Counter is set to zero. Instruction from that address is sent to instruction
decoder which recognizes it, after which it is executed with immediate effect.
5. The value of the Program Counter is incremented by 1 and the whole process is
repeated...several million times per second.

Fig.1.1 operation of microcontroller

As you can see, all the operations within the microcontroller are performed at
high speed and quite simply, but the microcontroller itself would not be so useful if there

7
are not special circuits which make it complete. In continuation, we are going to call your
attention to them.

Read Only Memory (ROM)


Read Only Memory (ROM) is a type of memory used to permanently save the
program being executed. The size of the program that can be written depends on the size
of this memory. ROM can be built in the microcontroller or added as an external chip,
which depends on the type of the microcontroller. Both options have some disadvantages.
If ROM is added as an external chip, the microcontroller is cheaper and the program can
be considerably longer. At the same time, a number of available pins is reduced as the
microcontroller uses its own input/output ports for connection to the chip. The internal
ROM is usually smaller and more expensive, but leaves more pins available for
connecting to peripheral environment. The size of ROM ranges from 512B to 64KB.

Random Access Memory (RAM)


Random Access Memory (RAM) is a type of memory used for temporary storing
data and intermediate results created and used during the operation of the
microcontrollers. The content of this memory is cleared once the power supply is off. For
example, if the program performs an addition, it is necessary to have a register standing
for what in everyday life is called the “sum” . For that purpose, one of the registers in
RAM is called the "sum" and used for storing results of addition. The size of RAM goes
up to a few KBs.

Electrically Erasable Programmable ROM (EEPROM)


The EEPROM is a special type of memory not contained in all microcontrollers.
Its contents may be changed during program execution (similar to RAM ), but remains
permanently saved even after the loss of power (similar to ROM). It is often used to store
values, created and used during operation (such as calibration values, codes, values to
count up to etc.), which must be saved after turning the power supply off.

A disadvantage of this memory is that the process of programming is relatively


slow. is measured in milliseconds.

8
Special Function Registers (SFR)
Special function registers are part of RAM memory. Their purpose is predefined
by the manufacturer and cannot be changed therefore. Since their bits are physically
connected to particular circuits within the microcontroller, such as A/D converter, serial
communication module etc., any change of their state directly affects the operation of the
microcontroller or some of the circuits. For example, writing zero or one to the SFR
controlling an input/output port causes the appropriate port pin to be configured as input
or output. In other words, each bit of this register controls the function of one single pin.

Program Counter
Program Counter is an engine running the program and points to the memory
address containing the next instruction to execute. After each instruction execution, the
value of the counter is incremented by 1. For this reason, the program executes only one
instruction at a time just as it is written. However the value of the program counter can be
changed at any moment, which causes a “jump” to a new memory location. This is how
subroutines and branch instructions are executed. After jumping, the counter resumes
even and monotonous automatic counting +1, +1, +1.…

9
1.2 BLOCK DIAGRAM OF PROJECT

POWER SUPPLY DEVICE 3

AT89S52
DTMF HT9170B
RELAY

MOBILE CONNECTOR

ULN 2003

RELAY RELAY

MOBILE

DEVICE 1 DEVICE 2

`Fig.1.1 block diagram of project

10
CHAPTER 2

DESCRIPTION OF HARDWARE COMPONENTS

2.1 Introduction to AT89S52


The system requirements and control specifications clearly rule out the use of 16,
32 or 64 bit micro controllers or microprocessors. Systems using these may be earlier to
implement due to large number of internal features. They are also faster and more reliable
but, the above application is satisfactorily served by 8-bit micro controller. Using an
inexpensive 8-bit Microcontroller will doom the 32-bit product failure in any competitive
market place. Coming to the question of why to use 89S52 of all the 8-bit Microcontroller
available in the market the main answer would be because it has 8kB Flash and 256 bytes
of data RAM32 I/O lines, three 16-bit timer/counters, a Eight-vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry.

In addition, the AT89S52 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. The Flash program memory supports both parallel programming and in
Serial In-System Programming (ISP). The 89S52 is also In-Application Programmable
(IAP), allowing the Flash program memory to be reconfigured even while the application
is running.
By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel
AT89S52 is a powerful microcomputer which provides a highly flexible and cost
effective solution to many embedded control applications.

11
PIN DIAGRAM

Fig.2.1 pin diagram of micro controller

Pinout Description
Pins 1-8: Port 1 Each of these pins can be configured as an input or an output.
Pin 9: RS A logic one on this pin disables the microcontroller and clears the contents of
most registers. In other words, the positive voltage on this pin resets the microcontroller.
By applying logic zero to this pin, the program starts execution from the beginning.
Pins10-17: Port 3 Similar to port 1, each of these pins can serve as general input or
output. Besides, all of them have alternative functions:
12
Pin 10: RXD Serial asynchronous communication input or Serial synchronous
communication output.
Pin 11: TXD Serial asynchronous communication output or Serial synchronous
communication clock output.
Pin 12: INT0 Interrupt 0 input.
Pin 13: INT1 Interrupt 1 input.
Pin 14: T0 Counter 0 clock input.
Pin 15: T1 Counter 1 clock input.
Pin 16: WR Write to external (additional) RAM.
Pin 17: RD Read from external RAM.
Pin 18, 19: X2, X1 Internal oscillator input and output. A quartz crystal which specifies
operating frequency is usually connected to these pins. Instead of it, miniature ceramics
resonators can also be used for frequency stability. Later versions of microcontrollers
operate at a frequency of 0 Hz up to over 50 Hz.
Pin 20: GND Ground.
Pin 21-28: Port 2 If there is no intention to use external memory then these port pins are
configured as general inputs/outputs. In case external memory is used, the higher address
byte, i.e. addresses A8-A15 will appear on this port. Even though memory with capacity
of 64Kb is not used, which means that not all eight port bits are used for its addressing,
the rest of them are not available as inputs/outputs.
Pin 29: PSEN If external ROM is used for storing program then a logic zero (0) appears
on it every time the microcontroller reads a byte from memory.
Pin 30: ALE Prior to reading from external memory, the microcontroller puts the lower
address byte (A0-A7) on P0 and activates the ALE output. After receiving signal from the
ALE pin, the external register (usually 74HCT373 or 74HCT375 add-on chip) memorizes
the state of P0 and uses it as a memory chip address. Immediately after that, the ALU pin
is returned its previous logic state and P0 is now used as a Data Bus. As seen, port data
multiplexing is performed by means of only one additional (and cheap) integrated circuit.
In other words, this port is used for both data and address transmission.
Pin 31: EA By applying logic zero to this pin, P2 and P3 are used for data and address
transmission with no regard to whether there is internal memory or not. It means that
even there is a program written to the microcontroller, it will not be executed. Instead, the
program written to external ROM will be executed. By applying logic one to the EA pin,
the microcontroller will use both memories, first internal then external (if exists).

13
Pin 32-39: Port 0 Similar to P2, if external memory is not used, these pins can be used as
general inputs/outputs. Otherwise, P0 is configured as address output (A0-A7) when the
ALE pin is driven high (1) or as data output (Data Bus) when the ALE pin is driven low
(0).
Pin 40: VCC +5V power supply.

2.2 POWER SUPPLY

2.2.1 introduction

All digital circuits require regulated power supply. In this article we are going to
learn how to get a regulated positive supply from the mains supply.

Fig.2.2 reguleted of block diagramg


Figure 1 shows the basic block diagram of a fixed regulated power supply. Let us go
through each block.
2.2.2 TRANSFORMER

Fig.2.3 Block daigram of transformer winding

14
A transformer consists of two coils also called as “WINDINGS” namely
PRIMARY & SECONDARY.

They are linked together through inductively coupled electrical conductors also
called as CORE. A changing current in the primary causes a change in the Magnetic Field
in the core & this in turn induces an alternating voltage in the secondary coil. If load is
applied to the secondary then an alternating current will flow through the load. If we
consider an ideal condition then all the energy from the primary circuit will be transferred
to the secondary circuit through the magnetic field.
So
2.1

2.2

The secondary voltage of the transformer depends on the number of turns in the Primary as well as in
the secondary.

2.3

2.2.3 Rectifier
A rectifier is a device that converts an AC signal into DC signal. For rectification purpose
we use a diode, a diode is a device that allows current to pass only in one direction i.e.
when the anode of the diode is positive with respect to the cathode also called as forward
biased condition & blocks current in the reversed biased condition.
Rectifier can be classified as follows:
a)Half wave rectifier

Fig.2.3 Block diagram of half wave rectifier.


15
This is the simplest type of rectifier as you can see in the diagram a half wave
rectifier consists of only one diode. When an AC signal is applied to it during the positive
half cycle the diode is forward biased & current flows through it. But during the negative
half cycle diode is reverse biased & no current flows through it. Since only one half of
the input reaches the output, it is very inefficient to be used in power supplies.

b)Full wave rectifier.

Fig. 2.4 block diagram of full wave rectifier

Half wave rectifier is quite simple but it is very inefficient, for greater efficiency
we would like to use both the half cycles of the AC signal. This can be achieved by using
a center tapped transformer i.e. we would have to double the size of secondary winding &
provide connection to the center. So during the positive half cycle diode D1 conducts &
D2 is in reverse biased condition. During the negative half cycle diode D2 conducts & D1
is reverse biased. Thus we get both the half cycles across the load.
One of the disadvantages of Full Wave Rectifier design is the necessity of using a center
tapped transformer, thus increasing the size & cost of the circuit. This can be avoided by
using the Full Wave Bridge Rectifier.

16
C)Bridge Rectifier

Fig.2.5 block daigram of bridge rectifier

As the name suggests it converts the full wave i.e. both the positive & the
negative half cycle into DC thus it is much more efficient than Half Wave Rectifier &
that too without using a center tapped transformer thus much more cost effective than
Full Wave Rectifier.

Full Bridge Wave Rectifier consists of four diodes namely D1, D2, D3 and D4.
During the positive half cycle diodes D1 & D4 conduct whereas in the negative half cycle
diodes D2 & D3 conduct thus the diodes keep switching the transformer connections so
we get positive half cycles in the output.

Fig. 2.6 block daigram of full wave bridge rectifier

17
If we use a center tapped transformer for a bridge rectifier we can get both
positive & negative half cycles which can thus be used for generating fixed positive &
fixed negative voltages.

2.2.4 filter capacitor

Even though half wave & full wave rectifier give DC output, none of them
provides a constant output voltage. For this we require to smoothen the waveform
received from the rectifier. This can be done by using a capacitor at the output of the
rectifier this capacitor is also called as “FILTER CAPACITOR” or “SMOOTHING
CAPACITOR” or “RESERVOIR CAPACITOR”. Even after using this capacitor a small
amount of ripple will remain.

We place the Filter Capacitor at the output of the rectifier the capacitor will charge to the peak
voltage during each half cycle then will discharge its stored energy slowly through the load while the
rectified voltage drops to zero, thus trying to keep the voltage as constant as possible.

Fig.2.7 block diagram of filter capacitor

18
If we go on increasing the value of the filter capacitor then the Ripple will decrease. But then
the costing will increase. The value of the Filter capacitor depends on the current consumed by the
circuit, the frequency of the waveform & the accepted ripple.

2.4

Where,
Vr= accepted ripple voltage.( should not be more than 10% of the voltage)
I= current consumed by the circuit in Amperes.
F= frequency of the waveform. A half wave rectifier has only one peak in one cycle so F=25hz
Whereas a full wave rectifier has Two peaks in one cycle so F=100hz.

2.2.5 VOLTAGE REGULATOR


A Voltage regulator is a device which converts varying input voltage into a
constant regulated output voltage. Voltage regulator can be of two types
a)Linear Voltage Regulator
Also called as Resistive Voltage regulator because they dissipate the
excessive voltage resistively as heat.
b)Switching Regulators.
They regulate the output voltage by switching the Current ON/OFF very
rapidly. Since their output is either ON or OFF it dissipates very low power thus
achieving higher efficiency as compared to linear voltage regulators. But they are more
complex & generate high noise due to their switching action. For low level of output
power switching regulators tend to be costly but for higher output wattage they are much
cheaper than linear regulators.
The most commonly available Linear Positive Voltage Regulators are the
78XX series where the XX indicates the output voltage. And 79XX series is for Negative
Voltage Regulators.

19
Fig.2.8 block diagram of voltage regulator

After filtering the rectifier output the signal is given to a voltage regulator. The
maximum input voltage that can be applied at the input is 35V.Normally there is Volts
drop across the regulator so the input voltage should be at least 2-3Volts.higher than the
output voltage. If the input voltage gets below the Vmin of theregulator due to the ripple
voltage or due to any other reason the voltage regulator will not be able to
produce the correct regulated voltage.

c)Circuit diagram of switching regulator

Fig. 2.9 block diagram of switching regulator

20
d)IC 7805:
7805 is an integrated three-terminal positive fixed linear voltage regulator. It
supports an input voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a
current rating of 1 amp although lower current models are available. Its output voltage is
fixed at 5.0V.

The 7805 also has a built-in current limiter as a safety feature. 7805 is
manufactured by many companies, including National Semiconductors and Fairchild
Semiconductors.

The 7805 will automatically reduce output current if it gets too hot.The last two
digits represent the voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series
of regulators is designed to work in complement with the 79xx series of negative voltage
regulators in systems that provide both positive and negative regulated voltages, since the
78xx series can't regulate negative voltages in such a system.

The 7805 & 78 is one of the most common and well-known of the 78xx series
regulators, as it's small component count and medium-power regulated 5V make it useful
for powering TTL devices.

SPECIFICATIONS IC 7805

Vout 5V

Vein - Vout Difference 5V - 20V

Operation Ambient Temp 0 - 125°C

Output Imax 1A

Table.2.1 Specifications of IC7805

21
2.3 RELAY

2.3.1Overview

A relay is an electrically operated switch. Current flowing through the coil of the
relay creates a magnetic field which attracts a lever and changes the switch contacts.
The coil current can be ON or OFF so relays have two switch position and they are
double throw (changeover) switches.

Relays allow one circuit to switch a second circuit which can be completely
separate from the first. For example a low voltage battery circuit can use a relay to switch
a 230V AC mains circuit. There is no electrical connection inside the relay between the
two circuits; the link is magnetic and mechanical.

The coil of a relay passes a relatively large current, typically 30mA for a 12V
relay, but it can be as much as 100mA for relays designed to operate from lower voltages.
Most ICs (chips) can not provide this current and a transistor is usually used to amplify
the small IC current to the larger value required for the relay coil. The maximum output
current for the popular 555 timer IC is 200mA so these devices can supply relay coils
directly without amplification.

Relays are usually SPDT or DPDT but they can have many more sets of switch
contacts, for example relay with 4 sets of changeover contacts are readily available. Most
relays are designed for PCB mounting but you can solder wires directly to the pins
providing you take care to avoid melting the plastic case of the relay.

The supplier's catalogue should show you the relay's connection. The coil will be
obvious and it may be connected either way round. Relay coils produce brief high voltage
'spikes' when they are switched off and this can destroy transistors and ICs in the circuit.
To prevent damage you must connect a protection diode across the relay coil.

The relay’s switch connections are usually contains COM, NC and NO.

COM = Common, always connect to this; it is the moving part of the switch.

22
NC = Normally Closed, COM is connected to this when the relay coil is off.

NO = Normally Open, COM is connected to this when the relay coil is on.

Connect to COM and NO if you want the switched circuit to be on when the relay coil is
on.

Connect to COM and NC if you want the switched circuit to be on when the relay coil is
off.

Most relays are SPDT or DPDT which are often described as "single pole changeover"
(SPCO)

Or "double pole changeover"(DPCO).

Fig.2.10 block diagram of single pole relay

This is a Single Pole Double Throw relay. Current will flow between the movable
contact and one fixed contact when the coil is energized and between the movable contact
and the alternate fixed contact when the relay coil is energized. The most commonly used
relay in car audio, the Bosch relay, is a SPDT relay..

Fig.2.11 block diagram of double pole relay

23
This relay is a Double Pole Double Throw relay. It operates like the SPDT relay but has
twice as many contacts. There are two completely isolated sets of contacts.

2.3.2 Relay Construction:

Relays are amazingly simple devices. There are four parts in every relay:

 Electromagnet
 Armature that can be attracted by the electromagnet
 Spring
 Set of electrical contacts

A relay consists of two separate and completely independent circuits. The first is
at the bottom and drives the electromagnet. In this circuit, a switch is controlling power
to the electromagnet. When the switch is on, the electromagnet is on, and it attracts the
armature. The armature is acting as a switch in the second circuit. When the
electromagnet is energized, the armature completes the second circuit and the light is on.
When the electromagnet is not energized, the spring pulls the armature away and the
circuit is not complete. In that case, the light is dark.

When you purchase relays, you generally have control over several variables:

 The voltage and current that is needed to activate the armature


 The maximum voltage and current that can run through the armature and the
armature contacts
 The number of armatures (generally one or two)
 The number of contacts for the armature (generally one or two -- the relay shown
here has two, one of which is unused)
 Whether the contact (if only one contact is provided) is normally open (NO) or
normally closed (NC)

24
2.3.3 Relay Applications:

In general, the point of a relay is to use a small amount of power in the


electromagnet coming, say, from a small dashboard switch or a low-power electronic
circuit -- to move an armature that is able to switch a much larger amount of power. For
example, you might want the electromagnet to energize using 5 volts and 50 milliamps
(250 mill watts), while the armature can support 120V AC at 2 amps (240 watts).

Relays are quite common in home appliances where there is an electronic


control turning on something like a motor or a light. They are also common in cars,
where the 12V supply voltage means that just about everything needs a large amount of
current. In later model cars, manufacturers have started combining relay panels into the
fuse box to make maintenance easier.

In places where a large amount of power needs to be switched, relays are often
cascaded. In this case, a small relay switches the power needed to drive a much larger
relay, and that second relay switches the power to drive the load.

Relays can also be used to implement Boolean logic.

2.3.4 Advantages of Relay:

 Relays can switch AC and DC, transistors can only switch DC.
 Relays can switch high voltages, transistors cannot.
 Relays are a better choice for switching large currents (> 5A).
 Relays can switch many contacts at once.

2.4 ULN2003

ULN is mainly suited for interfacing between low-level circuits and multiple
peripheral power loads,.The series ULN20XX high voltage, high current darlington
arrays feature continuous load current ratings. The driving circuitry in- turn decodes the
coding and conveys the necessary data to the stepper motor, this module aids in the
movement of the arm through step.

25
Fig.2.12 block diagram of ULN2003

The driver makes use of the ULN2003 driver IC, which contains an array of 7
power Darlington arrays, each capable of driving 500mA of current
At an approximate duty cycle, depending on ambient temperature and
number of drivers turned on, simultaneously typical power loads totaling over 230w can
be controlled.
The device has base resistors, allowing direct connection to any common logic
family. All the emitters are tied together and brought out to a separate terminal. Output
protection diodes are included; hence the device can drive inductive loads with minimum
extra components. Typical loads include relays, solenoids, stepper motors, magnetic print
hammers, multiplexed LED, incandescent displays and heaters.
2.4.1 Darlington Pair

A Darlington pair is two transistors that act as a single transistor but with a much
higher current gain.

26
Current gain
Transistors have a characteristic called current gain. This is referred to as its hFE.
The amount of current that can pass through the load when connected to a transistor that
is turned on equals the input current x the gain of the transistor (hFE) The current gain
varies for different transistor and can be looked up in the data sheet for the device.
Typically it may be 100 This would mean that the current available to drive the load
would be 100 times larger than the input to the transistor.

Fig.2.13 block diagram of current gain

2.4.2 Uses

In some application the amount of input current available to switch on a transistor


is very low. This may mean that a single transistor may not be able to pass sufficient
current required by the load.

As stated earlier this equals the input current x the gain of the transistor (hFE). If it
is not be possible to increase the input current then we need to increase the gain of the
transistor. This can be achieved by using a Darlington Pair.

A Darlington Pair acts as one transistor but with a current gain that equals:

Total current gain (hFE total) = current gain of transistor 1 (hFE t1) x current gain of
transistor 2 (hFE t2)

So for example if you had two transistors with a current gain (hFE) = 100:

(hFE total) = 100 x 100

27
(hFE total) = 10,000

You can see that this gives a vastly increased current gain when compared to a single
transistor. Therefore this will allow a very low input current to switch a much bigger load
current.

2.4.3 Base Activation Voltage

Normally to turn on a transistor the base input voltage of the transistor will need to be
greater that 0.7V. As two transistors are used in a Darlington Pair this value is doubled.
Therefore the base voltage will need to be greater than 0.7V x 2 = 1.4V.

It is also worth noting that the voltage drop across collector and emitter pins of
the Darlington Pair when the turn on will be around 0.9V Therefore if the supply voltage
is 5V (as above) the voltage across the load will be will be around 4.1V (5V – 0.9V)

2.5 HT9170B-- DTMF RECIEVER

The HT9170B/D are Dual Tone Multi Frequency (DTMF) receivers integrated
with digital decoder and band split filter functions as well as power-down mode and
inhibit mode operations. Such devices use digital counting techniques to detect and
decode all the 16 DTMF tone pairs into a 4-bit code output.

Highly accurate switched capacitor filters are implemented to divide tone signals
into low and high group signals. A built-in dial tone rejection circuit is provided to
eliminate the need for pre-filtering.

2.5.1 1FEAUTURES:

 Operating voltage: 2.5V~5.5V


 Minimal external components
 No external filter is required
 Low standby current (on power down mode)
 Excellent performance
 Tristate data output for MCU interface
 3.58MHz crystal or ceramic resonator
28
2.5.2 Block diagram DTMF receiver

fig.2.14 block daigram of DTMF receiver

2.5.3 functional description


The HT9170B/D tone decoders consist of three band pass filters and two digital
decode circuits to convert a tone (DTMF) signal into digital code output.
An operational amplifier is built-in to adjust the input signal. The pre-filter is a
band rejection filter, which reduces the dialing tone from 350Hz to 400Hz.
The low group filter filters low group frequency signal output whereas the high
group filter filters high group Frequency signal output. A zero-crossing detector with
follows each filters output hysteretic. When each signal amplitude at the output exceeds
the specified level, it is transferred to full swing logic signal.
When input signals are recognized to be effective, DV becomes high, and the
correct tone code (DTMF) digit is transferred.

29
2.5.4 Steering control circuit
The steering control circuit is used for measuring the effective signal duration and
for protecting against drop out of valid signals. It employs the analog delay by external
RC time-constant controlled by EST.
The EST pin is normally low and draws the RT/GT pin to keep low through
discharge of external RC. When a valid tone input is detected, EST goes high to charge
RT/GT through RC.
When the voltage of RT/GT changes from 0 to VTRT (2.35V for 5V
supply), the input signal is effective, and the code detector will create the correct code.
After D0~D3 are completely latched, DV output becomes high. When the voltage of
RT/GT falls down from VDD to VTRT (i.e. when there is no input tone), DV output
becomes Low, and D0~D3 keeps data until a next valid tone input is produced. By
selecting adequate external RC value, the minimum acceptable input tone duration
(tACC) and the minimum acceptable inter-tone rejection (tIR) can be set. External
Components (R, C) are chosen by the formula.

tACC=tDP+tGTP;
tIR=tDA+tGTA;
Where tACC: Tone duration acceptable time
TDP: EST output delay time (_L__H_)
TGTP: Tone present time
TIR: Inter-digit pause rejection time
TDA: EST output delay time (_H__L_)
tGTA: Tone absent time

30
TIMING DIAGRAM

Fig.2.15 Timing diagram of DTMF receiver

2.5.5 Applications
 PABX
 Central office
 Mobile radio
 Remote control
 Remote data entry
Call limiting
 Telephone answering systems

31
CHAPTER 3

CIRCUIT DIAGRAM
3.1 Circuits diagram of project

Fig.3.1 circuit diagram of project

32
3.2 CIRCUIT OPERATION

The goal of the project is to develop a system, which uses Mobile technology that
keeps control of the various units of the automobiles, which executes with respect to the
signal sent by the mobile.

For utilization of appliances the new concept has been thought to manage them
remotely by using GSM (DTMF), which enables the user to remotely control switching
of domestic appliances. Just by dialing keypad of remote telephone, from where you are
calling you can perform ON / OFF operation of the appliances.
The ranges of appliances that can be controlled through tele remote systems are
many in numbers. Some of them are as follows and this depends upon the usage priority
of the appliances i.e. Industrial appliances, Music System or other electrical / electronic
appliances.

3.3 SOURCE CODE

#include<reg51.h>

sbit bulb=P2^0;

sbit fan=P2^1;

sbit plug=P2^2;

void main()

while(1)

P3=0xff;

P2=0x00;

if(P3==0xf1)

bulb=1;

33
}

if(P3==0xf2)

fan=1;

if(P3==0xf3)

plug=1;

if(P3==0Xf4)

bulb=0;

if(P3==0xf5)

fan=0;

if(P3==0xf6)

plug=0;

34
3.4 FLOW CART

START

Initialization of Microcontroller

Initialization of DTMF decoder

Initialization ULN

If DTMF
output is 1 Devise one is on

If DTMF
output is 2 Devise two is on

If DTMF
output is 3 Devise three is on

Fig.3.2(a) flowchart

35
A

If DTMF
output is 4 Devise one is off

If DTMF
output is 5 Devise two is off

If DTMF
output is 6 Devise three is off

stop

Fig.3.2 flow chart of project

CHAPTER 4

36
ADVANTAGES, DISADVANTAGES & APPLICATION
4.1 ADVANTAGES

 In this project we are used a simple microcontroller based device operation such
that circuit are less complex.
 We are used a simple DTMF based controlling of devices, so compared to other
methods of controlling this project requires low cost.

 We can also save our valuable time with this project by remote operating of
devices.

4.2 DISADVANTAGES

 When Power Is Off, Then The Total System Is Off, So All Ways Required
Battery.

4.3 APPLICATION
 It is used in Automobiles for turn on and turn off vehicles parts like vehicles
doors etc..
 It is also used in Industries for remote operating of motors drives, furnaces, cranes
etc..
 It is also useful in home application for switching on and off various equipment
used in home.

FUTURE SCOPE

37
Our effort towards building the home automation concept did not utilise the
microcontroller concept. Using microcontroller in place of decoder will bring more
control techniques towards home automation.

This project can be further enhanced to the High voltage A.C Applications by
changing the ratings of the Relay.

We can control and monitor the high speed induction motors as well as
synchronous motors. This can be done in an economical way.

We can also add some security features in the circuit. One of the way is password
protection. Through this only selected people can access this control over the home
appliances.

In this project in future we can add a multimedia camera to see what is going
inside the home by sitting in office or somewhere.

RESULT AND ANALYSIS

38
The project “Development of Cell-phone Based Device Control with Voice
Acknowledgement" an effective switching system for controlling home and office
appliances.” has been successfully designed and tested. It has been developed by
integrating features of all the hardware components used. Presence of every module has
been reasoned out and placed carefully thus contributing to the best working of the unit.
Secondly, using highly advanced IC’s and with the help of growing technology the
project has been successfully implemented.

CONCLUSION

39
The project “DTMF BASED DEVICE CONTROLLING” has been successfully
designed and tested.
It has been developed by integrating features of all the hardware components
used. Presence of every module has been reasoned out and placed carefully thus
contributing to the best working of the unit.

Secondly, using highly advanced IC’s and with the help of growing technology
the project has been successfully implemented.

REFERENCES

40
1. "The 8051 Microcontroller Architecture, Programming & Applications"

By Kenneth J Ayala.

2. "The 8051 Microcontroller & Embedded Systems" by Mohammed Ali Mazidi


and Janice Gillispie Mazidi

3. "Power Electronics” by M D Singh and K B Khanchandan

4. "Linear Integrated Circuits” by D Roy Choudary & Shail Jain

5. "Electrical Machines” by S K Bhattacharya

6. "Electrical Machines II” by B L Thereja

7.Waldherr, S., Thrun, S., and Romero, R., “A Gesture based interface for
Human-Robot Interaction”, Kluwer Academic Publishers, Netherland, 2000

8. Liu, T., Guo, H., and Wang, Y., “A new approach for colorbased object
recognition with fusion of color models”, Congress on Image and Signal Processing
Conference, Sanya-China, vol. 3, pp. 456-460, May 2008.

9. Wang, B., and Yuan, T., “Traffic Police Gesture Recognition using
Accelerometer”, IEEE SENSORS Conference, Lecce-Italy,pp. 1080-1083, Oct. 2008.

10.Lalanne, T., and Lempereur, C., “Color recognition with a camera: a


supervised algorithm for classification”, IEEE Southwest Symposium on Image Analysis
and Interpretation, Tucson-Arizona, pp. 198- 204, April 1998.

11. R. Sharma, K. Kumar, and S. Viq, “DTMF Based Remote Control System,”
IEEE International Conference ICIT 2006, pp. 2380-2383, December 2006.

12. R.C. Luo, T.M. Chen, and C.C. Yih, “Intelligent autonomous mobile robot
control through the Internet,”IEEE International.

41

You might also like