Академический Документы
Профессиональный Документы
Культура Документы
POWER TRANSFORMER
1.1 Introduction
As the soul keeps the body alive same is the case of transformer for the electrical
system. It is used to provide electrical energy from one to another circuit. Magnetic field is
1
induced when primary current is changed and as a result secondary current is also changed. If
we connect the load then energy can further be transferred. The secondary current can be
determined by primary current if we know the turn ratio of transformer. By increasing Ns one can
[8]
step up the voltage and stepped down by decreasing Ns.
1.2 Efficiency
2
Transformer is one of the most effective devices. Its efficiency is up to 99%. They come
[9]
in different sizes. No matter what the range is the basic principle is same in every transformer.
1.3 Applications
Transformers are widely used to step down voltages to a suitable level. They isolate the
user from the main power supply. Signal and audio transformers are also used in applications
like microphones and record player cartridges. Two way communications on telephone lines is
just because of audio transformers, also the isolation between external cables and internal
. [8]
circuits is a big feature of them
Two basic principles are used in the transformer: magnetic field due to electric current
(electromagnetism) and voltage due to changing magnetic field (electromagnetic induction). If a
load is connected the energy is further transferred. Ideally a transformer should transfer energy
[8]
completely with full efficiency.
1.5 Types
3
Transformers come in all shapes and sizes for example balun transformer that is of the
size of a palm while weight of EHV power transformer is several metric tons.
[8]
Different types of transformers that are used in the industry are:
Generator transformer
Power transformer
Distribution Pole-mounted transformer
Grounding transformer
Regulating transformer
Welding transformer
Convertor transformer
Instrument transformer
Over-current protection in the form of fuses may be the only protection provided to a
small 50KVA, 11kv/400 distribution transformer. Different transformers need different protection
backups.
1.6 Coolant
4
No load losses are due to hysteresis losses and eddy current loss. These losses occur
while energizing the transformer. The voltage used for exciting the transformer determined how
much hysteresis loss and eddy current loss are produced in it.
CHAPTER: 2
5
IMPORTANCE OF
PROTECTION
2.1 Introduction
The modern society of today is heavily depending upon continuity and reliability of
electricity. Computer and telecommunication networks, railway networks, banking and post
6
offices networks, continuous process industries and life support systems are all those systems
which cannot work without a reliable source of electrical energy. On the other hand millions of
users whose life and carrier will totally be disturbed if they get no electricity. So we need a 24
hour power supply to live in this age but its not possible so we will have made a compromise.
We need power systems that are well protected for the coming future. Today it is a different
scenario because as the number of electrical companies is increasing the number of consumers
are increasing on double rate, so power is getting limited. The power requirements of users are
increasing and companies are not able to cop with it. So every company is trying to provide the
best of it for its survival in future. Whatever is done we cannot eliminate fault from our systems.
We can only provide compensation in case of faults.
[1]
Figure 2.1: Power infrastructure
We use better and better protection schemes whose characteristics give us best results.
7
2.2.1 Sensitivity
Sensitivity is a major issue. A system should be active enough to respond to any fault
that occurs. If a system is much sensitive it will detect minor changes as well.
2.2.2 Selectivity
2.2.3 Speed
The third important property is speed because a system should be fast enough to
remove faults as quickly as possible in order to retain stability. Time is money especially in case
of power systems. It should be remembered that speed and accuracy do have an inverse
relationship between them. A high speed system is not accurate enough that is why it has lesser
amount of information at its disposal than a slow speed system. It is the job of an engineer to
provide a balance between both these things.
Reliability and Dependency is the fourth important property. If a system is protective but
not reliable then it is useless. Just using good engineering judgment can lead us to a reliable
system. Systems which are simple are more reliable and majority in them are those having
locally available information. One should not depend much on remote systems. As already
mentioned we cannot reduce faults, so to enhance the protection and dependability of the
protective system we need backup systems.
8
We want a stable power system so we only isolate the faulty components5, leaving the
rest of the circuit as it is. So we apply a very pragmatic approach to deal with the faults. That is
why we use well-established technologies.
9
1) Design
According to the requirement of the client, two standards for current transformer were
developed. CT has enwrapped wire several times around the ring made up of silicon. The
current measurement of any circuit is done by passing that silicon ring over the circuit. The CT is
a constant-current series device. Primary circuit is not really affected by a CT while the
secondary current is 1 to 5 amperes. For example, a 2000:2 means there is current of 2A
flowing in secondary windings when the primary windings current is 2000A. [3]
2) Usage
A CT is mostly used to measure and monitor the current values. The CT is usually
described by the ratio of primary current to the secondary current. CTs can be used as
protection devices.
3) Safety Precautions
It should be kept in mind that when current is flowing in the transformer load should be
connected to the secondary side.
5) Accuracy
1) Types
There are several types of Potential Transformers. Three types are mainly used which
are as follows:
By changing the ratio between primary and secondary coils, we can get variable voltage. A
constant voltage transformer maintains constant output voltages for variations up to 20% in the
input voltages. When a voltage regulator is added then voltage ratio can be adjusted.
2) Selection
Configuration
Frequency
The size and cost of a transformer increases with the KVA rating.
11
3) Accuracy of Potential Transformer
The ratio and phase-angle inaccuracies of potential transformer are so small that they can be
neglected for protective-relaying purposes. The thermal VA rating corresponds to the full-load
rating of a power transformer. For metering purposes this voltage is kept higher than the VA
ratings. The equivalent-circuit impedances of potential transformers are comparable to those of
distribution transformers. The "burden" is the total external VA load on the secondary at rated
secondary voltage.
2.3.3 Relays
Relay is an electromechanical switch made up of an electromagnet and a set of
contacts. They are usually hidden and mostly used in computers for Boolean gates. The
purpose to use a relay is small amount of power consumption which is good for low-power
electronic circuits. Relays are quite common in home appliances where there is an electronic
control turning on something
There are four parts in every relay:
Electromagnet
Armature that can be attracted toward the electromagnet
Spring
Set of electrical contacts
Phase to neutral
Phase to phase
Phase to earth
Failure of installation cause shunt faults. The breaking of insulation can be due to overvoltage or
weakening of contacts having factors given as follows:
13
Overhead lines 50
Underground lines 9
Transformers 10
Generators 7
Switchgear 12
CT and PT relays 12
Our major challenge is protection of power Transformers using relays because they are
very expensive. Faults in power transformers are not economical.
There are several types of protections which have must be provided before installing of any
Power transformer.
Inrush current (switching current surge) has to be taken into account for its proper
Function
14
An interterm short circuit is developed when high current flows through the windings
which cause faults. Buchholz gas relay detects the windings and inter-turn faults and also deals
with the insulation failures.
CHAPTER: 3
15
MICROCONTROLLER
3.1 Introduction:
A compact stand alone computer suitable for control applications is microcontroller.
Processor, I /O interfaces, Random Access Memory (RAM), Read Only Memory (ROM) all are
present on single chip of silicon. Time taken by it to read or write instruction is very small.
Microprocessors are very important part of products in our everyday life such as TVs, cars,
radios, home applications. It is core part of computers. It makes only 2% of all semiconductor
market. 30% of Worlds semiconductor sales come from microprocessors, microcontrollers and
programmable peripheral chips. There are different types of Microcontrollers available in market
[12]
e.g. 4-bit, 8-bit, 16-bit.8-bit microcontroller is best selling controller.
16
[13]
Figure 3.1: Block diagram of microcontroller
There are also 32-bit microprocessors. It includes several embedded processors such
as Power PC, MIPS, and ARM chips. Embedded systems use approximately about 98% of
microprocessor. They are expensive and used in very large volume
Microcontroller is defined as computer on chip. Single IC contains all necessary parts. You just
need to power it up and it start executing the programme stored in it. It has CPU core,
ROM/EEPROM /FLASH, and RAM. It has ability to limit the capabilities of CPU itself allowing
complete computer on single silicone chip. Controllers are used in application where processing
power is not so important. For example, controlling a remote control device with the smallest
microcontroller. Microcontrollers are used in many electronic devices now days.
Data logging is a special feature of microcontroller. This feature also enables to monitor many
atmospheric parameters. They are very small sizes and easy to use. There power requirement
is very low.
17
[14]
Figure 3.2: PIC Microcontrollers architecture
PIC microcontroller enables us to do things which one cannot do with discrete logic. It may not
replace processors but this inexpensive, small size chip is right selection for many projects.
18
[15]
Figure 3.3:PIC16F877A pin configuration
19
[16]
Figure 3.4: Structure of PIC16F877A with peripherals
3.2.3 Features
PIC microcontroller is a processor with following features:
Internal EEROM
FLASH memory
Timers
Analog comparator
RAM
1) Programming
As PIC microcontroller use flash memory, you can re-program it. This is one of the
powerful features of PIC microcontroller. PIC microcontroller has built in ICSP serial interface for
programming and you can do programming even it is plugged in to circuit.
20
2) Input / Output - I/O
A PIC Microcontroller can control outputs and react to inputs. One can drive LCD or
seven segment display by using PIC microcontroller. By considering frequency counter and
discrete web design you will find microcontroller design efficiency over discrete design. Now it
has built in A/D converter so you can easily read analog signal.
[13]
Table 3.1: PIC Microcontroller Features
PIC
PIC microcontroller
microcontroller
feature description
Feature
Flash memory Re-programmable program storage.
RAM Memory storage for variables.
Long term stable memory: Electrically Erasable Programmable Read
EEPROM
Only Memory.
I/O ports High current Input/output ports (with pin direction change).
Timers/Counters Typically 3.
USART Built in RS232 protocol (only needs level translator chip).
Comparator An analogue comparator and internal voltage reference.
A/D Analog to digital converter.
PSP Parallel Slave Port (for 8 bit microprocessor systems).
LCD LCD interface.
Special features ICSP,WDT,BOR,POR,PWRT,OST,SLEEP
ICSP Simple programming using In Circuit Serial Programming.
CHAPTER: 4
21
PROJECT DESCRIPTION
22
In our research, the major topic of concern is microcontroller based relay for power
transformer protection and its hardware and software implementation. The percentage
differential protection which includes over current protection, external faults and over & under
voltage protection has been carried out in this project. In first quarter of primary current wave,
the method of rate of change of primary current w.r.t time has been adopted to discriminate the
internal current from inrush. Because magnetizing inrush current wave has high di/dt as
compared with di/dt of internal current wave. Block diagram of project is given below.
23
Capacitors
Cooling Fan
220/12 Volt Supply
Load (Lamps)
24
Figure 4.1 Voltage measuring circuit
25
NPN transistor is light sensitive, its base emitter junction will be forward biased due to light
falling on its base and transistor will then operates the relay. It is more beneficial to used pulse
train to operate the relay then pulse generator to trip the coil.
If collector and base terminal of NPN transistor in Opto-Coupler meets some fault, the high
voltage will not reach the control circuit, as there is no physical connection between power
circuit and control circuit. The only connection between them is LED light which is on falling
transistor base will operate the relay. In this way, the control circuit is protected from the high
voltage of power circuit.
26
Figure 4.3 Power supply circuit
27
Figure 4.4 current measuring circuit
28
Figure 4.5 buzzer circuit
29
Figure 4.6 Temperature sensing circuit
30
Figure 4.7 LCD circuit
4.4 Protections
Input pins 2 and 3 (RA0 and RA1) of microcontroller will provide the output
across the capacitor. Transformer protection against overload, internal faults, such as inter-turn
31
faults, windings to core faults etc. and thermal overload is done by programming PIC
microcontroller 16F877A.
32
increases from its safety limits. We have divided this protection in two steps. The temperature of
transformer is continuously fed to the microcontroller through heat sensor LM35.In the first step
of thermal overload protection, if temperature of the transformer exceeds from first preset value
the microcontroller sends the signal to LED/Buzzer. The LED/Buzzer will show that the
temperature has crossed the first limit and some preventive action must be taken (like start of
cooling fan).If the temperature further increases and crosses the second preset value
microcontroller senses this and sends the signal to the relay to operate. The relay in turn
energizes its contactor coil. The NC of contactor becomes open. In this way transformer is
protected against thermal overloading.
33
Figure 4.8 Complete Circuit Diagram of Project
34
CONCLUSION
In this modern age the protection of electrical system has been a challenging problem for all
protection engineers. The transformation from analog world to digital world has created vast
35
scope of study for all protection engineers and has moved to more economical techniques for
implementation as well.
With advancement of microchips we were also attracted towards protection of transformer using
microcontroller. Here we have chosen PIC microcontroller 16F877A due to its special features
like reprogram ability, built in Analog to digital convertor (A/D). The transformer is backbone of
every electrical power system. The various application of transformer has lead to its wide usage
including substations to mini house household appliances. Thus protection has been
compulsion.
In this project, microcontroller based protection system of transformer has been designed and
explained. The main purpose of this project is to provide protection against different faulty
conditions in transformer which are given below
Internal Faults
Short circuit
Overloading
Overheating
Over voltage
Under voltage
36
Accuracy: Correctness of an instrument
Analog Filters: Filters for Analog Signals
A/D Converters: Analog to Digital Converters
AC: Alternating Current
C
CT: Current Transformer
Circuit Breaker: An automatically-operated electrical switch
CISC: Complex Instruction Set Computer
CMOS: Complementary Metal Oxide Semiconductor
D
Differential Protection: Protection using difference of two quantities.
DGA: Digital Gas Analysis
DC: Direct Current
E
EEPROM: Electrically Erasable Programmable Read Only Memory
I
IEEE: Institute of Electrical and Electronic Engineers
ICSP: In Circuit Serial Programming
L
LCD: Liquid Crystal Display
O
OTP: One Time Programmable
P
PT: Potential Transformer
R
Relay: A simple electromechanical switch
RISC: Reduced Instruction Set Computer
RAM: Random Access Memory
ROM: Read Only Memory
S
SPI: Serial Peripheral Interface
SCI: Serial Communication Interface
37
U
UART: Universal Asynchronous Receiver Transmitter
USART: Universal Synchronous/Asynchronous Receiver Transmitter
REFERENCES
[1] http://intelligrid.epri.com/architecture/images/Power_Infrastructure_Relies_On_Information.jpg
38
[2] http://en.wikipedia.org/wiki/Power_system_protection
[3] http://www.esacademy.com
[4] http://www.sayedsaad.com/Protection/files/VT_CT/1_VT_CT_files/image006.jpg
[5] http://en.wikipedia.org/wiki/Transformer_oil
[6] http://www.mikeholt.com/mojonewsarchive/EESHTML/HTML/ElectricalCircuitBre
akers~20030621.htm
[7] http://www.electricity-today.com/et/june99/trans.html
[9] http://electronicslink.net/s/power_transformer_design
[10] http://en.wikipedia.org/wiki/Power_system_protection#Types_of_protection
[11] http://www.electricalpowertransformer.com
[12] http://www.best-microcontroller-projects.com/pic-microcontroller.html
http://www.pictutorials.com/microcontroller_architectur.gif
[15] http://electricly.com/wp-content/uploads/2011/01/pic-16F877-Pin-out-e1294033814646.png
[16] http://digsys.upc.es/sed//SED/unitats/unitat_2_10/img/imgtimerB.gif
[17]http://www.freepatentsonline.com/6617839-0-large.jpg
APPENDIX
Code:
#include <16F877.h>
39
#device adc=10
#use delay (clock = 4000000)
#fuses BROWNOUT, HS, NOWDT, NOLVP, PUT
#byte ADCON0 = 0X1F
#byte ADCON1 = 0X9F
#byte PORTB = 0x06
#byte PORTD = 0x08
#bit RS = PORTD.6
#bit EN = PORTD.7
#define BUZZER PIN_C4
#define RLY_FAN PIN_C5
#define RLY_240V PIN_C6
#define RLY_220V PIN_C7
#define RLY_200V PIN_D4
#define RLY_SHUT PIN_D5
#define SW1 PIN_E0
#define SW2 PIN_E1
#define SW3 PIN_E2
void lcd_ini (void);
void lcd_data (char);
void lcd_com (char);
void process_temp(void);
void process_voltage(void);
void process_current(void);
void OV_SHUT_DOWN(void);
void UV_SHUT_DOWN(void);
void OL_SHUT_DOWN(void);
void OT_SHUT_DOWN(void);
void BCD (void);
void display_temp (void);
void display_volt (void);
void display_current (void);
void settings(void);
void display_vs(void);
void display_is(void);
void display_ts(void);
unsigned int count, count1, digit1, digit2, digit3 ;
unsigned int32 adc_value, P1_VOLTAGE ;
40
unsigned int32 TEMPERATURE, P1_CURRENT;
unsigned int32 OV, UV, OL, T;
void main()
{ set_tris_a(0b11111111);
set_tris_e(0b11111111);
set_tris_b(0b00000000);
set_tris_c(0b00000000);
set_tris_d(0b00000000);
output_b(0x00);
output_c(0x00);
output_d(0x00);
ADCON0 = 0B10000001 ;
ADCON1 = 0B11000010 ;
output_high(RLY_SHUT);
output_low(BUZZER);
OV =2450; UV = 1700; OL = 120; T = 400;
lcd_ini();
delay_ms(1000);
while(1)
{
process_voltage();
process_current();
process_temp();
if (input (SW1) == 0 )
settings();
delay_ms(500);
}
}
/////////////////////////////////////////////////
void process_voltage (void)
{ set_adc_channel(1); //INPUT voltage
delay_ms(25);
adc_value = read_adc();
adc_value = adc_value*5000/1023;
P1_VOLTAGE = adc_value;
BCD();
lcd_com(0x80);
41
lcd_data('I');
lcd_data('N');
lcd_data(' ');
lcd_data(' ');
lcd_data(' ');
lcd_data(' ');
lcd_data(' ');
display_volt();
///////////////////////
set_adc_channel(2); //out voltage
delay_ms(25);
adc_value = read_adc();
adc_value = adc_value*5000/1023;
BCD();
lcd_com(0xC0); // set lcd cursor on line2 col1
lcd_data('O');
lcd_data('U');
lcd_data('T');
lcd_data(' ');
lcd_data(' ');
lcd_data(' ');
lcd_data(' ');
display_volt();
////////////////////////
if (P1_VOLTAGE > 1700 && P1_VOLTAGE < 1800 ) // 180v tapping
{output_low(RLY_200V); output_low(RLY_220V); output_low(RLY_240V);}
else if (P1_VOLTAGE> 1800 && P1_VOLTAGE <2000) // 200v tapping
{output_high(RLY_200V); output_low(RLY_220V); output_low(RLY_240V);}
else if (P1_VOLTAGE > 2000 && P1_VOLTAGE < 2200) // 220v tapping
{output_high(RLY_200V); output_high(RLY_220V); output_low(RLY_240V);}
else if (P1_VOLTAGE > 2200 && P1_VOLTAGE < 2400) // 240v tapping
{output_high(RLY_200V); output_high(RLY_220V); output_high(RLY_240V);}
if (P1_VOLTAGE < UV ) UV_SHUT_DOWN();
else if (P1_VOLTAGE > OV ) OV_SHUT_DOWN();
}
/////////////////////////////////////////////////
void process_current (void)
{ set_adc_channel(3); //P1 voltage
42
delay_ms(25);
adc_value = read_adc();
adc_value = adc_value*5000/1023;
P1_CURRENT = adc_value;
BCD();
lcd_com(0x90); // set lcd cursor on line3 col1
lcd_data('I');
lcd_data(' ');
lcd_data('L');
lcd_data('O');
lcd_data('A');
lcd_data('D');
lcd_data(' ');
display_current();
///////////////////////
if (P1_CURRENT > OL )
OL_SHUT_DOWN();
}
/////////////////////////////////////////////////
void process_temp (void)
{ set_adc_channel(0);
delay_ms(25);
adc_value = read_adc();
adc_value = adc_value*5000/1023;
TEMPERATURE = adc_value;
BCD();
lcd_com(0xD0); //set lcd cursor on line4 col1
lcd_data('T');
lcd_data('E');
lcd_data('M');
lcd_data('P');
lcd_data(' ');
display_temp();
if ( TEMPERATURE > T ) OUTPUT_HIGH(RLY_FAN);
else if (TEMPERATURE < (T-1)) OUTPUT_LOW(RLY_FAN);
}
///////// settings //////////////////////////////
void settings()
43
{ lcd_com(0x01); // clear lcd
delay_ms(100);
lcd_data('S');
lcd_data('E');
lcd_data('T');
lcd_data('T');
lcd_data('I');
lcd_data('N');
lcd_data('G');
lcd_data(' ');
lcd_data('M');
lcd_data('O');
lcd_data('D');
lcd_data('E');
44
delay_ms(500);
}
if (input (SW3) == 0)
{ adc_value = adc_value - 10;
display_vs();
delay_ms(500);
}
}
UV = adc_value ;
/////////////////////////////
while (!input (SW1));
delay_ms(100);
lcd_com(0xC0);
lcd_data('O');
lcd_data('V');
lcd_data('E');
lcd_data('R');
lcd_data(' ');
lcd_data('V');
lcd_data('O');
lcd_data('L');
lcd_data('T');
lcd_data('A');
lcd_data('G');
lcd_data('E');
adc_value = OV;
while (input (SW1))
{ display_vs();
if (input (SW2) == 0)
{ adc_value = adc_value + 10;
display_vs();
delay_ms(500);
}
if (input (SW3) == 0)
{ adc_value = adc_value - 10;
display_vs();
delay_ms(500);
}
45
}
OV = adc_value ;
/////////////////////////////
while (!input (SW1));
delay_ms(100);
lcd_com(0xC0);
lcd_data('O');
lcd_data('V');
lcd_data('E');
lcd_data('R');
lcd_data(' ');
lcd_data('C');
lcd_data('U');
lcd_data('R');
lcd_data('R');
lcd_data('E');
lcd_data('N');
lcd_data('T');
adc_value = OL;
while (input (SW1))
{ display_is();
if (input (SW2) == 0)
{ adc_value = adc_value + 10;
display_is();
delay_ms(500);
}
if (input (SW3) == 0)
{ adc_value = adc_value - 10;
display_is();
delay_ms(500);
}
}
OL = adc_value ;
/////////////////////////////
while (!input (SW1));
delay_ms(100);
lcd_com(0xC0);
46
lcd_data('T');
lcd_data('E');
lcd_data('M');
lcd_data('P');
lcd_data('E');
lcd_data('R');
lcd_data('A');
lcd_data('T');
lcd_data('U');
lcd_data('R');
lcd_data('E');
adc_value = T;
while (input (SW1))
{ display_ts();
if (input (SW2) == 0)
{ adc_value = adc_value + 10;
display_ts();
delay_ms(500);
}
if (input (SW3) == 0)
{ adc_value = adc_value - 10;
display_ts();
delay_ms(500);
}
}
T = adc_value ;
lcd_com(0x01);
delay_ms(100);
}
/////////////////////////////////////////////////
void display_vs()
{ lcd_com(0x90);
BCD();
display_volt();
}
///////////////////
void display_is()
47
{ lcd_com(0x90);
BCD();
display_current();
}
///////////////////
void display_ts()
{ lcd_com(0x90);
BCD();
display_temp();
}
/////////////////////////////////////////////////
void display_volt (void)
{ lcd_data(digit3+0x30);
lcd_data(digit2+0x30);
lcd_data(digit1+0x30);
lcd_data('V');
lcd_data(' ');
lcd_data(' ');
lcd_data(' ');
void display_current()
{ lcd_data (digit2+0x30);
lcd_data('.');
lcd_data (digit1+0x30);
lcd_data('A');
lcd_data(' ');
lcd_data(' ');
}
void display_temp()
{ lcd_data (digit2+0x30);
lcd_data (digit1+0x30);
lcd_data(' ');
lcd_data('C');
lcd_data(' ');
lcd_data(' ');
48
}
/////////////////////////////////////////////////
/////////////////////////////////////////////////
void OV_SHUT_DOWN(void)
{ lcd_com(0X01);
output_low(RLY_SHUT);
delay_ms(200);
lcd_data('O');
lcd_data('V');
lcd_data('E');
lcd_data('R');
lcd_data(' ');
lcd_data('V');
lcd_data('O');
lcd_data('L');
lcd_data('T');
lcd_data('A');
lcd_data('G');
lcd_data('E');
while(1)
{ output_toggle(BUZZER);
delay_ms(500);
}
}
49
/////////////////////////////////////////////////
void UV_SHUT_DOWN(void)
{ lcd_com(0X01);
output_low(RLY_SHUT);
delay_ms(200);
lcd_data('U');
lcd_data('N');
lcd_data('D');
lcd_data('E');
lcd_data('R');
lcd_data(' ');
lcd_data('V');
lcd_data('O');
lcd_data('L');
lcd_data('T');
lcd_data('A');
lcd_data('G');
lcd_data('E');
while(1)
{ output_toggle(BUZZER);
delay_ms(500);
}
}
/////////////////////////////////////////////////
void OL_SHUT_DOWN(void)
{ lcd_com(0X01);
output_low(RLY_SHUT);
delay_ms(200);
lcd_data('O');
50
lcd_data('V');
lcd_data('E');
lcd_data('R');
lcd_data(' ');
lcd_data('L');
lcd_data('O');
lcd_data('A');
lcd_data('D');
while(1)
{ output_toggle(BUZZER);
delay_ms(500);
}
}
/////////////////////////////////////////////////
void OT_SHUT_DOWN(void)
{ lcd_com(0X01);
output_low(RLY_SHUT);
delay_ms(200);
lcd_data('O');
lcd_data('V');
lcd_data('E');
lcd_data('R');
lcd_data(' ');
lcd_data('T');
lcd_data('E');
lcd_data('M');
lcd_data('P');
while(1)
{ output_toggle(BUZZER);
delay_ms(500);
}
}
51
/////////////////////////////////////////////////
void lcd_ini(void)
{ delay_ms(300);
lcd_com(0x38);
lcd_com(0x0C);
lcd_com(0x01);
delay_ms(100);
}
/////////////////////////////////////////////////
void lcd_com(char i)
{ RS = 0;
PORTB = i;
EN = 1;
delay_us(300);
EN =0;
}
/////////////////////////////////////////////////
void lcd_data(char i)
{ RS = 1;
PORTB = i;
EN = 1;
delay_us(300);
EN = 0;
}
52