# Usage of IoT Framework in Water Supply Management for Smart City in Nepal
## 3 Proposed Methodology
### Working Mechanism  
For the overall system, a mathematical model can be expressed as in Equation (1). \[W_{L}=L-0.5V_{s}T\;cm, \tag{1}\]  
where, \(W_{L}\) = Level of water in cm, \(L\) = Length/height of the tank in cm, \(V_{s}\) = Velocity of sound = 330 m/s, \(T\) = Total time taken from transmitting and receiving the ultrasonic wave in seconds. Similar calculations are undertaken in both the tanks and a comparison is made. We again assume \(W_{U}\) and \(W_{B}\) as the water level in the above tank and bottom tank respectively. Based on the condition of water level in these two tanks motor is switched on. The condition is mathematically written as, \(W_{B}\) > 30 cm and \(W_{B}\) < 20 cm. No operations are carried out in other cases. However a simple voice message is given to the user such as \"There is no water in the bottom tank\" in their respective cell phone in case if \(W_{B}\) < 25 cm. These are about automating the water in both the upper tank and lower tank. This application has another significant impact on controlling the overflow of the water. The overflow in each house in Nepal and India is one of the most serious and common issues. Pumps can be regarded as one of the essential components in water supply management. Depending upon the geographical condition, a water supply system may rely completely on pumping. We must be aware that pumps consume some negligible amount of water, the cumulative amount of water from each houses can be of significant besides their energy costs and regular maintenance of the pump [55]. The overflow of the water occurs when the consumers forgot to turn off the motor and water is supplied from the tank which is in the bottom to upper. If this overflow could be controlled, a huge volume of water in an entire state or country could be saved. The amount of water consumed by each house can be calculated by using the following Equations (2) and (3):  
\[CL_{House\_Number}^{\;Motor\_On}=\pi r^{2}\sum_{t=0}^{24 Hrs}\left(W_{L}-W_{L}^{ \prime}\right)\;litres/day, \tag{2}\]  
\[CL_{Day}=CL_{House\_Number}^{\;Motor\_On}, \tag{3}\]  
Here, \(CL\) represents the consumption Level, water level in the lower tank is \(W_{L}\) and new or changed water level in the lower tank is \(W_{L}^{\prime}.CL\) represents the amount of water consumed in 24 h in a single house and r represents the radius of the cylindrical tank. These data are stored in an individual database that is remotely located and can be accessed by the house owner or the authorized government officials. Government agencies may use the following Equation (4) to estimate the bill amount (\(BA\)) of a month. \[BA=\left(\sum_{Day=1}^{30}\left(CL_{Day}\right)\right)\times Rate\;\;\;Rs, \tag{4}\]  
Here, rate is the price charged by the government or related departments for the per liter consumption of water. This \(BA\) is then sent to the individual cell phone of the consumers, Rupees (\(Rs\)) is the currency of Nepal. The total consumption of all the houses in a state/province can be calculated by summing up the consumption of each house registered in the system in the same state/province as:  
\[CL_{Day}^{State\_Number}=\sum_{House\_Number}\left(CL_{Day}\right)\;litres/day \tag{5}\]  
However, in this research only, the data is generated in six spots (can be considered as six houses at different places). The above formula is a generalized version of how the data of overall state can be obtained. This data can be useful for the provincial/state government for future planning after further analysis is performed. Furthermore, for state data, annual data are more meaningfulfor budget allocation.