Anda di halaman 1dari 70

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 1

SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT


PREFACE
Precise distance calculation for underground cable fault detection is simply a technique to
detect the fault occurs in underground cable lines. This uses the fact that when any fault
like a short circuit occurs, the voltage drop varies as the resistance between that distance
changes since the current varies. The project is assembled with a set of resistors
representing cable length in KMs and fault creation is made by a set of slide switches at
every known KM to cross check the accuracy of the same.
Chapter 1: Gives a brief introduction to the project and the actual overview of the
project.
Chapter 2: Principle of the precise distance calculation for underground cable fault
detection.
Chapter 3: Brief view of other methods for fault detection in underground cable.
Chapter 4: Type of faults occurs in underground cable and their description.
Chapter 5: Block diagram of precise distance calculation for underground cable fault
detection and their description.
Chapter 6: Circuit diagram of precise distance calculation for underground cable fault
detection with each connection and their description.
Chapter 7: Hardware used along with brief explanation of each component.
Chapter 8: Software used and description.
Chapter 9: The schematic view and layout of the pcb.
Chapter 10: Advantages and Disadvantages of the project.
Chapter 11: Applications of the project.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 2
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT


CHAPTER
ONE
INTRODUCTION







PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 3
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
1. INTRODUCTION
The main function of the electrical transmission and distribution systems is to transport
electrical energy from the generation unit to the customers. Generally, when fault occurs
on transmission lines, detecting fault is necessary for power system in order to clear fault
before it increases the damage to the power system. Although the underground cable
system provides higher reliability than the overhead line system, it is hard to seek out the
fault location. The demand for reliable service has led to the development of technique of
locating faults. The objective of this project is to determine the distance of underground
cable fault from base station in kilometers. The underground cable system is a common
practice followed in many urban areas. While a fault occurs for some reason, at that time
the repairing process related to that particular cable is difficult due to not knowing the
exact location of the cable fault. The proposed system is to find the exact location of the
fault.

FIG 1.1: PDC FOR UNDERGROUND CABLE FAULT DETECTION
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 4
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT



CHAPTER
TWO
PRINCIPLE







PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 5
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
2. PRINCIPLE
The project uses the standard concept of Ohms law i.e., when a low DC voltage is
applied at the feeder end through a series resistor (Cable lines), then current would vary
depending upon the location of fault in the cable or A DC voltage is fed over the line in
multiplexing mode in combination with a ADC to detect the fault current and show the
distance on a LCD display based on voltage drop principle. In case there is a short circuit
(Line to Ground), the voltage across series resistors changes accordingly, which is then
fed to an ADC to develop precise digital data which the programmed microcontroller of
8051 family would display in kilometers. The project is assembled with a set of resistors
representing cable length in KMs and fault creation is made by a set of slide switches at
every known KM to cross check the accuracy of the same. The fault occurring at a
particular distance and the respective phase is displayed on a LCD interfaced to the
microcontroller.










PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 6
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT


CHAPTER
THREE
OTHER METHODS
FOR FAULT
DETECTION




PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 7
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
3. OTHER METHODS FOR FAULT DETECTION
3.1 SECTIONALIZING METHOD
It is also called as CUT & TRY METHOD this was among the first method to be used for
fault locating on a direct buried cable. Sectionalizes are an economical method of further
improving service on distribution lines equipped with recloses or reclosing circuit
breakers.
3.2 LOW VOLTAGE TDR
A low-voltage TDR is an appropriate method to localize faults and other impedance
changes on electrical cable such as twisted pair, parallel pair, and coaxial structure. Low
resistance faults of less than 200 between conductor and ground or between
conductors are displayed as downward reflections on the screen.
3.3 OTDR AND OPM METHOD
Both these method are used for detecting fault in Optical fiber cable. An OTDR may be
used for estimating the fiber length and overall attenuation, including splice and mated-
connector losses.
3.4 ARC REFLECTION
The arc reflection method of fault prelocating combines the use of a TDR (cable radar)
and a surge generator (thumper). By using an arc reflection filter, a low voltage TDR and
a high voltage surge generator can both be connected to the faulted cable and the TDR
can be looking down the cable while thumping. This method is often referred to as a high
voltage radar technique that overcomes the 200 limitation of low-voltage radar.


PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 8
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT




CHAPTER
FOUR
TYPE OF FAULTS






PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 9
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
4. TYPE OF FAULTS
4.1 TRANSIENT FAULT
A transient fault is a fault that is no longer present if power is disconnected for a short
time and then restored. Many faults in overhead power lines are transient in nature.
When a fault occurs, equipment used for power system protection operate to isolate the
area of the fault.
4.2 PERSISTENT FAULT
A persistent fault does not disappear when power is disconnected. Faults in
underground power cables are most often persistent due to mechanical damage to the
cable, but are sometimes transient in nature due to lightning.
4.3 SYMMETRIC FAULT
A symmetric or balanced fault affects each of the three phases equally. In transmission
line faults, roughly 5% are symmetric.
4.4 ASYMMETRIC FAULT
An asymmetric or unbalanced fault does not affect each of the three phases equally.
Common types of asymmetric faults, and their causes:
4.4.1 LINE-TO-LINE: - A short circuit between lines, caused by ionization of air, or
when lines come into physical contact, for example due to a broken insulator.
4.4.2 LINE-TO-GROUND: - A short circuit between one line and ground, very often
caused by physical contact, for example due to lightning or other storm damage.
4.4.3 DOUBLE LINE-TO-GROUND: - Two lines come into contact with the ground,
also commonly due to storm damage.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 10
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT


CHAPTER
FIVE
BLOCK DIAGRAM








PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 11
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
5. BLOCK DIAGRAM

FIG 5.1: BLOCK DIAGRAM
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 12
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
5.1 EXPLANATION
The whole system is divided into four parts The DC power supply part, the cable part,
the controlling part and the display part.
The DC power supply part consists of the ac supply which is the 230V mains which is
stepped down using the transformer, the bridge rectifier which converts the AC signal to
DC& the regulator to produce a constant DC voltage.
The cable part is denoted by a set of resistors along with switches. The set of resistors
denote the current sensing part of the cable and the switches are used as fault creators
to indicate the fault at each location. This part senses the change in current by sensing
the voltage drop.
The controlling part consists of the analog to digital converter which receives input from
the current sensing circuit, converts this voltage into digital signal and feeds the
microcontroller with the signal. The microcontroller also drives a relay driver which in
turn controls the switching of a set of relays for proper connection of the cable at each
phase.
The display part consists of the LCD display interfaced to the microcontroller which
shows the status of the cable of each phase and the distance of the cable at the
particular phase, in case of any fault.
5.2 HARDWARE USED
8051 series Microcontroller, LCD, Crystal, ADC, Relays, Relay Driver IC, Transformer,
Diodes, Voltage Regulator, Resistors, Capacitors, LEDs, slide switches.
5.3 SOFTWARE USED
Keil Compiler, Proteus software.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 13
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
5.4 DIFFERENT COMPONENTS USED
For the DC power Supply Section:
An AC source
A step down transformer
A set of diodes for the bridge rectifier arrangement
A capacitor for the filter circuit
A regulator IC along with a capacitor
For the Current Sensing Circuit:
A set of resistors along with a set of switches
An ADC 0804
For the Control Circuit:
A microcontroller 8051 along with proper interfacing components like crystals, etc.
A relay driver IC ULN2003 along with a set of relays
For the Display Circuit:
A LCD Display







PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 14
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT



CHAPTER
SIX
CIRCUIT DIAGRAM







PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 15
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
6. CIRCUIT DIAGRAM

FIG 6.1: CIRCUIT DIAGRAM
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 16
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
6.1 OPERATION
The circuit is prepared using a set of resistors arranged in 4 rows representing the cable
line. A set of three rows represent the three phases (assuming to be the R ,Y and B
phases). Each of three rows is scanned through a relay for any fault occurrence, thus
using a total of three relays which are driven by a relay driver operated by a
microcontroller. Each series resistor represents the resistance of the cable at certain
distance. The 4
th
row of resistors is connected to a +5V supply through a resistor. The
common point of the resistor and the cable series resistor is connected to an analog to
digital converter. A switch is connected in series with each resistor to represent the fault
condition.
6.1.1 POWER SUPPLY
The circuit uses standard power supply comprising of a step-down transformer from
230V to 12V and 4 diodes forming a Bridge Rectifier that delivers pulsating dc which is
then filtered by an electrolytic capacitor of about 470F to 1000F. The filtered dc being
unregulated, IC LM7805 is used to get 5V DC constant at its pin no 3 irrespective of input
DC varying from 9V to 14V. The input dc shall be varying in the event of input ac at
230volts section varies in the ratio of V1/V2=N1/N2. As N1/N2 i.e. no. of turns in the
primary to the no. of turns in the secondary remains unchanged V2 is directly
proportional to V1.Thus if the transformer delivers 12V at 220V input it will give 8.72V at
160V.Similarly at 270V it will give 14.72V.Thus the dc voltage at the input of the
regulator changes from about 8V to 15V because of A.C voltage variation from 160V to
270V the regulator output will remain constant at 5V.
The regulated 5V DC is further filtered by a small electrolytic capacitor of 10F for any
noise generated by the circuit. One LED is connected of this 5V point in series with a
resistor of 330 to the ground i.e., negative voltage to indicate 5V power supply
availability. The 12V point is used for other applications as on when required.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 17
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
6.1.2 STANDARD CONNECTIONS TO MICROCONTROLLER
ATMEL series of 8051 family of microcontrollers need certain standard connections. The
actual number of the Micro controller could be 89C51 , 89C52, 89S51, 89S52, as
regards to 20 pin configuration a number of 89C2051. The 4 set of I/O ports are used
based on the project requirement. Every micro controller requires a timing reference for
its internal program execution therefore an oscillator needs to be functional with a
desired frequency to obtain the timing reference as t =1/f.
A crystal ranging from 2 to 20 MHz is required to be used at its pin number 18 and 19 for
the oscillator. Typically 11.0592 MHz crystal is used in general for most of the circuits.
Crystal provides the reference frequency only and it is not a crystal oscillator as miss
understood by many but it oscillates at 11.0592MHz. Two small value ceramic capacitors
of 33pF each is used as a standard connection for the crystal as shown in the circuit
diagram.
6.1.3 RESET
Pin no 9 is provided with an RESET arrangement by a combination of an electrolytic
capacitor and a register forming RC time constant. At the time of switch on, the capacitor
gets charged, after charging it behaves as a full short circuit from the positive to the pin
number 9. After the capacitor gets fully charged the current stops flowing and pin
number 9 is pulled down by a 10k resistor to the ground.
A pushbutton switch is connected across the capacitor so that at any given time as
desired it can be pressed that discharges the capacitor and while released the capacitor
starts charging again and then pin number 9 goes to high and then back to low, to
enable the program execution from the beginning. This operation of high to low of the
reset pin takes place in fraction of a second as decided by the time constant R and C.
Pin no 31 of 40 pin 8051 microcontroller termed as EA is required to be connected to 5V
for accessing the program form the on-chip program memory.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 18
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
6.1.4 ULN2003
ULN2003 is an IC which is used to interface relay with the microcontroller. ULN2003 is
nothing but a set of inverters, if logic high is given to the IC as input then its output will
be logic low and vice-versa .Here in ULN2003 pin 1 to 7 are IC inputs and 10 to 16 are IC
outputs.
Darlington pairs are back to back connection of two transistors with some source
resistors and when they are arranged as shown in the circuit they are used to amplify
weak signals. Positive voltage i.e., 12V is given to 9
th
pin of the ULN2003 IC and also to
one end of the relay coil and the GND is connected to 8th pin.
When microcontroller gives logic high to the ULN2003, it gives an inverted output i.e.,
logic low which is connected to the other end of the relay coil. Due to this current flow
through the coil which makes the relay ON and also the load is switched ON.

FIG 6.2: OPERATION OF ULN2003
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 19
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
When microcontroller gives logic high to the ULN2003, it gives an inverted output i.e,
logic low which is connected to the other end of the relay coil. Then as one end of the
relay coil is consumed a power i.e. +12v it means this end become high.
Then when one end of the relay coil become high and one end of relay coil become low
then the path become completed current flow throughout the path then switch become
connect and led becomes glow.
When microcontroller gives logic high to the ULN2003, it gives an inverted output i.e.,
logic high which is connected to the other end of the relay coil. Then as one end of the
relay coil is consumed a power i.e. +12v it means this end become high .Then when both
end become high of the relay coil the switch not become connected and path cannot yet
connected thus due to this current cannot flow throughout the circuit then it became
unfunctioned.
6.2 OPERATION EXPLANATION
When the microcontroller sends a logic high signal to one of the input pins of the relay
driver, the corresponding output pin goes low. This low logic signal energizes the relay
connected to the output. Eventually the set of resistors connected to that relay gets
connected to ground in case a switch is in on state, representing the fault. That
particular resistor gets connected to the ve 5V supply representing a short circuit
condition.
As different resistors, get added in series with the resistors of the 4
th
row (connected to
the ADC) through the fault switch, the current flowing through the resistors changes and
eventually the voltage drop changes. This digital signal is fed to the microcontroller. The
microcontroller is programmed to read the ADC values to detect the fault which has
occurred at that exact location. The microcontroller is interfaced to a LCD display which
displays the distance of the cable in kilometers at which the fault has occurred and the
particular phase. In case of no fault, the display will show all the phases are in no fault
state.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 20
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
6.2.1 CONNECTIONS
The output of the power supply which is 5v is given to the 40
th
pin of microcontroller and
GND is connected to its 20
th
pin. Ports 1.0 to 1.3 of microcontroller are given to 18 to 15
pin of ADC0804. Relays 1, 2 & 3 are given to pins 1B, 2B & 3B of ULN2003A and port0.0
to 0.2 of microcontroller. Port 3.0 to 3.5 of microcontroller are given to pin 2, 3, 5of
ADC0804. Pins 16,15,14 of ULN2003A are given to relays RL1,RL2,RL3 which drives set
of resistors (R17,R16,R15,R14), (R21,R20,R19,R18) and (R25,R24,R23,R22).
The interfacing of the microcontroller with the lcd can be done by connecting the data
bus line of the LCD i.e. (D0,D1,D2,D3,D4,D5,D6,D7) to the port two of the
microcontroller i.e. P
2.0
to P
2.7.
The RS, R/W,E i.e. The EN line is called "Enable, The RS
line is the "Register Select" line ,The RW line is the "Read/Write" control line are
connected to the port three of the microcontroller i.e. P
3.0
, P
3.1
, P
3.2
.

6.2.2 WORKING
The project uses a set of resistances in series i.e. R10,R11,R12,R13 and
R17,R16,R14,R21, R20,R19,R18,R25,R22 as shown in the circuit diagram, one set for
each phase. Each series resistors represents the resistance of the underground cable for
a specific distance thus 4 such resistances in series represent 1-4kms. 3 relays are used
to common point of their contacts are grounded while the NO points are connected to
the input of the R17, R21 & R25 being the 3 phase cable input. R10 is fed with a series
resistor R1 to 5v supply. The common point of R10 & R1 is given to input pin of 6 of
ADC0804 duly wired as explained above .The supply are provided to each of the three
phase i.e. R,Y,B .This is done when the microcontroller gives high at the input of the
ULN2003 and this high input are then converted into low output through the inverter in
the relay driver as we provide a +12v power supply at one end of the relay coil .when
the other end become low then the circuit become complete then current can flow in
first phase i.e. R similarly this process done in several times to provide the supply in each
phase.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 21
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
6.3 OPERATING PROCEDURE

FIG 6.3: RELAY AND RESISTOR ASSEMBLY
While any of the 12switches are operated they impose conditions like LG, LL and 3Lfault
as per the switch operation. The program while executed continuously scans by
operating the 3relays in sequence of 1sec interval. Thus any NO point while driven to
GND through the common contact point of the relay develops a current flow through R1,
R10 & any other switch depending on the created fault. Thus the voltage drop at the
ADC pin varies depending on the current flow which is inversely proportional to the
resistance value representing the length of cable in kilometers. This varying voltage
passes through the ADC to develop an 8 bit data to the microcontroller port1 that while
executed displays an output in the LCD display the fault occurring km. In a fault
situation it displays R=3km if the 3kms switch is made ON. Accordingly all other faults
are indicated.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 22
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT


CHAPTER
SEVEN
HARDWARE
REQUIREMENTS






PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 23
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7. HARDWARE REQUIREMENTS
7.1 TRANSFORMER
Transformers convert AC electricity from one voltage to another with a little loss of
power. Step-up transformers increase voltage, step-down transformers reduce voltage.
Most power supplies use a step-down transformer to reduce the dangerously high
voltage to a safer low voltage. In this project we use a step down transformer.

FIG 7.1: A TYPICAL TRANSFORMER
The input coil is called the primary and the output coil is called the secondary. There is
no electrical connection between the two coils; instead they are linked by an alternating
magnetic field created in the soft-iron core of the transformer. The two lines in the
middle of the circuit symbol represent the core Transformers waste very little power so
the power out is equal to the power in. Note that as voltage is stepped down and current
is stepped up. A transformer is an electrical device that transfers energy between two
circuits through electromagnetic induction. A step-down transformer has a large number
of turns on its primary coil which is connected to the high voltage mains supply, and a
small number of turns on its secondary coil to give a low output voltage.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 24
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.2 VOLTAGE REGULATOR 7805
A voltage regulator is designed to automatically maintain a constant voltage level. it may
be used to regulate one or more AC or DC voltages. In this project the filtered dc coming
from the rectifier is being unregulated, the voltage regulator (LM7805) is used for
regulate it to get constant 5V DC. The regulated 5V DC is further filtered by a small
electrolytic capacitor of 10F for any noise generated by the circuit and then apply to
microcontroller for further processing.

FIG 7.2: VOLTAGE REGULATOR LM7805
The LM7805, like most other regulators, is a three-pin IC.
Pin 1 (Input Pin):- The input pin is the pin that accepts the incoming DC voltage,
which the voltage regulator will eventually regulate down to 5 volts.
Pin 2 (Ground):- Ground pin establishes the ground for the regulator.
Pin 3 (Output Pin):- The Output pin is the regulated 5 volts DC.
7.2.1 FEATURES
Output Current up to 1A.
Thermal Overload Protection.
Short Circuit Protection.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 25
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.3 RECTIFIRE
A rectifier is an electrical device that converts alternating current (AC), which periodically
reverses direction, into direct current (DC), current that flows in only one direction, a
process known as rectification. Rectifiers have many uses including as components of
power supplies and as detectors of radio signals. Rectifiers may be made of state diodes,
vacuum tube diodes, mercury arc valves, and other components. The output from the
transformer is fed to the rectifier. It converts A.C. into pulsating D.C. The rectifier may
be a half wave or a full wave rectifier. In this project, a bridge rectifier is used because of
its merits like good stability and full wave rectification. In positive half cycle only two
diodes (1 set of parallel diodes) will conduct, in negative half cycle remaining two diodes
will conduct and they will conduct only in forward bias only.

FIG 7.3: RECTIFIRE
The four diodes labeled D
1
to D
4
are arranged in series pairs with only two diodes
conducting current during each half cycle. During the positive half cycle of the supply,
diodes D1 and D2 conduct in series while diodes D3 and D4 are reverse biased and the
current flows through the load as shown below.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 26
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.4 MICROCONTROLLER (AT89S52)
The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes
of in-system programmable Flash memory. The device is manufactured using Atmels
high-density non-volatile memory technology and is compatible with the industry
standard 80C51 instruction set and pin out. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional non-volatile memory
programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a
monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a
highly-flexible and cost-effective solution to many embedded control applications. The
AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM,
32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector
two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock
circuitry.
7.4.1 FEATURES
8K Bytes of In-System Programmable (ISP) Flash Memory.
Fully Static Operation: 0 Hz to 33MHz.
256 x 8-bit Internal RAM.
32 Programmable I/O Lines.
Three 16-bit Timer/Counters.
Eight Interrupt Sources
Full Duplex UART Serial Channel
Low-power Idle and Power-down Modes
Interrupt Recovery from Power-down Mode



PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 27
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.4.2 BLOCK DIAGRAM OF AT89S52

FIG 7.4: BLOCK DIAGRAM OF AT89S52
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 28
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.4.3 PIN CONFIGURATIONS

FIG 7.5: PIN DIAGRAM OF AT89S52
PIN DESCRIPTION:-
VCC: - Supply voltage.
GND: - Ground.
PORT 0:- Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin
can sink eight TTL inputs.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 29
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
PORT 1:- Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1
output buffers can sink/source four TTL inputs.
PORT 2:- Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs.
PORT 3:- Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3
output buffers can sink/source four TTL inputs.
RST: - Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device. This pin drives high for 98 oscillator periods after the
Watchdog times out.
ALE/PROG: - Address Latch Enable (ALE) is an output pulse for latching the low byte of
the address during accesses to external memory. This pin is also the program pulse input
(PROG) during Flash programming.
PSEN: - Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each
access to external data memory.
XTAL 1:- Input to the inverting oscillator amplifier and input to the internal clock
operating circuit.
XTAL 2:- Output from the inverting oscillator amplifier.
EA/VPP: - External Access Enable. EA must be strapped to GND in order to enable the
device to fetch code from external program memory locations starting at 0000H up to
FFFFH.


PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 30
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
OSCILLATOR CHARACTERISTICS: - XTAL1 and XTAL2 are the input and output,
respectively, of an inverting amplifier which can be configured for use as an on-chip
oscillator, as shown in Figure 7.6. Either a quartz crystal or ceramic resonator may be
used. To drive the device from an external clock source, XTAL2 should be left
unconnected while XTAL1 is driven.

FIG 7.6: OSCILLATOR CONNECTIONS
7.4.4 OPERATING MODES
IDLE MODE: - In idle mode, the CPU puts itself to sleep while all the on chip peripherals
remain active. The mode is invoked by software. The content of the on-chip RAM and all
the special functions registers remain unchanged during this mode. The idle mode can be
terminated by any enabled interrupt or by a hardware reset.
POWER DOWN MODE: - In the power down mode the oscillator is stopped, and the
instruction that invokes power down is the last instruction executed. The on-chip RAM
and Special Function Registers retain their values until the power down mode is
terminated. The only exit from power down is a hardware reset. Reset redefines the
SFRs but does not change the on-chip RAM. The reset should not be activated before
VCC is restored to its normal operating level and must be held active long enough to
allow the oscillator to restart and stabilize.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 31
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.5 LIQUID CRYSTAL DISPLAY
In this project LCD HD44780U is used and it is the 16x2 display LCD. Most common LCDs
connected to the microcontrollers are 16x2 and 20x2 displays. This means 16 characters
per line by 2 lines and 20 characters per line by 2 lines, respectively. The standard is
referred to as HD44780U, which refers to the controller chip which receives data from an
external source and communicates directly with the LCD.

FIG 7.7: LIQUID CRYSTAL DISPLAY
7.5.1 44780 LCD BACKGROUND
The 44780 standard requires 3 control lines as well as either 4 or 8 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 a total of 7 data lines.

FIG 7.8: PIN DIAGRAM OF LCD HD44780U
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 32
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
The three control lines are referred to as EN, RS, and RW.
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.
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.
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.
7.5.2 FEATURES
Very compact and light.
Low power consumption.
No geometric distortion.
Little or no flicker depending on backlight technology.
Not affected by screen burn-in.
Can be made in almost any size or shape.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 33
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.6 ADC0804
Analog to digital converters find huge application as an intermediate device to convert
the signals from analog to digital form. These digital signals are used for further
processing by the digital processors.
ADC0804 is a very commonly used 8-bit analog to digital convertor. It is a single channel
IC, i.e., it can take only one analog signal as input. The digital outputs vary from 0 to a
maximum of 255. The step size can be adjusted by setting the reference voltage at pin9.
When this pin is not connected, the default reference voltage is the operating voltage;
i.e.vccADC0804 needs a clock to operate. The time taken to convert the analog value to
digital value is dependent on this clock source.

FIG 7.9: PIN DIAGRAM OF ADC0804
7.6.1 FEATURES
Compatible with microcontrollers, access time is 135 ns.
Logic inputs and outputs meet both MOS and TTL voltage level specifications.
Works with 2.5V (LM336) voltage reference.
On-chip clock generator.
0V to 5V analog input voltage range with single 5V supply.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 34
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.7 ULN2003
The ULN2003 is a monolithic high voltage and high current Darlington transistor arrays.
It consists of seven NPN Darlington pairs that feature high-voltage outputs with
common-cathode Clamp diode for switching inductive loads. The collector-current rating
of a single Darlington pair is 500mA. The Darlington pairs may be paralleled for higher
current capability. Applications include relay drivers, hammer drivers, lamp drivers,
display drivers .The ULN2003 has a 2.7kW series base resistor for each Darlington pair
for operation directly with TTL or 5V CMOS devices.

FIG 7.10: ULN 2003
Darlington pairs are back to back connection of two transistors with some source
resistors and when they are arranged as shown in the circuit they are used to amplify
weak signals. The amount by which the weak signal is amplified is called the GAIN.

FIG 7.11: PIN DIAGRAM OF ULN 2003
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 35
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
The ULN functions as an inverter as shown in the above pin diagram of ULN 2003. If the
logic at input 1B is high then the output at its corresponding pin 1C will be low.

FIG 7.12: DARLINGTON PAIR
Figure shows the Darlington pair connection of transistor. The circuit above is Darlington
Pair driver. The first transistors emitter feeds into the second transistors base and as a
result the input signal is amplified by the time it reaches the output. The important point
to remember is that the Darlington Pair is made up of two transistors.
7.7.1 FEATURES OF DRIVER
Seven Darlingtons per package.
Output currents500mA per driver (600mA peak).
Integrated suppression diodes for inductive loads.
Outputs can be paralleled for high currents.
TTL/CMOS/PMOS/DTL compatible inputs.
Inputs pinned opposite to outputs.
Simplified layout.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 36
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.8 RELAY
A relay is an electrically operated switch. Many relays use an electromagnet to operate a
switching mechanism mechanically, but other operating principles are also used. Relays
are used where it is necessary to control a circuit by a low-power signal (with complete
electrical isolation between control and controlled circuits), or where several circuits must
be controlled by one signal.

FIG 7.13: RELAYS
A relay is an electrically operated switch. Current flowing through the coil of the relay
creates a magnetic field which attracts a level and changes the switch contacts. The coil
current can be on or off so relays have two switch positions and most have double throw
(changeover) switch contacts as shown in the diagram.

FIG 7.14: RELAY SHOWING COIL AND SWITCH CONTACTS
Relays allow one circuit to switch a second circuit which can be completely separate from
the first. ULN2003 is an IC which is used to interface relay with the microcontroller.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 37
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.8.1 APPLICATIONS OF RELAYS
Relays are used for:
Control a high-voltage circuit with a low-voltage signal, as in some types of
modems or audio amplifiers.
Control a high-current circuit with a low-current signal, as in the starter solenoid
of an automobile.
Detect and isolate faults on transmission and distribution lines by opening and
closing circuit breakers.
7.9 IN4007
Diodes are used to convert AC into DC these are used as half wave rectifier or full wave
rectifier. Three points must he kept in mind while using any type of diode.
Maximum forward current capacity
Maximum reverse voltage capacity
Maximum forward voltage capacity

FIG 7.15: 1N4007 DIODES
The number and voltage capacity of some of the important diodes available in the
market are as follows: Diodes of number IN4001, IN4002, IN4003, IN4004, IN4005,
IN4006 and IN4007 have maximum reverse bias voltage capacity of 50V and maximum
forward current capacity of 1 Amp.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 38
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.10 RESISTORS
A resistor is a two-terminal electronic component designed to oppose an electric current
by producing a voltage drop between its terminals in proportion to the current, i.e. in
accordance with Ohm's law,
V = IR
Resistors are used as part of electrical networks and electronic circuits. The primary
characteristics of resistors are their resistance and the power they can dissipate. Other
characteristics include temperature coefficient, noise, and inductance .The ohm is the SI
unit of electrical resistance, named after Georg Simon Ohm. An ohm is equivalent to a
volt per ampere.

FIG 7.16: RESISTORS COLOUR CODE
Resistors provide resistance to current flow. The amount of resistance of a resistor is
based on its value. To determine the value of a resistor without any test equipment, we
must know the resistor color code. Each color stands for a number and place holder.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 39
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.11 CAPACITORS
A capacitor or condenser is a passive electronic component consisting of a pair of
conductors separated by a dielectric. When a voltage potential difference exists between
the conductors, an electric field is present in the dielectric. This field stores energy and
produces a mechanical force between the plates.

FIG 7.17: CAPACITOR VALUE CODE
A capacitor marked 104 is 10 with 4 more zeros or 100,000pF which is otherwise referred
to as a 0.1uF capacitor. So a 103J is a 10,000 pF with +/-5% tolerance. Capacitance is
measured in farads. One farad is a huge capacitor, so most normal capacitors have
values in the micro-farad (0.000001F = 1uF - 10^-6) or Pico-farad (0.000000000001F =
1pF - 10^ -12) range.
A capacitor is a passive electronic component consisting of a pair of conductors
separated by a dielectric (insulator). When there is a potential difference (voltage) across
the conductors, a static electric field develops in the dielectric that stores energy and
produces a mechanical force between the conductors. An ideal capacitor is characterized
by a single constant value, capacitance, measured in farads. This is the ratio of the
electric charge on each conductor to the potential difference between them.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 40
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.12 COMPONENT RATING
Table 7.1: COMPONENT RATING

COMPONENTS

RATINGS

TRANSFORMER

0-12V
VOLTAGE REGULATOR

Vo=5V TO 18V for Vin=35V
Vo=24V for Vin=40V
MICROCONTROLLER
(AT89S52)

4.0V to 5.5V Operating Range

ANALOG DIGITAL CONVERTOR

0V to 5V analog input voltage
range, 2.5V voltage reference
ULN2003
Input Voltage Max:5V
Output Voltage Max:50V
RELAY 12V

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 41
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
7.13 QUANTITY, VALUE AND COST OF COMPONENTS
QUANTITY PART-REFS VALUE COST
REGISTER
1 R1 330R Rs 1.00
22 R2-R23 1K Rs 3.00
1 R24 2.2K Rs 3.00
3 R25-R27 10K Rs 10.00
CAPACITOR
1 C1 470UF Rs 3.00
2 C2,C3 10UF Rs 3.00
2 C4,C5 33PF Rs 5.00
1 C6 56PF Rs 5.00
IC'S
1 U1 7805 Rs 30.00
1 U2 AT89S52 Rs 160.00
1 U3 ADC0804 Rs 185.00
1 U4 ULN2003A Rs 40.00
IC BASE
1 40-PIN Rs 10.00
1 20-PIN Rs 8.00
1 16-PIN Rs 8.00
DIODES
4 D1-D4 IN4007 Rs 4.00
MISCELLANEOUS
1 X1 11.0592MHz Rs 12.00
1 RV1 1K POT Rs 10.00
1 RV2 10K POT Rs 10.00
4 LED1-LED4 LED-RED Rs 3.00
3 RELAY1-RELAY3 12V Rs 180.00
1 LCD 16X2 Rs 380.00
1 TRANSFORMER 0-12V Rs 190.00
1 S1 PUSH BUTTON Rs 2.00
12 S2-S13 TOGGLE SWITCHES Rs 300.00
Table 7.2: QUANTITY, VALUE AND COST OF COMPONENTS
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 42
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT


CHAPTER
EIGHT
SOFTWARE
REQUIREMENTS





PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 43
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
8. SOFTWARE REQUIREMENTS
8.1 INTRODUCTION TO KEIL MICRO VISION (IDE)
Keil an ARM Company makes C compilers, macro assemblers, real-time kernels,
debuggers, simulators, integrated environments, evaluation boards, and emulators for
ARM7/ARM9/Cortex-M3, XC16x/C16x/ST10, 251, and 8051 MCU families. Keil
development tools for the 8051 Microcontroller Architecture support every level of
software developer from the professional applications engineer to the student just
learning about embedded software development. Loading the code to the microcontroller
is called dumping. The microcontrollers understand only binary language. So we need to
load the hex code into the microcontroller. There are lots of softwares available in the
market for loading the code to the microcontroller. Keil is a cross compiler. So first we
have to understand the concept of compilers and cross compilers. After then we shall
learn how to work with keil.
8.2 CONCEPT OF COMPILER
Compilers are programs used to convert a High Level Language to object code. Desktop
compilers produce an output object code for the underlying microprocessor, but not for
other microprocessors. I.E the programs written in one of the HLL like C will compile the
code to run on the system for a particular processor like x86 (underlying microprocessor
in the computer). Interpreter just interprets whole program at a time while compiler
analyses and execute each line of source code in succession, without looking at the
entire program.
The advantage of interpreters is that they can execute a program immediately. Secondly
programs produced by compilers run much faster than the same programs executed by
an interpreter. However compilers require some time before an executable program
emerges.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 44
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
8.3 CONCEPT OF CROSS COMPILER
A cross compiler is similar to the compilers but we write a program for the target
processor (like 8051 and its derivatives) on the host processors (like computer of x86). It
means being in one environment you are writing a code for another environment is
called cross development. And the compiler used for cross development is called cross
compiler. So the definition of cross compiler is a compiler that runs on one computer but
produces object code for a different type of computer. A cross compiler is
a compiler capable of creating executable code for a platform other than the one on
which the compiler is running. Cross compiler tools are used to generate executable
for embedded system or multiple platforms.
8.4 KEIL C CROSS COMPILER
Keil is a German based Software development company. It provides several development
tools like
IDE (Integrated Development environment).
Project Manager.
Simulator.
Debugger.
C Cross Compiler, Cross Assembler, Locator/Linker.
The Keil ARM tool kit includes three main tools, assembler, compiler and linker. An
assembler is used to assemble the ARM assembly program. A compiler is used to compile
the C source code into an object file. A linker is used to create an absolute object module
suitable for our in-circuit emulator.



PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 45
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
8.5 CREATING YOUR OWN APPLICATION IN VISION2
To create a new project in Vision2, you must:
Select Project - New Project.
Select a directory and enter the name of the project file.
Select Project - Select Device and select an 8051, 251, or C16x/ST10 device from
the Device Database.
Create source files to add to the project.
Select Project - Targets, Groups and Files. Add/Files, select Source Group1, and
add the source files to the project.
Select Project - Options and set the tool options. Note when you select the target
device from the Device Database all special options are set automatically. You
typically only need to configure the memory map of your target hardware. Default
memory model settings are optimal for most applications.
Select Project - Rebuild all target files or Build target.
8.6 DEBUGGING AN APPLICATION IN VISION2
To debug an application created using Vision2, you must:
Select Debug - Start/Stop Debug Session.
Use the Step toolbar buttons to single step through your program. You may enter
G, main in the Output Window to execute to the main C function.
Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.



PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 46
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
8.7 STARTING VISION2 AND CREATING A PROJECT
Vision2 is a standard Windows application and started by clicking on the program icon.
To create a new project file select from the Vision2 menu Project New Project. This
opens a standard Windows dialog that asks you for the new project file name. We
suggest that you use a separate folder for each project. Vision2 creates a new project
file with the name PROJECT1.UV2 which contains a default target and file group name.
compilers require some time before an executable program emerges.
8.8 WINDOW FILES
Now use from the menu Project Select Device for Target and select a CPU for your
project. The Select Device dialog box shows the Vision2 device data base. Just select
the microcontroller you use. We are using for our examples the Philips 80C51RD+ CPU.
This selection sets necessary tool Options for the 80C51RD+ device and simplifies in this
way the tool Configuration. This opens a standard Windows dialog that asks you for the
new project file name. We suggest that you use a separate folder for each project.
8.9 BUILDING PROJECTS AND CREATING A HEX FILES
Typical, the tool settings under Options Target are all you need to start a new
application. You may translate all source files and line the application with a click on the
Build Target toolbar icon. When you build an application with syntax errors, Vision2 will
display errors and warning messages in the Output Window - Build page. A double click
on a message line opens the source file on the correct location in a Vision2 editor
window. Once you have successfully generated your application you can start debugging.



PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 47
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
8.10 CPU SIMULATION
Vision2 simulates up to 16 Mbytes of memory from which areas can be mapped for
read, write, or code execution access the Vision2 simulator traps and reports illegal
memory accesses. In addition to memory mapping, the simulator also provides support
for the integrated peripherals of the various 8051 derivatives. The on-chip peripherals of
the CPU you have selected are configured from the Device.
8.11 DATABASE SELECTION
You have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral
using the controls in the dialog boxes.
8.12 START DEBUGGING
You start the debug mode of Vision2 with the Debug Start/Stop Debug Session
Command. Depending on the Options for Target Debug Configuration, Vision2 will
load the application program and run the startup code Vision2 saves the editor screen
layout and restores the screen layout of the last debug session. If the program execution
stops, Vision2 opens an editor window with the source text or shows CPU instructions in
the disassembly window.
For example, you can use the find command or correct program errors. Program source
text of your application is shown in the same windows. After debugging we can going to
explain the disassembly window that shows your target program as mixed source and
assembly program or just assembly code.
A trace history of previously executed instructions may be displayed with Debug View
Trace Records. To enable the trace history, set Debug Enable/Disable Trace Recording.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 48
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
If you select the Disassembly Window as the active window all program step commands
work on CPU instruction level rather than program source lines. You can select a text line
and set or modify code breakpoints using toolbar buttons or the context menu
commands .You may use the dialog Debug Inline Assembly to modify the CPU
instructions. That allows you to correct mistakes or to make temporary changes to the
target program you are debugging.
The Keil Vision Debugger accurately simulates on-chip peripherals (IC, CAN, UART,
SPI, Interrupts, I/O Ports, A/D Converter, D/A Converter, and PWM Modules) of your
8051 device. Simulation helps you understand hardware configurations and avoids time
wasted on setup problems. Additionally with simulation you can write and test
applications before target hardware is available.
8.13 EMBEDDED C
An Embedded System is a combination of computer hardware and software, and perhaps
additional mechanical or other parts, designed to perform a specific function. An
embedded system is any computer system hidden inside a product other than a
computer.
Use of embedded processors in passenger cars, mobile phones, medical equipment,
aerospace systems and defense systems is widespread, and even everyday domestic
appliances such as dish washers, televisions, washing machines and video recorders now
include at least one such device.
8.14 PRINTED CIRCUIT BOARD DESIGN SOFTWARE
Proteus is software for microprocessor or simulation, schematic capture, and printed
circuit board (PCB) design. It is developed by Lab center Electronics. Proteus PCB design
combines the ISIS schematic capture and ARES PCB layout programs to provide a
powerful, integrated and easy to use suite of tools for professional PCB Design.
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 49
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
8.14.1 EDITING MODES
The ISIS provides several editing tools (or modes) to facilitate schematic editing. These
tools can be selected from the left bar menu. Below figure list the editing tools and their
corresponding icons for your reference during this experiment.

FIG 8.1: EDITING MODE FIG 8.2: CURSOR DESCRIPTION
8.14.2 CHANGING PROPERTIES OF A DEVICE
When a component is placed on the drawing area, we can modify its properties either by
double clicking the component object or by right clicking on the component and selecting
"Edit Properties". The Properties window contains a number of characteristics such as :
component name, type, value, data sheet, PCB layout, etc.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 50
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT

(A) CLOCK GENERATOR (B) GROUND TERMINAL
FIG 8.3: PLACING COMPONENTS USING EDITING MODES.
You can insert a terminal into the drawing area by choosing Terminal Mode then
selecting DEFAULT from the Terminals list box as shown in below Figure. You change the
orientation of the terminal using the rotate and mirror buttons from the left bar menu.

FIG 8.4: TERMINALS SELECTION
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 51
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT


CHAPTER
NINE
PCB DESIGNING








PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 52
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
9. PCB DESIGNING
9.1 SCHEMATIC CAPTURE
The Schematic window is where you create your schematic designs. You can create your
design by placing components, ports, data items, units, variables, equations etc.
Schematic capture or schematic entry is a step in the design cycle of electronic design
automation (EDA) at which the electronic diagram, or electronic schematic of the
designed electronic circuit is created by a designer. This is done interactively with the
help of a schematic capture tool also known as schematic editor. The circuit design is the
very first step of actual design of an electronic circuit. Schematic capture involves not
only entering the circuits into the CAD system, but also generally calls for decisions that
may seem more appropriate for later in the design, such as package choice.
Steps to schematic capture in proteus software:
Open the Proteus software. A window with a menu bar appears.

Click on the file menu.

Select new design from the drop down menu.

Click on the library menu.

Select pick devices/symbol from the drop down menu.

Select the relevant comment by double clicking on it, so that the component
appears on the window.

Add all the components and draw the circuit with proper connections.


PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 53
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT

FIG 9.1: SCHEMATIC CAPTURE
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 54
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
9.2 PCB LAYOUT

FIG 9.2: PCB LAYOUT
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 55
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT

CHAPTER
TEN
ADVANTAGES
&
DISADVANTAGES




PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 56
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
10. ADVANTAGES & DISADVANTAGES
10.1 ADVANTAGES
This proposed model is applicable to all types of cables ranging from 1kv to 500
kv.
Fault Detection method is simple and easy to maintain.
Not specified training is required to use this model.
Operator can easily differentiate between light and severe faults.
TDRs are single tools and find faults only. While the underground cable fault
detector can locate lines as well as faults.

10.2 DISADVANTAGES
Continuous observation of the operator is required.
No direct detection of multiple faults.
The accuracy of the measurement depends on the size of the measuring current.






PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 57
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT


CHAPTER
ELEVEN
APPLICATIONS








PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 58
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
11. APPLICATIONS
Location of incipient faults. The permanent fault in cables would be averted if the
incipient fault was located.

Telecom engineering companies.

Oil industries.

It used in department of electricity, railways, mines to ensure the construction
quality inspection of underground cables.













PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 59
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
CONCLUSION
We can conclude from this project that it can determine the distance of underground
cable fault from base station in kilometers. The underground cable system is a common
practice followed in many urban areas. While a fault occurs for some reason, at that time
the repairing process related to that particular cable is difficult due to not knowing the
exact location of the cable fault. The proposed system is to find the exact location of the
fault. This project has been developed to demonstrate the detection of fault in cable
lines. The fault location is determined and the distance is displayed on the LCD screen.
Thus by getting to know the location of the fault, the technician can easily repair the
fault.

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 60
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT




APPENDICES









PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 61
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
APPENDIX I
SOURCE CODE

#include<at89x52.h>
#define LCDDATA P2
#define ADCDATA P1
#define MINIMUM 5
sbit BUSY = P2^7;
sbit RS = P2^0;
sbit RW = P2^1;
sbit EN = P2^2;
sbit OE = P1^3; //RD pin
sbit SC = P1^4; // WR is active LOW pin
sbit EOC = P1^5; //INTR is active LOW pin
sbit RELAY1 = P1^0;
sbit RELAY2 = P1^1;
sbit RELAY3 = P1^2;
Unsigned char Buff [3] = 0;
Void ISR_T0 () interrupt 1
{
TH0 = 0x4B;
TL0 = 0xFF;


TF0 = 0;
}
VoidDelay (unsigned int time)
{
Unsignedint i = 0;
For (i=0;i<time;i++);
}

Unsigned char Read ADC ()
{
Unsigned char temp = 0;

SC = 1; // Make WR pin low
Delay (150); // wait for a while
SC = 0; // Make WR pin High
While (EOC == 1); // wait till INTR pin goes low
While (EOC == 0); // wait till INTR pin goes High
Delay (150);
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 62
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
OE = 0; // Make RD pin LOW
Temp = ADCDATA;
OE = 1; // MAKE RD Pin HIGH
Return temp;

}

/*Function to check status of LCD*/
VoidBusy Check ()
{
BUSY = 1;
RS = 0; // RS =0 FOR COMMAND
RW = 1; // RW = 1 FOR READING
While (BUSY)
{
EN = 0; // ENABL EIS LOW
EN = 1; // ENABLE IS HIGH
}
}
/*Function to Send Command to LCD*/
VoidLCDCMD (unsigned char CMD)
{
Busy Check ();
LCDDATA = CMD;
RS = 0; // RS =0 FOR COMMAND
RW = 0; // RW = 0 FOR WRITING
EN = 1; // ENABLE IS HIGH
EN = 0; // ENABL EIS LOW
}

/*Function to Send Data to LCD*/
Void LCDData(unsigned char Data)
{
Busy Check();
LCDDATA = Data;
RS = 1; // RS =1 FOR DATA
RW = 0; // RW = 0 FOR WRITING
EN = 1; // ENABLE IS HIGH
EN = 0; // ENABL EIS LOW
}

Void LCDString(unsigned char *str)
{
While (*str)
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 63
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
{
LCDData (*str);
str++;
}

}
Void Init_T0 ()
{
TMOD = 0x01; // SET THE TIMER0 IN MODE 1 MODE
TH0 = 0x4B; // LOAD THE TH0 VALUE
TL0 = 0xFF; // LOAD THE TL0 VALUE
ET0 = 1; // ENABLE THE TIMER0 INTERRUPT
EA = 1; // ENABLE ALL INTERRUPT
TR0 = 1; // START THE TIMER
}

/*Function to Initialize LCD*/
VoidintLCD()
{
/*Command to Select 2 line, 5x7 matrix mode of LCD */
LCDCMD(0x38);

/*Command to shift the cursor to next position when Data is send in LCD */
LCDCMD(0x06);

/*Command to ON Display, OFF the Cursor in LCD */
LCDCMD(0x0C);

/*Return cursor home */
LCDCMD(0x02);
}

VoidDisplay (unsigned char Data)
{
Switch (Data)
{
Case 170:
LCDString("1KM");
Break;
Case 204:
LCDString("2KM");
Break;
Case 219:
LCDString("3KM");
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 64
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Break;
Case 227:
LCDString("4KM");
Break;
Case 255:
LCDString("NF ");
Break;
Default:
Break;
}
}

Voidmain ()
{
P0 = 0x0F;
Buff [0] = 0xFF;
int_T0 ();
int_LCD();

While (1)
{
P0 = 0x01;
LCDCMD (0x80);
LCDString("R: ");
Display (Read _ADC());
LCDCMD (0x87);
LCDString("B: ");
Display (Read_ADC());

P0 = 0x02;
LCDCMD (0xC0);
LCDString("Y: ");
Display(Read_ADC());

P0 = 0x04;
LCDCMD (0xC7);
LCDString("N: ");
Display(Read_ADC());

}
}


PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 65
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
APPENDIX II
TOOLS REQUIREMENTS
SOLDERING IRON AND WIRE: A soldering iron is a hand tool used in
soldering. It supplies heat to melt the solder so that it can flow into the joint
between two work pieces. A soldering iron is composed of a heated metal tip and
an insulated handle.
.
FIG B.1: SOLDERING IRON FIG B.2: SOLDERING WIRE
SCREWDRIVER: A screwdriver is a tool, manual or powered, for turning screws.
The shaft is usually made of tough steel to resist bending or twisting.

FIG B.3: SCREWDRIVER
WIRE CUTTER: Diagonal pliers (wire cutters) are pliers intended for the cutting
of wire.

FIG B.4: WIRE CUTTER
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 66
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
APPENDIX III
HARDWARE TESTING
CONTINUTY TEST:
In electronics, a continuity test is the checking of an electric circuit to see if current
flows (that it is in fact a complete circuit). A continuity test is performed by placing a
small voltage (wired in series with an LED or noise-producing component such as a
piezoelectric speaker) across the chosen path. If electron flow is inhibited by broken
conductors, damaged components, or excessive resistance, the circuit is "open.
Devices that can be used to perform continuity tests include millimeters which
measure current and specialized continuity testers which are cheaper, more basic
devices, generally with a simple light bulb that lights up when current flows.

FIG C.1: MULTIMETER

PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 67
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
An important application is the continuity test of a bundle of wires so as to find the two
ends belonging to a particular one of these wires; there will be a negligible resistance
between the "right" ends, and only between the "right" ends.
This test is the performed just after the hardware soldering and configuration has been
completed. This test aims at finding any electrical open paths in the circuit after the
soldering. Many a times, the electrical continuity in the circuit is lost due to improper
soldering, wrong and rough handling of the PCB, improper usage of the soldering iron,
component failures and presence of bugs in the circuit diagram. We use a multi meter to
perform this test. We keep the multi meter in buzzer mode and connect the ground
terminal of the multi meter to the ground. We connect both the terminals across the path
that needs to be checked. If there is continuation then you will hear the beep sound.
POWER ON TEST:
This test is performed to check whether the voltage at different terminals is according to
the requirement or not. We take a multi meter and put it in voltage mode. Remember
that this test is performed without microcontroller. Firstly, we check the output of the
transformer, whether we get the required 12 v AC voltage.
Then we apply this voltage to the power supply circuit. Note that we do this test without
microcontroller because if there is any excessive voltage, this may lead to damaging the
controller. We check for the input to the voltage regulator i.e., are we getting an input of
12v and an output of 5v. This 5v output is given to the microcontrollers 40
th
pin. Hence
we check for the voltage level at 40
th
pin. Similarly, we check for the other terminals for
the required voltage. In this way we can assure that the voltage at all the terminals is as
per the requirement.



PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 68
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
APPENDIX IV
ADC0804 PIN DESCRIPTION
(REFERS TO THE FIG 7.8: PIN DIAGRAM FOR ADC0804)
PIN NO DESCRIPTION NAME
1 Activates ADC; Active low Chip select
2 Input pin; High to low pulse brings the data from internal
registers to the output pins after conversion
Read
3 Input pin; Low to high pulse is given to start the
conversion
Write
4 Clock Input pin; to give external clock. Clock IN
5 Output pin; Goes low when conversion is complete Interrupt
6 Analog non-inverting input Vin(+)
7 Analog inverting Input; normally ground Vin(-)
8 Ground(0V) Analog Ground
9 Input pin; sets the reference voltage for analog input Vref/2
10 Ground(0V) Digital Ground
11



8 bit digital output pins
D7
12 D6
13 D5
14 D4
15 D3
16 D2
17 D1
18 D0
19 Used with Clock IN pin when internal clock source is used Clock R
20 Supply voltage; 5V Vcc
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 69
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
LCD HD44780U PIN DESCRIPTION
PIN NO DESCRIPTION NAME
1 Power supply (GND) VSS
2 Power supply (+5V) VCC
3 Contrast adjust VEE
4 0 = Instruction input
1 = Data input
RS
5 0 = Write to LCD module
1 = Read from LCD module
R/W
6 Enable signal EN
7 Data bus line 0 (LSB) D0
8 Data bus line 1 D1
9 Data bus line 2 D2
10 Data bus line 3 D3
11 Data bus line 4 D4
12 Data bus line 5 D5
13 Data bus line 6 D6
14 Data bus line 7 (MSB) D7
(REFERS TO THE FIG 7.7: PIN DIAGRAM FOR LCD HD44780U)
PRECISE DISTANCE CALCULATION FOR UNDERGROUND CABLE FAULT DETECTION P a g e | 70
SAGAR INSTITUTE OF TECHNOLOGY AND MANAGEMENT
BIBLIOGRAPHY
TEXT BOOKS REFERE
The 8051 Microcontroller and Embedded systems by Muhammad Ali Mazidi and Janice
Gillespie Mazidi , Pearson Education.
ATMEL 89S52 Data Sheets.

WEBSITES
www.atmel.com
www.wikipedia.org
www.howstuffworks.com
www.scribd.com
www.alldatasheet.com
www.electronicsprojects4u.com
www.atmel.com/literature
www.8051projects.info

Anda mungkin juga menyukai