Arduino based Smart Water Management

Rainwater harvesting is the process to store the rain water in containers before the rain water goes beneath the ground and recharges the underground water table. This paper proposes the design of smart water management system based on Arduino as an IoT application. In the proposed design, once water is collected in ground tank, the ultrasonic sensor is used to sense the level of water. The sensed information is updated on an android application through which user can visualize the water level on a smartphone. According to the level of water in the tank, the motor functioning is controlled, when water reaches near high level of underground tank, motor will be turned on through Blynk application on smartphone to transfer the water in the ground tank to main tank and when main tank is about to fill up it will turn off automatically. When soil of the garden is dry, the soil moisture sensor senses the dryness in soil and automatically start the water pump and water flow through main tank and reach the soil of garden then motor is automatically switched off. Storing the rainwater reduces the surface runoff. This also reduces the surface erosion. By capturing rainwater in reservoirs, the flood problem in large rainfalls is also diminished. Keywords— Blynk Application; Soil Moisture Sensor; Ultrasonic Sensor; Arduino; IoT.


INTRODUCTION
Internet of Things (IoT) is the networking of physical objects that contain electronics embedded within their architecture in order to communicate and sense interactions amongst each other or with respect to the external environment. In the recent years, IoT-based technology offers advanced levels of services and practically change the way people lead their daily lives. Advancements in medicine, power, gene therapies, agriculture, smart cities and smart homes are just a very few of the categorical examples where IoT is strongly established [1].
Internet of Things (IoT) is a system of interconnected objects, generally known as smart devices, through the Internet. The systems that have been assigned an IP address and have the capability to collect and transfer data over a network. These systems interact with the surrounding environment with the help of embedded technology, which helps them in taking decisions as these devices can now represent themselves digitally [2].
Rainwater harvesting system also called rainwater collection system or rainwater catchment system is a technology that collects and stores rainwater for human use. Rainwater harvesting systems range from simple rain barrels to more elaborate structures with pumps, tanks and purification system. The non-potable water can be used to irrigate landscaping, flush toilets, wash cars, or launder clothes, and it can even be purified for human consumption with water scarcity a pressing problem for many densely populated regions, rainwater harvesting systems can supply households and businesses with water for use in dry seasons and lessen the demand on municipal systems [3].  [4] Most of the rain falling on roads, buildings, roofs and other hard landscaping does not permeate into the soil and is rather guided into storm sewers for disposal. Water resistant surfaces cause urban flooding in many areas and accumulate contaminated unusable water which is guided off from potable water reservoir [5]. During dry season, local groundwater can be used still many localities fight to meet their requirement of usable water. Rainwater harvesting significantly reduces the demanded amount of the total fresh water as well as the strain on storm water infrastructure [6]. While many localities recommend and even subsidize rain barrels and other rainwater harvesting systems, certain areas, particularly those in the southwestern United States, view rainwater harvesting as a water rights issue and place restrictions on such collections [7]. Smart Water Management (SWM) uses Information and Communication Technology (ICT), real-time data and responses as an integral part of the solution for water management challenges [8]. The potential application of smart systems in water management is wide and includes solutions for water quality, water quantity, efficient irrigation, leaks, pressure and flow, floods, droughts and much more [9].

II. METHODOLOGY
The proposed design is the combination of hardware and software. So, the working procedure of the proposed design is not the same for both software and hardware. The proposed design method is divided into six steps as shown in fig. 2. in the form of work flow diagram. For solving any problem or for any system development the whole work should be handled in these segments so that accuracy can be provided. The workflow feature is flexible and designer can return back to the previous step and correct the system at any time according to the requirement. In this workflow, before completing the next stage, each stage must be executed completely. Such a workflow is basically short and there are no uncertain requirements for the proposed design. At each stage the design is analyzed to determine whether the proposed design is going on in the right direction and whether to continue or cancel the stage.

A. Hardware Used
First  There is Version2 (V2) available for NodeMCU Dev Kit i.e. NodeMCU Development Board v1.0 (Version2), which usually comes in black colour PCB. An ultrasonic sensor transmits ultrasonic waves into the air and detects reflected waves from an object. There are many applications for ultrasonic sensors, such as in intrusion alarm systems, automatic door openers and backup sensors for automobiles [12].
Solar panels (also known as "PV panels") are used to convert light from the sun, which is composed of particles of energy called "photons", into electricity that can be used to power electrical loads. Solar panels can be used for a wide variety of applications including remote power systems for cabins, telecommunications equipment, remote sensing and for the production of electricity by residential and commercial solar electric systems. A battery charger is a device used to put energy into a secondary cell or rechargeable battery by forcing an electric current through it. A trickle charger provides a relatively small amount of current, only enough to counteract self-discharge of a battery that is idle for a long time. Some battery types cannot tolerate trickle charging of any kind; attempts to do so may result in damage. Lithium ion battery cells use a chemistry system which does not permit indefinite trickle charging.
The soil moisture sensor consists of two probes which are used to measure the volumetric content of water. The two probes allow the current to pass through the soil and then it gets the resistance value to measure the moisture value. This sensor can be connected in two modes; Analog mode and digital mode. First, we will connect it in Analog mode and then we will use it in Digital mode.

B. Connection & Working
The circuit diagram of smart water management system is shown in fig. 4. NodeMCU is used as the microcontroller (MCU). The USB power supply is given to the NodeMCU. Ultrasonic sensor pin VCC connected to left 3V pin and Trig pin connected to D0 pin, Echo pin to D1 pin, GND pin to left GND pin of NodeMCU. Relay module 1 SIG pin to D2 pin and VCC pin to right 3V pin, GND pin to right GND pin of NodeMCU. Relay module 1 connected to 9V battery and 6V mini water pump. Soil moisture sensor A0 pin connected to A0 pin, VCC pin to 3V pin and GND pin to GND pin of NodeMCU. Relay Module 2 SIG pin connected to D4 pin, VCC pin to 3V pin and GND pin to GND pin. Relay Module 2 NO (Normally Open) pin and COM pin connected to battery charging module. Solar panel, lead-acid battery and mini water pump 2 which is connected with battery charging module.
Transistor (T1) base connected to D3 pin, in series of T1 collector have a resistor R1 which is connected to another resistor R2, R2 connected with LED and LED connect with transistor T2 collector and its base connected to transistor T1, T2 emitter connect to GND pin of NodeMCU. The NodeMCU board 3V given to the Diode (D1), LED and Relay (RL1). A 12-volt relay is used to switch on and switch off the water heater through relay driver transistor BC547.
Water collected in the ground tank ultrasonic sensor senses the level of water. This information will be updated on android application; user can visualize the water level on a Smartphone. According to the level of water in the tank the water pump functioning will be controlled, at near high level of water of underground tank water pump will turn on through Blynk app on Smartphone for storing water in the ground tank to main tank and when main tank is about to fill up it will cut off. Similarly, when soil of garden is dry the soil moisture sensor sense the dryness in soil and automatically start the water pump and water flow through main tank to soil after that soil is wet of garden then motor will automatically cut off. Connect the water heater to 230V AC mains at normallyconnect (NC) contact of RL1. Connect 230V AC mains to USB power supplier. When you click on Play in Blynk app, the timer will start. When the timer reaches the predetermined or set time, as defined in the app, it will automatically start. The relay will get energized and the heater will be switched on. And after the stop time, the relay will get de-energized and the heater will be switched off.

C. Implementation
NodeMCU is programmed with ESP8266_standalone.info using Arduino IDE by selecting NodeMCU 1.0 (ESP-12E Module) as the preferred board from Board Manager. For adding NodeMCU board in Arduino IDE. The IoT platform can be accessed using Blynk app on iOS and Android devices using the steps given below. 1. Download Blynk app on your smartphone, and either create a new account or log in using your existing Facebook credentials. 2. Go to Create New Project in the app and enter the project name (say, IoT_ heater). Choose Device, for example, NodeMCU, and click on Create. 3. After creating a new project, an authorisation token number will be sent to your email account. 4

III. RESULT & DISCUSSION
In the last few years, the water sector has faced significant challenges, in particular, the effort to develop a smart water system in order to improve efficiency and sustainability performance (e.g., social, technical, and environmental). The developed designations, as well as the analyzed case studies, show that the application of this smart technology does not only contribute to the future of smart cities in terms of water but also to energy nexus, through adequate smart water planning and management. The prototypes of the proposed circuit design are shown in figure 5, 6 & 7. A Smart water management system consists of water level monitoring circuit; automatic soil irrigation system and timer switch for electric water heater. This application will improve the water sustainability and management, as well as the policy of smart cities adequately adapted considering different constrains. The selected techniques and actions depend on the considered threshold, the capital investment, and the availability of techniques and equipment. In addition, these applied strategies must be associated with a worldwide awareness of society to the sustainable planning and management for the best use of available resources. Through the technological innovations, the smart cities will reduce costs, increase the service quality and optimize the operation of the system. The proposed methodology can also be applied to other water networks contributing to improving system efficiency and sustainability by better management of the water resources.

IV. FUTURE SCOPE
It is widely acknowledged that there are fundamental flaws in the nation's water and wastewater management infrastructure (pipe systems, facilities, and equipment) that result in environmental damage and the loss of millions of gallons of water every year. Labor-intensive meter reading and the lack of visibility into distribution, collection, and consumption patterns result in time-consuming, costly, and reactive services. To minimize these losses, and to address mounting concerns about drought, flooding, and water quality, the water industry is now adopting advanced sensor and communications solutions designed specifically for "smart" Internet of Things (IoT) water management. In large part, the move toward implementing smart water solutions is being driven by stricter government compliance requirements, the evolution of smart cities, and the need for water conservation in agriculture and other heavy water use markets. Smart Water Utilities Improving Service Levels and Promoting Water Conservation Smart Municipalities Reducing Pollution and Enhancing City Services Water management is considered the heart of many smart city initiatives across North America.