An Automatic System to Detect Presence of Water in Supply Lines and Maintain Water level of Underground and Overhead Tanks

Commonly most of the houses rely upon the overhead and underground tanks as the main source of water. People usually turn on the motor when their taps go dry and switch off the motor when the tank starts overflowing. This results in needless wasting of water and the lack of water in emergencies. This water is mostly coming through supply line pipes installed by the government through different schemes. The timing of this water coming is mostly irregular because it varies time to time, and in areas where it is fixed, the time is inconvenient for domestic residents to switch ON their motors and fill their tanks. Either the water comes late at night or in the daytime when the people are mostly at their jobs, so they are unable to turn ON their motors. This paper presents a solution to both these problems, a hardware model has been developed using Arduino as the main microcontroller, ultrasonic sensors to detect the level of water in tanks two pumping motors one for underground and one for an overhead tank. And one a water flow sensor is used to automatically detect the water coming in supply lines and switch on the motor. The proposed system saves water, electrical power and human efforts as the whole system is automatic.

Pakistan is one of the top countries that are most affected by global warming. Its major effect is arising as increasing water scarcity and in that scenario, the mismanagement and wastage of water are making the condition even worse. Due to this its water level for per capita is decreasing drastically per year. UN Sustainable Development Goals 2030, outlined in 2015, shall be implemented SDG-6 to ensure the security and sustainability of water and sanitation for all (Van Engelenburg, Van Slobbe, & Hellegers, 2019). Water is one of the necessities for the living, and it must be readily accessible for a comfortable life.
Water supplies are not only important to the survival of biodiversity, but their effective management is indispensable for improving livelihoods, creating incomes and reducing poverty (Grey & Sadoff, 2007). As human civilization has evolved during centuries people have modernized the way to ensure the availability of water. In older days rivers and canals were dogged to transfer the water from one place to another place and people use to fetch water from their nearest river or canal in their water pots. In the modern world, water supply schemes are used to transfer the water to domestic homes from rivers or canals. These schemes use water pipelines to transfer the water. At an interval of time in the day, the water is pumped into these water pipes and the domestic consumers use their water pumps at homes to pump that water into their water reservoir tanks which are mostly underground. Another overhead tank is also built-in every home from where the water in the underground tank is then pumped into that overhead tank. Due to the height of the overhead tank above the house the water flows into the water taps with pressure and become available for the later hours of the day. The problem arises when the domestic consumers are not made aware of the timings of water coming in supply lines or the timing of the water availability varies daily. Nowadays the domestic are either not at homes at the time of water availability in lines or they forget to switch on their pumping motors to fill their reservoir tanks for later use of water. So, they are unable to get their portion of water and are forced to pay extra fees to the water tankers to provide water and fill their underground tanks. Besides this issue of availability of water, the other thing that is wasting the water is the overflow of overhead water tanks. Once the residents switch on the pump to fill their overhead tanks they forget to switch off the motor when the tank is filled because there is no any system to alarm the residents to switch off the pump or any other mechanism to automatically power off the motor once the tank becomes full. In this way, hundreds of gallons of water are being wasted on daily basis and in this water scarcity situation it is very alarming. Figure 1 shows the total water consumption by different sectors of Pakistan. 8% of total consumption is used by domestic users which is a significant number.  Figure 2 shows the wastage of water due to an overhead water tank overflow. While figure 3 shows the gap between the availability of water and growth of population in Pakistan, it is being estimated by different water agencies that Pakistan will turn into a water scarce from water stressed country till year 2025. Which is very alarming situation?

Related Previous Work Done
To address the above-stated issues of wastage and mismanagement of water different techniques have been proposed by different researchers and a couple of prototypes have been built. The authors of Getu & Attia (2016) have proposed a system called "Automated Water Tank Overflow Control Integrated with Mobile" this system was designed to control the flow of water into the tanks automatically. The connectivity between the control circuit and mobile is done through Bluetooth module. The author of Zu bair (2018) have discussed a method to automatically switch off he pump motor once the tank is filled with water and alarm a buzzer to indicate it. The LEDs of different colors are also used to indicate the level of water available in the tank (Zubair, 2018). A system with microcontroller and LABVIEW software gave been developed that maintains the water level in the tank by switching ON and OFF the water pump as per requirements of water all the process is controlled automatically (Ahmed et al., 2018). The authors of have developed a "single Application Specified Integrated Circuit" (ASIC) based on Flip-Flop technology which is a low cost method using minimum electronic components to get the job done. This method also provides a way to control the water level of tank. Bello, Gana, Faruk, & Umar (2018) A multilevel water control and monitoring system has been fabricated which monitors and controls 4 different tanks via ESP8266 Wi-Fi module and Arduino microcontroller. All these systems use either flip flops or any other device that operates on conductivity of water, so they are most of the time in contact with the water. Bello et al. (2018) A system that is directly not in contact with water has also been developed that uses Ultrasonic sensors which operate on sound waves to detect the level of water and generate the control signals to the motor accordingly (Bello et al., 2018).
All the above-discussed systems provide either a way to monitor the level of water in the tank or to both monitors as well as control the level of water automatically. But none of the systems discussed a way to automatically detect the availability of water in the supply line pipes and fills the reservoir tanks so there should not be any wastage of water and no human intervention should be required to fill the tanks. In many societies, the water in supply lines comes at midnight and people left their pumping motor running one or two hours before the timing of water which wastes a lot of electrical energy or they are unable to fill their tanks.

Proposed Solution
In the proposed system the solution of the above-stated issues is presented, and a hardware model has been developed. The proposed system provides a method to automatically maintain the level of water in the overhead water tank by switching ON and OFF the pumping motor according to the level of water available in the tank. It also provides a way to maintain the level of the water in the unground water tank by automatically sensing the water coming in the supply line pipes and switching ON the pumping motor. If the underground tank is full then it will not turn ON, the pumping motor. The proposed system uses the HC-SR04 Ultrasonic sensor to detect the level of water and Arduino microcontroller and the main controller of all the operations.

Fig.5. Block Diagram of proposed System
The level of water is indicated through a set of LEDs of different colors. For the overhead tank, the red LED at the bottom indicated the low level of water and it will switch ON the pumping motor and will continue to run until the level of the tank reaches the upper top level and a green LED will indicate that level. Once the level of the overhead tank reaches 25% of the full volume the motor will start pumping the water in the tank. For an underground tank, a water flow sensor is used which uses hall effect to detect the presence of water in the supply lines. This sensor is connected in between the main line of supply and the line that is coming into consumers house so once the water starts coming in the supply lines this sensor will detect it and send a signal to Arduino microcontroller. The Arduino will check the level of water available in the underground tank and if that tank is 95% filled than it will not turn ON the pumping motor. But if the tank is less than this value then it will automatically switch ON the motor until the volume of the tank reaches 95%. To check the level of water in the underground tank another Ultrasonic sensor is used. Like in the overhead tank here also different colors of LEDs are used to indicate the level of water.

Water Flow Sensor
A copper body, a water rotor, and a hall-effect sensor are made of water flow sensors. When water flows through the rotor, its speed varies with various flow rates when the rotor rolls. And the halleffect sensor gives the required pulse signal

Ultrasonic Sensor
Ultrasonic sensors work By generating sound waves at a frequency too high for humans to detect. Then wait until the sound is reflected and the distance is determined based on the appropriate time. This is analogous to how the time it takes a radio wave to return after reaching an object is   Figure 9 shows the flowchart of working of the system for the underground tank it starts with initializing the variables after which water flow sensor starts working and senses the water coming in the supply lines. If the water is available in the supply lines the sensor will send a signal to thee Arduino which will then check the level of water in the underground tank. If the tank is nearly full then Arduino will not send a signal to start the pump motor but if the water level is below the maximum level, then Arduino will send a signal to relay to start the pumping motor. The motor will run until either the level of the tank reaches the max level or the water from the supply lines stops coming. So, in this way, there is no human interaction required to switch ON or OFF the motor when the water is available in the lines  Figure 10 shows the flowchart for maintaining the water level in the overhead tank. It starts by checking the level of water in the tank through ultrasonic sensor if the water level in the tank reaches below minimum level then Arduino will detect it and check the water level of the underground tank. If the underground tank has enough level of water i.e. it is more than 15% then Arduino will send a signal to the motor to start filling the over-head tank. The motor will run until either the level of the tank reaches maximum point, or the water level of the underground tank reaches below 15 % level.

Discussion and Implementation
The proposed system provides has an upper hand over all other previously developed systems. All the previously developed systems only provide half of the solution that is to automatically maintain the level of water in overhead tanks. But the proposed system provides the solution for maintaining the water level in the overhead tank as well as a solution for irregular timing of water supply schemes to automatically switch ON and OFF the pumping motor to maintain the water level of the underground tank. The main advantage of the proposed system is to save the water and limit its wastage, but it also saves the wastage of electricity by running for just specific time of use. Normally domestic residents use to switch ON their pumping motor hour or half-hour before the actual timing of water coming in supply lines which wastes a significant amount of electrical power as these motors are of high-power ratings. The proposed system can be implemented easily with the very minimum cost required. Most of the components required are easily available and not much costly. The same pumping motors can be used that are already installed at resident's homes. A couple of ultrasonic sensors an Arduino some LED lights and a water flow sensor are enough to install the proposed system. Not many modifications are needed in the previously installed system only water flow sensor will be installed in between the main supply line and pumping motor. The ultrasonic sensors will be mounted over both underground and overhead tanks and Arduino will be placed at a convenient place where LED indications can be easily seen.

Conclusion
Water is one of the most abundant substances and an important part of our lives but due to our carelessness and mismanagement, we are losing this crucial element. It must be preserved for future generations to come for their comfort and better living. The solution to the wastage of water due to the overflow of overhead tanks is presented and in the second part, the proposed system provides a solution for detecting the irregular timing of water in supply lines and automatically switch ON and OFF the water pumping motor to maintain the water level of the underground tank. In this way, the wastage of water is limited as well as it also saves the electrical power by running the motor for the particular time of day only when it is needed.