Progress Report Final

You might also like

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

KATHMANDU UNIVERSITY

SCHOOL OF ENGINEERING
DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING

PROJECT PROGRESS REPORT

Protection of Power Instruments from 3-Phase Lines Faults

Submitted By:
Bishal Bhetwal (31036)
Rajiv Bishwokarma (31037)
Abhay Jaiswal (31046)
Bishal Kandel (31047)
Saipal Singh Kathayat (31048)

February 2018
ABSTRACT

The aim of this project is to develop a load isolation mechanism to protect the load connected from phase
fault damages. The fluctuation in AC mains supply is frequent in homes and industries. The sensitive
electronic devices in these conditions can get easily damaged. It is preferable to have a load isolating
mechanism to protect the load. The system being developed aims to protect the electrical power equipment
from under voltage, over voltage, and line-to-line faults and display the fault information in a LCD.
Currently, the system detects any voltage greater than or lower than 15% of the normal 220V AC (pre-set
value). If the voltage is greater or less than the pre-set value, it displays the a fault signal in the LCD.
However, upon completion the detection of any fault will initiate a trip signal, which is given to the relay
driver. The relay driver, then, drives the contactor to isolate the load from the source. Thus, protecting the
connected equipment.

i
SYMBOLS AND ABBREVIATIONS

A. Symbols
Symbol Description First Used in Page
Vp Primary voltage 5
Vs Secondary voltage 5
Np Number of primary turns 5
Ns Number of secondary turns 5

B. Abbreviations
Abbreviation Full Form First Used in Page
AC Alternating Current 1
LCD Liquid Crystal Display 2
IC Integrated Circuit 3
IEEE Institute of Electrical and 3
Electronics Engineers
PIC Peripheral Interface Controller 3
GSM Global System for Mobile 4
communication
SMS Short Message Service 4
DC Direct Current 5
IDE Integrated Development 8
Environment
FTDI Future Technology Devices 9
International
USB Universal Serial Bus 9
EEPROM Electronically Erasable 9
Programmable Read Only
Memory
PWM Pulse Width Modulation 10
SPI Serial Peripheral Interface 10
LED Light Emitting Diode 10
TWI Two Wire Interface 10
SDA Serial Data 10
SCL Serial Clock 10
MOSI Master Out Salve In 10
MISO Master In Slave Out 10
SCK Clock Signal 10
SRAM Static Random Access Memory 11
TX Transmit 11
RX Receive 11

ii
LIST OF FIGURES
Fig. No. Title Page No.
Figure 1 Block diagram of a step-up transformer ......................................................................................... 5
Figure 2 Bridge rectifier with input and output waves for first terminal...................................................... 6
Figure 3 Bridge rectifier with input and output waves for second terminal ................................................. 6
Figure 4 Rectified and smoothed ripples ...................................................................................................... 7
Figure 5 Arduino Uno labelled diagram ....................................................................................................... 8
Figure 6 Atmega 328 pin mapping ............................................................................................................. 10
Figure 7 20x4 Liquid Crystal Display pin configuration............................................................................ 12
Figure 8 Interfacing 20x4 LCD with Arduino Uno .................................................................................... 14
Figure 9 Block diagram of the fault detection system ................................................................................ 15
Figure 10 Flowchart for the fault detection process ................................................................................... 17
Figure 11 Task accomplished during the first stage of the project ............................................................. 18

iii
LIST OF TABLES
Table. No. Title Page No.
Table 1 Arduino Uno Technical Aspects…………………………………………………………………11
Table 2 20x4 Liquid Crystal Display pin allocation……………………………………………………...13
Table 3 Gantt Chart.....................................................................................................................................30

iv
TABLE OF CONTENTS
ABSTRACT .................................................................................................................................................. i
SYMBOLS AND ABBREVIATIONS......................................................................................................... ii
A. Symbols ............................................................................................................................................... ii
B. Abbreviations ....................................................................................................................................... ii
LIST OF FIGURES .....................................................................................................................................iii
LIST OF TABLES ....................................................................................................................................... iv
CHAPTER 1 ................................................................................................................................................. 1
INTRODUCTION ........................................................................................................................................ 1
1.1 Introduction......................................................................................................................................... 1
1.2 Background ......................................................................................................................................... 1
1.3 General and Specific Objectives ......................................................................................................... 2
1.4 Scope and Limitation .......................................................................................................................... 2
1.5 Application ......................................................................................................................................... 2
CHAPTER 2 ................................................................................................................................................. 3
LITERATURE SURVEY ............................................................................................................................. 3
2.1 Introduction......................................................................................................................................... 3
2.2 Background ......................................................................................................................................... 3
2.3 System Hardware ................................................................................................................................ 4
2.3.1 Transformer ................................................................................................................................. 4
2.3.2 Rectifier ....................................................................................................................................... 5
2.3.3 Capacitor ...................................................................................................................................... 7
2.3.4 Voltage Divider ........................................................................................................................... 7
2.3.5 Arduino Uno ................................................................................................................................ 8
2.3.6 Liquid Crystal Display ............................................................................................................... 11
2.3.7 44780 LCD ................................................................................................................................ 12
2.3.7 Interfacing LCD with Arduino Uno .......................................................................................... 13
CHAPTER 3 ............................................................................................................................................... 15
SYSTEM ANALYSIS AND EXPERIMENTS.......................................................................................... 15
3.1 System Overview .............................................................................................................................. 15
3.2 Flowchart .......................................................................................................................................... 16
3.3 Task Accomplished .......................................................................................................................... 17
3.4 Remaining Tasks .................................................................................................................................. 18
CHAPTER 4 ............................................................................................................................................... 19
5
CONCLUSION........................................................................................................................................... 19
4.1 Conclusion ........................................................................................................................................ 19
APPENDIX A ............................................................................................................................................. 21
A.1 Code for fault detection ................................................................................................................... 21
A.2 Code for Liquid Crystal Display ...................................................................................................... 24
APPENDIX B ............................................................................................................................................. 30
B.1 Schedule Management ..................................................................................................................... 30

6
CHAPTER 1
INTRODUCTION

1.1 Introduction
A fault can be classified as any abnormal condition in a power system. In a power system, the
steady state operating mode is a balanced 3-phase AC. However, this state is disrupted due to a
sudden change – internal or external – in the system. When a conducting object meets a live point,
a short circuit – classified as a fault - occurs.
There are numerous causes of faults in the power systems. A lightning strike at the phase wires
cause a sudden disruption in the transmission and this can damage the power instruments
connected to the lines.
Common faults include:
 Single line to ground fault
 Line to line fault
 Double line to ground fault
 Balanced phase fault
 Over voltage fault
 Under voltage fault
Faults lead to various hazards and can severely damage power instruments in industries or homes.
This interferes with industrial and commercial activities that support the economic growth and
learning activities in institutions, work in offices and domestic applications. Therefore, it is
important to have a fault protection device for power instruments.

1.2 Background
It is of upmost importance that the faults after detection should be eliminated, the contactor,
isolates load from the source after getting command from the microcontroller. The function of
protective relay is to sense the fault and send a tripping command to the contactor. Before the age
of automation, the faults in the power system was detected using manual staffs, which was very
difficult, as the system became more and more complex it was not possible for a human to continue
doing so, this gave rise to the system of automatic fault detection. Rapid detection and elimination
of faults became a necessity as technology grew, so a microcontroller based fault detection system
for a fast removal of the faults was envisioned. Today, new relays are normally numerical relays.
They are built using a microprocessor in which the relay characteristic is digitally Implemented.
The analog signals are converted to digital signals within the microprocessor. One of the main part
of the fault clearing system is the circuit breaker. The circuit breaker used now is very fast, but

1
since all circuit breakers are dependent on a current zero-crossing to interrupt the current, they can
never protect the power system from the first peak of the short-circuit current.

1.3 General and Specific Objectives


The general objective of the project is:
 To build a device capable of detecting faults in the power lines so as to protect the power
instrument connected to this device.

The specific objective of the project is:


 To detect the line-to-line faults.
 To detect the under-voltage and over-voltage faults.
 To display the type of faults using a LCD.
 To isolate the load connected to the device in case of any type of faults.

1.4 Scope and Limitation


 Line to line, under-voltage and over-voltage are the only types of faults that this system
can detect.

1.5 Application

 This device can be used in industries, hospitals, laboratories to protect the power
instruments.

2
CHAPTER 2
LITERATURE SURVEY

2.1 Introduction
In three-phase systems, a fault may involve one or more phases and ground, or may occur only
between phases. In a "ground fault" or "earth fault", current flows into the earth. The prospective
short-circuit current of a predictable fault can be calculated for most situations. In a polyphase
system, a fault may affect all phases equally, which is a "symmetrical fault". If only some phases
are affected, the resulting "asymmetrical fault" becomes more complicated to analyze.

2.2 Background
In [1], the authors design a system to detect the faults in the line and isolate the system connected
to it. It involves the use of microcontroller conjugation with the relay circuit with LCD display.
This system detects phase fault only. AC supply is used to get three phase-looped supply by
switches named R, Y, and B looping the three terminals of switch and getting three different phase
voltages. Step down transformer (12-0-12) is connected to full wave rectifier consisting of diodes
and current limiting resistors used to set regulated dc output voltage, which is fed to LCD and IC
microcontroller.
In case of abnormality, phase voltage is seen affected firs and phase voltage decreases which leads
to abnormal and fault operation.
If any of three phases R, Y or B fails then the system detects such kind of phase failure and displays
the information in LDC screen. At the same time, the microprocessor sends a signal to disconnect
the instrument from the main supply until the fault is clear. The microprocessor compares the value
of input voltage and output voltage in case if the relay receives any kind of tripping signal.
In [2], authors present different ways to characterize faults. One way to characterize the types of
faults is to describe them as shunt or series faults. Shunt faults are faults when one or more of the
phases are short-circuited (possibly to earth). Shunt faults are in general more severe than series
faults. The definition of a short-circuit fault from an IEEE standard is presented as: An abnormal
connection (including an arc) of relatively low impedance, whether made accidentally or
intentionally, between two points of different potential.
In [3], the authors construct a device for fault detection using a PIC16F877 microcontroller. The
device can withstand load up to 2 kV. The set voltage in the system varies from 200-240 volts.
This device can be used directly as standalone equipment between main supply and load.
The authors define over-voltage and under-voltage faults in the real system when the voltage
exceeds/ lags the normal voltage by 10% more than 1 minute. The main purpose of device is to
isolate the load from over voltage and under voltage condition by relay tripping coil using PIC
microcontroller. The microcontroller compares the supply voltage with the desired preset voltage

3
and operates the tripping coil in the relay. If the input voltage falls below or above the preset range
of values, then the fault is detected.
In [4], the authors build a device to protect a load from over-voltage, over-current and under-
voltage faults. This system makes comparison with the reference threshold values set by the user.
This system is constructed by using 8051, relay and circuit breaker. Protective relay functions as
a sensing diode and senses the faults. It, then, sends a tripping command to the circuit breaker. The
circuit breaker disconnects the fault element.
The authors conduct the overcurrent measurement with the following technique. Current
transformer reduces current levels from thousands of amperes down to its standard output of a
known ratio to 5 amps for normal operation. When the ratio is greater than 5 than overcurrent fault
is detected. For over-voltage and under-voltage, the voltage transformer/ potential transformer is
used to step down the voltage of a device to measurable values within the instrumentation
measurement range 110v or 100v. The voltage below 100v is condition of under-voltage and above
110v is over-voltage. When the fault is detected it is displayed on the screen.
In [5], authors study the construction of a device that can detect faults in a three-phase system. The
study is done with the following technique: In a symmetric three-phase power supply system, three
conductors each carry an AC of the same frequency and voltage amplitude relative to a common
reference but with a phase difference of one-third the period. Due to phase delay, it provides
constant power transfer to a balanced linear load. It also makes it possible to produce a rotating
magnetic field in an electric motor and generate other phase arrangements using transformers. In
a three phase system feeding a balanced and linear load, the sum of the instantaneous currents of
the three conductors is zero. Six numbers of steps down transformers are used for forming star and
delta secondary at low voltage output. Fault condition is created with a set of switches to input LL,
LG, 3L fault to the circuit.
In this project two timers are used one is mono-stable mode and other is stable mode. When any
push button is pressed for a short time the load is disconnected only for that period which indicating
a temporary fault. If the push button is pressed for longer time, then the stable timer s activated
and it causes a permanent fault and disconnects the load permanently. GSM technology can help
us to control the faults by sending SMS via mobile phone from any three phase faults.

2.3 System Hardware


2.3.1 Transformer
A transformer is an electrical device that transfers electrical energy between two or more circuits
through electromagnetic induction. The input coil is the primary and the output coil is the
secondary. There is no electrical connection between the primary and secondary. Transformers
waste very little power so the power out is (almost) equal to the power in. Note that as transformer
steps down the voltage, the current steps up. The voltage produced across a transformer winding
is directly proportional to the number of turns on the winding (shown in figure 1).

4
Figure 1 Block diagram of a step-up transformer

Thus:
Vp Np
=
Vs Ns
Where,
VP : Primary voltage
Vs : Secondary voltage
NP : Number of tuns in primary winding
Ns : Number of tuns in secondary winding

Np Ns
Finally, the turns-per-volt rating for a transformer is, t. p. v. = =
Vp Vs

2.3.2 Rectifier
A rectifier is an electrical device that converts alternating current (AC), which periodically
reverses direction, to direct current (DC), which flows in only one direction. The process is
rectification.
Rectifiers have many uses, but are often found serving as components of DC power supplies and
high-voltage direct current power transmission systems. Rectification may serve in roles other than

5
to generate direct current for use as a source of power. Because of the alternating nature of the
input AC sine wave, the process of rectification alone produces a DC current that, though
unidirectional, consists of pulses of current. Many applications of rectifiers, such as power supplies
for radio, television and computer equipment, require a steady constant value (as would be
produced by a battery). In these applications, an electronic filter (usually a capacitor) smooths the
output of the rectifier. A diode bridge is an arrangement of four (or more) diodes in a bridge circuit
configuration that provides the same polarity of output for either polarity of input.
In figure 2, when the input connected to the left corner of the diamond is positive, and the input
connected to the right corner is negative, current flows from the upper supply terminal to the right
along the positive path to the output, and returns to the lower supply terminal via the negative path.

Figure 2 Bridge rectifier with input and output waves for first terminal

When the input connected to the left corner is negative, and the input connected to the right corner
is positive, current flows from the lower supply terminal to the right along the positive path to the
output, and returns to the upper supply terminal via the negative path (figure 3).

Figure 3 Bridge rectifier with input and output waves for second terminal

6
2.3.3 Capacitor
The most common meaning of ripple in electrical science is the small, unwanted residual periodic
variation of the direct current (DC) output of a power supply which has been derived from an
alternating current (AC) source. This ripple is due to incomplete suppression of the alternating
waveform within the power supply.
However, ripple voltage is also commonly expressed as the peak-to-peak value. This is largely
because peak-to-peak is both easier to measure on an oscilloscope and is simpler to calculate
theoretically. Filter circuits intended for the reduction of ripple are usually called smoothing
circuits. The simplest scenario in AC to DC conversion is a rectifier without any smoothing
circuitry at all. The ripple voltage is very large in this situation; the peak-to-peak ripple voltage is
equal to the peak AC voltage. A more common arrangement is to allow the rectifier to work into
a large smoothing capacitor, which acts as a reservoir. After a peak in output voltage the capacitor
(C) supplies the current to the load (R) and continues to do so until the capacitor voltage has fallen
to the value of the now rising next half-cycle of rectified voltage. At that point the rectifiers turn
on again and deliver current to the reservoir until peak voltage is again reached. If the time
constant, CR, is large in comparison to the period of the AC waveform, then a reasonably accurate
approximation can be made by assuming that the capacitor voltage falls linearly. A further useful
assumption can be made if the ripple is small compared to the DC voltage (as shown in figure 4).
In this case, the phase angle through which the rectifiers conduct will be small and it can be
assumed that the capacitor is discharging all the way from one peak to the next with little loss of
accuracy.

Figure 4 Rectified and smoothed ripples

2.3.4 Voltage Divider


A potentiometer, informally a pot, is a three-terminal resistor with a sliding or rotating contact that
forms an adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts
as a variable resistor or rheostat. The measuring instrument called a potentiometer is essentially a

7
voltage divider used for measuring electric potential (voltage); the component is an
implementation of the same principle, hence its name. Potentiometers are commonly used to
control electrical devices such as volume controls on audio equipment. Potentiometers operated
by a mechanism can be used as position transducers, for example, in a joystick. Potentiometers are
rarely used to directly control significant power (more than a watt), since the power dissipated in
the potentiometer would be comparable to the power in the controlled load.
A potential divider can also be used as a level shifter to safely interface different circuits which
use different reference voltages. For example, an Arduino microcontroller works at 5 V logic,
while many sensors require 3.3 V logic. Directly interfacing the Arduino with a 3.3 V sensor may
cause permanent damage to the sensor. By using a level shifter with a ratio of 3.3/5 resistor values
on each pin connected to the sensor, an Arduino board can safely communicate with the sensor.
2.3.5 Arduino Uno
Arduino is an open-source computer hardware (shown in figure 5), and software company, project
and user community that designs and manufactures microcontroller-based kits for building digital
devices and interactive objects that can sense and control objects in the physical world. An Arduino
board historically consists of an Atmel 8-, 16- or 32-bit AVR microcontroller (although since 2015
other makers' microcontrollers have been used) with complementary components that facilitate
programming and incorporation into other circuits. Arduino programs may be written in any
programming language with a compiler that produces binary machine code. Atmel provides a
development environment for their microcontrollers, AVR Studio and the newer Atmel Studio.
The Arduino IDE supports the C and C++ programming languages using special rules of code
organization. The Arduino IDE supplies a software library called "Wiring" from the Wiring
project, which provides many common input and output procedures. A typical Arduino C/C++
sketch consist of two functions that are compiled and linked with a program stub main() into an
executable cyclic executive program:

Figure 5 Arduino Uno labelled diagram

8
 setup(): a function that runs once at the start of a program and that can initialize settings.
 loop(): a function called repeatedly until the board powers off
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver
chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-
to-serial converter.
The Arduino Uno board can be powered via the USB connection or with an external power supply.
The power source is selected automatically. External (non-USB) power can come from either an
AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm
center-positive plug into the board's power jack. Leads from a battery can be inserted in the GND
and VIN pin headers of the POWER connector. The board can operate on an external supply from
6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts
and the board may become unstable. If using more than 12V, the voltage regulator may overheat
and damage the board. The recommended range is 7 to 12 volts.
The power pins are as follows:
 Vin. The input voltage to the Uno board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can
supply voltage through this pin, or, if supplying voltage via the power jack, access it
through this pin.
 5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or
the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage the board.
 3.3V: A 3.3-volt supply generated by the on-board regulator. Maximum current draw is 50
mA.
 GND. Ground pins.
 IOREF. This pin on the Uno board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin voltage and
select the appropriate power source or enable voltage translators on the outputs to work
with the 5V or 3.3V.
The ATmega328 – shown in figure 6 - has 32 KB (with 0.5 KB occupied by the bootloader). It
also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM
library).
The mapping between Arduino pins and ATmega328P ports is shown. The mapping for the
Atmega8, 168, and 328 is identical. Each of the 14 digital pins on the Uno can be used as an input
or output, using pin Mode (), digital Write (), and digital Read () functions. They operate at 5 volts.
Each pin can provide or receive 20 mA as recommended operating condition and has an internal
pull-up resistor (disconnected by default) of 20-50k ohm. A maximum of 40mA is the value that
must not be exceeded on any I/O pin to avoid permanent damage to the microcontroller.

9
In addition, some pins have specialized functions:

Figure 6 Atmega 328 pin mapping

 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins
are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value,
a rising or falling edge, or a change in value. See the attach Interrupt () function for details.
 PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write () function.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the
SPI library.
 LED: 13. There is a built-in LED driven by digital pin 13. When the pin is HIGH value, the LED
is on, when the pin is LOW, it's off.
 TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.

The Uno has six analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution
(i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible
to change the upper end of their range using the AREF pin and the analog Reference () function.
There are a couple of other pins on the board:

 AREF: Reference voltage for the analog inputs. Used with analogReference().
 Reset: Bring this line LOW to reset the microcontroller. Typically used to add a reset button
to shields, which block the one on the board.

10
The Uno has a number of facilities for communicating with a computer, another Uno board, or
other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which
is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this serial
communication over USB and appears as a virtual com port to software on the computer. The
16U2 firmware uses the standard USB COM drivers, and no external driver is needed. However,
on Windows, a .inf file is required. The Arduino Software (IDE) includes a serial monitor which
allows simple textual data to be sent to and from the board. The RX and TX LEDs on the board
will flash when data is being transmitted via the USB-to-serial chip and USB connection to the
computer (but not for serial communication on pins 0 and 1. The detailed Arduino Uno
specification is provided in TABLE I.

A Software Serial library allows serial communication on any of the Uno's digital pins. The
ATmega328 also supports I2C (TWI) and SPI communication. The Arduino Software (IDE)
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI
communication, use the SPI library.

TABLE I Arduino Uno Technical Aspects


TECHNICAL ASPECTS
Microcontroller ATmega328P
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Input Voltage (limit) 6-20V
Digital I/O Pins 14 (6 PWM)
PWM Digital I/O Pins 6
Analog Input Pins 6
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (0.5 used by bootloader)
SRAM 2 KB
EEPROM 1KB
Clock Speed 16 MHz
Length 68.6 mm
Width 53.4 mm
Weight 25 g

2.3.6 Liquid Crystal Display


A 20x4 LCD means it can display 20 characters per line and there are four such lines. In this LCD
each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command
and Data. LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. A 20x4 LCD display is very basic module and is very commonly used in
various devices and circuits. These modules are preferred over seven segments and other multi
segment LEDs. The reasons being: LCDs are economical; easily programmable; have no limitation
of displaying special & even custom characters (unlike in seven segments), animations and so on.
The command register stores the command instructions given to the LCD. A command is an

11
instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the
cursor position, controlling display etc. The data register stores the data to be displayed on the
LCD. The data is the ASCII value of the character to be displayed on the LCD.
2.3.7 44780 LCD
The 44780 standard requires three control lines as well as either four or eight I/O lines for the data
bus. The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus.
If a 4-bit data bus is used the LCD will require seven data lines (3 control lines plus the 4 lines for
the data bus). If an 8-bit data bus is used the LCD will require 11 data lines (3 control lines plus
the 8 lines for the data bus).

EN: The 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: The 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 should be displayed on the screen. For example, to display
the letter "T" on the screen you would set RS high.

RW: The 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 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. The pin mapping of the LCD is shown in figure 7 and the detailed pin
allocation is provided in TABLE II.

Figure 7 20x4 Liquid Crystal Display pin configuration

12
TABLE II 20x4 Liquid Crystal Display pin allocation
LIQUID CRYSTAL DISPLAY PIN ALLOCATION
Pin Number Name Function
1 VSS Power supply (GND)
2 VDD Power supply +5V
3 VO or VEE Contrast adjustment: through
a variable resistor.
4 RS Selects command register
when low; and data register
when high
5 R/W Low to write to the register;
High to read from the register
6 E Sends data to data pins when
a high lo low pulse is given
7 DBO Data bus line
8 DB1 Data bus line
9 DB2 Data bus line
10 DB3 Data bus line
11 DB4 Data bus line
12 DB5 Data bus line
13 DB6 Data bus line
14 DB7 Data bus line
15 A Power supply for LED
Backlight (+5V)
16 K Power supply for LED
Backlight (GND)

2.3.7 Interfacing LCD with Arduino Uno


The circuit diagram of interfacing LCD to Arduino for displaying a text message is shown in figure
8. RS pin of the LCD module is connected to digital pin 12 of the Arduino. R/W pin of the LCD
is grounded. Enable pin of the LCD module is connected to digital pin 11 of the Arduino. In this
project, the LCD module and Arduino are interfaced in the 4-bit mode. That means only four of
the digital input lines (DB4 to DB7 of the LCD are used). This method is very simple, requires
less connections and you can almost utilize the full potential of the LCD module. Digital lines
DB4, DB5, DB6 and DB7 are interfaced to digital pins 5, 4, 3 and 2 of the Arduino. The 10K
potentiometer is used for adjusting the contrast of the display. 560 ohm resistor R1 limits the
current through the back light LED. The Arduino can be powered through the external power jack
provided on the board. +5V required in some other parts of the circuit can be tapped from the 5V
source on the Arduino board. The Arduino can be also powered from the PC through the USB
port.

13
Figure 8 Interfacing 20x4 LCD with Arduino Uno

14
CHAPTER 3
SYSTEM ANALYSIS AND EXPERIMENTS

3.1 System Overview


The AC voltage is connected to the system and the output from the system is then connected to the
load. This allows for the detection of the faults and operation of the load. The input AC voltage is
rectified to DC voltage and then stepped down to 5 volts for operating the microcontroller. The same
voltage is parallel supplied to the load through relay. The microcontroller periodically compares a
preset voltage value to that of the input voltage. If the input voltage value is more than or less than
the pre-set value by 15% then a fault is detected. When the fault is detected, the relay driver is tripped
and the contactor isolates the load. LCD displays the information about line voltages and faults when
the system is powered on.

Figure 9 Block diagram of the fault detection system

15
The device gets the input voltage and current from three phase R, Y, B supply. The different blocks as
shown in figure 9 function as:
 30A-Current Sensor: Three 30A current sensors are used in conjunction with the transformers to
sense the current for the detection of line-to-line voltages.
 12V-0V-12V Transformer: Four transformers of each 12-0-12 AC step down factor convert
220V AC to 12 V AC.
 5V Rectifier: Three 5V rectifiers were used with each transformer to convert the incoming 220V
AC to 5V DC.
 12V Rectifier and Regulator: One 12V rectifier and regulator ensures that the microcontroller
gets a constant DC voltage of 12V for operation.
 Liquid Crystal Display: One Liquid Crystal Display displays the voltage, current and fault
information.
 Single Phase Selector: It receives the command – from microcontroller - to switch the supply
power from one phase to another.
 Relay Driver: The relay driver drives the contactor after it gets the signal from the microcontroller.
 Contactor: The contactor separates the load from the source when the fault is detected.
 Microcontroller: The microcontroller oversees all the operation – from fault detection in phase
supply to isolation of load.

3.2 Flowchart
The microcontroller constantly monitors the input voltage in the system. The value of the stepped
down DC voltage changes whenever there is a change in the raw AC voltage. Thus, the
microcontroller is able to compare the pre-set value to the input DC value. Whenever the input
value is lower than the minimum pre-set voltage value or the input value is greater than the
maximum pre-set voltage value, the fault is detected. When the fault is detected the system isolates
the load and displays the fault information in the LCD. The flowchart for the under voltage and
over voltage fault detection is shown in figure 10. The code for following flowchart is provided in
APPENDIX A.

16
Figure 10 Flowchart for the fault detection process

3.3 Task Accomplished


The tasks allocated for the first stage - prior to the starting of the project – were accomplished.
Figure 11 shows the block diagram of the tasks accomplished. The code written for the
microcontroller - and represented in figure 10 as a flowchart- is provided in APPENDIX A.

 12V-0V-12V Transformer: Four transformers of each 12-0-12 AC step down factor were
placed to provide 12V to the rectifier from 220V line.
 5V Rectifier: Three 5V rectifiers were used with each transformer to convert the incoming
220V AC to 5V DC. This rectified voltage was then fed into the microcontroller to
examine. Suitable value of resistances were used to map the 220V into 3V and, thus, the
overvoltage is detected if there is input DC voltage greater than 3V + 0.15 * 3V = 3.45V
and under-voltage is detected if the DC input is less than 3V - 0.15 * 3V = 2.55V.

17
 12V Rectifier and Regulator: One 12V rectifier and regulator was used to ensure that the
microcontroller gets a constant DC voltage of 12V for operation.
 Liquid Crystal Display: One Liquid Crystal Display was used to display the voltage and
fault information.

Figure 11 Task accomplished during the first stage of the project

Implementation of above mentioned system meets two of the objectives stated in the system
goals, namely:
 To detect the under-voltage and over-voltage faults.
 To display the type of faults using a LCD.

3.4 Remaining Tasks


Section 3.3 provides the details of the objectives that were accomplished. However, there are tasks
that have to be done in order for the system to be complete as stated in the proposal:

 To detect the line-to-line faults.


 To isolate the load connected to the device in case of any type of faults.

These tasks are planned to be carried out in the stage two of the project. To detect the line-to-line
faults, current will be monitored and to isolate the load in case of faults, relay drivers and
contactors will be used.

18
CHAPTER 4
CONCLUSION
4.1 Conclusion
Overall, during the first phase of the project, half of the stated objectives were met. Three step
down 12-0-12 transformers for each line were used and the rectifiers connected with them were
connected to the analog input pin of the Arduino and used the preset value within the Arduino
program to display the result in the 20x4 LCD. As planned in the time management schedule
provided in APPENDIX B, detection of line-to-line faults in the three phase and the contactor
tripping mechanism to isolate the load will be carried out in the stage two of the project plan.

19
Reference
[1] N. Joshi, "Microcontroller based Fault Detector", International Journal of Advancements in Research
and Technology, vol. 1, no. 5, pp. 281-288, 2012.
[2] M. Ohrstr, “Fast fault detection for power distribution systems”, Stockholm: Kungl Tekniska
H¨ogskolan, pp. 7-9. 2003.
[3] V. Kumar, V. Kumar and V. Verma, "A Microcontroller Based Online Fault Detection System", CS
Journals, vol. 7, no. 2, pp. 1-4, 2015.
[4] H. Dhiman, "DESIGN ANALYSIS AND REALIZATION OF MICROCONTROLLER BASED
OVER CURRENT RELAY WITH IDMT CHARACTERISTICS: A PROTEUS SIMULATION", vol.
3, no. 5, 2015.
[5] T. Sarker, A. Rahman, T. Rahman, A. Sarker, V. Sarker and Z. Mahmud, "GSM & Microcontroller
Based Three Phase Fault Analysis System", International Journal of Advancements in Research &
Technology, vol. 6, no. 1, pp. 1-8, 2017.
[6] Bayindir R., Sefa I., Cola I., and Bektas A. “Fault Detection and Load Protection Using Sensors”,
IEEE Transactions on Energy Conversion, Vol. 23, Issue 3, pp. 734–741, 2008.
[7] Close K. J., and Yarwood J.,“Experimental Electronics for Students” 1st Edition, Chapman and Hall
Ltd, Britain, 1979.

20
APPENDIX A
A.1 Code for fault detection
/* Reading the voltage values from the analog pins in Arduino*/
#include <stdio.h>

#define VOLT_MAX (220 + 0.15 * 220) /* Maximum Voltage Input */


#define VOLT_MIL 220 /* Normal Voltage Input */
#define VOLT_MIN (220 - 0.15 * 220) /* Minimum Voltage Input */

#define INTR_FACT (5.0 / 1023.0) /* Internal mapping inside the Arduino */


#define TRAN_FACT (194.0 / 2.9) /* Transformer transformation factor */

float PIN_VOLT_LIN_R=A0, PIN_VOLT_LIN_Y=A1, PIN_VOLT_LIN_B=A2; /* Voltage


Inputs for each Line */
float PIN_CURR_LIN_R=A3, PIN_CURR_LIN_Y=A4, PIN_CURR_LIN_B=A5; /* Current
Inputs for each Line */

float VOLT_LIN_R=0, VOLT_LIN_Y=0, VOLT_LIN_B=0;


float CURR_LIN_R=0, CURR_LIN_Y=0, CURR_LIN_B=0;

int count = 0;

void setup() {
Serial.begin(9600);
/* Mode definition for voltages */
pinMode(PIN_VOLT_LIN_R, INPUT);
pinMode(PIN_VOLT_LIN_Y, INPUT);
pinMode(PIN_VOLT_LIN_B, INPUT);

21
/* Mode definition for currents */
pinMode(PIN_CURR_LIN_R, INPUT);
pinMode(PIN_CURR_LIN_Y, INPUT);
pinMode(PIN_CURR_LIN_B, INPUT);
}

void loop() {
VOLT_LIN_R = analogRead(PIN_VOLT_LIN_R);
VOLT_LIN_Y = analogRead(PIN_VOLT_LIN_Y);
VOLT_LIN_B = analogRead(PIN_VOLT_LIN_B);

/* Internal maping out of the Arduino */


VOLT_LIN_R = VOLT_LIN_R * INTR_FACT;
VOLT_LIN_Y = VOLT_LIN_Y * INTR_FACT;
VOLT_LIN_B = VOLT_LIN_B * INTR_FACT;

/* Conversion factor of the transformer used. */


VOLT_LIN_R = VOLT_LIN_R * TRAN_FACT;
VOLT_LIN_Y = VOLT_LIN_Y * TRAN_FACT;
VOLT_LIN_B = VOLT_LIN_B * TRAN_FACT;
delay(1000);

/* Fault detection for line R*/


DetectFault(VOLT_LIN_R, String("R"));

/* Fault detection for line Y*/


DetectFault(VOLT_LIN_Y,String("Y"));

22
/* Fault detection for line B*/
DetectFault(VOLT_LIN_B,String("B"));

void DetectFault(float LINE_VOLT, String(Line))


{
String Message = String();
Message = "LINE_VOLT_" + Line + " = ";
if (LINE_VOLT < VOLT_MIN)
{

Serial.println("******************************************************************
**");
Serial.print("\n");
Serial.print(Message);
Serial.print(LINE_VOLT);
Serial.println("V, \t UNDER VOLTAGE");
}
else if (LINE_VOLT > VOLT_MAX)
{

Serial.println("******************************************************************
**");
Serial.print("\n");
Serial.print(Message);
Serial.print(LINE_VOLT);
Serial.println("V, \t OVER VOLTAGE");
}
else

23
{

Serial.println("******************************************************************
**");
Serial.print("\n");
Serial.print(Message);
Serial.print(LINE_VOLT);
Serial.println("V, \t NO FAULT");

Serial.println("******************************************************************
**");
}
}

A.2 Code for Liquid Crystal Display


#include<string.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(12,11,9,8,7,6,5,4,3,2);

char buffer[20*4+1]=" ";//20*4 spaces


int pos=0;

void render_realloc() {
//clear screen
lcd.clear();
//print in correct order
for(int pos2=0;pos2<20;pos2++) lcd.print(buffer[pos2]);
for(int pos2=40;pos2<60;pos2++) lcd.print(buffer[pos2]);
for(int pos2=20;pos2<40;pos2++) lcd.print(buffer[pos2]);

24
for(int pos2=60;pos2<80;pos2++) lcd.print(buffer[pos2]);
}

void print_(char str[]) {


int pos2,pos3,strpo,b,spos2,posa,strpos,line;
int len = strlen(str);
//int overrun = pos+len-79;
int overrun = pos+len-80;
if(overrun>0) {
if(len>=80) {//if buffer will fill the whole screen
//for(strpo=len-79, b=0;strpo<len;strpo++, b++) {
for(strpo=len-80, b=0;strpo<len;strpo++, b++) {//fill the screen with the last 80
characters
buffer[b]=str[strpo];
}
//greg put thisbuffer[79]=' ';
//pos=79;
pos=80;
render_realloc();
return;
}
int charsleft = 80-pos;//calculate the ammount of chars that still fit in the buffer
for(posa = pos, strpos=0; strpos<=charsleft;posa++,strpos++) {//put the rest of the
characters into the buffer
buffer[posa]= str[strpos];
}
int remainder = overrun % 20;
int extralines = 1+(overrun - remainder)/20; //divide by 20, removing remainder
(adding 1 because at least one line of overrun)

25
for (line=0;line<extralines;line++) {
//scroll the display up by one line
for(pos2=20;pos2<40;pos2++) buffer[pos2-20]=buffer[pos2];//put line 2 on line 1
for(pos2=40;pos2<60;pos2++) buffer[pos2-20]=buffer[pos2];//put line 3 on line 2
for(pos2=60;pos2<80;pos2++) buffer[pos2-20]=buffer[pos2];//put line 4 on line 4
for(pos2=60,pos3=0;pos2<80;pos2++,pos3++) {
int strp = charsleft+pos3+line*20;
char ch;
if (strp>=len) {
ch = ' ';
} else {
ch = str[strp];
}
buffer[pos2]=ch;
}
pos-=20;
}
} else {//if there is no overrun, just copu the string to the buffer
for(spos2=0, pos2=pos;spos2<len;spos2++,pos2++) {
buffer[pos2]=str[spos2];
}
}
pos+=len;
render_realloc();
}

void newline() {
char spaces[21] = " ";// 20 spaces

26
int remainder = pos % 20;//remember the 0-19 clock story
int charsleft = 20-remainder;
spaces[charsleft]= '\0';
print_(spaces);
}

void print_ln(char str[]) {


print_(str);
newline();
}

void setup() {
lcd.begin(20, 4);
char tmp[100];
strcpy(tmp, "Fault Detect System");
print_(tmp);
newline();
strcpy(tmp, "Initializing...");
print_(tmp);
delay(3000);
}

void cls() {
lcd.clear();
strcpy(buffer," ");//20*4 spaces
pos=0;
}
void loop() {

27
cls();
char tmp[100];
strcpy(tmp, "R=");
print_(tmp);
strcpy(tmp,"220");
print_(tmp);
strcpy(tmp,"v");
print_(tmp);
strcpy(tmp," OK");
print_(tmp);
newline();

strcpy(tmp, "Y=");
print_(tmp);
strcpy(tmp,"150");
print_(tmp);
strcpy(tmp,"v");
print_(tmp);
strcpy(tmp," UVF");
print_(tmp);
newline();

strcpy(tmp, "B=");
print_(tmp);
strcpy(tmp,"300");
print_(tmp);
strcpy(tmp,"v");
print_(tmp);

28
strcpy(tmp," OVF");
print_(tmp);
newline();
delay(5000);
}

29
APPENDIX B
B.1 Schedule Management
The whole process of designing and implementing the system was divided into two stages, each for one
semester. In the first semester, we conducted the literature survey and implemented the fault detection for
under voltage and over voltage. For the next semester, we have allocated the implementation of the line-
to-line fault detection using current sensor. The schedule management Gantt chart is shown in Table III.
TABLE III: Gantt Chart
Nov Dec Jan Feb Mar Apr May June July

Proposal
Submission

Literature Survey

Prototype Designing

Circuit Designing &


Testing

Product
Assembling & PCB
Designing
Final Report

Task Accomplished
Task Remaining

30

You might also like