A LoRaWAN-based IoT System for Leakage Detection in Pipelines

— Leakages in a pipeline are an important problem due to the potential economic and environmental hazard they present. In this study, we proposed a LoRaWAN-based approach for detecting and localizing leakages in pipelines. Our study includes an experimental setup that simulates a pipeline network with pressure and flow rate sensors attached. The flow rate and pressure data were transmitted through LoRaWAN to a receiver, which in turn uploads the data to a cloud server using a cellular network. The receiver compares the flow rate reading from all the monitoring nodes attached to the pipeline network. If flow rate reading from successive nodes presents a percentage variation of more than 1.5%, a leak is confirmed to have taken place. The flow rate readings can also be used to localize the leak. The resolution of the leak detection is dependent on the number of monitoring nodes on the pipeline network. In our study, the pressure readings were found to be insufficient to provide reliable evidence of leakages. In our specific situation, due to the relatively short length of the experimental pipeline network, a pressure drop of up to 38.2% was recorded between successive nodes with an overall pressure loss of 62%, making pressure data unsuitable for leak detection in the short pipeline network.


I. INTRODUCTION
Pipelines globally are critical assets for the transportation of all kinds of fluid from a loading point to a final destination [1].They are popular for inter-regional and intra-regional movement of crude oil, refined petroleum products, water, and gas, among several others.While petroleum products depend largely on the use of roads and rail tracks as an alternative way of transportation, water is majorly restricted to having pipelines as the major channel for transportation and distribution, particularly within the metropolis [2].Consequently, water conservation will constantly be a paramount objective for countries worldwide due to its indispensability to society.
To have an efficient supply of water for human consumption, wastage along the transportation channel must be reduced to the barest minimum.Unfortunately, aging pipelines, flawed installations, and the surrounding environmental conditions are all potential culprits of leaks and wastage, which can sometimes be difficult to stop [3].Detecting and locating leaks within the pipeline infrastructure has always been a challenge, particularly when the pipeline network is underground or when the network passes through spots that are not easily accessible [4].Traditional approaches like physical inspection and examination often lead to delays in detection and repair, resulting in substantial water loss.Therefore, a robust IoTbased pipeline monitoring system is fundamental to ensuring prompt detection and localization of leaks so as to minimize water loss and prevent potential damage to infrastructure.Consequently, in this paper, we proposed a comprehensive solution that leverages LoRaWAN-based Internet of Things (IoT) technology [5] for monitoring and detecting leaks in water pipelines.Our technique exploits the ubiquity of IoT [6] and its ability to facilitate wireless connectivity between people and systems in a seamless manner.Specifically, we proposed the use of the Long-Range Wide Area Network (LoRaWAN) to provide long-range wireless connectivity of the IoT system to the cloud.
The IoT system proposed in this paper offers several advantages over traditional approaches.Firstly, its sensorbased technology enables the system to automatically detect and locate leaks in the pipeline network through the use of ultrasonic flow rate sensors attached at regular intervals along the pipeline.By continuously monitoring the flow rate and pressure of water within the pipelines, any abnormalities indicative of leaks can be promptly identified.This real-time monitoring capability allows for immediate intervention and repair, significantly reducing the time required to address leaks and minimize water loss.
Additionally, the integration of IoT technology provides a seamless and interconnected network that facilitates efficient data communication and management.The use of LoRaWAN, a low-power wide-area network protocol, ensures long-range connectivity and low energy consumption, making it an ideal choice for monitoring vast pipeline networks [7].The collected data from the flow sensors is securely transmitted to the cloud, where it undergoes further processing and analysis.The cloud-based data processing offers extensive opportunities for in-depth analysis and insights.By leveraging advanced analytical techniques, anomalous occurrences can be readily identified.This information can assist water management authorities in making informed decisions regarding infrastructure maintenance and facility repair.Furthermore, the integration of a user-friendly web interface allows stakeholders, such as water utility companies and regulatory agencies, to access real-time information about the pipeline network's status and potential leaks.This remote monitoring capability enhances operational efficiency, as personnel can respond promptly to detected leaks and allocate resources more effectively.The overall goal of this study, which is to mitigate losses to leaks in pipelines, will be discussed as follows.Section II provides an extensive survey of related studies and a background to the study.In Section III, we provided our design approach, which includes our experimental studies and design analysis.In section IV, we presented our results with discussion, while section V provides the conclusion and further studies area for the research.

II. BACKGROUND TO THE STUDY
Water is a critical commodity for all domestic and industrial activities.Hence, a sustainable supply of this essential commodity is crucial for both economic and industrial development [8].While about 70% of the earth's surface is covered with water, clean water is still considered a scarce resource even in civilized communities [9].Unfortunately, this scarce resource is highly prone to wastage more than any other resource.One important source of wastage is leakages in the distribution pipes that are used to distribute potable water for both domestic and industrial usage [10].Water pipeline leakage is a big problem around the world, and most water distribution authorities face extreme difficulties in detecting and localizing these leakages.According to [11], most developed and developing countries will be at risk of severe water shortages by the end of the century if urgent steps are not taken to address the problem of leakages.Presently, lack of access is already becoming a serious problem for several sub-urban areas, particularly in the developing world.For example, an estimate shows that about 66.3 million Nigerians currently lack access to clean water [12].
The challenges with water distribution are multidimensional.According to [13], some of these challenges include an increasingly high urbanization rate, inadequate investment and funding, poor management, and maintenance, and disjointed institutional and legal frameworks, among several others.For large cities with a wide land mass, pipeline networks can be expected to be very extensive, usually requiring widespread and highly complex leak detection and localization mechanisms.In this situation, the time taken to locate leaks may be long, and consequential damage unacceptable.
To mitigate this problem, several variants of leak detection and localization methods have been proposed by researchers.Some of these methods include flow rate monitoring techniques, pressure point analysis, negative pressure wave, distributed fiber optic sensing, acoustic sensing, real-time transient modeling, model simulation, infrared cameras, and lidar systems [14].Most modern leak detection systems have been strongly aided by rapid advancement on the Internet of Things technology.The technology allows for interaction between sensors and actuators over a network.Through the sharing and exchange of information, pre-trained intelligent systems can use available data to make informed decisions that can help minimize wastage through leakages.
The survey carried out by authors in [15] highlights the centrality of certain forms of intelligence to the future of pipeline leakages and localization.The study highlighted the significant contribution of intelligent underwater unmanned autonomous vehicles for leakage detection and control in marine environments.The study also emphasized the importance of such intelligent approaches in not only detecting leakages but also investigating the sizes of the leaks or, if possible, estimating the quantity of water or fluid that has been lost to the leak.
A study by [16] proposed an IoT-based architecture for remote monitoring of water pipelines.For the data acquisition setup, the authors employed the use of pressure and flow rate sensors, radio frequency identity tags, and a digital camera.For data transmission, the study employed the use of a wireless sensor network, which consists of radios, GPS, and remote distance equipment for remote communication.The setup equally features a data storage layer and a processing unit that runs a genetic algorithm for optimization.With each node on the pipeline network having access to a cluster head, the design system was able to leverage shared intelligence to anticipate leakage problems and improve pipeline operational performance.
Authors in [17] also proposed an experimental investigation and prototype of a water pipeline leakage monitoring system based on a low-cost microcontroller, Arduino, with three types of sensors.These sensors monitor the water flow rate, turbidity, and pressure.These data were then sent in real-time to cloud applications that provide visualization on mobile platforms and short messaging services.Although the study highlights the reliability of the collected data, further emphasis is on the use of cloud-based infrastructure for real-time monitoring applications.
Several metrics have been used extensively in the literature to detect leakage in pipelines, with pressure and flow rate being the most popular, even though authors in [17] equally monitored water turbidity to improve the detection reliability.Other techniques include the use of vibrations in pipelines [18], hydrophones [19], and water movement under gravity through accelerometers [20].Another interesting approach was proposed in [21].The author employed the use of soil moisture to monitor the moisture content of soil surrounding the pipeline to detect if leakages have occurred in that area or not.
In [22], the authors carried out a review of current technologies on leakage detection in pipeline distribution networks.The study identified data collection, AI-based data analytics, and reliable wireless communication links as the core of any pipeline monitoring system.The study, however, noted that flow rate and pressure sensors are more suited for burst leakage detection, while vibration sensors, acceleration sensors, contact microphones, and hydrophones are capable of producing better results due to their higher level of sensitivity but at a much higher cost.
Artificial intelligence is equally playing an increasingly prominent role in leakage detection.For example, studies carried out in [23] proposed a pipeline monitoring system that combines pressure sensors and accelerometers together with machine learning algorithms to detect and localize pipeline leakages with very little error margin.
The authors, through the deployment of AI, were able to give a moderate estimate of volumetric loss due to the leakages.Experimental evaluation carried out in the study yielded an average of 97%, 96%, and 92% accuracy for leak detection, localization, and leak volumetric loss estimate, respectively.Similarly, authors in [24] developed an AIbased acoustic leak detection system.The developed system relies on leakage sound to generate AI-assisted models for leakage localization.The study also compared different variants of AI models and concluded that deep neural networks outperformed other popular AI models like convolutional neural networks and support vector machines with an accuracy level of 90%.
In terms of processing, the Raspberry Pi, with several ARM-based microcontrollers, has been popularly used to provide processing power to most pipeline monitoring operations.The study in [25] employs Raspberry Pi to detect leakages in the pipeline using the leak audio detection approach.The Raspberry Pi constantly relies on the audio pickups from different points on the pipeline and uses a combination of the Gaussian mixture model and the hidden Markov model implemented on the Raspberry Pi for leakage detection.Raspberry Pi was also used in the study conducted by [26] for gas pipeline leakage detection, while authors in [27] employed the use of an ARM Cortex-M4F microcontroller.
Most surveyed literature on leakage detection in pipelines requires a flowmeter as one of the cheapest approaches for leakage detection.It was noted that the sensors are presented in two forms.As noted in [27], the ultrasonic type is the most preferred since it is non-invasive.The other type requires a physical intrusion into the pipeline network, thereby increasing the installation cost.It was, however, noted that the invasive type is slightly more consistent than the noninvasive.
The final block in most IoT-based pipeline leakage monitoring systems is the communication link between the nodes and the cloud.Several wireless technologies like Bluetooth, Wi-Fi, ZigBee, and Cellular networks have been discussed in the literature [22], [28].For example, the study conducted by [19], [29] developed a smart water pipeline monitoring system that relies on Wi-Fi for cloud connectivity.Wi-Fi has the advantage of high data rate connectivity.Also, for deployment in urban centers with already existing Wi-Fi connectivity, deploying the technology can be an advantage.Wi-Fi, however, has a few drawbacks.Firstly, the Wi-Fi technology is limited in range to less than a hundred meters, even in line-of-sight condition.Secondly, for nodes that rely on batteries for power, Wi-Fi technology is not an excellent choice due to a relatively high power consumption.These challenges are also applicable to Bluetooth even though the Bluetooth variant has a variant that is slightly more energy efficient than the conventional Wi-Fi technology.Cellular networks were deployed by authors in [3] and [17].Cellular networks are capable of providing both long-range and highdata-rate communication.Unfortunately, they are also affected by high energy consumption.
One very important wireless technology that is gaining popularity in most IoT applications is the long-range wide area network (LoRaWAN).Due to the use of a licenseexempt band and long range at very minimal energy cost, they have generally been accepted as a sustainable option for wireless communication in IoT applications [30].LoRa provides an impressive alternative for pipeline monitoring, particularly for installation sites that have no access to cellular or Wi-Fi coverage.

A. Experimental Setup
The experimental setup in this study is shown in Fig. 2. The setup includes a water tank, a pipeline network of about 200 meters in length, a 1 hp pump, an ultrasonic flow rate sensor, and a pressure sensor.The pipes used in this study were made of polyvinyl chloride (PVC) material with a diameter of 1 inch.PVC was used in this experiment since it is a common material used in pipeline construction due to its flexibility and resistance to corrosion and chemicals.The 1-inch diameter pipe used is considered a standard size for domestic installations and is appropriate for the scale of the experiment.
The setup was operated in a close loop format such that one set of pipes convey water through the pump into the pipeline network while the second pipeline return the water into the tank.The combined length of the entire pipe is 200 m.The study was carried out in an open yard behind the central Engineering workshop of the Federal University of Technology, Akure, Ondo State.The location of the pipeline was chosen due to its proximity to water supply and easy access to electrical installations for the purpose of pumping water.The system pipeline started at a pump station with a water tank that was intended to store water for the experiment.A single pipe was used to transport water over a distance of 200 meters.This pipe was then connected to a second pipe that transported water back to the water tank, as shown in Fig. 2. The connection was done with a flexible hose and both pipelines were located above the ground to simulate an above-ground system.
Eight sensors consisting of 4 pressure and 4 flow rate sensors were attached to the entire pipeline network.One pair of flow rate and pressure sensors was placed at the start of the pipeline network close to the tank, with another placed at the endpoint of the pipeline network.The remaining two sensor pairs were evenly spaced along the pipeline.The flow rate sensor used is the TUF-2000M ultrasonic flow sensor, while the Model QDX50A series Pressure transmitter was used for pressure readings.The flow rate  is calculated using (1): where V is the volume of water passing through the pipe and t is the time it takes the water to pass through the length of the pipe.Since V = Ad, where A is the area of the pipe and d is the diameter of the pipe,  can be rewritten as shown in (2).
Pressure is calculated by the force the fluid exerts on the diaphragm of the pressure sensor, as shown in Equation ( 3), where F is the force on the pressure sensor's diaphragm, and A is the area of the diaphragm.The location of each pair of sensors is referred to as a node for a total of four nodes.In between each node, we put a valve that can be opened to simulate leakage in the pipeline.

B. Pipeline Monitoring System
The pipeline monitoring system consists of the processing and communication unit.This was composed of the TTGO ESP32 microprocessor that takes input from the sensors, a buck converter, a 12 V battery, and a battery charging circuitry, as shown in Fig. 3. TTGO ESP32 has the ESP32 microcontroller together with the LoRa SX1276 chip on the same development board.The buck converter provides the necessary voltage level to all the modules in the device, while the 12 V battery powers the sensors.The monitoring device also features an OLED display to facilitate easy monitoring and debugging.Four monitoring devices were made and attached to each of the nodes on the pipeline to measure the pressure and flow rate at the nodes.The receiver unit block diagram is shown in Fig. 4. The receiver system acts as the central point of the system.
It receives the readings from each of the 4 hubs and displays it on the OLED screen.The user can see all the readings on the pipeline, both flow and pressure readings.The system employs the ESP32 TTGO LoRa module to communicate with the 4 monitoring hubs.Communication between the receiver and the hubs is facilitated by LoRaWAN.LoRaWAN allows for long-range communication between the monitoring device and the receiver.The receiving device collates the pressure and flow rate readings from four monitoring devices approximately every 10 seconds for upload to the cloud.Proper time slot allocation was done on all the monitoring devices to ensure that collision does not occur.The receiver also features a sim800L GSM module, which helps to send the data to a Firebase server.The picture of the complete monitoring device and the receiver is shown in Fig. 5 and Fig. 6, respectively, whereas the operational process of the leak detection system is shown in Fig. 7. Firstly, the pumping machine pumps water from the tank through the pipeline network in a closed loop.The four initialized monitoring device acquires the pressure and flow rate readings at each node where they have been installed and transmit the readings after every 10 seconds to the receiver over the LoRaWAN network.The receiver constantly compares the pressure and flow rate readings to ensure they are within a maximum of 1.5% variation across the entire length of the pipe.The 1.5% variation is an allowance that is used to account for minor loss within the pipeline due to friction between the different layers of the fluid and also due to the internal roughness of the pipe itself.All the data received at the receiver are relayed to a cloud server for remote monitoring and visualization.If there is no more than 1.5% variation in pressure or flow rate readings, the system assumes no leakage.However, if an anomaly in either the pressure or flow rate is detected, an alert is sent, and the anomaly can be seen on the visualization panel for immediate action.
Aside from being able to detect leakages, the system is also able to localize the leak.The resolution of the localization depends on the distance between successive nodes.For this setup, a resolution of less than 25 meters is achievable since the maximum distance successive nodes is 25 meters.If there is more than 1.5% drop in both pressure and flowrate readings between node 2 and 3 or between node 3 and 4, the system detects leakage between those nodes and sends an alert accordingly.

IV. RESULTS AND DISCUSSION
In an ideal scenario, the flow rate of water through a straight pipe of constant diameter and no additional sources of resistance or changes in elevation will remain the same through the length of the pipeline.However, in real-life situations, as in this project, the flow rate of water cannot remain constant through the pipeline due to several factors like friction at edges and joints as well as minor pressure losses.A complete installation is shown in Fig. 8. From Fig. 8, the leakage monitoring device is labeled "A", "B" is the flow rate sensor, and the pressure sensor is labelled as "C." In testing the developed leak detection and localization system, first, the flow rate and pressure profile of the entire pipeline network were obtained.This is the profile of the network when there is no leak.A typical flow rate profile of the network at no leak condition is shown in Fig. 9 and it shows that the flow rate is fairly constant across the pipeline network.The recorded flow rate at node 1 is 1.090 m 3 /s while the flow rate at the last node was 1.076 m 3 /s.This results in a 1.28% difference between the first and last node.The flow loss can be attributed to the internal roughness of the PVC pipe used as well as the frictional loss within the fluid layers.This is normal and well expected.To simulate leakage on the pipeline network as well as to test the ability of the developed system to detect leaks, the installed valves on the pipeline network were opened, and the corresponding effects were noted.The result of a simulated leak between nodes 1 and 2 is shown in Fig. 10.From Fig. 10, the flow rate at node 1 and node 2 is 1.090 m 3 /s and 1.074 m 3 /s, respectively, signifying a 1.504% drop in the flow rate.Since this value is greater than the 1.5% variation between successive nodes, a leak notification is sent.The result in Fig. 10 also shows a slight reduction in the flow rate between nodes 2 and 3 and between nodes 3 and 4.However, since the first notable and largest variation is observed between nodes 1 and 2, it can be confirmed that the leak occurred between the first two nodes.While the leak variation of 1.5% is applicable in this experiment, it is important to note that it may not be perfect in all test cases for two reasons.The first is that there is a direct relationship between the percentage variation observed and the size of the leak.Since the size of the leak is not a variable that is considered in this experiment, the 1.5% variation may not be considered sacrosanct.Secondly, the length of the pipeline network considered in this study is relatively short compared to pipeline networks that can grow into hundreds or even thousands of kilometers.In this case, higher frictional loss may have a much greater effect on the flow rate loss.Considering these two factors, it may be necessary to increase or decrease the 1.5% variation that was found to be suitable in our own specific test scenario.
The result for the pipeline network pressure reading under no leak condition is shown in Fig. 11.The pressure reading at the first node from the figure is 113 KPa.The pressure dropped to 68.73 KPa at the second node.Pressure readings of 45.17 KPa and 42.36 KPa, respectively, were recorded at the third and fourth nodes.In our own specific situation, it was difficult to use the pressure for precise leakage detection due to the large variation in our pressure readings under no leak condition.This variation made it slightly difficult to carry out precise correlation since the base pressure proved to be unreliable.The large variation in pressure reading was possibly due to the relatively short length of the pipeline network under consideration, and since the distance is too short for the fluid to reach a stable point, the pressure readings proved insufficient.Finally, the Web app built for the leak monitoring system is shown in Fig. 12.The web app displays the flow rate and pressure readings at each node.Also, once the water is pumped and is flowing through the pipeline, the flow sensors start displaying the flow readings, and the web app immediately displays the results for each of the 4 flow sensors.

V. CONCLUSION
In this work, we proposed a LoRaWAN-based IoT monitoring system for leakage detection in pipelines.The experiment carried out in this work used water as a fluid.However, it is noted that the study can be extended to other fluids, particularly petroleum products like gasoline, AGO, and several others with similar fluid dynamics.In the study, we demonstrated the use of IoT for monitoring pressure and flow rates in pipelines.We also show that flow rate, in particular, can be used to reliably detect and localize leaks.However, pressure readings proved unreliable due to the relatively short length of the pipeline network used for the experimental study.While our study was able to employ the use of flow rate of leakage detection, we did not study how the flow rate data can be used to estimate the size of the leak.This is a recommendation for future study.The impact of the pipeline network design on the pressure of fluid in the pipeline is also another area that requires future study.

ACKNOWLEDGMENT
We wish to appreciate the support of the Departments of Civil Engineering and Electrical and Electronics Engineering for their support in providing laboratory assistance during the course of this work.We also, more than anyone, appreciate the support of TETFund Nigeria for financing this research work.

Fig. 6 .
Fig. 6.Working process of the leak detection system.

Fig. 7 .
Fig. 7.A node consisting of the monitoring unit, flow sensor, and pressure sensor attached to the pipeline.

Fig. 10 .
Fig.10.Pressure profile for the leak monitoring system at no leak.