Design and Development of IoT Based Water Flow Monitoring for Pico Hydro Power Plant

A Pico hydro power plant is one good solution to support energy independence for rural areas in Indonesia. The problem that normally emerged is the uncertainty of water debit. This may cause the damage of the Pico hydro power plant equipment. The main objective of this study is to design a water flow monitoring (WAFLOW-MT) device based on the Internet of Things (IoT). This device may help the technicians at the Pico hydro power plant in monitoring the speed of water flow at the river so that the water debit is recorded all the time. The design and development process of the WAFLOW-MT device was done through 4 stages: 1) need analysis; 2) system design; 3) system development, and 4) system testing. The data was collected from the water flow sensor and sent via IoT to the webserver thingspeak.com by 6 days duration of testing. According to the testing result, it can be concluded that the WAFLOW-MT device successfully monitored the water flow of the river.


Introduction
Indonesia is archipelagos with various characteristics of watersheds starting from the shallow one to the deep which are exist across the country. Watershed refers to an area of land that includes rivers and other streams that can be used to hold, save, and drain the rainfall off to the lakes, bays, or ocean naturally [1]. Regarding watersheds, the upstream area has a strategic function, namely as a catchment area, conservation area, and buffer for areas below such as small rivers [2]. A river is a long and big water stream that flows continuously from upstream (source) to downstream (estuary). In general, there are two types of rivers. The first type is a naturally formed river due to soil erosion by a water flow originating from rain. Another natural river can be formed from a path flow of larvae of a volcanic eruption. The second type is an artificial river formed by a human intervention which is usually used for irrigation in rice fields or fish ponds. The river physically has different forms in terms of the velocity of the water flow, the ratio of width and depth of the river, the rocks on the riverbed, and the river's length.
The management of rivers in Indonesia is regulated in Government Regulation No. 38/2011. This regulation includes river conservation, river development, and river-related disaster management. Rivers in Indonesia, which have a variety of characteristics, have made special attention to be used as a potential source of energy. In the context of renewable energy, the river flow has the potential energy to generate the electrical power that can be used to supply the houses, particularly in remote areas. To that end, one of the important things is the adequacy of the river flow speed. In order to measure the water flow speed, it needs a measurement device to monitor and evaluate the water balance of an area through the available surface water resource potential approach [3].
One of the advanced technologies today is IoT. Basically, IoT technology has been found since the 1990s. The first device used IoT technology for turning on and off remotely over the Internet was a cake toaster. In 2000, the giant company of LG made a smart refrigerator that has its capability to determine whether or not to replenish the food items stored [4]. Those make the IoT gaining significant interest from researchers due to its potential for information processing and data exchange in various aspects of our everyday life. Now, in around 20 years since Kevin Ashton introduced the IoT in a United Nations ITU report [5], the IoT became capable of intelligently monitoring, managing, tracking, or positioning some particular system. IoT technology is a concept in which the device can transfer data over an internet network without requiring human-andcomputer interaction. In other words, the user (human) does not need to control or monitor an object or device directly by their hand. The control and monitoring process can be done remotely via a smartphone, PC, or laptop.
Recently, IoT has been widely used in many topics; some of them are in smart shopping system [6], for saving electrical energy [7], for school attendance system [8], etc. IoT has been also considerably used in the field of small-scale electric power such as the Pico hydro power plant. Pico hydro is one of the alternative energy sources with relatively small potential energy that can be used to provide electrical energy in remote areas. As conducted by [9], the authors deal with the IoT in order to measure the level as well as the flow of water in the pico hydro power generation system. The system made by those authors successfully monitored how much water has moved through the water flow sensor and sent the information and data via IoT for monitoring purposes.
Another development has been proposed by Moreno et al. [10], which focused on a web-based data acquisition platform integrated with IoT techniques to retrieve data of river water levels through cellular networks. Kafli & Isa [11] have also been developed a water surface IoT-based monitoring system. Their platform was capable to monitor the air quality and water quality of a river as well as the water level of the river.
As exemplified by some of the researchers mentioned above, the use of IoT in monitoring the behavior of river water was considerably needed in order to transfer the data of the sensor attached remotely. The technician does not need in the same site as the physical system and may get the monitoring data easily and in a real-time manner. Concerning the development of the Pico hydro power plant, the problem that commonly encountered is the inconstant water flow because it is very dependent on rainfall, which often results in equipment damage.
As with the shift of the turbine shaft, over-speed, and changes in frequency, each failure has a major impact on the economy because of lost productive hours as well as working hours. As mentioned in [12] and [13], the Pico hydro power plant requires a governing system to limit the variation of water turbine speed due to the weather change and variation of consumer load. Accordingly, it needs a system that capable to monitor the river flow speed remotely based on IoT. This system, hereinafter called as a WAFLOW-MT (water flow monitoring device), aims to monitor the river flow speed remotely via IoT technology. From those data and its graphical output, the operator may monitor and analyze in a real-time manner the minimum, the maximum, and the average speed of the water flow.

Research Method
The main focus of this study is the design and development of the water flow monitoring system based on the IoT. To that end, one commonly used method to deal with is the sequential model of 1) need analysis; 2) system design; 3) system development, and 4) system testing [14]. This model has been successfully implemented by many researchers [15], [16]. The following are the detailed explanation for each stage of this study.

Needs analysis
This step deals with the first process from the whole process of the design and development of the system to identify and collect as much information as possible in order to build a comprehensive understanding of how the system should works. Basically, the water flow measuring system is a technology-based innovation to measure and monitor the flow of the river. The monitoring process is done over the internet network by applying the IoT concept. The water flow sensor attached in the system is used as the main input data that will be transferred to the particular website. Subsequently, the data collected can be used by the user or technician at the Pico hydro power plant to decide whether or not the water flow is stable. After analyzing the needs related to the electronic circuit used, it can be identified the principal components required for the development of the WAFLOW-MT system. The main components of the system are microcontroller Arduino UNO R3, ESP8266 IoT module, YF-S201 water flow sensor, and power supply.

System design
This section discusses the design process of the water flow monitoring system in detail. In general, the system design comprises two parts: first, the design that relates to the hardware system and the second, the design that focuses on the software of the system.

Design of Hardware
Based on the result of the need analysis, it can be noted that there are four main components: microcontroller Arduino UNO R3, ESP8266 IoT module, YF-S201 water flow sensor, and power supply. Those components connect each other as shown in Figure 1 below.

Water Flow
Sensor YF-S201

IoT module ESP8266
Power Supply

Fig. 1. Diagram block of the proposed system
The microcontroller acts as the main brain of the system. Arduino UNO R3 was selected as the main processor due to its easiness, flexibility, small and light, low-cost, and robust. In order to collect the data of the water flow, the system in this study used the YF-S201 water flow sensor. This sensor works by measuring how much liquid has moved through its pinwheel. The sensor then generates pulses which are converted into digital data [17]. The digital data collected is then sent to the microcontroller. The microcontroller calculates the data and then sends it to the ESP8266 IoT module. The ESP8266 module is a self-contained SoC (system on chip) with an integrated TCP/IP protocol that has the capability to connect to the internet network. This module will continuously send the data over the internet to the webserver. All the electronic components in the system are powered by the independent power supply that has a battery and portable solar cell for self-charging. Meanwhile, Figure 2 shows a wiring diagram of all components used in the water flow monitoring system of this study. In order to ensure the system works as designed, it needs a program code installed at the microcontroller Arduino UNO R3. The development of program code can be conducted by using the Arduino Software IDE (Integrated Development Environment). As seen in Figure 3, the software starts by initializing process. This process sets all variables used in the program related to the microcontroller pin addressing and some initial predetermined value. The program continues by getting the data from the water flow module. The main controller processes the collected data and sends it to the network through the IoT module. This process will never be stopped unless the main switch of the system is switched off. The data is then received by ThingSpeak webserver. ThingSpeak is an open IoT platform that allows the user to collect, visualize, and analyze live data streams in the cloud.

System development
The work continues by developing the prototype based on the results from the need analysis and system design stages. This process starts by preparing all components needed and then wiring the components according to the wiring diagram that has been previously designed. After that, the process of downloading the program code that is already established is conducted through Arduino IDE to the microcontroller.
Looking into detail at the principal work of YF-S201 water flow sensor, as seen in Figure 4, the wheel at the water flow sensor rotates when getting a pressure boost from a river current. This rotation results in a repeated friction between the magnet and the Hall Effect sensor. As a consequent, it becomes a Hall Effect field. The Hall Effect is a deflection of electricity (electrons) in a conductor plate due to the influence of a magnetic field. This principle is the basis of the Lorenz Force [18]. The process described above takes place continuously so as to generate pulses. The pulses will be processed and converted into digital data by the microcontroller Arduino UNO R3 and then to be displayed through the IoT module on the ThingSpeak webserver. The stronger a river flow, the more pulses are generated and vice versa.

Fig. 4. Water flow sensor mechanism
The next step turns into the development of the mechanical structure of the WAFLOW-MT device. As seen in Figure 5, the box is made from acrylic which is attached to the floating styrofoam. Acrylic and floating styrofoam are chosen because of their strong and lightweight materials that allowed the prototype to float accordingly. There are ballasts attached at the bottom of the mechanical structure which is made from concrete. These ballasts keep the prototype steady from the river current.

System testing
This section will discuss the testing stage that should be conducted in order to ensure the water flow monitoring device may function as designed. In the development of software code, there is actually a debugging process. This debugging process is conducted to detect firstly and then subsequently remove the potential errors found in software code. The process is normally done by eliminating the language error or syntax error, the run-time error, and the logical error [19]. After the software is relatively free from the errors, the testing continues by applying the functional-based test. This test, is commonly known as a Black Box Testing [20], is one of the software test approaches that examines only the functionality of the system without seeing into detail the internal structure of the program code. The trial test has been conducted in one of the rivers located in Condongcatur, Depok District, Sleman Regency of the Special Region of Yogyakarta, Indonesia. This trial test was a hardware testing approach to real environmental conditions. This test included a ballast resistance from river currents, disturbances from tree branches or leaves, and resistance from rain or sun heat. This test was conducted to see whether or not the device can be stable when taking data samples on the real environmental conditions of the river.

Research Results and Discussion
As it is already mentioned in the sub-section system testing, our proposed system has been tested on the basis of functionality testing. The test has been conducted by setting the WAFLOW-MT device on the river up for 6 days at specific time periods. In those periods, the WAFLOW-MT device is successfully sent the data to the Thing-Speak webserver. Table 1 shows the summary data collected from the ThingSpeak webserver. It can be seen that the data collected in 6 days comprises three different time range. These time ranges represent the morning time, the afternoon time, and the night time. It is also important to highlight that there is a simple statistical analysis used in showing the data of river flow speed, i.e., calculating the maximum, the minimum, and the average speed of water flow in m/s. One of the important benefits offering by ThinkSpeak is the capability to visualize the data online. Figure 6 shows the graph of the water flow speed (in rpm) from the ThinkSpeak website. It can be seen from the graph that the river flow speed is relatively stable. The data collected and visualized by the ThinkSpeak website can be used by the user or technician to decide whether or not the water flow speed of the river is safe for the Pico hydro power plant. This approach may reduce the potential damage that often occurs to the shaft of the Pico hydro power plant due to the unmonitored water flow speed. The monitoring system built in this study equips with one water flow sensor only that may reduce the complexity of the construction of the hardware system as faced in [10] and [11]. The use of one sensor in this study also suppresses the cost of development and gives faster data sending without ignoring the main objective of the system in monitoring the water flow speed. The simple algorithm without any intelligence approach has also implemented in the system in order to get the fast computation process in sending and calculating the data.

Conclusion
Based on the testing results and discussion it can be concluded that the proposed system could monitor the river flow speed real-time and easily access via a gadget, laptop, or PC. In addition, the collected data can be downloaded so it can be then easily used to analyze the potential problems related to the unstable water flow speed that may risk the Pico hydro power plant. The WAFLOW-MT device has also a relatively small dimension so it has more flexibility to set in the river up. However, there are still weaknesses found on this device. In the context of internal disturbances, this device still uses naturally conventional cooling by relying on air entering through the circulation holes in the device box. However, based on the trial test, it can be found that the working temperature of this device was relatively low. In terms of the external disturbance, this device is not equipped with a filter to block the garbage that is normally found on the Indonesian river which may interfere the monitoring process. These drawbacks might be taken into consideration for the next design and development. Concerning the data transfer, the one important point in dealing with wireless data communication is a stable connection. Since this study used a cellular internet connection in order to transfer the data collected which is sometimes losing the provider signal, thus it needs some specific mechanism or strategy to tackle such a problem. This problem could be considered for future improvement that has not been addressed in this study.

6 Authors
Nurhening Yuniarti is an engineering educator and researcher focusing on electrical engineering at Yogyakarta State University, Indonesia. She finished his Doctoral degree (Joint Degree Program) at the Yogyakarta State University, Indonesia and TU Dresden, Germany. Her research interests include electrical power engineering, technology-enhanced learning, and education in the context of electrical engineering. She can be conveniently reached by email at nurhening@uny.ac.id Didik Hariyanto is officially a lecturer and also a researcher at the Department of Electrical Engineering Education, Faculty of Engineering, Yogyakarta State University, Indonesia. He finished his Doctoral degree at the Institute of Vocational Education and Vocational Didactics, TU Dresden, Germany. His research interests include adap-