Water Level Monitoring and Control System in Elevated Tanks to Prevent Water Leaks

The shortage of water is recurrent in Lima, Perú and in the world, either due to natural disasters, deficiency in pipes due to age, or breakages by external agents such as heavy trucks, heavy machinery, etc., which damage to the underground pipes causing flooding and, shortages in the affected area or zone. As a possible solution, many inhabitants have elevated tanks, but they do not have an automatic control, nor view the water level in the tank, nor recognize possible water leaks if they occur, such leaks are economic detriment to the user. The objective research work wants to avoid shortages in the short period, controlling and monitoring of water for use at home or industry. For the implementation of this project, the technology of the Arduino Uno board, a 16x2 LCD screen, an ultrasonic sensor, and a mini pump will be used, which will be fed with a DC voltage, it is intended to have manual control every time, otherwise the work will be fully automatic. The results obtained were as expected, always displaying on the LCD screen, as at the beginning of the process with the tank empty and its corresponding alarm on a led diode, the percentage of water that gradually rises until the end of the process with the full tank message and its corresponding alarm on another led diode. The implementation of this project is economical, which is why it is very viable for many households and companies that can choose this alternative. Keywords—Arduino; ultrasonic sensor; stockouts; algorithm; monitoring and control; water leaks; elevated tanks


I. INTRODUCTION
Many homes, residential, condominiums, etc., have water reservoirs on the rooftops, but they do not have a constant monitoring system that guarantees optimal performance to visualize the status of storage or water leakage problems which could arise due to natural disasters [1], or due pipe breaks caused by heavy means of transport or due the age of the canalization system [2].
The fluidity of water is essential to carry out any activity or work, but since this objective is achieved in times of shortage or problems in the supply of drinking water, it is convenient to make an underground well and elevated tanks to counteract this adversity [3].
There are companies that depend on great fluidity of water for their different processes, such as laundries or dry cleaners, how can the constant supply of the liquid element be guaranteed, in addition to saving on the implementation of a constant control and monitoring of tanks elevated, powered by constant pressure pumps and PID control [4].
The main objective of this project is to avoid water shortages and leaks either in houses, residences, condominiums, and companies whose area is causally linked to the use of water such as the different textile companies, laundries, and dry cleaners. With this project, the use of water will be efficiently improved for its different needs and the low budget it manages, since the electronic elements to be used are low cost and very accessible in the market, also mention that this project will prevent water leaks [7].
To develop this research work, we will use the opensource electronic creation platform (Arduino), which is based on free hardware and software, flexible and quite easy to use to create and develop. To create the pseudocode, we will go to the Arduino IDE programming language, which is based on the C ++ language. It will also need an element that is capable of measuring distance to objects, such as the ultrasonic sensor, which in this case will measure distance to water and will be processed on the Arduino board and displayed on the LCD screen.
The following research work is structured as follows: In Section II, the electronic elements to be used will be shown such as the Arduino board, ultrasonic sensor, LCD screen, among others, in addition to the pseudo-code that will make possible the operation of the circuit to be put testing. In Section III, the results obtained, the complete layout, step by step of the water percentages and the corresponding alarms such as: empty tank and full tank will be shown, which will verify the good design and application of the project. In Section IV, the discussions regarding similar works will be shown, but that in comparison to the presented project differ in the number of accessories and operating costs. In Section V, the respective conclusions and recommendations of the future work that will be achieved with this work will be appreciated.

II. LITERATURE REVIEW
Using free software and hardware, the process of monitoring water level and leaks can be efficiently automated as presented by Astudillo [5], an automated system with application of an ultrasonic sensor, LCD screen and Arduino Mega board as the main elements for the control of the aforementioned process, as a result an efficient monitoring www.ijacsa.thesai.org system was obtained in a condominium in which it was properly implemented, the water level is displayed at all times on the LCD screen and if it exceeds the higher level, a water leak alarm is displayed. Also using a low budget and guaranteeing optimum performance, the Arduino board with an ultrasonic sensor and solar powered can be used to avoid the need to resort to the 220v alternating current, as presented by Núñez and Martínez in a house in Lorica, Córdoba in Colombia, achieving successful independence of the entire project from the alternate mains supply, also achieving real-time monitoring with the visualization on the LCD screen of the percentage of water in the elevated tank and the alarms programmed into the Arduino Mega board. It is an excellent alternative to monitor in real time and specify the status of the water level in elevated tanks [6].
In the project presented by Valderrama [4], where alternate water pumps are connected to supply, in addition to adding a Siemens PLC to work directly with the touch screen, solenoid valves for better handling of all processes, this project was implemented for a thesis at the Universidad Católica de Colombia, achieving the total control of the processes through the touch screen.

III. METHODOLOGY
The type of research is Experimental, it seeks to apply scientific theoretical knowledge to the solution of a practical and immediate problem of knowledge through the implementation, transformation and/or modification of concrete reality [8]. In this sense: The methods that we will use during the research process are Deductive and Scientific. Deductive Method: It is the one we use to explain the characteristics of the technology with Scratch architecture and electronic prototype platform -ARDUINO. Scientific Method: We will use this method to define our concepts, hypotheses and variables that gives us the resources and intellectual instruments to solve the problem [9].
As has already been reflected previously, the basic objective of this project is to provide users with real information on the status of the elevated tank in the place of residence, this task will be broken down from three different computers: The first, the Arduino device installed as the operations center of the water tank and that will serve as receiver and transmitter of all information. The second, the electronic ultrasound device installed on the top of the tank, which will always inform the Arduino system of the status of the water level. The third, an LCD display to view each information processed by the Arduino [10].

A. Software
For the project, it will use the Scratch program. Which is very compatible with Arduino and it will give below some scopes of it: Scratch 4 Arduino, S4A, developed by the Spanish Citilab. It has in its favor that for practical purposes it is a Scratch 1.4 modified to allow connection with an Arduino board and add the corresponding blocks that allow interaction with it. Developed and published since 2010, it is not updated as frequently as would be desirable, but despite this, it allows to work with standard Arduino boards without complications and in a familiar environment, such as the original Scratch 1.4. Completely free and available for Windows, macOS and Linux systems [11].

1) Arduino pseudocode:
The model of the board to use will be the Arduino Uno, which is an electronic board based on the ATmega328 microcontroller. It has 14 digital inputs/outputs, of which 6 can be used as PWM (Pulse Width Modulation) outputs and another 6 are analog inputs [6]. a) Valve opening and closing: The minimum water percentage will be 10% and the maximum will be 90%. These values will be very important since they will start and end the filling and monitoring of the water tank [12]. The process will begin with the start-up through the mini start button, at that moment the mini water pump will begin to work, making it possible to fill and register the water level through the ultrasonic sensor, which will be important since it measures the distance to the liquid, using ultrasonic waves, the head emits an ultrasonic wave and receives the reflected wave that returns from the water. Ultrasonic sensors measure the distance to the object by counting the time between emission and reception. and displayed through the LCD screen, which will culminate when reaching 90% at which time the work of the water pump will be cut off, it should be noted that if it exceeds 90% the system will send an alarm to check the system [12].
b) Verification and monitoring of water level: Water level monitoring will be made possible by the ultrasonic sensor and 16x2 LCD screen (the term 16x2 LCD refers to a small device with a liquid crystal display that has two rows, of sixteen characters each, used to display information, usually alphanumeric), which will show in real time the percentage of water in the tank [3].
c) Water flow abnormality alarm: The leak alarm can be displayed on the LCD screen when the percentage of water level exceeds 90%, at that moment through the programming entered the Arduino it will make it possible to send a voltage to an optocoupler integrated circuit to activate the lamp. circuit failure, for which an alarm will be issued to show the system failure in order to fix it [13].
B. Hardware 1) System Implementation: The model will consist of a plywood base, in which it will be conditioned in a cylindrical container that will act as a water tank, a 12V DC mini water pump, which will allow the filling of the tank, an ultrasonic sensor, which will be located in the upper part of the water tank and will allow data to be sent to the Arduino board of the status of the water level, an LCD screen, in which the percentage of water can be read, 1 mini start button , which will allow the start of the process and 1 mini stop button, to stop the action at any point in the process [14].
The power supply will be important for the good performance of the components, in Fig. 1 we can clearly see the connection between them. The use of the ultrasonic sensor is based on the emission of an ultrasonic pulse to a reflective surface, the free surface, and the reception of its echo in the www.ijacsa.thesai.org receiver [15]. Also, in Fig. 2, there is the connection of the mini pump to the activation circuit that is why the present project is automatized so when the system requires water, it will activate the mini pump.
The trigger circuit will be very important because it will govern the pump when it needs to be enabled with the Arduino [16].
Process: As shown in Fig. 3, the implementation will be made in a 30cm x 50cm plywood model, previously conditioned, then the mini water tank with a built-in water vent will be fixed, then a protoboard will be fixed to put the LCD screen and the Arduino board to later wire them, LED diodes will also be fitted, which will indicate processes such as: process running, low level, medium level, full tank.   As shown in Fig. 4, the manufactured container will act as a water tank in which the liquid will be stored and then discharged through the discharge valve.

A. Program Algorithm
To program the microcontroller, the Arduino IDE is used, which will make it possible to govern and activate what is necessary for the system to operate well at each stage of the process [12].
As we appreciate in part of the program below, the activation and deactivation of the mini pump is clearly appreciated, which will be left indicated to be able to start the process. In the part of the program below, we proceed to give some details of the program for the work of the ultrasonic sensor, which is programmed the range in cm and the percentage is assigned, it also shows which output pins it will work on [12]. #define DIST_TOPE120// maximum level, measured with empty tank const int trigPin =2; const int echoPin =5; float distancia = 0; int nivel = 0; // level of percent In part of the program below, the assignment of percentages to the different levels of flow perceived by the ultrasonic sensor and sent to the Arduino Uno board is shown. The activation of the relay on the Arduino board to cut the water pump in the moment that the maximum water storage level is reached [16].

B. System Implementation
The tank monitoring system, in percentages of water and detection of failure in case of water leakage is displayed in Fig. 8. As the reader can see, in Fig. 5, there is the prototype of water monitoring system, also the connections of the Arduino board, display and the ultrasonic module.
Initially, 7V DC is supplied for the correct operation of the different stages of the system. At that moment, the message "EMPTY TANK" will be displayed on the LCD screen, which will start the mini water pump, thus starting the filling of the tank, as shown in Fig. 6.
At the beginning of the process, an ultra-bright LED diode was also incorporated as an indicator in case the LCD screen could suffer from any damage and no message could be displayed as seen in Fig. 7.
Following the process, the percentage is displayed in real time at each instant of the tank filling as seen on the LCD screen, additionally an ultra-bright LED was incorporated, which will indicate that the filling is being carried out in case of failure in the tank. LCD screen and could not be viewed on the screen, as shown in Fig. 8, 9 and 10.
As can be seen in Fig. 10, the process is carried out normally, clearly indicating the percentage of water.
As we can see in the previous figures, the work of the water percentage sensor is what is expected, finally when it passes 90% on the LCD screen the message "TANK FULL" will be displayed as the reader can see in Fig. 10, at the same time it will turn on an amber led, time in which the filling process will be concluded, at this moment the water pump will stop working until the water level drops to 20%, with which the process will start again.    441 | P a g e www.ijacsa.thesai.org As can be seen in each image, the work done by the prototype implemented to control the water level and failures in elevated tanks is as expected. The full-scale implementation is very economical, an economic estimate of 200 Peruvian Soles, for an automatic and modern system for efficient work, which each household should have implemented (economic, modern and safe).
The prototype of water level monitoring was tested in an electronic laboratory from Universidad de Ciencias y Humaniades, proving their running in differents floor of the university. As a future work, we want to implement this research work in different house and heights.

V. DISCUSSIONS
The Project that is presented in this Paper has specific and necessary functions that are required for the proper functioning together of how to monitor the elevated water tank and its possible breakdowns, which is not the case with the project provided with Morales and Flores [8], in which the program is very extensive to describe each working moment, in addition to adding several loops to complete the functionality of accessories such as solenoids, solenoid valves, limit switches, pumps and control relays, which are many . Comparisons are to scale in working mode of the accessories used.
In terms of programming, we also see substantial differences between the work presented by Morales, Flavio and Flores [8], they created a web page to see in real time on the pc and on their cell phones, the operation of their project, using the following languages programming: HTML, PFP, JAVASCRIPT and CSS, on the other hand, the program presented in this Paper only has a C ++ type language, in addition to showing, with simple steps, how a good performance of the circuit is achieved at the scale of monitoring elevated tanks.
The project presented by Navarro [16], is very interesting, in which a work like the one presented in this research work is described on a real scale, it shows us the programming in blocks (Mblog), which is easily understood with a program since it is short and simple (a single loop), in terms of materials it uses almost the same as those described in this research work (ultrasonic sensor, LCD screen, etc.), also it uses an electronic card (D1 Mini Chipset), which calculates the distance and connects via Wi-Fi, it also has power via a solar panel and the voltage is stored in lithium batteries, which makes this project independent from the home alternating power network.
If this research work would need to be implemented in a building with 15 floors or more, it would be necessary to incorporate components and accessories similar to that presented by Astudillo [5], in which a more extensive circuitry is appreciated, adding limit switches, solenoid valves, PID control and a complex algorithm with 5 loops, ideal for jobs where more control and electronic security are required for the inhabitants, compared to our research work that is implemented for a 3-story house.
Castillo [17] shows in his work where, in addition to the accessories used in the present research work, a touch screen is displayed, which makes the entire process very manageable, compared to ours, since we only use the LCD screen, in which nothing can be accessed since it is only visualization, from the touch screen you can enter everything necessary for the operator to control all the functions that needed, a great achievement of links and algorithms. It should be noted that, in economic terms, this system is expensive since the work presented in this research work would be only 15% of the cost of the Castillo project, of which, budget increase due to the use of the touch screen, there will always be people or companies with the economic budget to acquire them.
We also have the option of Valencia [18], who uses in his project the SIEMENS NANO PLC LOGO, which uses more electromechanical components such as buoys, more voltage power supplies, more relays to enable and disable the process, more lamps of Signaling, compared to our research work, which only uses the Arduino since it is very programmable and for what is required in this project is more than enough and the same results obtained by Astudillo are obtained, it is undeniable that by reducing the circuit part to electronic mode, it is more economical and practical to make this project more viable.

VI. CONCLUSIONS
The results obtained were as expected, from the beginning the problem was identified, in this case foreseeing water shortages either naturally, caused by man or deterioration of the pipes over time, the use of elevated tanks, is beneficial for these cases mentioned above, we add constant monitoring and warning in case of leaks or water shortages, also the project is very viable.
The process begins with the tank empty, at that moment the system will launch the alarm and the mini water pump will start to work, the percentage of water will rise and be displayed on the LCD screen, through the ultrasonic sensor it will be possible this job of sending information to the Arduino board and sent for viewing on the LCD screen mentioned above, the percentage of water will rise until it reaches 90% of the water level, after that the process will stop until the level drops to 20%, instant in which the process will resume again, it should be noted that if the water level exceeds 90%, the system will emit an alarm with the word "TANK FULL" which will warn of a possible leak so, unnecessary expenses in monthly billing will be avoided.
The system shown, designed and tested guarantees optimal performance, the theory learned in university classes and subsequent research are put into practice, which are essential for the development of this project, it should be noted that a real problem arises and its possible solution for certain days of water shortages, it is also mentioned how economical this system is for the home and that depending on the area to work, more elements can be added to improve its performance, such as: solar power sources , PLC, touch screen, among others. www.ijacsa.thesai.org As a future work, it will be sought to disseminate it and manufacture it to be able to commercialize it, since, as can be seen in this paper, it is ideal, economical, and exact in monitoring the water level in elevated tanks for standard homes and with some more additional accessories, it will also be possible to use it in companies.