Berihun Project 2 1

You might also like

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

ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

ASSOSA UNIVERSITY

COLLEGE OF ENGINEERING TECHNOLOGY

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING

STREAM: - INDUSTRIAL CONTROL ENGINEERING

SEMISTER PROJECT

PREPARED BY

1) BERIHUN ENGDA…………ETR 148/06


2) BEKALU MERETE…………ETR 248/06
3) BATRI CHIMDI…………….ETR 129/06
4) HANA DESALEGN……… ...ETR 345/06
5) SAMUEL G/TSADIK……….ETR 551/06
6) TADESE GETE……………...ETR 615/06

Submission date:- July 03, 2017

SUBMITED TO ECE DEPARTMENT

ASSOSA, ETHIOPIA

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page i


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

DECLARATION
We declare that the information found in this project is our original work the project has never has
been presented or published anywhere or in any institution of learning. And all sources of materials
that will be used for the project work will be fully acknowledged.

Student name ID no Signature

1) BERIHUN ENGDA…………ETR 148/06


2) BEKALU MERETE…………ETR 248/06
3) BATRI CHIMDI…………….ETR 129/06
4) HANA DESALEGN…………ETR 345/06
5) SAMUEL G/TSADIK……….ETR 551/06
6) TADESE GETE……………...ETR 615/06

APPROVAL
This is to certify that the project titled “POWER TRANSFORMER PROTECTION BY USING
ATMEGA 32”carried out control stream group six has been read and approved for meeting part of the
requirements and regulations governing the award of the bachelor of science in Electrical and
Computer Engineering.

Name of advisor

………………..

Name of examiners

………………………..

Date submission

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page ii


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

ACKNOWLEDGMENT
First of all we would like to express our heart full gratitude for our GOD to help us during our Work
throughout all things. Next to this we would thanks our heart full gratitude to our advisor GETANEH,
our teacher NATARAJAN and our friends for his a reserved guidance, suggestion and advice. We are
great full to this motivation for the timely completion of our project.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page i


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

ABSTRACT

The main intention of this project is to design a microcontroller based system that can be used in
power transformer protection. The system checks the operating parameters of the transformer i.e.
current and reports the quantity that is flowing through the transformer. The system is designed such
that it is able to detect currents above the normal operating level and isolate the power transformer
from the distribution line. This isolation process is to ensure that the transformer is safe from any
excess current levels that can make it to overheat thus get damaged. It gives a solution to the need to
reduce cost of maintenance and ensure that supply of electricity to consumers is not interrupted for
long periods taken while repairing or replacing destroyed transformers.

A current sensor ACS755 series has been used in this project as the interfacing instrument between the
power transformer and ATmega32 microcontroller. ATmega32 controls all operations that the device
does. A relay and a contactor have been used as the switching gears to isolate the transformer from the
power system in case a fault occurs. A monochrome LCD has been used to show system current,
temperature and voltage readings and indicate cases of over-current fault. To warn an operator of a
fault occurrence. Temperature sensor has been used to know amount of temperature of transformer
during it operate. All these peripheral devices depend on the microcontroller to make them operate or
otherwise. Some of the tools used in this project include AVR micro C programming software used to
write the program for the microcontroller used in this project. Proteus- simulation software has also
been used to test whether the design works appropriately before its implementation on hardware.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page ii


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

Table Contents
CONTENT PAGE

DECLARATION ........................................................................................................................................ ii
APPROVAL ............................................................................................................................................... ii
ACKNOWLEDGMENT.............................................................................................................................. i
ABSTRACT ................................................................................................................................................ ii
List of Figure............................................................................................................................................... v
Acronym and Abbreviation........................................................................................................................ vi
CHAPTER 1 ............................................................................................................................................... 1
BACKGROUND OF THE PROJECT........................................................................................................ 1
1.1 INTRODUCTION ................................................................................................................................ 1
1.2 Objectives ............................................................................................................................................. 2
1.2.1 General Objective .............................................................................................................................. 2
1.2.2 Specific Objective .............................................................................................................................. 2
1.3 Problem statement ................................................................................................................................. 2
1.4 Scope of this project.............................................................................................................................. 2
CHAPTER 2 ............................................................................................................................................... 3
LITERATURE REVIEW AND THEORETICAL BACKGROUND ........................................................ 3
2.1 Electric Power System .......................................................................................................................... 3
2.1.1 Importance of power system protection ............................................................................................. 4
2.2 Transformer protection ......................................................................................................................... 4
2.3. Causes of fault in power transformer ................................................................................................... 5
2.4 Transformer Protection Schemes .......................................................................................................... 6
CHAPTER 3 ............................................................................................................................................... 9
SYSTEM DESIGN OF OUR PROJECT .................................................................................................... 9
3.1 Overview ............................................................................................................................................... 9
3.2 Component details .............................................................................................................................. 10
3.2.1 Microcontroller ................................................................................................................................ 10

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page iii


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

3.2.2 Current sensor .................................................................................................................................. 11


3.2.3 Voltage transformer ......................................................................................................................... 12
3.2.4 Analysis of Voltage protection circuit ............................................................................................. 13
3.2.4.1 over voltage protection circuit ...................................................................................................... 13
3.2.5 Relay ................................................................................................................................................ 14
3.2.6 Crystal oscillator .............................................................................................................................. 15
3.2.7 Power Supply design........................................................................................................................ 16
3.2.8 Temperature sensing unit ................................................................................................................. 17
3.2.9 Transmitter description .................................................................................................................... 18
3.3 Software design overview ................................................................................................................... 19
3.3.1 Flow chart of the entire system ........................................................................................................ 19
CHAPTER 4 ............................................................................................................................................. 22
HARDWARE AND SOFTWARE DESIGNAND IMPLEMENTATION .............................................. 22
4.1 Schematic diagram .............................................................................................................................. 22
4.1.1 Complete schematic diagram ........................................................................................................... 22
4.2 Software implementation .................................................................................................................... 23
4.2.1 Programming in Micro PRO for AVR ............................................................................................. 23
4.3. Proteus for Atmega32 ........................................................................................................................ 25
RESULTS AND DISCUSSION ............................................................................................................... 25
4.5 Results ................................................................................................................................................. 25
CHAPTER 5 ............................................................................................................................................. 26
CONCLUSION AND FUTURE RECOMMENDATION ....................................................................... 26
5.1 Conclusion .......................................................................................................................................... 26
5.2 Future Recommendations ................................................................................................................... 26
Reference .................................................................................................................................................. 27
APENDEX ................................................................................................................................................ 28

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page iv


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

List of Figure
Figure 1 Generation, transmission and distribution of electrical power .................................................. 3
Figure 2 Electro-magnetic induction ....................................................................................................... 5
Figure 3 Waveform of a magnetizing inrush current ............................................................................... 6
Figure 4 Restricted Earth Fault Protection............................................................................................... 7
Figure 5 Over current Phenomenon ......................................................................................................... 7
Figure 6 Block diagram of the system ..................................................................................................... 9
Figure 7 Current sensing circuits ........................................................................................................... 12
Figure 8 over voltage sensing circuit. .................................................................................................... 13
Figure 9 230VAC lamp switched ON using microcontroller based relay ............................................. 15
Figure 10 Crystal oscillator circuit inscribed in the controller .............................................................. 16
Figure 11 Transformer power supply .................................................................................................... 16
Figure 12 LM35 sensor interfaced with the AVR microcontroller........................................................ 18
Figure 13 Microcontroller with Max232 interface with RS23 Interface ............................................... 19
Figure 14 Flowchart description of the system ...................................................................................... 20
Figure 15 Complete schematic............................................................................................................... 23
Figure 16 Complete circuit simulation models .......................................Error! Bookmark not defined.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page v


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

Acronym and Abbreviation

LCD Liquid crystal display

ADC analog to digital convertor

PC personal computer
CT current transformer
PS power system
universal synchronous asynchronous receiver
USART
Transmitter

EEPROM electrically erasable programmable read only memory


RAM random access memory

ASCII American Standard Code for Information Exchange

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page vi


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

CHAPTER 1
BACKGROUND OF THE PROJECT

1.1 INTRODUCTION
In the design of electrical power generation, transmission and distribution system, there are various
factors that need to be considered in the quest to satisfy the needs of electricity consumers. Electrical
power systems experience faults at various times due to various reasons. These faults must be
foreseen and safety precautions applied to the power system. An electrical power system consists of
various components such as generators, switches, transmission cables, transformers, capacitor banks
among other components. It cannot therefore operate without an effective protective device to keep
these components safe and the system stable.

Faults in a power system refer to the undesired conditions that occur in the electrical power system.
These conditions may include short circuit, over current, overvoltage, high temperatures among
others. It is clear that over time, there has been an increase in human population, economic growth
and technological advancement. This has continuously made the demand for electrical power to go
high because as technology, human population and economy grows; there is an increase in demand
for power as many more electrical loads are introduced into the supply line. An increase in load leads
to a lot of current drawn from the power line. At times the demand goes above what the power
distributor can supply. The consequence of this is that electrical power overload cases become
common thus posing danger to power system components. This therefore throws in the need for
devices that can monitor the rate of power consumption in accordance with the level that a given
system is designed to sustain. Such a device must be designed to cut off consumption if the system
oversteps its ability thus being dangerous to users and the components.

In this project, we look at the protection of power transformer from various faults that may occur and
may be destructive to the component if left undetected. Power transformer is one of the most
significant equipment in the electric power system, and transformer protection is an essential part of
the general system protection approach. Transformers are used in a wide variety of applications, from
small distribution transformers serving one or more users to very large units that are an integral part
of the bulk power system.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 1


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

1.2 Objectives
1.2.1 General Objective
The main objective of this project is to design and implement a system that uses microcontroller and
other peripheral devices to protect power transformer.

1.2.2 Specific Objective


a) Design and build an over current relay using PIC microcontroller and a current sensor
b) Development, analysis and calibration of the current sensor.
c) Development of the ADC program to convert the analogue sensor output to equivalent digital
form within the PIC microcontroller.
d) Development of the LCD program to display the sensed levels.
e) Development of warning (audio and visual) and relay control system program.

1.3 Problem statement


An essential concern in transformer protection is the high cost of the transformer and the relative long
outage time that occurs when a large transformer fails. The proper type of protection can often detect
initial faults before they become major, and thereby prevent major physical damage and long outage
times[1]. Transformers experiences faults which leads to deterioration and acceleration aging and
failure of transformer winding resulting from insulation failures, one of the causes is the over current.
Due to overload and externally applied conditions including over current and external short circuit
causes rise in temperature of both transformer oil and windings [4]. Whenever the winding
temperature raises and exceeds transformer thermal limits, the insulation will deteriorate and may fail
prematurely. Continuous thermal overload (over temperature) might weaken the insulation of a
transformer and resulting in rapid transformer loss of life. Over excitation (an increase in system
voltage), internal faults can lead to deterioration, acceleration aging and fault trips in transformer
protection function [5].

1.4 Scope of this project


The overall aim of the study is to build a microcontroller based transformer protection with
transformer parameters monitoring capabilities. This protection is based on the transformer
parameters fed into the ADC of the microcontroller and monitoring the transformer parameters
through PC. Immediately a fault is detected the microcontroller taking necessary action.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 2


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

CHAPTER 2
LITERATURE REVIEW AND THEORETICAL BACKGROUND

2.1 Electric Power System

An electric Power system refers to a network that constitutes electrical components/machines used in
the supply, transmission and consumption of electric power. The diagram below illustrates a complete
electric power system. It involves generation, transmission and distribution of electric power to
various categories of consumers.

Figure 1 Generation, transmission and distribution of electrical power

The generation plant is normally located far from the load Centre. There are different levels of
electric power consumption depending on the purpose for which a consumer uses electricity.
Electrical power consumers may be industrial, commercial or domestic [6]. These consumers require
different levels of electric power supply. In order to meet their specific needs, certain devices that
adjust the voltage levels accordingly have to be used. Some of those components include: step up and
step down transformers, capacitor banks, protective devices etc. The main aim of power system
protection scheme is to switch off a section that is faulty in the system from the remaining live
system. This ensures that the remaining portion is able to function satisfactorily locking out chances
of damage that may be caused by fault current.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 3


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

A circuit breaker closes automatically as a result of trip signals it receives from the relay whenever a
fault is detected. “The basic philosophy of a power protection system is that system faults cannot be
prevented from flowing in the system but can be stopped from spreading in the system”.

2.1.1 Importance of power system protection


Occurrence of fault is hazardous to both electric power user and the electric system itself. To the user,
life is of most important concern. The main concern of the system is to ensure a stable supply of
electric power to consumer and to ensure that the electrical components do not get destroyed. In
summary, power protection is necessary to:
a) User/Personnel- ensure safety i.e. Prevent injury/accident.
b) Electrical equipment - to protect the equipment from cases of over current, overvoltage and
frequency drift that can destroy the equipment.
c) General Safety -Prevent secondary accidents that occur as a result of system fault like fire.
d) Power Supply Stability- Ensures a continuous and stable supply of electrical power.
e) Operation Cost -Ensure optimal operating efficiency so as to reduce equipment
maintenance/replacement cost.

2.2 Transformer protection


Electrical power systems have various devices that aid in the transmission and distribution of
electrical power. One such component is the power transformer. A transformer can be described as an
electrical device used in electric power system to transmit power between different circuits, applying
the principle of electromagnetic induction. The transfer of energy from one circuit to another makes
use of basic magnetic fields. Transformer theory and application is based on the principle where
magnetic field in one coil causes voltage induction into another coil. Sizes of transformers vary
according to their applications from the tiny ones used in microphones to the ones weighing hundreds
of tones used system grid. Transformers are used in electronic appliances and in electrical power
networks. Transformers are therefore very important in transmission, distribution and consumption of
electrical power [7].
There are two basic principles that explains the operation of a transformer
 Magnetic field can be caused by electric current.
 A varying magnetic field linked to a coil induces voltage across the ends of the coil by means
of electromagnetic induction.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 4


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

Figure 2 Electromagnetic induction

As shown in the diagram above, as current passes through the primary coil, it causes magnetic field.
The primary and the secondary windings are woven around a core whose magnetic permeability is
very high. This is to ensure that a large percentage of the magnetic flux pass through the primary
windings and the secondary windings.

2.3. Causes of fault in power transformer


There are many faults that can occur in a transformer owing to a variety of reasons as follows:-
a) Winding and core fault is the most frequent type of fault in a power transformer. This can be
attributed to weakening of conductor insulation. Phase faults rarely occur in the transformer, they
may however occur at the terminals of that are found within the transformer protection zone.
b) Most power transformers use oil for cooling and insulation, oil leakage can also be a cause of fault
in a transformer.
c) The inrush current that occurs momentarily when a transformer is energized can also be treated as
a fault unless conditions are set for its detection.
d) Inter-turn faults may occur and cause rise in hot spots within the transformer winding.
e) Transformer may experience over fluxing which may be as a result of transformer operating at low
frequency at rated voltage. Over fluxing may also be caused by overvoltage operation at rated
frequency.
f) Sustained overload can also be a cause of fault in a transformer
POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 5
ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

2.4 Transformer Protection Schemes


There are several schemes used in transformer protection. A few are presented below.
Percentage differential protection
This protection scheme is used to protect transformers against internal short circuits. It is an effective
method to protect transformer against internal faults. It may however not be effective in protecting the
transformer against ground fault in case of ungrounded or high impedance grounding. The following
factors affect differential current in a transformer and should be taken into consideration while using
differential protection scheme to protect a transformer.
Magnetizing inrush current
This is the maximum instantaneous current that a transformer draws when it is first switched on.
Power transformers can draw as high as 8-30 times its rated current depending on its resistance.
Inrush current if not taken care of can thus be detected by the system as a Fault and thus cause
unwanted response. The diagram below shows a typical waveform of inrush current.

Figure 3 Waveform of a magnetizing inrush current

Harmonic restraint relay


Differential relay can fail due to magnetizing inrush current. The magnetizing inrush current
waveform normally consists of several harmonics while the internal fault current consists of the
fundamental component. To solve the problem of inrush current, a harmonic restraint relay is used. It
is only effective during inrush current and remains inactive the remaining times.
Restricted Earth Fault
Restricted earth fault protection is used in power transformer to detect the transformer’s internal earth
fault. This scheme is connected as shown below. It is restricted to the transformer winding; otherwise,
POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 6
ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

it may operate for any ground fault anywhere in the system. It detects faults with values below pick
up of differential relay.

Figure 4 .Restricted Earth Fault Protection

Over current protection


Over current protection scheme ensures that the transformer is protected from momentary excess
current caused by overload, power surge etc. In electric power system, over current refers to a
situation where more than current intended flows through a conductor. This leads to excessive heat
generation and thus the risk of causing fire or causing destruction to electrical equipment. Over
current is caused by short circuit, overloading or wrong design.

Figure 5 over current Phenomenon


Over current protection protects the transformers against currents that rise beyond its rated value.
Over current relay isolates the transformer in case of a fault in the system. This relay is the focus of
this project. It can be implemented using analogue circuitry or digitally using microcontrollers. This

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 7


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

project seeks to apply microcontroller and appropriate software program to design an over current
relay. Thus project is based on microcontroller transformer protection with PC based transformer
parameters monitoring capabilities.

This protection is focused on the transformer parameters feed into the ADC of the microcontroller
and monitoring the transformer voltage, current and temperature through personal computer. The
voltage transformer will be connected across a variable AC input source using an autotransformer
which can be varied from 0-250VAC. The output of the transformer (secondary) will be connected to
electric bulbs which will serve as loads. The load current will be monitored by connecting a current
sensor in series between the load and the secondary side of the transformer. The transformer voltage
will be monitored through rectifying a step down 230-12VAC transformer to a pure 5VDC and then
feed to the microcontroller ADC pin for voltage monitoring. The input of the step down transformer
will be connected to autotransformer and the output will be perfectly rectified to a pure
5VAC.whenever the input voltage is varied, the microcontroller shows the value of the voltage on an
LCD and also on the PC.

As input voltage is varied above 230VAC, the microcontroller detects an over voltage fault and it
sends a trip signal to the voltage protective relay for protecting the transformer and the load
connected. Similarly, the microcontroller monitor’s the load current and temperature added to the
secondary side of the transformer, the current at the secondary side rise. As the load of transformer
and displays the values on LCD and on the PC. Whenever loads are added to the secondary side of
the transformer, the current at the secondary side rise. As the load current exceeds the rated current
rating of the transformer, the temperature of the secondary winding rises, therefore the
microcontroller will send a trip signal to the overcurrent protective relay, thereby protecting the
transformer from burning.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 8


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

CHAPTER 3
SYSTEM DESIGN OF OUR PROJECT

3.1 Overview
The block diagram of the system is shown in figure 3.1

Figure 6 Block diagram of the system


The primary of the 230:160VAC transformer is connected to a variable AC input voltage
(autotransformer), and the output is connected to a load which is usually electrical appliances such as
bulbs, electric heater etc. At the primary side of the 230:160VAC transformer, a step down 230-
12VAC transformer is rectified to a pure 5VDC and feed into the ADC pin of the microcontroller for
monitoring the voltage of the transformer. At the secondary side of the transformer, a current sensor
is connected in series between the load and the transformer secondary terminal for sensing, the load
current, output of the current sensor is then feed to the microcontroller ADC pin for monitoring. The
LCD is used to display the transformer voltage, current and temperature, similarly the personal
POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 9
ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

computer is used to display the transformer parameters for monitoring purpose. While monitoring the
transformer parameters, whenever the load current exceeds the transformer rated current, the
microcontroller detects an overcurrent faults and it sends a trip signal to the overcurrent relay, thereby
protecting the transformer from blowing off. Moreover, when the autotransformer secondary is varied
above the specific limit, the microcontroller detects an overvoltage faults and it sends a trip signal to
the overvoltage protective relay, thereby protecting the transformer and the loads from blowing off.

3.2 Component details


Based on the various reviews conducted on transformer protection and the above block diagram
which was conceived out of those literature reviews conducted, numbers of components are required
in developing the protection system.

3.2.1 Microcontroller
The microcontroller is required to serve the purpose monitoring the transformer information such as
temperature, voltage and current through the LCD display, personal computer and triggering the relay
when there is any fault. Modern power networks require faster, more accurate and reliable protective
schemes. Microcontroller-based protective schemes are capable of fulfilling these requirements. They
are superior to electromagnetic and static relays. These schemes have more flexibility due to their
programmable approach when compared with the static relays which have hardwired circuitry.
Therefore in order to achieve this task the ATmega32 microcontroller was chosen because of its
suitability for this project such as speed, power consumption, Universal Synchronous Asynchronous
Receiver Transmitter (USART) functionality, in built ADC, and amount of RAM and ROM on the
chip.

The ATmega32 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC
architecture. It has a High Endurance Non-volatile Memory segments such as 32K Bytes of In-
System Self-programmable Flash program memory, 1024 Bytes EEPROM, 2K Byte Internal SRAM,
write/erase Cycles: 10,000 Flash/100,000 EEPROM. The ATmega32 microcontroller I/O pins are 40
in number, and most of them can be used as I/O pins. The input/output pins serves the purpose of
connecting the ADC chip, LED, LCD display, alarm buzzer and in this case the port A, pin one, two
and three were used to take care of ADC input since we are using three different analogue signals one
for the voltage transformer other for the current transformer and finally for the temperature sensor.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 10


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

3.2.2 Current sensor


The protection of the transformer against over current is concerned with the detection and
measurement of fault, where the measurement can be dangerous and indeed impossible to measure if
the actual load and fault currents are very large. A professional way of avoiding these difficulties is to
use the current sensor. Therefore in the block diagram, current transformer is used to measure the
load current. The current sensor ACS755 was used because the current sensor ICs provides
economical and precise solution for AC or DC current sensing in industrial, automotive, commercial,
and communication systems. The device package allows for implementation by the customer. Typical
applications include motor control, load detection and management, power supplies and overcurrent
fault protection. The current sensor is capable of measuring up to 50A.The monitored current values
are displayed on the LCD display and as soon the voltage transformer is overloaded the current
transformer sends the information through the ADC and the microcontroller energizes the relay,
thereby protecting the transformer.
3.2.2.1 Overcurrent protection circuit
An ammeter cannot be used in measuring the load current in this project because an analogue signal
most be fed into the ADC of the microcontroller for monitoring the load current. A current sensor
was found to be the suitable current sensing device for this purpose. The current sensor used can
measure up to 50A. The BBACS755comes with one set of dean-T connector and a 3 ways right angle
pin header. The ACS756 is power up with 5VDC and gives out voltage to indicate the direction and
current value. The output of the current sensor is fed to Micro-controller ADC unit for taking the
necessary action. The current flowing through the CT primary can be measured, for this purpose,
digital display is provided at the output of the Microcontroller Chip. Figure shows below the circuit
diagram of the current sensing circuit.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 11


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

TR1

L1 L2
220v 220v

TRAN-2P2S

4
U1

IP-

VCC IP+
CURRENT SENSOR

VIOUT
GND
2

1
Microcontroller ADC pin for current monitoring

Figure 7 Current sensing circuits

3.2.3 Voltage transformer


The 230VAC:12VAC step down voltage transformer is used to measure the load voltage. The voltage
transformer will pass through rectification process before fed to the ADC. .
3.2.3.1 Secondary winding calculation
The transformer used has 120 turns of coil in the primary; therefore secondary winding turn is
calculated as shown below:

The above calculation shows that the transformer has a turn ratio of 120:6 =20:1

3.2.3.2 Primary current calculation


The transformer used is a step down transformer (230VAC:160VAC). It is known that a transformer
with less turns in the secondary than in the primary would step down the voltage, but would step up
the current. The below calculation will verify that.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 12


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

I1=0.667A

The above calculation shows that the step down transformer has step up the primary current from
0.667 to 1A at the secondary.

3.2.4 Analysis of Voltage protection circuit

3.2.4.1 over voltage protection circuit


The over voltage and under voltage protection circuit is capable of measuring and monitoring voltage
from 200 to 250VAC. In this project the voltage can be increased or decreased by using the
autotransformer and the output of the voltage monitoring circuit is fed to ADC converter, whenever
the voltage is varied to 200VAC, the microcontroller will detect under voltage fault and whenever the
voltage is varied to 250VAC, the microcontroller detects over voltage fault, consequently the
microcontroller sends a trip signal to the relay, and the relays cuts the primary of the transformer
from the AC mains, thereby protecting the transformer.

TR1 BRIGDE RECTIFIER


RV1 ADC PIN

0-250VAC
C1
50%

1nF

1k

TRAN-2P2S

Step down transformer 230-12vac for voltage monitoring

Figure 8 over voltage sensing circuit.


In Figure 8, a step down transformer of 230-12VAC was used and was rectified to a pure dc using the
capacitor and then adjusted to voltage within 5VAC using the potentiometer in order to be fed the

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 13


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

analogue signal into the ADC without burning the ADC converter. Whenever the primary voltage of
the transformer is adjusted, the secondary voltage also changes, and based on the microcontroller
program, the input voltage can be monitor, displayed and the transformer can be protected from any
over voltage fault.

3.2.5 Relay
The relay is an electrically controllable switch widely used in industrial controls, automobiles, and
.appliances. It allows the isolation of two separate sections of a system with two different voltage
sources. For example, a +5V system can be isolated from a 120V system by placing a relay in
between them. One such relay is called an electromechanical or electromagnetic relay EMR as shown
in figure 3.4. The EMRs have three components: the coil, spring and contacts. In Figure 3.4, a digital
+5V can control a 230Vac lamp without any physical contact between them. When current flows
through the coil, a magnetic field is created around the coil (the coil is energized), which causes the
armature to be attracted to the coil. The armature’s contact acts like a switch and closes or opens the
circuit. The relay serves as the protective device of the entire system. The relay receives trip signal
from the microcontroller and thereby cutting the transformer primary from the input ac source hence
protecting the transformer

3.2.5.1 Relay Driver Circuit no heading


Microcontroller pins lack sufficient current to drive a relay. While the 6volts relay’s coil needs
around 12mA to be energized, the current is obtained by the V/R expression. For example, if the coil
is 6VDC and the coil resistance is 500Ω, a minimum of 12mA (6V/500Ω = 12mA) is need to
energize the relay while the microcontroller’s pin can provide a maximum of 1-2mA current,
therefore a transistor was used as relay driver which is placed between the microcontroller and the
relay as shown in figure 9

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 14


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

U1
9 22
RESET PC0/SCL
23
PC1/SDA
13
XTAL1 PC2/TCK
24 RL1
12
XTAL2 PC3/TMS
25 R2 D1 6v
26 10k DIODE
PC4/TDO
40 27
PA0/ADC0 PC5/TDI
39 28
PA1/ADC1 PC6/TOSC1
38 29
PA2/ADC2 PC7/TOSC2
37
36
PA3/ADC3
14
R1
35
PA4/ADC4 PD0/RXD
15 L1
PA5/ADC5 PD1/TXD 2.2k 12V
34
PA6/ADC6 PD2/INT0
16 Q1
33 17 2N2369
PA7/ADC7 PD3/INT1
18
PD4/OC1B
1 19
PB0/T0/XCK PD5/OC1A
2 20
PB1/T1 PD6/ICP1
3 21
PB2/AIN0/INT2 PD7/OC2
4
PB3/AIN1/OC0
5
PB4/SS
6
PB5/MOSI
7 32
PB6/MISO AREF
8 30
PB7/SCK AVCC
ATMEGA32

Figure 9 230VAC lamp switched ON using microcontroller based relay

3.2.5.2 Transistor used as Driver


The transistor is used as the driver and the basic function of the driver circuit is to provide the
necessary current to energize the relay coil. The Resistor R1 is used to set the base current for the
transistor, the value of R1 should be such that when input voltage is applied to the transistor, it is
driven into saturation i.e. it is fully turned ON and the Relay is energized. It’s important that the
transistor is driven into saturation so that the voltage drop across the transistor is minimum there by
dissipating very little power. The protection diode in the circuit is used to protect the transistor from
the reverse current generated from the coil of the relay during the switch off time.

3.2.6 Crystal oscillator


The clock circuit is an important element that is required in the system board. This is because the
microcontroller works digitally based on generated clock. The rate of the clock is determined by a
crystal oscillator that is connected to the clock logic pins. A high speed crystal of 16 MHz is used in
our project in order to avoid any delay in terms of relay tripping ON and OFF, and monitoring of the
transformer parameters through the ADC of the microcontroller. Because the monitoring of
transformer parameters and tripping off the relay has to be very fast to avoid failure of the entire
protection system. Figure below show the crystal inscribed into the microcontroller, with two 33 pF
capacitors used to filter out external noise from interfering with the crystal frequency.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 15


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

C1
U1
9 22
RESET PC0/SCL
33nF 23
PC1/SDA
X1 13
XTAL1 PC2/TCK
24
16MHZ 12 25
C2 XTAL2 PC3/TMS
26
PC4/TDO
40 27
PA0/ADC0 PC5/TDI
39 28
PA1/ADC1 PC6/TOSC1
33nF 38 29
PA2/ADC2 PC7/TOSC2
37
PA3/ADC3
36 14
PA4/ADC4 PD0/RXD
35 15
PA5/ADC5 PD1/TXD
34 16
PA6/ADC6 PD2/INT0
33 17
PA7/ADC7 PD3/INT1
18
PD4/OC1B
1 19
PB0/T0/XCK PD5/OC1A
2 20
PB1/T1 PD6/ICP1
3 21
PB2/AIN0/INT2 PD7/OC2
4
PB3/AIN1/OC0
5
PB4/SS
6
PB5/MOSI
7 32
PB6/MISO AREF
8 30
PB7/SCK AVCC
ATMEGA32

Figure 10 Crystal oscillator circuit inscribed in the controller

3.2.6.1 Crystal time cycle (Period) calculation


The period of the clock cycle can be calculated by using the frequency formula which says

F=

F=16MHZ

T= = =62.5ns

3.2.7 Power Supply design

3.2.7.1 Power supply theory


The power supply circuit design is one of the important parts of this project, without a power supply
the electronic devices such as microcontroller, relay, alarm, LCD etc. display will not function.
Similarly a wrong power supply design will lead to the damaging of the electronic devices used in
this project.
230v, 50 HZ
Transformer Bridge rectifier Filter Regulator
AC 20:1

Figure 11 Transformer power supply


The main power supplies needed for this project is 5VDC in order to power on the relay and other
electronic devices such as microcontroller etc. The design is done using a transformer, bridge

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 16


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

rectifiers, filter capacitor and a voltage regulator. Figure above shows the sequential process of
designing a constant DC power supply.

In Figure 11 the input voltage is obtained the main 230VAC outlet and then connected to the
transformer. A step down transformer is used in stepping the 230VAC to a 12VAC.The 12VAC
serves as an input voltage to the bridge rectifier which is basically for diodes connected where two
diodes are in forward biased and the other two are in reversed biased for each half cycles. The bridge
rectifier is used in converting the 12VAC into a dc voltage. The filter capacitor serves as a smoother
to smooth the dc voltage from the bridge rectifier and the LM7805 is the voltage regulators which
purposely stabilizes the output voltages to 6VDC and 5VDC.

3.2.8 Temperature sensing unit


The LM35 was chosen to be the temperature sensing device in this project. The LM35 series are
precision integrated-circuit temperature sensors, whose output voltage is linearly, Proportional to the
Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors
calibrated in degree Kelvin, as the user is not required to subtract a large constant voltage from its
output to obtain convenient Centigrade scaling with a rated operating temperature range of over -55°
to +150°C. These sensors use a solid-state technique to determine the temperature. That is to say, they
don’t use mercury (like old thermometers), bimetallic strips (like in some home thermometers or
stoves), nor do they use thermistors (temperature sensitive resistors). Instead, they use the fact as
temperature increases, the voltage across a diode increases at a known rate. Similarly, the LM35 is
chosen over thermocouples because it can measure temperature more accurately than a using a
thermistor. The sensor circuitry is sealed and not subject to oxidation, etc. The LM35 generates a
higher output voltage than thermocouples and may not require that the output voltage be amplified.
Figure below shows an LM35 sensor interfaced with the AVR microcontroller.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 17


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017
LCD1
LM016L

VDD
VSS

VEE

RW
RS

D0
D1
D2
D3
D4
D5
D6
D7
E
1
2
3

4
5
6

7
8
9
10
11
12
13
14
U1
9 22
RESET PC0/SCL
23
PC1/SDA
13 24
XTAL1 PC2/TCK
12 25
XTAL2 PC3/TMS
26
PC4/TDO
40 27
PA0/ADC0 PC5/TDI
39 28
PA1/ADC1 PC6/TOSC1
38 29
PA2/ADC2 PC7/TOSC2
37
PA3/ADC3
36 14
U2 PA4/ADC4 PD0/RXD
1 35 15
PA5/ADC5 PD1/TXD
34 16
PA6/ADC6 PD2/INT0
33 17
PA7/ADC7 PD3/INT1
18
34.0 PD4/OC1B
1 19
PB0/T0/XCK PD5/OC1A
2 20
PB1/T1 PD6/ICP1
2 3 21
VOUT PB2/AIN0/INT2 PD7/OC2
4
PB3/AIN1/OC0
5
PB4/SS
6 R1
PB5/MOSI
3 LM35 7 32
PB6/MISO AREF
8 30 10k
PB7/SCK AVCC
ATMEGA32
C1

1nF

Figure 12 LM35 sensor interfaced with the AVR microcontroller

The output voltage of the LM35 varies linearly with temperature. Therefore to calculate the
temperature, a general equation is shown below which is used to convert the output voltage to
temperature
Temperature (C) =V Out * (100 C/V)…………………….. (1)
Hence, if V Out is 0.84V, then, Temperature = 84C

3.2.9 Transmitter description


The transmitter section consists of the MAX232 IC and the Atmega32 TX pin. The microcontroller is
interfaced to the computer using MAX232 through RS232 serial communication.RS232
(recommended standard 232) supports both synchronous and asynchronous transmissions and its user
data is send as a time of bits. MAX232 is an integrated chip that converts convert Transistor–
transistor logic (TTL) to RS232 and RS232 to TTL voltage levels compatible with digital logic circuit
such as the microcontroller. The serial data sends from the microcontroller is then fed to the PC
through RS232 for monitoring purpose.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 18


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

U1
9 22
RESET PC0/SCL
23
PC1/SDA
13 24
XTAL1 PC2/TCK
12 25
XTAL2 PC3/TMS
26
PC4/TDO
40 27
PA0/ADC0 PC5/TDI
39 28
PA1/ADC1 PC6/TOSC1 C1
38 29
PA2/ADC2 PC7/TOSC2
37
PA3/ADC3
36 14
PA4/ADC4 PD0/RXD
35 15 1nF
PA5/ADC5 PD1/TXD U2
34 16 1 3
PA6/ADC6 PD2/INT0
33 17
PA7/ADC7 PD3/INT1
18
PD4/OC1B C1+ C1- P1
1 19
PB0/T0/XCK PD5/OC1A
2 20 11 14
PB1/T1 PD6/ICP1 T1IN T1OUT
3 21 12 13 1
PB2/AIN0/INT2 PD7/OC2 R1OUT R1IN DCD
4 10 7 6
PB3/AIN1/OC0 T2IN T2OUT DSR
5 9 8 2
PB4/SS R2OUT R2IN RXD
6 7
PB5/MOSI RTS
7 32 2 3
PB6/MISO AREF VS+ TXD
8 30 6 8
PB7/SCK AVCC VS- CTS
C3 4
DTR
ATMEGA32
C2+ C2- C4 1nF 9
RI
1nF
4 5 MAX232
C2 ERROR
COMPIM

1nF

Figure 13 Microcontroller with Max232 interface with RS23 Interface

3.3 Software design overview


The software design plays a very important role in the working of the entire system; the system will
not operate without the software. An algorithm needs to be developed to enable the AVR controllers
read the input and respond accordingly. The programming language selected for this project is the C
program. The C program will enable communication between the transformer, microcontroller and
PC with other different interfaces in the system. With the software programed into it,
microcontrollers acts as brain of the whole transformer protection and transmit its parameters for
monitoring its conditions. It will send the transformer information through PC via the RS232 serial
port.

3.3.1 Flow chart of the entire system


The flowchart gives a diagram representation of the program algorithm. The system flowchart is
designed as shown below:

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 19


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

Figure 14 Flowchart description of the system


The flowchart above shows the initial description of the system program code. The first thing the
program will do is to initialize and read the ADC and the USART pins, then sends the transformer
parameters which are fed to the ADC to the personal computer system using the UART1_Write
command, then to the LCD display. The microcontroller ADC will continuously capturing the
transformer parameters, as soon as the transformer secondary current is greater than 1A, it sends a trip
signal to the overcurrent relay, and it cuts off the load that leads to the overcurrent, thereby protecting
the transformer from burning. Same process goes to the over voltage protection, it will check whether

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 20


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

the transformer input voltage is greater than 230Vac, if so, it sends a trip signal to overvoltage relay,
thereby protecting the transformer.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 21


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

CHAPTER 4
HARDWARE AND SOFTWARE DESIGNAND IMPLEMENTATION

4.1 Schematic diagram


4.1.1 Complete schematic diagram
As designed in chapter 3, the circuit section consists of AVR microcontroller, step down transformer
circuit for voltage sensing, current sensing circuit, relay circuits, a temperature sensor, RS232 and the
masx232 circuit. The step down transformer used is a 230VAC to 12VAC transformer and is used for
the purpose of sensing the input voltage to the main transformer with a voltage rating of 230VAC to
160VAC. The step down transformer is been rectified and filtered to a pure dc which goes directly to
the microcontroller ADC for monitoring the input voltage. For the purpose of current sensing, a
current transformer was used for that purpose. It went through rectification and filtering process then
directly connected to the microcontroller ADC for monitoring the load current.

The microcontrollers send the monitored parameters to LCD display and also transmit them to a
personal computer. The transmission to personal computer was made possible by interfacing the
microcontroller with the computer using MAX232 through RS232 serial communication. RS232
(recommended standard 232) supports both synchronous and asynchronous transmission and its user
data is send as a time series of bits. While monitoring the parameters, whenever a fault occurs which
might be high voltage or over current, the microcontroller sends a trip signal to the relay and thereby
protecting the transformer from burning.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 22


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

Figure 15 Complete schematic

4.2 Software implementation


4.2.1 Programming in Micro PRO for AVR
Microcontroller acts as the brain of the entire system. It monitors the voltage, current and
temperature of the transformer, display the parameters on LCD and PC through RS232 serial port.
Whenever a fault occurs, it automatically sends a trip signal to the relay and thereby protecting the
transformer from burning. An algorithm has been developed which makes the microcontroller reads
the input analogue signals and responds consequently. The algorithms have been represented by the
flowchart shown in chapter three, and now the flowcharts are been interpreted into C language and
complied using the Micro PRO for AVR. Refer to appendix for complete C program.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 23


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

4.2.1.1 Brief description of the system main program


The main program is divided into multiple of parts, and the parts are the definition of ports and pins,
initialization of ADC, configuration of the serial communication protocol ports and finally
configuration of LCD display.

Figure 16 Complete circuit simulation models

4.2.1.2 Initialization ports and pins.


General purpose input/ output pins of the microcontroller can be said to be the basic and commonly
used peripherals in microcontrollers. They permit the Atmega16 microcontroller pins to be used as
input or outputs based on the task at hand for monitoring and controlling devices. To use a port or pin
of a microcontroller as input, a data direction register called DDR register is used to configure the
port as input. To setup PORTB as input, DDR register is set as DDRB=0X00. And to use the PORTB
as output, DDR register setup as DDRB=0XFF.In this project PORT A is used for Analogue digital

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 24


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

conversion, PORT C is used for LCD interfacing, PORT D is used for relay control, LCD control
pins and serial port.

4.3. Proteus for Atmega32


With the exclusive feature of the Proteus simulation software, it helps in easy development of both
the system hardware and software. The Proteus design enables us to progress in our project more
rapid, giving us the ability to make hardware or software changes which reduces software
troubleshooting problems. The project was built and tested in Proteus just by using the software
prototype components without using the physical hardware prototype. Therefore using Proteus
software, the voltage sensing circuit, current sensing circuit, temperature sensor, relays, LED’s, LCD
display and serial communication were all developed and tested as shown figure above.

RESULTS AND DISCUSSION

4.5 Results
From simulation of this project we can observe that when impute power supply is varied
microcontroller sense this variation and send signal to the relay in order to be ON state after that
whatever input power is changed relay never change its position. and also current sensor never sense
change that happen on the load (i.e. it never detect over current existence automatically ).

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 25


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

CHAPTER 5
CONCLUSION AND FUTURE RECOMMENDATION

5.1 Conclusion
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 but
the results have not been verified with proteus simulation so much enough.

5.2 Future Recommendations


Any work and investigation on transformer protection is very advantageous and challenging. Based
on the present time, it can be observed that the world’s population is increasing rapidly. Therefore
demands on electricity will be high and these will lead to demands of highly sophisticated protection
devices, which will be incorporated in transformer protection schemes. Based on the work done in
this project which protecting transformer using microcontroller, so more improvements need to be
made in the future work. It was noticed that use of current sensor prevent the protection from high
performance application because the current sensor needs some amount of time to sense the load
current and transfer the signal to the microcontroller

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 26


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

Reference
Books
[1]Badri ram and D N Vishwakarma (1995) power system protection and switch gear.
[2]Frank D. Petruzella (2010) Electric motors and control systems 1st ed. New york:
McGraw-Hill
[3]J. Lewis Blackburn , Thomas J. Domin (2006). Protective Relaying Principles and
Applications . 3rd ed. United States of America: CRC press
[4]Leonard L. Grigsby (2007). The Electric Power Engineering Handbook. 2nd ed. United
States of America: CRC press.
[5]P. M. Anderson (1998). Power system protection. New York: John Wiley & Sons,
IncP.673.
[6]2002 Student Conference on Research and Development Proceedings, Shah Alam,
Malaysia
[7]International Research Journal Of Multidisciplinary Studies & Sppp's,
Karma yogi Engineering College, Pandharpur Organize National Conference
Special Issue March 2016.

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 27


ASU DEPARTMENT OF ECE 4TH YEAR CONTROL STREAM SEMISTER PROJECT 2017

APENDEX
#include <built_in.h>
#define LCD PORTC
sbit LCD_RS at PORTD4_bit;
sbit LCD_EN at PORTD6_bit;
sbit LCD_RW at PORTD5_bit;
sbit LCD_D7 at PORTC7_bit;
sbit LCD_D6 at PORTC6_bit;
sbit LCD_D5 at PORTC5_bit;
sbit LCD_D4 at PORTC4_bit;
sbit LCD_D3 at PORTC3_bit;
sbit LCD_D2 at PORTC2_bit;
sbit LCD_D1 at PORTC1_bit;
sbit LCD_D0 at PORTC0_bit;

// Pin direction
sbit LCD_RS_Direction at DDD4_bit;
sbit LCD_EN_Direction at DDD6_bit;
sbit LCD_RW_Direction at DDD5_bit;
sbit LCD_D7_Direction at DDC7_bit;
sbit LCD_D6_Direction at DDC6_bit;
sbit LCD_D5_Direction at DDC5_bit;
sbit LCD_D4_Direction at DDC4_bit;
sbit LCD_D3_Direction at DDC3_bit;
sbit LCD_D2_Direction at DDC2_bit;
sbit LCD_D1_Direction at DDC1_bit;
sbit LCD_D0_Direction at DDC0_bit;
sbit RS at PORTD4_bit;
sbit EN at PORTD6_bit;
sbit RW at PORTD5_bit;
sbit relay at PORTD2_bit;
sbit relay2 at PORTD3_bit;
unsigned int voltage,current,temp,current2,current1;
int decimal,integer;float analog;
char txt1[] = "Transformer protection";
.
.
.
.
UART1_Write(temp);
UART1_Write(voltage);
UART1_Write(current);
}
}

POWER TRANFORMER PROTECTION SYSTEM DESIGN BASED ON ATMEGA 32 Page 28

You might also like