You are on page 1of 67

A

PROJECT REPORT
ON

“PROTECTION OF POWER TRANSFORMER BASED ON


OIL TEMPERATURE”
Submitted in the partial fulfillment of the
Requirements
For the award of
DIPLOMA
in
ELECTRICAL AND ELECTRONICS ENGINEERING

SUBIMITTED BY:-
P.NAVEEN KUMAR 16541-EE-034
Under the Esteemed Guidance
Mr. R. SRAVAN
(Asst. PROFESSOR)
Department of Electrical and Electronics Engineering
AURORA’S POLYTECH ACADEMY
Bandlaguda, Hyderabad-500005, Ph: 040-64573435.

EEE dept [1]


CONTENTS
ABSTRACT 4
CHAPTER-1 5 -13
INTRODUCTION
1.1 Introduction of Project
1.2 Introduction of Embedded system
1.3 Introduction of Microcontroller
CHAPTER-2: 14 - 21
BLOCK DIAGRAM AND CIRCUIT DESCRIPTION
2.1 Block Diagram
2.2 Block Diagram Description
2.3 Circuit Diagram
2.4 Circuit Description
CHAPTER-3: 22 - 57
COMPONENT DESCRIPTION
3.1 Power supply
3.2 Microcontroller
3.3 LCD
3.4 Temperature sensor (NTC Thermistor 10k).
3.5 Relay driver
3.6 Relay
CHAPTER-4: 58 - 59
ADVANTAGES, DISADVANTAGES AND APPLICATIONS
4.1 Advantages
4.2 Disadvantages
4.3 Applications
CHAPTER-5: 60 - 68
SOFTWARE DESCRIPTION AND CODING
5.1 Introduction of keil
5.2 Code

EEE dept [2]


CHAPTER-6: 65
CONCLUSION
CHAPTER-7: 67
REFERENCE

EEE dept [3]


ABSTRACT

Now a day the power is the main consideration in every field. Transformers make an
important role in the power distribution. The power which is generated in huge amount at
power stations can undergo many stages .In these stages transformers play an important
role. But due the increase in the load the transformers gets heated and finally there may
be chance to get damage of transformer. So there is need to Capture the temperature of
transformer oil and shut down the transformer.

This project is intended to protect the main transformers. This project mainly deals with
measuring oil temperature. Here the oil temperature is continuously monitored using
sensors. If the sensor output (i.e. load) exceeds some predefined value, then the
transformer gets shut down using a relay.

EEE dept [4]


CHAPTER-1
INTRODUCTION

EEE dept [5]


1.1INTRODUCTION OF PROJECT

The Project designed with Peripheral Interface Controller Utility companies has
enormous amounts of money invested in transformers of all types, including distribution
and power transformer. Operating, maintaining, and inspecting all power transformers are
not an easy work. In order to reduce burden on maintenance of such transformers a new
idea has been discovered.

This project is mainly used to protect the transformer from getting worn out due
to electrical disturbances. The oil temperature of the transformers give to Controller and
the output signal is provided to operate a relay by comparing the base values with the
operating oil temperature. The application consists of a board of electronic components
inclusive of a microcontroller with programmable logic. It has been designed to work
with high accuracy. The transformer oil temperature fed to the Controller as base values.
The oil temperature value during the operation of the power transformer is monitored and
fed to the controller. By comparing these values the Peripheral Interface Controller
produces a trip signal which operates the relay and in turn the connectivity between main
supply and the power transformer is cut off, thus protecting the power transformer from
burning/damage.

1.2 INTRODUCTION TO EMBEDDED SYSTEMS

Embedded systems are electronic devices that incorporate microprocessors with in their
implementations. The main purposes of the microprocessors are to simplify the system
design and provide flexibility. Having a microprocessor in the device helps in removing
the bugs, making modifications, or adding new features are only matter of rewriting the
software that controls the device. Or in other words embedded computer systems are
electronic systems that include a microcomputer to perform a specific dedicated
application. The computer is hidden inside these products. Embedded systems are
ubiquitous. Every week millions of tiny computer chips come pouring out of factories
finding their way into our everyday products.
Embedded systems are self-contained programs that are embedded within a piece of
hardware. Whereas a regular computer has many different applications and software that

EEE dept [6]


can be applied to various tasks, embedded systems are usually set to a specific task that
cannot be altered without physically manipulating the circuitry. Another way to think of
an embedded system is as a computer system that is created with optimal efficiency, there
by allowing it to complete specific functions as quickly as possible.
Embedded systems designers usually have a significant grasp of hardware technologies.
They use specific programming languages and software to develop embedded systems
and manipulate the equipment. When searching online, companies offer embedded
systems development kits and other embedded systems tools for use by engineers and
businesses.

Embedded systems technologies are usually fairly expensive due to the necessary
development time and built in efficiencies, but they are also highly valued in specific
industries. Smaller businesses may wish to hire a consultant to determine what sort of
embedded systems will add value to their organization.

1.3 CHARACTERISTICS:
Two major areas of differences are cost and power consumption. Since many embedded
systems are produced in tens of thousands to millions of units range, reducing cost is a
major concern. Embedded systems often use a (relatively) slow processor and small
memory size to minimize costs.

The slowness is not just clock speed. The whole architecture of the computer is often
intentionally simplified to lower costs. For example, embedded systems often use
peripherals controlled by synchronous serial interfaces, which are ten to hundreds of
times slower than comparable peripherals used in PCs. Programs on an embedded system
often run with real-time constraints with limited hardware resources: often there is no
disk drive, operating system, keyboard or screen. A flash drive may replace rotating
media, and a small keypad and LCD screen may be used instead of a PC's keyboard and
screen.

EEE dept [7]


Firmware is the name for software that is embedded in hardware devices, e.g. in one or
more ROM/Flash memory IC chips. Embedded systems are routinely expected to
maintain 100% reliability while running continuously for long periods, sometimes
measured in years. Firmware is usually developed and tested too much harsher
requirements than is general-purpose software, which can usually be easily restarted if a
problem occurs.

PLATFORM:
There are many different CPU architectures used in embedded designs. This in contrast to
the desktop computer market which is limited to just a few competing architectures
mainly the Intel/AMD x86 and the Apple/Motorola/IBM Power PC’s which are used in
the Apple Macintosh. One common configuration for embedded systems is the system on
a chip, an application-specific integrated circuit, for which the CPU was purchased as
intellectual property to add to the IC's design.

TOOLS:
Like a typical computer programmer, embedded system designers use compilers,
assemblers and debuggers to develop an embedded system. Those software tools can
come from several sources:
Software companies that specialize in the embedded market Ported from the GNU
software development tools. Sometimes, development tools for a personal computer can
be used if the embedded processor is a close relative to a common PC processor.
Embedded system designers also use a few software tools rarely used by typical
computer programmers. Some designers keep a utility program to turn data files into
code, so that they can include any kind of data in a program. Most designers also have
utility programs to add a checksum or CRC to a program, so it can check its program data
before executing it.

OPERATING SYSTEM:

EEE dept [8]


They often have no operating system, or a specialized embedded operating system (often
a real-time operating system), or the programmer is assigned to port one of these to the
new system.

DEBUGGING:
Debugging is usually performed with an in-circuit emulator, or some type of debugger
that can interrupt the micro controller’s internal microcode. The microcode interrupt lets
the debugger operate in hardware in which only the CPU works. The CPU-based
debugger can be used to test and debug the electronics of the computer from the
viewpoint of the CPU.

Developers should insist on debugging which shows the high-level language, with
breakpoints and single stepping, because these features are widely available. Also,
developers should write and use simple logging facilities to debug sequences of real-time
events. PC or mainframe programmers first encountering this sort of programming often
become confused about design priorities and acceptable methods. Mentoring, code-
reviews and ego less programming are recommended.

DESIGN OF EMBEDDED SYSTEMS:


The electronics usually uses either a microprocessor or a microcontroller. Some large or
old systems use general-purpose mainframes computers or minicomputers.

START-UP:
All embedded systems have start-up code. Usually it disables interrupts, sets up the
electronics, tests the computer (RAM, CPU and software), and then starts the application
code. Many embedded systems recover from short-term power failures by restarting
(without recent self-tests). Restart times under a tenth of a second are common.
Many designers have found one of more hardware plus software-controlled LED’s useful
to indicate errors during development (and in some instances, after product release, to
produce troubleshooting diagnostics). A common scheme is to have the electronics turn
off the LED(s) at reset, whereupon the software turns it on at the first opportunity, to

EEE dept [9]


prove that the hardware and start-up software have performed their job so far. After that,
the software blinks the LED(s) or sets up light patterns during normal operation, to
indicate program execution progress and/or errors. This serves to reassure most
technicians/engineers and some users.

THE CONTROL LOOP:


In this design, the software has a loop. The loop calls subroutines. Each subroutine
manages a part of the hardware or software. Interrupts generally set flags, or update
counters that are read by the rest of the software. A simple API disables and enables
interrupts. Done right, it handles nested calls in nested subroutines, and restores the
preceding interrupt state in the outermost enable. This is one of the simplest methods of
creating an exocrine.

Typically, there's some sort of subroutine in the loop to manage a list of software timers,
using a periodic real time interrupt. When a timer expires, an associated subroutine is run,
or flag is set. Any expected hardware event should be backed-up with a software timer.
Hardware events fail about once in a trillion times.

State machines may be implemented with a function-pointer per state-machine (in C++,
C or assembly, anyway). A change of state stores a different function into the pointer.
The function pointer is executed every time the loop runs.

Many designers recommend reading each IO device once per loop, and storing the result
so the logic acts on consistent values. Many designers prefer to design their state
machines to check only one or two things per state. Usually this is a hardware event, and
a software timer. Designers recommend that hierarchical state machines should run the
lower-level state machines before the higher, so the higher run with accurate information.

Complex functions like internal combustion controls are often handled with multi-
dimensional tables. Instead of complex calculations, the code looks up the values. The
software can interpolate between entries, to keep the tables small and cheap.

EEE dept [10]


One major disadvantage of this system is that it does not guarantee a time to respond to
any particular hardware event. Careful coding can easily assure that nothing disables
interrupts for long. Thus interrupt code can run at very precise timings. Another major
weakness of this system is that it can become complex to add new features. Algorithms
that take a long time to run must be carefully broken down so only a little piece gets done
each time through the main loop.

This system's strength is its simplicity, and on small pieces of software the loop is usually
so fast that nobody cares that it is not predictable. Another advantage is that this system
guarantees that the software will run. There is no mysterious operating system to blame
for bad behavior.

USER INTERFACES:
` Interface designers at PARC, Apple Computer, Boeing and HP
minimize the number of types of user actions. For example, use two buttons (the absolute
minimum) to control a menu system (just to be clear, one button should be "next menu
entry" the other button should be "select this menu entry"). A touch-screen or screen-edge
buttons also minimize the types of user actions.

Another basic trick is to minimize and simplify the type of output. Designs should
consider using a status light for each interface plug, or failure condition, to tell what
failed. A cheap variation is to have two light bars with a printed matrix of errors that they
select- the user can glue on the labels for the language that she speaks.

For example, Being's standard test interface is a button and some lights. When you press
the button, all the lights turn on. When you release the button, the lights with failures stay
on. The labels are in Basic English.

Designers use colors. Red defines the users can get hurt- think of blood. Yellow defines
something might be wrong. Green defines everything's OK.

EEE dept [11]


Another essential trick is to make any modes absolutely clear on the user's display. If an
interface has modes, they must be reversible in an obvious way. Most designers prefer the
display to respond to the user. The display should change immediately after a user action.
If the machine is going to do anything, it should start within 7 seconds, or give progress
reports.

One of the most successful general-purpose screen-based interfaces is the two menu
buttons and a line of text in the user's native language. It's used in pagers, medium-priced
printers, network switches, and other medium-priced situations that require complex
behavior from users. When there's text, there are languages. The default language should
be the one most widely understood.

1.3.1.1 INTRODUCTION TO MICROCONTROLLER


Microcontrollers as the name suggests are small controllers. They are like single chip
computers that are often embedded into other systems to function as
processing/controlling unit. For example the remote control you are using probably has
microcontrollers inside that do decoding and other controlling functions. They are also
used in automobiles, washing machines, microwave ovens, toys ... etc, where automation
is needed.

Micro-controllers are useful to the extent that they communicate with other devices, such
as sensors, motors, switches, keypads, displays, memory and even other micro-
controllers. Many interface methods have been developed over the years to solve the
complex problem of balancing circuit design criteria such as features, cost, size, weight,
power consumption, reliability, availability, manufacturability. Many microcontroller
designs typically mix multiple interfacing methods. In a very simplistic form, a micro-
controller system can be viewed as a system that reads from (monitors) inputs, performs
processing and writes to (controls) outputs.

Embedded system means the processor is embedded into the required application. An
embedded product uses a microprocessor or microcontroller to do one task only. In an

EEE dept [12]


embedded system, there is only one application software that is typically burned into
ROM. Example: printer, keyboard, video game player
1) Microprocessor - A single chip that contains the CPU or most of the computer
2) Microcontroller - A single chip used to control other devices
Microcontroller differs from a microprocessor in many ways. First and the most
important is its functionality. In order for a microprocessor to be used, other components
such as memory, or components for receiving and sending data must be added to it. In
short that means that microprocessor is the very heart of the computer. On the other hand,
microcontroller is designed to be all of that in one. No other external components are
needed for its application because all necessary peripherals are already built into it. Thus,
we save the time and space needed to construct devices.

MICROPROCESSOR VS MICROCONTROLLER:
Microprocessor:
1) CPU is stand-alone, RAM, ROM, I/O, timer are separate
2) Designer can decide on the amount of ROM, RAM and I/O ports.
3) expensive
4) versatility general-purpose
Microcontroller:
1) CPU, RAM, ROM, I/O and timer are all on a single chip
2) fix amount of on-chip ROM, RAM, I/O ports
3) for applications in which cost, power and space are critical
4) single-purpose

EEE dept [13]


CHAPTER-2
BLOCK DIAGRAM AND CIRCUIT
DIAGRAM EXPLANATION

EEE dept [14]


2.1 BLOCK DIAGRAM

Block diagram:

2.2 BLOCK DIAGRAM DESCRIPTION

In this project total we have 6 blocks which are

1) Power supply
2) Microcontroller
3) LCD
4) Temperature sensor (NTC Thermistor 10k).
5) Relay Driver
6) Relay

EEE dept [15]


Power Supply Block

In-order to work with any components basic requirement is power supply. In this section
there is a requirement of 5V regulated DC power supply. This block converts 230V AC
in to 5V DC.

Microcontroller Block

This blocked is used to control its interfacing devices (ADC, LCD, BUZZER, and
RELAY) according to given code.

L.C.D

LCD means liquid crystal display this block is used to display the power factor states.

Temperature sensor

This block is used for measuring oil temperature and corresponding digital signal to
microcontroller

RELAY

This block is used on/off the load according to oil temperature.

2.3 CIRCUIT DIAGRAM

EEE dept [16]


2.4 CIRCUIT DESCRIPTION
DESIGNING:

Since the main intension of this project is to design a WIRELESS SCRUTINIZER FOR
DETECTING THE FAULT IN TRANSMISSION LINE.

In order to fulfill this application there are few steps that has been performed i.e.

1) Designing the power supply for the entire circuitry.


2) Selection of microcontroller that suits our application.
3) Selection of RF.
4) Complete studies of all the above points are useful to develop this project.
POWER SUPPLY SECTION:

EEE dept [17]


In-order to work with any components basic requirement is power supply. In this section
there is a requirement of 5V DC power supply voltage levels.

Now the aim is to design the power supply section which converts 230V AC in to 5V
DC. Since 230V AC is too high to reduce it to directly 5V DC, therefore we need a step-
down transformer that reduces the line voltage to certain voltage that will help us to
convert it in to a 5V DC. Considering the efficiency factor of the bridge rectifier, we
came to a conclusion to choose a transformer, whose secondary voltage is 3 to 4 V higher
than the required voltage i.e. 5V. For this application 0-12V transformers is used, since it
is easily available in the market.

The output of the transformer is 12V AC; it feed to rectifier that converts AC to pulsating
DC. As we all know that there are 3 kind of rectifiers that is

1) half wave
2) Full wave and
3) Bridge rectifier
Here we short listed to use Bridge rectifier, because half wave rectifier has we less in
efficiency. Even though the efficiency of full wave and bridge rectifier are the same,
since there is no requirement for any negative voltage for our application, we gone with
bridge rectifier.

Since the output voltage of the rectifier is pulsating DC, in order to convert it into pure
DC we use a high value (1000UF/1500UF) of capacitor in parallel that acts as a filter.
The most easy way to regulate this voltage is by using a 7805 voltage regulator, whose
output voltage is constant 5V DC irrespective of any fluctuation in line voltage.

SELECTION OF MICROCONTROLLER:

As we know that there so many types of micro controller families that are available in the
market.

Those are

1) 8051 Family

2) AVR microcontroller Family

EEE dept [18]


3) PIC microcontroller Family

4) ARM Family

Basic 8051 family is enough for our application; hence we are not concentrating on
higher end controller families. In order to fulfill our application basic that is AT89C51
controller is enough. But still we selected AT89S52 controller because of inbuilt ISP (in
system programmer) option.

There are minimum six requirements for proper operation of microcontroller.

Those are:

1) power supply section


2) pull-ups for ports (it is must for PORT0)
3) Reset circuit
4) Crystal circuit
5) ISP circuit (for program dumping)
6) EA/VPP pin is connected to Vcc.

PORT0 is open collector that’s why we are using pull-up resistor which makes PORT0 as
an I/O port. Reset circuit is used to reset the microcontroller. Crystal circuit is used for
the microcontroller for timing pluses. In this project we are not using external memory
that’s why EA/VPP pin in the microcontroller is connected to Vcc that indicates internal
memory is used for this application.

SELECTION OF LCD:

A liquid crystal display (LCD) is an electronically-modulated optical device shaped into a


thin, flat panel made up of any number of color or monochrome pixels filled with liquid
crystals and arrayed in front of a light source (backlight) or reflector.

CIRCUIT OPERATION:

EEE dept [19]


Protection of transformer is developing basing on a micro controller 89s52. the
transformer temperature of oil measured by temperature circuit and feed that digital
signal to the micro controller. That microcontroller continuously monitoring oil
temperature. When the oil temperature value is exceeding the predefined value the
microcontroller will give signal to relay driver so relay disconnect load from transformer
and display on LCD like load is disconnected due to over temperature.

EEE dept [20]


CHAPTER-3

COMPONENT DESCRIPTION

EEE dept [21]


3.1 POWER SUPPLY:
Block diagram:

Figure: Power Supply

Circuit diagram:

Description:
Transformer : A transformer is a device that transfers electrical energy from one circuit to
another through inductively coupled conductors—the transformer's coils. A varying
current in the first or primary winding creates a varying magnetic flux in the
transformer's core, and thus a varying magnetic field through the secondary winding.
This varying magnetic field induces a varying electromotive force (EMF) or "voltage" in
the secondary winding. This effect is called mutual induction.

EEE dept [22]


Figure: Transformer Symbol
(or)
Transformer is a device that converts the one form energy to another form of energy like
a transducer.

Figure: Transformer

Basic Principle :
A transformer makes use of Faraday's law and the ferromagnetic properties of an iron
core to efficiently raise or lower AC voltages. It of course cannot increase power so that
if the voltage is raised, the current is proportionally lowered and vice versa.

EEE dept [23]


Figure: Basic Principle

Transformer Working:
A transformer consists of two coils (often called 'windings') linked by an iron core, as
shown in figure below. There is no electrical connection between the coils, instead they
are linked by a magnetic field created in the core.

Figure: Basic Transformer

EEE dept [24]


Transformers are used to convert electricity from one voltage to another with minimal
loss of power. They only work with AC (alternating current) because they require a
changing magnetic field to be created in their core. Transformers can increase voltage
(step-up) as well as reduce voltage (step-down).
Alternating current flowing in the primary (input) coil creates a continually changing
magnetic field in the iron core. This field also passes through the secondary (output) coil
and the changing strength of the magnetic field induces an alternating voltage in the
secondary coil. If the secondary coil is connected to a load the induced voltage will make
an induced current flow. The correct term for the induced voltage is 'induced
electromotive force' which is usually abbreviated to induced e.m.f.
The iron core is laminated to prevent 'eddy currents' flowing in the core. These are
currents produced by the alternating magnetic field inducing a small voltage in the core,
just like that induced in the secondary coil. Eddy currents waste power by needlessly
heating up the core but they are reduced to a negligible amount by laminating the iron
because this increases the electrical resistance of the core without affecting its magnetic
properties.
Transformers have two great advantages over other methods of changing voltage:
1. They provide total electrical isolation between the input and output, so they can
be safely used to reduce the high voltage of the mains supply.
2. Almost no power is wasted in a transformer. They have a high efficiency (power
out / power in) of 95% or more.
Classification of Transformer:
 Step-Up Transformer
 Step-Down Transformer
Step-Down Transformer:
Step down transformers are designed to reduce electrical voltage. Their primary voltage
is greater than their secondary voltage. This kind of transformer "steps down" the voltage
applied to it. For instance, a step down transformer is needed to use a 110v product in a
country with a 220v supply.
Step down transformers convert electrical voltage from one level or phase configuration
usually down to a lower level. They can include features for electrical isolation, power
distribution, and control and instrumentation applications. Step down transformers

EEE dept [25]


typically rely on the principle of magnetic induction between coils to convert voltage
and/or current levels.
Step down transformers are made from two or more coils of insulated wire wound around
a core made of iron. When voltage is applied to one coil (frequently called the primary or
input) it magnetizes the iron core, which induces a voltage in the other coil, (frequently
called the secondary or output). The turn’s ratio of the two sets of windings determines
the amount of voltage transformation.

Figure: Step-Down Transformer


An example of this would be: 100 turns on the primary and 50 turns on the secondary, a
ratio of 2 to 1.
Step down transformers can be considered nothing more than a voltage
ratio device.
With step down transformers the voltage ratio between primary and secondary will mirror
the "turn’s ratio" (except for single phase smaller than 1 KVA which have compensated
secondary). A practical application of this 2 to 1 turn’s ratio would be a 480 to 240
voltage step down. Note that if the input were 440 volts then the output would be 220
volts. The ratio between input and output voltage will stay constant. Transformers should
not be operated at voltages higher than the nameplate rating, but may be operated at
lower voltages than rated. Because of this it is possible to do some non-standard
applications using standard transformers.
Single phase step down transformers 1 KVA and larger may also be reverse connected to
step-down or step-up voltages. (Note: single phase step up or step down transformers
sized less than 1 KVA should not be reverse connected because the secondary windings
have additional turns to overcome a voltage drop when the load is applied. If reverse
connected, the output voltage will be less than desired.)

EEE dept [26]


Step-Up Transformer:
A step up transformer has more turns of wire on the secondary coil, which makes a larger
induced voltage in the secondary coil. It is called a step up transformer because the
voltage output is larger than the voltage input.
Step-up transformer 110v 220v design is one whose secondary voltage is greater than its
primary voltage. This kind of transformer "steps up" the voltage applied to it. For
instance, a step up transformer is needed to use a 220v product in a country with a 110v
supply.
A step up transformer 110v 220v converts alternating current (AC) from one voltage to
another voltage. It has no moving parts and works on a magnetic induction principle; it
can be designed to "step-up" or "step-down" voltage. So a step up transformer increases
the voltage and a step down transformer decreases the voltage.
The primary components for voltage transformation are the step up transformer core and
coil. The insulation is placed between the turns of wire to prevent shorting to one another
or to ground. This is typically comprised of Mylar, name, Kraft paper, varnish, or other
materials. As a transformer has no moving parts, it will typically have a life expectancy
between 20 and 25 years.

Figure: Step-Up Transformer


Applications
Generally these Step-Up Transformers are used in industries applications only.
Turns Ratio and Voltage
The ratio of the number of turns on the primary and secondary coils determines the ratio
of the voltages...

EEE dept [27]


...where Vp is the primary (input) voltage, Vs is the secondary (output) voltage, Np is the
number of turns on the primary coil, and Ns is the number of turns on the secondary coil

3.2 DESCRIPTION OF MICROCONTROLLER 89S52


Features:
 8K Bytes of In-System Reprogrammable Flash Memory
 Endurance: 1,000 Write/Erase Cycles
 Fully Static Operation: 0 Hz to 24 MHz
 256 x 8-bit Internal RAM
 32 Programmable I/O Lines
 Three 16-bit Timer/Counters
 Eight Interrupt Sources
 Programmable Serial Channel
 Low-power Idle and Power-down Modes

The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with


8Kbytes of Flash programmable and erasable read only memory (PEROM). The on-chip
Flash allows the program memory to be reprogrammed in-system or by a conventional
nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a
monolithic chip, the Atmel AT89C52 is a powerful microcomputer, which provides a
highly flexible and cost-effective solution to many embedded control applications.

EEE dept [28]


PIN DIAGRAM - AT89S52:

Pin Description:
VCC - Supply voltage.
GND - Ground.
Port 0:
Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-
impedance inputs. Port 0 can also be configured to be the multiplexed low-order
address/data bus during accesses to external program and data memory. In this mode, P0
has internal pull-ups. Port 0 also receives the code bytes during Flash programming and

EEE dept [29]


outputs the code bytes during program verification. External pull-ups are required during
program verification.
Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are
externally being pulled low will source current (IIL) because of the internal pull-ups. In
addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input
(P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively.
Port Pin Alternate Functions:
P1.0 T2 (external count input to Timer/Counter 2), clock-out
P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction control
Port 2:
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are
externally being pulled low will source current (I IL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory
and during accesses to external data memory that uses 16-bit addresses (MOVX @
DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During
accesses to external data memory that uses 8-bit addresses (MOVX @ RI); Port 2 emits
the contents of the P2 Special Function Register. Port 2 also receives the high-order
address bits and some control signals during Flash programming and verification.
Port 3:
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers
can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high
by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are
externally being pulled low will source current (I IL) because of the pull-ups. Port 3 also
serves the functions of various special features of the AT89C51. Port 3 also receives
some control signals for Flash programming and verification.
Port Pin Alternate Functions:
P3.0 RXD (serial input port)

EEE dept [30]


P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe).
Rst:
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device.
Ale/Prog:
Address Latch Enable is an output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during
flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the
oscillator frequency and may be used for external timing or clocking purposes. However,
that one ALE pulse is skipped during each access to external data memory. If desired,
ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set,
ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly
pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external
execution mode.
Psen:
Program Store Enable is the read strobe to external program memory. When the
AT89C52 is executing code from external program memory, PSEN is activated twice
each machine cycle, except that two PSEN activations are skipped during each access to
external data memory.
Ea/Vpp:
External Access Enable (EA) must be strapped to GND in order to enable the device to
fetch code from external pro-gram memory locations starting at 0000H up to FFFFH.
However, if lock bit 1 is programmed, EA will be internally latched on reset. EA should
be strapped to VCC for internal program executions. This pin also receives the 12V

EEE dept [31]


programming enable voltage (VPP) during Flash programming when 12V programming
is selected.
Xtal1:
Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
Xtal2:
It is an output from the inverting oscillator amplifier.
Block Diagram of 89S52:

EEE dept [32]


Architecture of 8052 Microcontroller:

Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier,
which can be configured for use as an on-chip oscillator. Either a quartz crystal or
ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 is driven. There are no requirements
on the duty cycle of the external clock signal, since the input to the internal clocking
circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high
and low time specifications must be observed.

Idle Mode:
In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain
active. The mode is invoked by software. The content of the on-chip RAM and all the

EEE dept [33]


special functions registers remain unchanged during this mode. The idle mode can be
terminated by any enabled interrupt or by a hardware reset. It should be noted that
when idle is terminated by a hardware reset, the device normally resumes program
execution, from where it left off, up to two machine cycles before the internal reset
algorithm takes control. On-chip hardware inhibits access to internal RAM in this
event, but access to the port pins is not inhibited. To eliminate the possibility of an
unexpected write to a port pin when Idle is terminated by reset, the instruction
following the one that invokes Idle should not be one that writes to a port pin or to
external memory.
Oscillator Connections:

Note: C1, C2 = 30 pF ± 10 pF for Crystals


= 40 pF ± 10 pF for Ceramic Resonators

EEE dept [34]


External Clock drives Configuration.

3.3 LCD (Liquid Cristal Display):


A liquid crystal display (LCD) is a thin, flat display device made up of any number of
color or monochrome pixels arrayed in front of a light source or reflector. Each pixel
consists of a column of liquid crystal molecules suspended between two transparent
electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to
each other. Without the liquid crystals between them, light passing through one would be
blocked by the other. The liquid crystal twists the polarization of light entering one filter
to allow it to pass through the other.
A program must interact with the outside world using input and output devices
that communicate directly with a human being. One of the most common devices
attached to a controller is an LCD display. Some of the most common LCDs connected to
the controllers are 16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1
line 16 characters per line by 2 lines and 20 characters per line by 2 lines, respectively.
Line lengths of 8, 16, 20, 24, 32 and 40 characters are all standard, in one, two many
microcontroller devices use 'smart LCD' displays to output visual information. LCD
displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it is
even possible to produce a readout using the 5X7 dots plus cursor of the display.

EEE dept [35]


They have a standard ASCII set of characters and mathematical symbols. For an 8-bit
data bus, the display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3
D2 D1 D0). For a 4-bit data bus it only requires the supply lines plus 6 extra lines (RS
RW D7 D6 D5 D4). When the LCD display is not enabled, data lines are tri-state and
they do not interfere with the operation of the microcontroller.
Features:
 Interface with either 4-bit or 8-bit microprocessor.
 Display data RAM
 Character generator ROM
 160 different 5 x7 dot-matrix character patterns.
 Display data RAM and character generator RAM may be Accessed by
the microprocessor.
 Numerous instructions
 Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF,
 Blink Character, Cursor Shift, Display Shift.
 Built-in reset circuit is triggered at power ON.
 Built-in oscillator.

Description Of 16x2:
This is the first interfacing example for the Parallel Port. We will start with something
simple. This example doesn't use the Bi-directional feature found on newer ports, thus it
should work with most, if no all Parallel Ports. It however doesn't show the use of the
Status Port as an input. So what are we interfacing? A 16 Character x 2 Line LCD
Module to the Parallel Port. These LCD Modules are very common these days, and are
quite simple to work with, as all the logic required running them is on board.

EEE dept [36]


Schematic Diagram:

 Above is the quite simple schematic. The LCD panel's Enable and Register Select is
connected to the Control Port. The Control Port is an open collector / open drain
output. While most Parallel Ports have internal pull-up resistors, there are a few
which don't. Therefore by incorporating the two 10K external pull up resistors, the
circuit is more portable for a wider range of computers, some of which may have no
internal pull up resistors.
 We make no effort to place the Data bus into reverse direction. Therefore we hard
wire the R/W line of the LCD panel, into write mode. This will cause no bus conflicts
on the data lines. As a result we cannot read back the LCD's internal Busy Flag which
tells us if the LCD has accepted and finished processing the last instruction. This
problem is overcome by inserting known delays into our program.
 The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy here.
As with all the examples, I've left the power supply out. You can use a bench power
supply set to 5v or use a onboard +5 regulator. Remember a few de-coupling
capacitors, especially if you have trouble with the circuit working properly.
 The 2 line x 16 character LCD modules are available from a wide range of
manufacturers and should all be compatible with the HD44780. The one I used to test
this circuit was a Power tip PC-1602F and an old Philips LTN211F-10 which was
EEE dept [37]
extracted from a Poker Machine! The diagram to the right, shows the pin numbers for
these devices. When viewed from the front, the left pin is pin 14 and the right pin is
pin 1

16 x 2 Alphanumeric LCD Module Features:


 Intelligent, with built-in Hitachi HD44780 compatible LCD controller and RAM
providing simple interfacing
 61 x 15.8 mm viewing area
 5 x 7 dot matrix format for 2.96 x 5.56 mm characters, plus cursor line
 Can display 224 different symbols
 Low power consumption (1 mA typical)
 Powerful command set and user-produced characters
 TTL and CMOS compatible
 Connector for standard 0.1-pitch pin headers
16 x 2 Alphanumeric LCD Module Specifications:

Symbol Level Function


Pin
1 VSS - Power, GND
2 VDD - Power, 5V
3 Vo - Power, for LCD Drive
Register Select Signal
4 RS H/L H: Data Input
L: Instruction Input
H: Data Read (LCD->MPU)
5 R/W H/L
L: Data Write (MPU->LCD)
6 E H,H->L Enable
7-14 DB0-DB7 H/L Data Bus; Software selectable 4- or 8-bit mode

15 NC - NOT CONNECTED
16 NC - NOT CONNECTED

EEE dept [38]


FEATURES:
 5 x 8 dots with cursor
 Built-in controller (KS 0066 or Equivalent)
 + 5V power supply (Also available for + 3V)
 1/16 duty cycle
 B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K (LED)
 N.V. optional for + 3V power supply
Data can be placed at any location on the LCD. For 16×1 LCD, the address
locations are:

Fig: 15: Address locations for a 1x16 line LCD


Even limited to character based modules, there is still a wide variety of shapes and sizes
available. Line lengths of 8, 16,20,24,32 and 40 characters are all standard, in one, two
and four line versions.
Several different LC technologies exist. “Supertwist” types, for example, offer Improved
contrast and viewing angle over the older “twisted nematic” types. Some modules are
available with back lighting, so that they can be viewed in dimly-lit conditions. The back
lighting may be either “electro-luminescent”, requiring a high voltage inverter circuit, or
simple LED illumination.

EEE dept [39]


Electrical Block Diagrm
Power supply for LCD driving:

Fig: 18: power supply for LCD

PIN DESCRIPTION:
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections).

Fig 19: pin diagram of 1x16 lines LCD

EEE dept [40]


Fig 17: Pin specifications

CONTROL LINES:
EN:
Line is called "Enable." This control line is used to tell the LCD that you are sending it
data. To send data to the LCD, your program should make sure this line is low (0) and
then set the other two control lines and/or put data on the data bus. When the other lines
are completely ready, bring EN high (1) and wait for the minimum amount of time
required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it
low (0) again.
RS:
Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is
high (1), the data being sent is text data which sould be displayed on the screen. For
example, to display the letter "T" on the screen you would set RS high.

RW:
Line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively

EEE dept [41]


querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read
command. All others are write commands, so RW will almost always be low.
Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation selected
by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1, DB2,
DB3, DB4, DB5, DB6, and DB7.

Logic status on control lines


 E - 0 Access to LCD disabled- 1 Access to LCD enabled
 R/W - 0 Writing data to LCD- 1 Reading data from LCD
 RS - 0 Instructions- 1 Character

Writing data to the LCD:


1. Set R/W bit to low
2. Set RS bit to logic 0 or 1 (instruction or character)
3. Set data to data lines (if it is writing)
4. Set E line to high
5. Set E line to low
Read data from data lines (if it is reading) on LCD:
1) Set R/W bit to high
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low
Entering Text:
First, a little tip: it is manually a lot easier to enter characters and commands in
hexadecimal rather than binary (although, of course, you will need to translate commands
from binary couple of sub-miniature hexadecimal rotary switches is a simple matter,
although a little bit into hex so that you know which bits you are setting). Replacing the
d.i.l. switch pack with a of re-wiring is necessary.
Switches:

EEE dept [42]


The switches must be the type where On = 0, so that when they are turned to the zero
position, all four outputs are shorted to the common pin, and in position “F”, all four
outputs are open circuit.
All the available characters that are built into the module are shown in Table 3. Studying
the table, you will see that codes associated with the characters are quoted in binary and
hexadecimal, most significant bits (“left-hand” four bits) across the top, and least
significant bits (“right-hand” four bits) down the left.
Most of the characters conform to the ASCII standard, although the Japanese and Greek
characters (and a few other things) are obvious exceptions. Since these intelligent
modules were designed in the “Land of the Rising Sun,” it seems only fair that their
Katakana phonetic symbols should also be incorporated. The more extensive Kanji
character set, which the Japanese share with the Chinese, consisting of several thousand
different characters, is not included!
Using the switches, of whatever type, and referring to Table 3, enter a few characters
onto the display, both letters and numbers. The RS switch (S10) must be “up” (logic 1)
when sending the characters, and switch E (S9) must be pressed for each of them. Thus
the operational order is: set RS high, enter character, trigger E, leave RS high, enter
another character, trigger E, and so on.

3.3 Temperature sensor (NTC Thermistor 10k).


THERMISTOR
The thermostat is a temperature sensing device whose resistance changes with
temperature. Thermistors, however, are made from semiconductor materials. in the
thermistor’s operating range we can see a large resistance change for a very small
temperature change. This makes for a highly sensitive device.

EEE dept [43]


Thermostats require external current excitation and significant signal conditioning.

WHAT ARE NTC THERMISTORS?

NTC stands for “Negative Temperature Coefficient”. NTC thermistors are resistors with
a negative temperature coefficient, which means that the resistance decreases with
increasing temperature. They are primarily used as resistive temperature sensors and
current-limiting devices. The temperature sensitivity coefficient is about five times
greater than that of silicon temperature sensors (silistors) and about ten times greater than
those of resistance temperature detectors (RTDs). NTC sensors are typically used in a
range from −55°C to 200°C.
The non-linearity of the relationship between resistance and temperature exhibited by
NTC resistors posed a great challenge when using analog circuits to accurately measure
temperature, but rapid development of digital circuits solved that problem enabling
computation of precise values by interpolating lookup tables or by solving equations
which approximate a typical NTC curve.

NTC THERMISTOR DEFINITION


An NTC thermistor is a thermally sensitive resistor whose resistance exhibits a large,
precise and predictable decrease as the core temperature of the resistor increases over the
operating temperature range.
NTC THERMISTOR SYMBOL
The following symbol is used for a negative temperature coefficient thermistor, according
to the IEC standard.

NTC thermistor

CONSTRUCTION AND PROPERTIES OF NTC THERMISTORS

EEE dept [44]


Materials typically involved in the fabrication of NTC resistors are platinum, nickel,
cobalt, iron and oxides of silicon, used as pure elements or as ceramics and polymers.
NTC thermistors can be classified into three groups, depending on the production process
used.
BEAD THERMISTORS

These NTC thermistors are made from platinum alloy lead wires directly sintered into the
ceramic body. They generally offer fast response times, better stability and allow
operation at higher temperatures than Disk and Chip NTC sensors, however they are
more fragile. It is common to seal them in glass, to protect them from mechanical damage
during assembly, and to improve their measurement stability. The typical sizes range
from 0.075 – 5mm in diameter.
Disk and Chip thermistors

These NTC thermistors have metallized surface contacts. They are larger, and as a result
have slower reaction times than bead type NTC resistors. However, because of their size,
they have a higher dissipation constant (power required to raise their temperature by 1°C)
and since power dissipated by the thermistor is proportional to the square of the current,
they can handle higher currents much better than bead type thermistors. Disk type
thermistors are made by pressing a blend of oxide powders into a round die, which are
then sintered at high temperatures. Chips are usually fabricated by a tape-casting process
where a slurry of material is spread out as a thick film, dried and cut into shape. The
typical sizes range from 0.25-25mm in diameter.

EEE dept [45]


Glass encapsulated NTC thermistors

These are NTC temperature sensors sealed in an airtight glass bubble. They are designed
for use with temperatures above 150°C, or for printed circuit board mounting, where
ruggedness is a must. Encapsulating a thermistor in glass improves the stability of the
sensor, as well as protecting the sensor from the environment. They are made by
hermetically sealing bead type NTC resistors into a glass container. The typical sizes
range from 0.4-10mm in diameter.

CHARACTERISTICS OF NTC THERMISTORS


Unlike RTDs (Resistance Temperature Detectors), which are made from metals, NTC
thermistors are generally made of ceramics or polymers. Different materials used result in
different temperature responses, as well as other characteristics.
Temperature response
While most NTC thermistors are typically suitable for use within a temperature range
between −55°C and 200°C, where they give their most precise readings, there are special
families of NTC thermistors that can be used at temperatures approaching absolute zero
(-273.15°C) as well as those specifically designed for use above 150°C. The temperature
sensitivity of an NTC sensor is expressed as “percentage change per degree C”.
Depending on the materials used and the specifics of the production process, the typical
values of temperature sensitivities range from -3% to -6% per °C.

EEE dept [46]


Fig:Characteristic NTC curve
As can be seen from the figure, the NTC thermistors have a much steeper resistance-
temperature slope compared to platinum alloy RTDs, which translates to
better temperature sensitivity. Even so, RTDs remain the most accurate sensors with
their accuracy being ±0.5% of the measured temperature, and they are useful in the
temperature range between -200°C and 800°C, a much wider range than that of NTC
temperature sensors.
Comparison to other temperature sensors
Compared to RTDs, the NTCs have a smaller size, faster response, greater resistance to
shock and vibration at a lower cost. They are slightly less precise than RTDs. When
compared to thermocouples, the precision obtained from both is similar; however
thermocouples can withstand very high temperatures (in the order of 600°C) and are used
in such applications instead of NTC thermistors, where they are sometimes referred to as
pyrometers. Even so, NTC thermistors provide greater sensitivity, stability and accuracy
than thermocouples at lower temperatures and are used with less additional circuitry and
therefore at a lower total cost. The cost is additionally lowered by the lack of need for
signal conditioning circuits (amplifiers, level translators, etc.) that are often needed when
dealing with RTDs and always needed for thermocouples.
Self – heating effect
The self-heating effect is a phenomenon that takes place whenever there is a current
flowing through the NTC thermistor. Since the thermistor is basically a resistor, it
dissipates power as heat when there is a current flowing through it. This heat is generated
in the thermistor core and affects the precision of the measurements. The extent to which

EEE dept [47]


this happens depends on the amount of current flowing, the environment (whether it is a
liquid or a gas, whether there is any flow over the NTC sensor and so on), the
temperature coefficient of the thermistor, the thermistor’s total area and so on. The fact
that the resistance of the NTC sensor and therefore the current through it depends on the
environment is often used in liquid presence detectors such as those found in storage
tanks.
Heat capacity
The heat capacity represents the amount of heat required to increase the temperature of
the thermistor by 1°C and is usually expressed in mJ/°C. Knowing the precise heat
capacity is of great importance when using an NTC thermistor sensor as an inrush-current
limiting device, as it defines the response speed of the NTC temp sensor.
TYPICAL APPLICATIONS
NTC thermistors are used in a broad spectrum of applications. They are used to measure
temperature, control temperature and for temperature compensation. They can also be
used to detect the absence or presence of a liquid, as current limiting devices in power
supply circuits, temperature monitoring in automotive applications and many more. NTC
sensors can be divided into three groups, depending on the electrical characteristic
exploited in an application.
Resistance-temperature characteristic
Applications based on the resistance-time characteristic include temperature
measurement, control and compensation. These also include situations in which an NTC
thermistor is used so that the temperature of the NTC temp sensor is related to some other
physical phenomena. This group of applications requires that the thermistor operates in a
zero-power condition, meaning that the current through it is kept as low as possible, to
avoid heating the probe.
Current-time characteristic
Applications based on current-time characteristic are: time delay, inrush current limiting,
surge suppression and many more. These characteristics are related to the heat capacity
and dissipation constant of the NTC thermistor used. The circuit usually relies on the
NTC thermistor heating up due to the current passing through it. At one point it will

EEE dept [48]


trigger some sort of change in the circuit, depending on the application in which it is
used.
Voltage-current characteristic
Applications based on the voltage-current characteristic of a thermistor generally involve
changes in the environmental conditions or circuit variations which result in changes in
the operating point on a given curve in the circuit. Depending on the application, this can
be used for current limiting, temperature compensation or temperature measurements.

3.4 RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to operate a
switching mechanism mechanically, but other operating principles are also used. Relays
are used where it is necessary to control a circuit by a low-power signal (with complete
electrical isolation between control and controlled circuits), or where several circuits
must be controlled by one signal. The first relays were used in long distance telegraph
circuits, repeating the signal coming in from one circuit and re-transmitting it to another.
Relays were used extensively in telephone exchanges and early computers to perform
logical operations.

Automotive-style miniature relay, dust cover is taken off


Pole and throw:

EEE dept [49]


Normally-open (NO) contacts connect the circuit when the relay is activated; the circuit
is disconnected when the relay is inactive. It is also called a Form A contact or "make"
contact. NO contacts may also be distinguished as "early-make" or NOEM, which means
that the contacts close before the button or switch is fully engaged.

Normally-closed (NC) contacts disconnect the circuit when the relay is activated; the
circuit is connected when the relay is inactive. It is also called a Form B contact or
"break" contact. NC contacts may also be distinguished as "late-break" or NCLB, which
means that the contacts stay closed until the button or switch is fully disengaged.

Change-over (CO), or double-throw (DT), contacts control two circuits: one normally-
open contact and one normally-closed contact with a common terminal. It is also called a
Form C contact or "transfer" contact ("break before make"). If this type of contact utilizes
a "make before break" functionality, then it is called a Form D contact.

Circuit symbols of relays. (C denotes the common terminal in SPDT and DPDT types.)
The following designations are commonly encountered:
SPST – Single Pole Single Throw. These have two terminals which can be connected or
disconnected. Including two for the coil, such a relay has four terminals in total. It is
ambiguous whether the pole is normally open or normally closed. The terminology
"SPNO" and "SPNC" is sometimes used to resolve the ambiguity.

SPDT – Single Pole Double Throw. A common terminal connects to either of two
others.

EEE dept [50]


Including two for the coil, such a relay has five terminals in total.

DPST – Double Pole Single Throw. These have two pairs of terminals. Equivalent to
two SPST switches or relays actuated by a single coil. Including two for the coil, such a
relay has six terminals in total. The poles may be Form A or Form B (or one of each).

DPDT – Double Pole Double Throw. These have two rows of change-over terminals.
Equivalent to two SPDT switches or relays actuated by a single coil. Such a relay has
eight terminals, including the coil.

Applications:
Relays are used to and for:Amplify a digital signal, switching a large amount of power
with a small operating power. Some special cases are:
A telegraph relay, repeating a weak signal received at the end of a long wire
Controlling a high-voltage circuit with a low-voltage signal, as in some types of modems
or audio amplifiers,

Relay Driver
The output from the voltage level detectors cannot directly drive the relay and hence the
relay driver is used.

Circuit diagram:

EEE dept [51]


In this a relay (12V <500 ohms) is connected to the collector of NPN transistor. The
output voltage from the comparator is applied to the base of NPN transistor through a
resistance R1. When the output from the comparator is low the transistor is in OFF state
and the relay is in de-energized state. Similarly when the output from the comparator
goes high the transistor switches ON and the flow of current from the collector to emitter
of transistor energizes the relay. Generally in a relay driver circuit, parallel to the relay
coil, a diode or a capacitor is used. This is to eliminate the back emf generated by the
relay coil when currents are suddenly broken. Capacitor C1 is connected in parallel to the
coil, which filters out the back elf but it, slows down the working of relay. A better
method is to connect two diodes (as shown in the figure 5) that stop the relay – transistor
junction swinging more than 600mV above the positive rail or below the zero-volt rail.
During normal operation the diodes are reverse biased and have no effect on the
performance of circuit. But when back is induced, the diodes conduct heavily and absorb
all transient voltages. However, I have employed the both methods.

EEE dept [52]


CHAPTER-4:

ADVANTAGES, DISADVANTAGES AND APPLICATIONS

EEE dept [53]


4.1 ADVANTAGES
1) It prevents Transformer from damage
2) Avoid interruption in power supply
3) Transformer safety
4) fast response
5) better isolation

4.2 DISADVANTAGES
6) High cost

4.3 APPLICATIONS
7) Industries
8) Sub Stations
9) Power distribution systems

EEE dept [54]


CHAPTER-5

SOFTWARE DESCRIPTION AND CODING

EEE dept [55]


5.1 INTRODUCTION TO KIEL SOFTWARE

Many companies provide the 8051 assembler, some of them provide shareware
version of their product on the Web, Kiel is one of them. We can download them from
their Websites. However, the size of code for these shareware versions is limited and we
have to consider which assembler is suitable for our application.

KIEL U VISION2:

This is an IDE (Integrated Development Environment) that helps you write, compile, and
debug embedded programs. It encapsulates the following components:

 . A project manager
 . A make facility
 . Tool configuration
 . Editor
 . A powerful debugger
To get start here are some several example programs

BUILDING AN APPLICATION IN UVISION2:

To build (compile, assemble, and link) an application in uVision2, you must:

. Select Project–Open Project

(For example, \C166\EXAMPLES\HELLO\HELLO.UV2)

. Select Project - Rebuild all target files or Build target. UVision2 compiles,
assembles, and links the files in your project.

CREATING YOUR OWN APPLICATION IN UVISION2:

To create a new project in uVision2, you must:

EEE dept [56]


. Select Project - New Project.

. Select a directory and enter the name of the project file.

. Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from
the Device

. Database

. Create source files to add to the project.

. Select Project - Targets, Groups, and Files. Add/Files, select Source Group1, and
add the source files to the project.

. Select Project - Options and set the tool options. Note when you select the target
device from the Device Database all-special options are set automatically. You
only need to configure the memory map of your target hardware. Default memory
model settings are optimal for most.

APPLICATIONS:

. Select Project - Rebuild all target files or Build target.

DEBUGGING AN APPLICATION IN UVISION2:

To debug an application created using uVision2, you must:

. Select Debug - Start/Stop Debug Session.

. Use the Step toolbar buttons to single-step through your program. You may enter
G, main in the Output Window to execute to the main C function.

. Open the Serial Window using the Serial #1 button on the toolbar.

. Debug your program using standard options like Step, Go, Break, and so on.

LIMITATIONS OF EVALUATION SOFTWARE:

EEE dept [57]


The following limitations apply to the evaluation versions of the C51, C251, or C166 tool
chains. C51 Evaluation Software Limitations:

The compiler, assembler, linker, and debugger are limited to 2 Kbytes of object code but
source Code may be any size. Programs that generate more than 2 Kbytes of
object code will not compile, assemble, or link the startup code generated includes
LJMP's and cannot be used in single-chip devices supporting Less than 2 Kbytes
of program space like the Philips 750/751/752.

. The debugger supports files that are 2 Kbytes and smaller.

. Programs begin at offset 0x0800 and cannot be programmed into single-chip


devices.

. No hardware support is available for multiple DPTR registers.

. No support is available for user libraries or floating-point arithmetic.

EVALUATION SOFTWARE:

. Code-Banking Linker/Locator

. Library Manager.

. RTX-51 Tiny Real-Time Operating System

PERIPHERAL SIMULATION:

The u vision2 debugger provides complete simulation for the CPU and on chip
peripherals of most embedded devices. To discover which peripherals of a device are
supported, in u vision2. Select the Simulated Peripherals item from the Help menu. You
may also use the web-based device database. We are constantly adding new devices and
simulation support for on-chip peripherals so be sure to check Device Database often.

EEE dept [58]


5.2 CODING:

#include<reg51.h>

#include<

>

#include<intrins.h>

#include<string.h>

#include<stdio.h>

sbit buzzer = P0^0;

sbit IR = P2^0;

void SEND_CHR(unsigned char c)

SBUF = c;

while(TI == 0);

TI = 0;

void SEND_STR(unsigned char *s)

while(*s)

SEND_CHR(*s++);

void ex_interrupt(void) interrupt 0 //INT0 external-interrupt-0

EEE dept [59]


{

cmd_lcd(0x01);

display_lcd("SENDING SMS...");

SEND_STR("AT+CMGS=");

SEND_CHR('"');

SEND_STR("7893090750");

SEND_CHR('"');

SEND_STR("\r\n");

delay_ms(500);

SEND_STR("Some One Enter In To U R Home");

SEND_STR("\r\n");

SEND_CHR(0x1A);

delay_ms(500);

cmd_lcd(0x01);

display_lcd("SMS SENT");

while(dor==0);

cmd_lcd(0x01);

void main(void)

IR=1;

buzzer=0;

EEE dept [60]


IE = 0x85; //EANIBLING INT0,INT1

TMOD=0x20;

SCON=0x50;

TH1=0xFD; //set 9600 baud rate

TR1=1;

init_lcd();

display_lcd("Home security");

cmd_lcd(0xC0);

display_lcd("Using GSM");

delay_ms(750);

delay_ms(100);

init_lcd();

while(1)

cmd_lcd(0x01)

EEE dept [61]


CHAPTER-6:

CONCLUSION

EEE dept [62]


CONCLUSION

Protection of distribution transformer is a big challenge nowadays. By the help of


microcontroller-based relay, protection of transformer is performed very quickly and
accurately.
This system provides a better and safer protection than the other methods which
are currently in use. The advantages of this system over the current methods in use are
fast response, better isolation and accurate detection, auto even data recording also
possible.
This system overcomes the other drawbacks in the existing systems such as
reclosing problem due to temporary fault on load side. Thus burden of maintenance
department is decrease. Even due to data recording and courting of switching operation
due to overload manufacturers can decide warranty period policy and give better service
to customers.
In this project, the transformer protection using a microcontroller is proposed. For
transformer voltage and current sensing, a current sensing circuit and voltage sensing
circuits were designed and the results have been verified with proteus simulation.
Hardware with an AVR microcontroller was implemented to verify the proposed
technique and the performance of the real time hardware was compared with the proteus
computer simulation. Through the transformer current analysis in figure 5.1, we can see
that the current of the transformer rises as load increases, whenever the load current goes
above the transformer rated current, the microcontroller detects an overcurrent and it
sends a trip signal to over current relay thereby protecting the transformer from burning.
As the load current goes below the rated current of the transformer, the microcontroller
detects normal there by sending an on signal to the overcurrent relay.
Moreover, through the transformer voltage analysis in figure 5.2, we can see that
the voltage of the transformer rises as the input voltage of the transformer is increased
through varying an autotransformer. Whenever the input voltage goes above the
transformer rated voltage (230VAC), the microcontroller detects an overvoltage and it
sends a trip signal to over voltage relay thereby protecting the transformer from burning.

EEE dept [63]


CHAPTER:7

REFERENCE

EEE dept [64]


REFERENCE

Books
 Badri ram and D N Vishwakarma (1995) power system protection and switch
gear New delhi: Tata Mc Graw hill.
 Frank D. Petruzella (2010) Electric motors and control systems 1st ed. New york:
McGraw-Hill
 J. Lewis Blackburn , Thomas J. Domin (2006). Protective Relaying Principles
and Applications . 3rd ed. United States of America: CRC press
 Leonard L. Grigsby (2007). The Electric Power Engineering Handbook. 2nd ed.
United States of America: CRC press.

 P. M. Anderson (1998). Power system protection. New York: John Wiley & Sons,
Inc. P.673.

Smarajit Ghosh, (2007). Electrric Machines 1st Edn. India: Dorling Kindersley
Journals
Ali Reza Fereidunian, Mansooreh Zangiabadi, Majid Sanaye-Pasand, Gholam Pournaghi,
(2003) ‘Digital Differential Relays For Transformer Protection Using Walsh Series And
Least Squares Estimators’. CIRED (International Conference on Electricity), pp. 1-6.
Atthapol Ngaopitakkul and Anantawak kunakorn (2006), ‘Internal Fault Classification in
Transformer Windings using Combination of Discrete Wavelet Transforms and Back-
propagation Neural Networks’ International journal of control, automation and systems,
4(3), pp. 365-371.

Mazouz A. Salahar Abdallah R. Al-zyoud (2010), ‘Modelling of transformer differential


protection using programmable logic controllers’ European journal of scientific
research, 41(3), pp. 452-459.
Pankaj Bhambri, Chandni Jindal, Sagar Bathla (2007), ‘Future Wireless Technology-
ZIGBEE’ Proceedings of national conference on challenges, pp. 154-156.
S.M Bashi, N. Mariun and A.rafa (2007). ‘Power Transformer protection using
microcontroller based relay’, Journal of applied science, 7(12), pp.1602-1607.

EEE dept [65]


EEE dept [66]
EEE dept [67]

You might also like