A Real-Time Oil Pipeline Anti-Intrusion System Using Acoustic Sensors

In this paper, a real-time oil Pipeline intrusion detection system was designed, developed and implemented using acoustic sensors. This approach involves the transmission of audio tones through wires laid along the pipeline. It is intended to overcome most of the problems associated with previous systems designed for this purpose, which includeconscious monitoring, unavailability of mobile network service for SMS monitoring, and destruction of cameras by intruders.The system consists of a master controller module and three or possibly more slave modules. The master module regularly polls the slave modules for acoustic signals that are transmitted to a computer. Dedicated software programs, running on the computer reads the status data from the Master module and displays it on a Graphical User Interface (GUI). A decision can then be made regarding the nature of the signal. Limitations like the delay in signal transmission to the control station and from longer distances along the pipeline need to be solved in further work.


INTRODUCTION
Pipeline is an efficient means of transporting fluids over long distances, from production locations to the markets. The safe and continuous operation of hydrocarbon pipelines requires the pipeline operator to have the most recent information regarding the condition of his pipeline [1]. Furthermore, tampering with oil pipelines will not only lead to economic loss, but could also be very inimical to the environment leading to loss of lives and properties. Between 1998 and 2009, Nigeria lost over two thousand people due to pipeline explosions across the country [2]; most explosions are caused by residents to scooping fuel from vandalized pipelines. Thisaccounts for most, or all the incidents that now represent a major increase in the mortality rate in Nigeria.
The motivation behind this work is to create a monitoring system, using acoustic methods, which can be employed in remote monitoring of pipeline activity. This will aid government and oil industry in reducing the loss of pipeline products due to third party intrusion. An Effective pipeline monitoring system like our Dual Tone MultiFrequency (DTMF) -based real time pipeline monitoring system is a model utilized to lower pipeline operating costs(in the long run though), improve performance, increase effectiveness andefficiency and as well provide the most needed protection for the pipeline from third party damages.

REVIEW OF RELATED WORK
Attempts to monitor and prevent pipeline vandalism did not start today. Various people have used various approaches and technologies to thwart unruly efforts to gain access to oil contents being transported via pipelines. In this section, we intend to x-ray such known works that attempted to design and implement similar works like ours.
The first of such work is described in [3], where satellite technology was used as the major monitoring component. It is an integrated satellite-based detection system for pipeline monitoring. This satellite aims at allowing accurate geo-positioning of pipelines and other distribution lines (gas). Information gathering is by the local use and topography representation of these lines, helping it become easy to identify. This is fully achieved by having the pipeline location being placed as a vector file over a one meter spatial resolution satellite image (colored red in the work).Then in other to differentiate between other geographical areas, environmental areas are identified as green, roads and agricultural areas and structures are also clearly distinguishable due to the high spatial resolution image [3]. After placing all these, when there is an intrusion by an individual on any line, the detection is aided by a radar system. However, this type of design does not transmit information in realtime and the harm must have been done before it is detected. Also, its cost profile puts it beyond the reach of smaller oil companies.
The work done by C. Nayak in [4] is very recent but is directly related to leakage detection in pipelines. A Chemical Engineering approach was used and a lot of model equations was presented as well.
Another system designed by [5] uses Surveillance Cameras mounted at interval of 10feet along the oil pipleline and connected to a Central Monitoring Room (CMR). The disadvantages of this system include Insufficient coverage of all the area of under check e.g. Under water coverage and long distance coverage, easily damaged (rain/sun and animals and environmental hazards), not reliable and making the job boring for the operators.
An improvement on the above designs is the implementation of the monitoring system using a feedback via Short Message Service (SMS). This can tell the owners where tampering occured and does not require steady monitoring as in the use of surveillance cameras. This work was done by [6]. However, the problem with the use of SMS can become obvious during network outage and processing can be slow when concurrent breaches occur along the length of the oil pipeline.
In furtherance of the quest to design and implement a better pipeline monitoring system, the Supervisory Control and Data Acquisition (SCADA) system was considered as a better alternative to the existing solutions. SCADA systems are used to monitor and control pipeline, or plant equipment. It is also used by Telecommunication, water and waste control , oil and gas refining and transportation companies. This system was a breakthrough in pipeline monitoring, because it was used to control as well as monitor the operation at various points in the asset. SCADA systems consist of the following:  One or many field data devices, which form the eyes of the system. Devices such as RTU (remote terminal unit) or PLC (programmable logic controls), which interface to field sensing devices and local control switchboxes and valve stations.  A communication system used to transfer data from the field to the terminal unit.
System can be telephone cable, satellite or combination of both.  A master station or master terminal unit used as a central host to control others.  A collection of standard and/ or custom software such as HMI (human machine interface) or man machine interface used to provide SCADA central host and operating terminal application, to support the communication system and monitor and control remotely located field data interface devices. [1].

ACOUSTIC METHOD FOR PIPELINE MONITORING
The Basic principle of operation of widely utilized pipeline monitoring systems such as the Distributed Acoustic Sensors (DAS) is centered around detection of sound variations on the pipeline. Despite the technology used in the detection and the method of signal processing employed, the fundamental quantity being detected and read is sound. Our work is built on this fundamental concept but was expanded upon using microcontrollers and DTMF technology.

Design Objectives
In this work we seek to design a system that meets the following objectives: 1. The operation of the system should not have any distance limitation. The system should be able to monitor activities around the pipeline over its span. 2. The installation and operation of the system should not in any way affect the physical properties and operation of the pipeline. 3. The system should be able to differentiate between noise resulting from flow of petroleum products in the pipeline and noise resulting from vandal activities. 4. It should be able to withstand environmental conditions irrespective of where it is installed.
Apart from these design objectives certain factors were also put into consideration. Among these are, mnimal cost, maintainability, reliability and ease of installation.

HARDWARE DESIGN
The system hardware component comprises of the Master Controller Module (MCM) and the Slave Module(s) (SM). Each of the modules is capable of receiving and transmitting data over the pipeline. The pipeline is used as a medium of signal transmission while a single wire is used as ground link to provide a return current path for the signal currents. To avoid interference or signal corruption and to ensure unique data transmission and reception of data, Dual Tone Multiple Frequency Signals were used. These signals are encoded and used for communication between all modules on the pipeline. Fig. 1 illustrates the placement of the Master Controller Module and the Slave Modules on a pipeline.

Fig. 1. Placement of master and slave modules on a pipeline being monitored
From Fig. 1, P denotes the pipeline to be monitored; MCM represents the Master Controller Module while SM1, SM2 and SM3 are the Slave Modules. Acoustic methods are used to detect activity on the pipeline. Each of the Slave Modules incorporates an electret-type microphone and constantly senses sound waves on the surface of the pipeline. The Slave Modules are installed such that the microphones maintain sufficient acoustic contact with the surface of the pipeline. X1, X2 and X3 are the distances between the modules. These distances are equal and must be noted. The distances must be such that sound generated as a result of tampering with the pipe within the distance can propagate easily and reach the microphones at both ends of the pipe. For instance, if the point on the pipeline being tampered with is within the point distance of X3, microphones in Slave Modules M2 and M3 should be able to detect the vibrations resulting from the puncturing activity. Since the distance is known and equal, it will be easy to give a rough estimate of the location on the pipe being punctured or tampered with. Instantaneous sound level information is requested by the Master Controller module from the Slave Modules sequentially and continuously.

Slave Module
The Slave Modules are responsible for the monitoring of sound level around the point on the pipeline on which they are installed. An Electret Microphone is used as a sound transducer to enable conversion of sound waves into electrical signals that are then amplified, converted to digital format and processed. In terms of circuit layout, the slave module is identical to the master module except for the addition of an amplifier module that conditions the signals from the electret microphone; and the absence of the RS232 interface. Fig. 3 presents the diagram of the slave module.

Fig. 3. Block diagram of the slave module(s)
The major circuit components of the Slave Module(s) include: The circuit presented in Fig. 4 conditions the analog signal from the electret microphone to allow proper conversion to digital format and processing by the microcontroller. The circuit is basically an inverting amplifier. Resistors R5 and R6 are used to bias the Non-inverting terminal of the operational amplifier to half the supply voltage (This is required in single supply operational amplifier circuits). This automatically places the output terminal of the operational amplifier to half the supply voltage for symmetrical swing. Resistors R1, R4 and RV1 set the voltage gain of the amplifier stage. RV1 is a variable resistor. This is used to vary the gain of the amplifier as well as the sensitivity of the overall sound detection circuit.
More gain results to response to little sounds, while a lower gain dampens the response. The voltage gain of an inverting amplifier is given by: Fig. 4, Rf comprises of the series combination of R1 and RV1. Since RV1 is variable, the minimum gain of the amplifier will occur when RV1 has been set to 0 (zero) Ohms; in this case R1 will be the dominant resistance. The gain thus will be 47. The highest gain occurs when RV1 has been set to its highest level (100KOhms); this gives a gain of 57. Being able to vary the gain will help in properly calibrating the sound detection system for effective operation. Capacitor C3 acts as an AC coupling capacitor, to pass only the AC component of the sound signal to the amplifier while blocking the DC component.

Fig. 4. Sound detection/amplification circuit of the slave module(s) [8]
The Microcontroller integrated ADC is used to convert the signal output of the sound detector module to digital form. After the conversion, the resulting data is scaled to fit in a 9-scale sound level. Thus the microcontroller matches the sound level on a scale of 9 levels depending on the amplitude of the detected sound.
The microcontroller then sends a DTMF digit (1-9) representing the detected peak sound level to the master module when requested.
By default sound level is set to 1. This is the lowest level and is also used to indicate that the slave module is online. Peak detection implemented through software, allows the microcontroller to average sound data level and send the final sound level to the master module when required.

Data Communication Protocol
For effective data communication between the master module and slave modules, a protocol was implemented. Owing to the 30 millisecond DTMF detection window of the MT8870 tone decoder used in all the modules, the protocol implemented was such that allowed the fastest data transaction between the Master Module and each of the slave modules. Data communication is of the synchronous type. The Master Module initiates a data communication session by sending out a broadcast DTMF character; in this case the Hash (#) character. The listening Slave modules receive this broadcast data and initialize their respective delay timers. Each slave module has an ID number (identification number). For the three slave module, the IDs are 1,2 and 3 respectively. The slave ID is used to set the amount of time the slave module must wait, after receiving the broadcast data from the master module, to transmit its sound level data. The base time 80 milliseconds was selected. This means that each slave module waits for (80ms * ID) after the broadcast signal before transmitting its sound level data. i.e.
 Slave Module1 delays (80* 1)milliseconds  Slave Module2 delays (80* 2)milliseconds  Slave Module3 delays (80* 3)milliseconds The Master Module repeats the transmission after all slave modules must have transmitted their data. This is approximately 240ms. Thus a communication frame time of 240ms is used to read data from all three slave modules. Fig. 5 is the timing diagram for a data communication frame between the master module and the slave modules, while Fig. 6 presents the flow diagram of the master module. The DTMF transmission duration for each module is 50ms. While the MT8870 decoder DTMF detection window is 30ms. Transmission duration of 50ms ensures that all modules receive the tone without error.

SOFTWARE DESIGN
The software used in the project is in two parts:

Master/Slave Module Firmware
The Master Module and Slave Module have software running in their respective microcontrollers. Their software was written in C under Microchip(R) MPLAB integrated development environment. Using a high level language instead of Assembly Language allows for complex software programs to be written in a shorter amount of time. It is also less tedious to debug. The Master and Slave modules both have the DTMF generator algorithm common to them. The DTMF algorithm is capable of generating DTMF tone with less than 0.1 percent THD (Total Harmonic Distortion). The algorithm is the core of the operation of the project.
The algorithm is based on Direct Digital Synthesis. Data Samples for a Full-cycle sine wave is generated and stored in a table in the microcontroller memory. Two sets of data samples were used in the project; one data sample is used for generating the higher order DTMF frequencies while the other is used in generating the lower order frequencies. 64 samples where used. The number of samples affects the harmonic distortion of the generated DTMF signal. Table 2 presents the first 32 samples of the High and Low Order DTMF frequencies.  39  50  42  54  46  59  50  64  53  68  57  73  60  77  63  81  66  85  68  88  71  91  72  93  74  95  75  97  76  98  77  99 The data values in table 2 were derived using the formula below: Where: By sending this data at a fixed interval to a digital to analog converter, sine wave of any frequency can be generated. The frequency of the generated sine wave is directly proportional to the rate at which the data samples are passed to the DAC. As DTMF signals are the result of the sum of two sine waves with different frequencies, applying a direct sum on the data samples of the High and LOW order Data samples (as shown in table 2) and passing them to a DAC generates the required DTMF signal.
The Algorithm is able to generate the whole range of telephone DTMF frequencies using this method. To further explain the operation of the Master /Slave Module Firmware, the flow diagrams below will be used.

Desktop Computer Software
The Desktop Computer software was written using Microsoft's Visual C# (pronounced seesharp). It is an object oriented programming language and runs under the dot net framework. It is a robust programming language that can be used to design complex programs that can run on any version of windows operating system. With Visual Studio, Graphical user Interface (GUI) elements such as buttons, textbox, label, combo box, etc can be designed easily and quickly by dragging and dropping the required elements onto the software from Visual C# toolbox.
The Major function of the desktop software is to receive data from the master module, decode the data and then display it on the computer screen in an easy to read manner. The software also checks if any slave sound data has passed a set threshold and then indicates the time it occurred on the GUI.
Once the Master Module is plugged into the computer and the desktop software is run, the settings dialog must be used to configure the Master Module. Combo Box (Labelled 'A' in Fig. 7) is used to select the communication port on which the master module is plugged in. After selecting the port, the software checks for the availability of the master module. if found, the software notifies the user and starts processing the data received from the master module in the background. B is used to set the threshold level of the slave module sound data which when exceeded is logged on the main GUI. C is used to run a quick check on all the slave modules. After the check, a report is displayed showing slave modules that are active and those that are inactive. D is used to set the distance between the slave modules on the pipeline. This value is used to derive an approximate point where activity is taking around the pipeline. Fig. 7 presents the main GUI interface while Fig. 8 presents the flow diagram of the slave module.

RESULTS AND DISCUSSION
The system was first implemented on a breadboard, tested and then transfered to a veroboard. However, a simulation of the signals using Proteus softtware was part of the implementation process. Some of the simulation results are presented in this section together with the actual test on oil pipelines. Scale and Send ADC Peak data Value (DTMF 1 -9) Clear ADC peak data

Simulation Results
Shown in Fig. 9 and Fig. 10 are; (A) PWM waveform of generated DTMF signal before filtering; (B) Filtered DTMF signal waveform after amplification, respectively.
The following results were obtained and observations made during the different stages of testing.
Slave module delay = 80 milliseconds. Total time for the three modules = 240 milliseconds. Time for broadcast by the Master control module = 50 milliseconds. Detection time = 30 milliseconds.

Simulation Results
Shown in Fig. 9 and Fig. 10 are; (A) PWM waveform of generated DTMF signal before filtering; (B) Filtered DTMF signal waveform after amplification, respectively.
The following results were obtained and observations made during the different stages of testing.
Slave module delay = 80 milliseconds. Total time for the three modules = 240 milliseconds. Time for broadcast by the Master control module = 50 milliseconds. Detection time = 30 milliseconds.

Simulation Results
Shown in Fig. 9 and Fig. 10 are; (A) PWM waveform of generated DTMF signal before filtering; (B) Filtered DTMF signal waveform after amplification, respectively.
The following results were obtained and observations made during the different stages of testing.
Slave module delay = 80 milliseconds. Total time for the three modules = 240 milliseconds. Time for broadcast by the Master control module = 50 milliseconds. Detection time = 30 milliseconds.

Packaging
A plastic casing was used due to a number of factors, which broadly fall into Physical and Environmental considerations.
The physical considerations in choosing a plastic casing are; i.) Appearance: we wanted a final package which is beautiful and physically appealing ii.) Weight: a casing that should be light weight.
iii.) Using Plastics allowed us to easily melt or bore some sections of the plastic to fit in components such as the power switch, status LEDs, Mounting Clips, Microphones etc.
The environmental factors that also influenced the choice of casing are; i.) HUMIDITY: to ensure that the casing does not rust or water does not get into the internal circuitry, the package must be rust resistant and water tight (to an extent). ii.) SHOCK AND VIBRATION: due to the adverse effects of shock and vibration, the casing should be spacious, damped and must not be a conductor to prevent shock. iii.) PESTS AND INSECTS: the casing should be able to withstand the destructive tendencies of pests and insects. Fig. 11 presents the packaging of the prototype, while Fig. 12 presents its attachment to the pipeline.

CONCLUSION
This paper has presented the design and implementation of a pipeline monitoring system that has overcome most of the drawbacks of existing solutions. It is a system that can be used remotely to effectively and reliably monitor pipeline activity using acoustic and DTMF signaling. This is intended to curb the drawbacks of current systems in use today.
However, several challenges were thrown up during the design stage of the work. Generating DTMF signals using software that would run on a microcontroller posed a serious challenge. Eventually, the DDS (Direct Digital synthesis) technique for DTMF tone generation was used. Also, it was challenging to figure out how to convert the Digital DTMF data to Analog. Further research made it possible to use PWM for Digital to Analog conversion, which worked flawlessly when implemented.
In terms of further work, we recommend that data communication frame duration be reduced to a great extent. The current frame time of 240mS can pose a serious challenge as more Slave modules are connected to the system. It might end up having the frame time extend by about 10s of seconds. The protocol used will also need to be modified to achieve a reduced frame time. A protocol similar to that of Ethernet would, to a great extent, can solve the problem.
Also, the complexity of the design can be further reduced by implementing the DTMF tone decoder in software. The Ring/In-Call detector Circuit can be made part of the microcontroller