Keywords

1 Introduction

The value of ‘water’ is not known until the well runs dry. Humans depend on the water daily for various activities either domestic or commercial purposes. According to a survey, water scarcity is expected to affect more than 1.8 billion people around the world. Due to wastage of water, even the environment gets affected as some areas may face soil erosion, or heavy rainfalls or low rainfalls, etc. Even though three-fourths of the earth is covered with water, humans cannot use all the water as water quality is the deciding factor to tell whether a certain amount of water is used or not for certain activities.

The system described here can be used to reduce wastage of water due to the running of overhead water tanks. The intent of using the ultrasonic sensor is that to detect the water level, which is mounted at top of the tank to calibrate the water level in the overhead tank also by using Arduino. The concept of ECHOS is used to measure the level of the water, and further actions are performed. Usually, the height of the water in the water tank is measured continuously, and the water pump motor is switched on when a certain minimum threshold value is reached [1,2,3]. It gives a detailed picture of the quantity of water consumed. Another method is to keep two sensors, one at the top of tank, and other at bottom of tank [4, 5].

The flow sensor is attached to the inlet pipe of the water tank which measures the rate of flow of water into the tank. The readings are taken at discrete intervals of time to reduce the power consumption. Water quality is assessed based on physical appearance, chemical, and biological characteristics. By the utilization of tainted water, diseases like cholera, typhoid, rashes, fluorosis, etc. could affect health. The system uses different sensors like pH sensor, TDS sensor, and turbidity sensor to measure the chemical composition of water. If the water is contaminated, the system analyzes the chemical composition of water and sends data to the cloud and the end-user via IoT [6,7,8]. The user can have access to the data and controls of the system via the Internet. The quality of the water stored is measured and reported to the user along with the height of the water in the tank.

In vis-à-vis to the stored water, the storage (i.e., water tanks) also plays a crucial role. In due course, the sealed tank creates pressure inside, consequently, silts and scum accrue on the walls, ceiling, and floor of the water tank. Due to this, there are high chances of Pseudomonas and Legionella bacteria forming on the interior wall of the water tank. To remove sediment scales, manual scrubbing is done using chemicals which are harmful. The cleaning process in the proposed system uses a brush and motor alignment, which cleans the water tank when operated. Every time the water tank is filled, the quality of water is tested and compared with standard values. If the water quality deteriorates, it indicates that the water tank is not pure and a notification is sent to the user via IoT and gives the user an option to clean the tank. The cleaning method for the overhead tank is mentioned using a detergent, brushes [9, 10].

The system follows an efficient algorithm to achieve the main purpose, i.e., to reduce wastage of water due to running of overhead water tanks without using much power compared to traditional methods. All the techniques used reduce the impact on the environment, as well as reduce human effort and stress. The paper is divided into 5 sections:

  1. 1.

    Introduction: This section gives a brief introduction to the paper and describes the outline of the system’s functionality along with past papers related to this paper.

  2. 2.

    Architectural Details of Proposed System: This section briefs about the physical structure of the system and shows models of the proposed system.

  3. 3.

    Proposed system: This section describes the sensors, actuators, and other parts used.

  4. 4.

    Methodology: This section describes the working of the system and the algorithm used in the system.

  5. 5.

    Results: This section summarizes the paper with the final conclusions reached.

2 Architectural Details of Proposed System

The proposed system uses a single board computer, Raspberry Pi Zero W for processing the data, communicating with the cloud, and collecting sensor data from the ultrasonic sensor and flow sensor. The Raspberry Pi Zero W is a BCM2835 ARMv7 processor-based system-on-chip (SOC) with Wi-Fi and Bluetooth connectivity. The Raspberry Pi Zero W lacks multiple analog pins, for better and easier interfacing with extended processing support, we use an Arduino Uno to get the sensor readings from the pH sensor and turbidity sensor. This Arduino Uno is programmed in Arduino IDE to collect the data and send it to Raspberry Pi through serial communication over USB, which will be sent to the Raspberry PI Zero W.

The Raspberry Pi Zero W is programmed to collect and process all the sensor data using Python language. All the obtained sensor readings are then passed over various functions to calculate the overall purity of the water. The Raspberry Pi Zero W is linked with the firebase real-time database using the application program interface (API) key provided by the cloud. Once the cloud is linked to the Raspberry Pi, then the water level and the purity of water are sent to the firebase.

Unlike other approaches, the proposed system does not display any chemical compositions or graphs. All the data processing is done within the Raspberry Pi, and only the purity information and water level are updated to the cloud. The system is designed based on the end-user’s ease of using the system, and the final user has no use with the chemical composition. This is the specific reason for not displaying the chemical composition but to display only pureness and level of water. Figure 1 provides the basic working of the proposed system.

Fig. 1
A block diagram depicts the interconnections of the Android application, firebase real time database, raspberry pi zero w, Ardunio U N O, and others.

Block diagram of proposed system

The data that is sent to the firebase is then projected over the android application that is built over the popular application making platform MIT APP inventor which is designed not only to get the data from the firebase and display in the android application but also to instruct the main processor to perform actions on the requirement. When the water quality is in the specified portable range, then on the android application, a purity notifying statement is displayed along with a slider indicating the water level.

If the water quality is deviating from the specified portable range, then on the android application, an alert notification on the purity is displayed along with a slider indicating the water level and a tank cleaning option. When the user chooses to clean the tank, this instruction is sent back to the Raspberry Pi Zero W over the firebase and a cleaning action is initiated through a motor setup to drive away all the scaling sediments, algae which might be the reason for the impure water. If the water is impure even after the cleaning process is done, it indicates that water itself is not clean and the user can use filtering or any other chemical methods to purify water. The system is designed to have an automatic water level maintaining system. This is achieved by using an ultrasonic sensor when the ultrasonic sensor reading is above a permissive value. The Raspberry Pi switches off the water pump by using a relay module, which is an electrical switch that is operated through the signal from the Raspberry Pi sent to control the output AC water pump.

The physical design plays an important role in terms of efficient measurement and durability of the system. The structure of the system as shown in Fig. 2 has an ultrasonic sensor at one end separately to measure the water level. The red-colored box consists of the water quality sensors required to test the purity of water. The blue-colored box is the motor for cleaning the tank. The vertical bars are brushes to clean the tank.

Fig. 2
A three-dimensional model of a sectional view of the proposed system depicts a cylindrical tank with two boxes, one on the top and the other on the bottom left.

3D model of proposed system

All the other sensor setup is safely stored in a box like enclosure which is placed at the bottom outlet of the tank into which little amount of water is pumped using an electronic regulating valve to test the quality of the water before filling the water tank. Once the quality test is passed, the inlet water from pump will be allowed to fill the tank. The system is unique with its cleaning feature, which is achieved by using a motor and brush setup as seen in Fig. 3. Once the user chooses to clean the tank, the processing unit controls the cleaning motor to clean the walls of the tank to remove the debris and scum algae present on the walls.

Fig. 3
A three-dimensional model of the cleaning mechanism exhibits a small cylindrical top attached to the cylindrical pipe with the frame below it.

3D model of cleaning mechanism

3 Proposed System

In the process of designing the sensing part of the system, various sensors like ultrasonic sensor, pH sensor, turbidity sensor, and flow sensor were used. To process the sensor data obtained from sensors and to transmit it to the cloud, Raspberry Pi Zero W and Arduino were used with the help of firebase platform.

3.1 Raspberry Pi Zero W

Raspberry Pi Zero W is a 1GHz, single core CPU with 512 MB RAM with inbuilt Wi-Fi module and Bluetooth module. Flow sensor and ultrasonic sensor are connected to Raspberry Pi Zero W, as the data connected from them are very critical in the working of the whole system, when compared with other sensors.

3.2 Arduino Uno

Arduino Uno is a micro-processor used to record the analog inputs from analog sensors like pH sensor, turbidity sensor, and TDS sensor. The Raspberry Pi Zero W is connected to Arduino UNO via USB interfacing. The analog sensors connected to Uno are taken for a certain time to avoid sensory errors. ADC module can be used as a substitute for Uno.

3.3 Ultrasonic Sensor

The ultrasonic sensor consists of a TRIG pin, ECHO pin, and a control circuit. The sensor generates a frequency wave of 40 kHz, when there is an obstacle in between, then the wave bounces back. Using this principle, it calculates the distance of that obstacle by knowing the time taken to send and receive signal. Ultrasonic sensor is used for detecting the water level in water tank.

3.4 Flow Sensor

Flow sensor is used to observe the rate of flow of water into the tank. It constitutes of water rotor and hall effect sensor. When there is a flow of water through the valve, it results in the rotation of rotor. The output is a pulse signal which is recorded with the help of hall sensor.

3.5 Turbidity Sensor

Turbidity sensor measures the amount of turbidity/insoluble particles present in the water tank. It sends a light beam into the water and usually a light detector is placed at 90° to the light source. The reflected light indicates the presence of insoluble particles. If more light is detected, it indicates that more particles are present in water. Turbidity sensor is an important sensor in this system, as the color of water gives us a broad idea of how pure the water stored might be. The equation for sensor reading into NTU is

$$ - 1120.4\,*\,{\text{readings}}^{2} + {\text{readings}}\,*\,5742.3 - 4353.8, $$

where readings are the sensor value and the output is in NTU.

3.6 TDS Sensor

TDS sensor is used to find the total dissolved solids sin a solution and is measured in terms of PPM. TDS measures the conductivity of a solution. If the total dissolved solids increases, so does the conductivity, so does the ppm. TDS sensor tells us if the dissolved solids are more than certain threshold values.

3.7 PH Sensor

pH sensor is used to determine the pH of a solution. The number of concentrated H+ ions determines the acidic or alkaline nature of the solution. A pH of 7 indicates neutral solution. pH sensor can tell us if there are any chemicals in the water stored which may change the nature of water.

3.8 Motor and Motor Driver

A 12 V DC motor is used for cleaning purpose, which is mounted at the top of the water tank. The motor is connected to Arduino via a L298N motor driver. Raspberry Pi Zero W gives the main instruction to the Arduino, so that the cleaning process can be activated.

3.9 Setup

The system provides the user with the water level of the tank, and the water quality on the Android application. This is achieved by using firebase database which is a real-time cloud hosted database, and this is linked with Raspberry Pi Zero W and Android application which are synced continuously. The firebase database provides the user with an API which is linked with the Android application designed using MIT app inventor. The Android displays the water level and quality of water as shown in Fig. 4.

Fig. 4
A screenshot of an Android operating system applications user interface. It has the following text, water quality monitoring, water level, and the water is pure.

Experimental observation-1

If the water is impure, the user will be notified about the quality and the user will be given a choice to clean the overhead water tank, as shown in Fig. 5. The water quality sensors are packed in a closed container, where only the sensing part of the sensor will be in contact with water. This ensures that the water quality sensors can perform their function properly without comprise in the functionality and life of sensor.

Fig. 5
A screenshot of the user interface has the following text. Water quality monitoring, water level, the water is not pure, clean the tank, and yes with enable button.

Experimental observation-2

4 Methodology

The system is designed in a way that components in the process have less chance of getting damaged and consumes less energy, by taking sensor readings at discrete intervals of time without compromising the main functions of the system. Initially, the system checks whether there is any water left in the tank with the help of an ultrasonic sensor. If some water is present, then the water quality sensors analyze the purity of water and compare it with threshold values. The water quality sensors consist of a turbidity sensor, pH sensor, and TDS sensor.

The water is initially checked with a turbidity sensor, as it observes the turbidity of water which is a key factor in the quality of water. If the water has turbidity within permissible range (<5 NTS), then pH sensor and TDS sensor readings are taken and compared to the system. Both pH and TDS sensor readings are passed through an OR gate, i.e., if reading lies in permissible range (6.5–8.5 for pH, 0–600 mg/l for TDS), then it is assigned a logical ‘1,’ else a logical ‘0’ is assigned. The sensors collect data for 60 s ensuring that there would be no error in sensing. Figure 6 describes the procedure followed by the system to analyze whether water is pure or impure. By using the OR gate, the number of misfires can be reduced (false triggers). The use of OR gate does not affect the overall functionality of the test as in water both pH and TDS are somewhat linked to each other.

Fig. 6
A workflow diagram illustrates the process followed by the system for analyzing if the water is pure or impure.

Water quality mechanism

If the quality of water fails to lie in permissible range, i.e., water is impure, then a message is sent to the user using IoT. The message will inform the user that the water quality is bad and asks if the water tank needs to be cleaned. If the user responds ‘Yes’ within 5 min, then the cleaning process of the tank starts to clean the tank. Else if it does not get any response within 5 min, it checks when was the last time the regular tank cleaning occurred, i.e., checks if CT ≥ 6. If the tank was cleaned exactly last week, then it will clean the tank and then starts filling the tank. If it gets ‘No’ from the user, then it starts to fill the tank. After the weekly cleaning, CT is set to 0.

If the water passes the water quality test or if the tank is cleaned, then the system instructs the motor to switch ON and pump water into the overhead tank. Else, if no water is present, then the system instructs the motor to switch ON and pump water into the tank. Figure 7 is the procedure followed by the system for cleaning the water tank. The flow sensor is active when the motor starts pumping into the tank. If the flow sensor reading is less than the threshold value, then the system instructs the motor to switch OFF, so that damage to the motor is reduced or avoided. The ultrasonic sensor and flow sensor measure in certain intervals of time, to reduce the energy consumption by the sensors. This also results in increased sensor life, i.e., number of times the sensor can be reused is increased. Figure 8 shows the overall methodology used in writing the program for the system in the form of a flowchart.

Fig. 7
A flow diagram starts from send message via I O T, cleaning motor equals ON, time delay equals 10 minutes, Cleaning motor equals off, and C T equals 0.

Cleaning process

Fig. 8
A flow chart starts from height and water quality to check pure and impure and ends with Moter off send a message via I O T.

Proposed system flow

The interval time (appropriately T/10.5 or 9.52% of T) is derived by considering the efficiency of the system along with the regular height measurement, i.e., it checks for every 9.52% of the time taken to completely fill the tank. So that the system checks the water level in 10 steps without having a chance of overflow. After checking 10 times, the ultrasonic sensor decreases the time interval to check for every 10 or 15 s, which can be varied depending on the pumping capacity of the water tank. This approach increases the efficiency of the system, instead of measuring continuously. T is the time taken to fill water tank previously or can be initialized manually before usage. Once the water level reaches UTh, then the motor is switched OFF. UTh is the upper threshold of the tank.

At the time of switching ON the motor, a clock is started and the clock ends when the motor is switched OFF, i.e., when water level reaches UTh. The time is stored as ‘T’ and averaged periodically every time the whole process is repeated. Once again, the quality of the water is checked. If it is found impure, then a message is sent to the user via IoT, informing the user that the water in the tank is not good, so that the user can take precautions by adding chemicals to improve its purity or using the water for other purposes like gardening, car wash, etc. The above process repeats continuously, making the system a semi-automatic system, which works efficiently.

5 Results

The system proposed can be included as part of smart home technology. The proposed system is an energy efficient, smart water tank management system, which is user oriented, semi-automatic, and IoT-based system. It is capable of monitoring the water quality, alongside maintaining the water level in the tank, and cleaning the water tank. The experimental setup for the proposed system is shown in Fig. 9.

Fig. 9
A photograph of the experimental setup depicts a container with water and measuring equipment inside it.

Proposed system flow

The algorithm is developed considering various factors like power consumption, sensor reading’s accuracy and lifespan. The system collects ultrasonic sensor data at discrete intervals of time to decrease power consumption. The time interval is derived mathematically, and it is set to 9.52% of the total time taken to fill the tank (i.e., 9.52% of T). If the time interval increases, the functionality of the system would be lost. Whereas, if it is decreased, the power consumption increases.

6 Conclusion

The system presented provides the necessary framework for practical application. The system can further be extended to other applications by varying the sensor combination according to the nature of storage. It reduces the manual quality monitoring process with its simple yet efficient android application UI, where the quality of the water can be monitored. The approach to cleaning the water tank stands out to be one of the very unique and efficient methods to maintain the water tank and avoid the formation of water weeds inside the water tank.