IoT based real time water level monitoring using Texas instruments' CC3200

Objective: To monitor and control the water level in real time using IoT and cloud computing technologies to avoid the wastage of water in water storage tanks/sumps. Methods/Analysis: The level of water in a tank is detected by using ultrasonic sensor HC-SR04 which works on the principle similar to radar/sonar by converting electrical energy to acoustic waves and vice-versa and it is interfaced with CC3200 Launchpad, on-chipWi-Fi microcontroller from Texas Instruments. Geotagging Technique is used to easily track the location of the water overflow. Findings: Ultrasonic sensor measures the distance and the microcontroller reads the data and uploads to the ThingSpeak cloud for real timemonitoring and graphical representation.When thewater reaches the reserve position and normally the motor will be switched off. Once the water attains a maximum level before overflow occurs. In case failure of the motor actuator (relay) it needs a physical switching of the motor. Such a scenario is tackled by sending an alert to the mobile using GSM SIM900A (Global System for Mobile communication Subscriber Identity Module) as such, failure of the actuator is taken care off.Novelty: In this study, we have designed an IoT based water level indicator with minimum power consumption which can be used for Domestic applications.


Introduction
Water is the most essential natural resource for living creatures. Scarcity of water is becoming the leading offender facing majority of the cities in the world and wastage during transmission is becoming a global risk. More than half of the earth's surface is covered with water but 96.5% is totally salt water and only 2.65% is fresh water (1) . Hence, it is necessary to control and conserve the water for our future. Because of growing population and for daily needs overhead tanks/ containers are installed in many areas for water storage. Traditional water tanks neither control nor save the water level in the tanks. So, Human interference https://www.indjst.org/ is required (2) . Hence, there is a need to automate the water controlling system using technologies like Internet of Things (IoT) and Cloud computing.
The proposed IoT based system is fully automated which save human energy and time. So, there is no need to check water level manually. In real time monitoring, a smart water tank consists of a sensor attached to it to sense the water level. A microcontroller reads the sensor data and sends the data to the Thing speak cloud using its on-chip Wi-Fi to operate the system anywhere from remote areas. The motor will act automatically in accordance with the water level in the tank. GSM module is used for mobile communication to alert the user if there is any failure in motor actuator takes place so that the motor needs physical switching.
In (3) , non-contact water measurement PIC microcontroller and ultrasonic sensor HC-SR04 are used. The system measures the level of the water over 30cm and provides an early intimation to the observer if there is shortage/excess of water in the overhead tank. In (4) , have developed automated water tank using android application. The entire system includes ultrasonic sensor, sensing unit, control unit, motor system, ESP8266 Wi-Fi module, Fire base Cloud for real time accessing of sensors data, and an android mobile application MIT App inventor to set threshold values in tank. In (5) , have implemented a water level monitor in tank using IoT. The system consists of Node MCU, ULN2003 and an embedded circuit to automate the water pump control. The system easily detects water level and switch on/off the pump in consequence with status of the tank. To view the data in real time an android application Blynk is used and an email alert to the user. In (6) , have presented multiple water tank control system using Field Programmable Gate Array (FGPA) Technology. This system includes Atmega 328 Microchip, buzzer, actuator and VHSIC-HDL (Very High-Speed Integrated Circuit Hardware Descriptive Language) to control and monitor the water flow in an overhead tank. In (7) , GSM Based water level monitoring using ultrasonic sensor based on IoT technology is presented. The system involves Arduino microcontroller and Graphical User Interface (GUI) can be used at any location which easily detects the water level in a tank using Visual indicator and Graphical icons. Also, GSM module will intimate observer with an early message when deficiency of water is seen in tank. In (8) , have developed water level indicator based on IoT for smart village. The proposed system consists of IoT based architecture including presentation layer, service and physical layers. Implementation includes Liquid level sensor, Arduino, ethernet shield for Internet, carriots.com and freeboard.io are included to acquire details of water level from any location. In (9) , have developed Automatic water level system using sequential logic based on Flip-flops. The system checks and controls the flow of water through pump in nine steps. Motor pump using relay and seven segment display are part of the design. In (10) , have presented automated water level control using insulated conducting wires will acts as sensing probes to check the water in four stages. BC548C Transistor is used as an amplifier and LM7805 is used as a five volts regulator to power the whole system. In (11) , have developed AU water level control system including the pressure sensor MPX2010DP to detect pressure in tank, INA126 amplifier to amplify the signals, and android application Modbus to setup the threshold point. In (12) , have implemented a water level controller system for Green house sump tank using 2 electrodes made of copper protrude act as sensor which senses water level at high and low level in the tank. The embedded control circuitry includes LED's, Buzzer's, MAX4094 act as a comparator and CMOS4011BIC. The developed system helps for better irrigation in a green house.
It is clear that various researchers designed water level indicators using different sensors like Ultrasonic sensor, PIR sensor and technologies like MIT App, FGPA, Blynk, GUI, VHSIC-HDL, CMOS, pressure sensor MPX2010DP. Furthermore, an IoT based water level monitoring using Texas instruments and it's GeoTagging is very rarely seen. So, developing an IoT based real time water level controller using a low-cost Ultrasonic sensor HC-SR04, will be a cost-effective solution for domestic applications.

Hardware and Software Description
The water level controller developed in the present work consists of hardware components like HC-SR04 Ultrasonic sensor, Texas Instruments CC3200, DC motor, Embedded Relay system. Software is developed by using Energia IDE (Integrated Development Environment). The technique involves measuring the distance between sensor and water level using ultrasonic sensor and CC3200 reads the data and uploads to the cloud using on-chip Wi-Fi and the data will be represented graphically in real time. Rest of the Hardware and Software are presented in the following sections. The block diagram of the system is shown in Figure 1. built in USB-to-JTAG (13) . The overview of CC3200 is shown in Figure 2.

HC-SR04 ultrasonic sensor
Ultrasonic Sensors are versatile specially in sound measurements beyond human audible range 20 kHz. Accompanied by the technical trends in recent technology ultrasonic sensor became a cost-effective and an easy solution for many common demands with an exceptional non-contact measurement with distance ranging between 2 to 400cm. Its compact size, high accuracy, reliability and scalability helps the user to use it in many applications like distance and level measurement. It is independent of light, smoke, color, dust and material. It is useful both in air and under water (14) .

Working principle of ultrasonic sensor HC-SR04
Ultrasonic sensor is a 4-pin module having Vcc, GND, TRIG and ECHO where Trig is an input pin and Echo is an output pin. It works by transmitting out a sound wave beyond human frequency and this wave travels in air and when hits obstacle it reflects back toward the sensor and ultrasonic receiver module observes this reflected wave. This sensor consists of two eyes like projections in front which represents ultrasonic transmitter and receiver (15) . The working methodology of ultrasonic senor is shown in Figure 3.  (16) .

Integration of sensor and microcontroller system with ThingSpeak cloud
In the present work ultrasonic sensor is used to detect the water level by estimating the distance between sensor and water level in the tank. The trig and echo pins are connected to GPIO 63 and 64 pins of CC3200. An actuator (relay) system using Relay and SL100 transistor is designed to automate and control the motor in accordance with the amount of water. Submersible DC motor is placed in the sump. Ultrasonic sensor measures the distance and microcontroller reads the data. Then the data will be processed to the CC3200 and it uploads the data to the cloud using its on-chip Wi-Fi facility. The sensor data can be viewed graphically in the ThingSpeak website and location of the water tank can be tracked using GeoTagging. Once the tank reaches reserve position then the relay triggers and switches on the motor in the sump to pump the water to the tank. GSM module will activate and send an alert to the observer to check the water storage in the sump, in case of any failure in the actuator, the motor needs physical switching. If the water reaches the overflow then automatically the motor will be off. The entire schematics of the system is shown in Figure 4.

ThingSpeak cloud
Thing speak is used for collecting data with advanced data analysis through MATLAB.  (17) .
The following are the steps involved in accessing the cloud: a) Creating an account in the Thing Speak website is the first step. b) Sign into your account by entering user id and Password and create a new channel and enter the details of the channel and then it automatically creates an ID which is unique for each channel. Specify the channel as public (or) private, channel name in its setting. Each channel consists of eight data fields to display data. The screenshot of channel creation is shown in Figure 5.

Software description
The software developed for this work is using Energia IDE. The flowchart developed for the present work is shown in Figure 7. Robert Wessels in 2012 started Energia IDE which is an open source prototype platform based on Arduino wiring framework for Texas Instruments. Mspgcc C compiler is used in Energia and it is a portable framework which can be used in other famous IDE's like CCS Cloud, CCS Desktop IDE. It works with different operating systems like Mac OS X, windows and Linux (18) .   Fig 7. Flowchart of the present system

Results and Discussions
In this study we have designed and developed an IoT based Real time water level monitoring system specially for domestic applications using low-cost Ultrasonic sensor HC-SR04. The total setup is shown in Figure 8. A Relay based embedded system is designed to activate the DC motor which is immersed in the sump to fill the tank when the water reaches the reserve position in tank. On-chip Wi-Fi microcontroller is used to process the sensor data and upload the values to the cloud and present them graphically, and the location of the tank can easily be tracked by Geotagging as shown in Figure 9. The real time data can be downloaded in the form of. CSV file and if the water reaches the set point then the GSM will activate and send an alert to the observer as shown in Figure 10.

Conclusion
A low-cost real time water level monitoring system with GeoTagging is developed. The developed system has ability to continually monitor the water level in the tank using Ultrasonic sensor HC-SR04 and the sensors data are sent to the Thing Speak cloud for real time observation, also a relay based embedded system controls the DC motor ON/OFF in accordance with the water level in tank [Overflow/Reserve]. The sensor data can be retrieved anytime and anywhere in the world. And also, an alert is sent to the observer to take an immediate action. The system has been composed with less hardware components and with low power consumption by which it becomes scalable, accessible and cost-effective.