Microcontroller and Android HMI Based Water Level and Control System

Water is a basic human need in daily life. The use of water is used for various household needs for example for consumption, bathing, washing and so on. At present there are still many people who use water pumps to fill water reservoirs at home or in office buildings that are filled manually, so that problems often occur such as the level of water in the reservoir where water is unknown, it is possible that the situation of reservoirs can occur overflow or empty. Utilizing technology in this research will create a tool used to control the water level in the reservoir, which is "Microcontroller-Based Water Level Control System and Android HMI" which is an alternative in controlling and monitoring the water level in a reservoir automatically using an Android Smartphone. This tool is used to control and monitor water reservoirs automatically via Android HMI so that it can be controlled remotely. This tool is designed using a NodeMCU ESP8266 Microcontroller, a relay module that functions to turn on and turn off the pump, and one sensor, the HC-SR04 Ultrasonic Sensor which functions to measure the water level in the reservoir. And the android application used is Cayenne. The test result data is shown in the cayenne application in the form of setting the water height setpoint, the ON / OFF pump indicator and the height value in units of percent (%) and centimeter (cm).


Introduction
The basic need of the Indonesian people is the availability of water to meet their daily needs. Even though Indonesia is a water country, some regions in Indonesia experience water crisis or water shortages caused by prolonged drought. The availability of clean water in Indonesia has many problems including the service and distribution of drinking water, the quality and the amount of water available [1]. Water crisis occurs because people use water without thinking without thinking that the surface water will shrink [2].
One way to overcome the occurrence of a water crisis is the need for high water reservoirs that can be controlled and monitored. Control and monitoring of water level in water reservoirs can be done automatically by using ultrasonic sensors. Control and monitoring of water level in water reservoirs can be done automatically by using ultrasonic sensors. Previous research had been carried out using PIC microtrolers with water level sensors. Water level control using a microcontroller and water level sensor [3] [4][5] [6]. Integrate water level measurements monitored using Short Message Services (SMS) [7][8] [9]. Ultrasonic Sensor Research from Microcontroller-Based Automatic Water Level Control is still found to be lacking, as it can only detect water discharges in a reservoir and is monitored using LCD alone and also cannot be controlled remotely. In this study will make an alternative in controlling and monitoring water level in a reservoir automatically using an Android smartphone so that it can be controlled remotely to complement the shortcomings of previous research [10] [11]. In this reseach design a Water Level Control System Based on Microcontroller and Android HMI by utilizing the HC-SR04 ultrasonic sensor with data processing and regulating of all system activities created using NodeMCU ESP8266 then the water level information will be displayed through AndroidHMI in the form of water level in centimeters cm)

Tool Schema
The initial stage of designing this tool requires an initial overview of how the system works from the tool. Broadly speaking, the design using ultrasonic sensors consists of NodeMCU, relays, ultrasonic sensors, water pumps, Android HMI, and reservoir water reservoirs. The schematic drawing in this tool is shown in the image below

Flowchart
The tool to be made must have a proper work flow diagram and in accordance with the plans that have been prepared. To facilitate the process of making tools, a flowchart is made. Flowchart is a general description of the working principle of the tool to be made. By making a flow chart first, the concepts and general description of the device made will appear clear. The working process flow chart of the tool can be seen in the following figure.

Figure 2. Flowchart
The program starts with a start which means the circuit is turned on. The program performs initial initialization which is connected to the ultrasonic sensor circuit. After that the ultrasonic sensor is used to measure the height of the water level.When the reservoir is empty, the pump will start and fill the reservoir. If the water level reaches the upper limit setpoint, the pump will shut down and the water level results in the reservoir reservoir will be displayed on Android HMI. Then the ultrasonic sensor will continue to work and when the water level reaches the lower limit setpoint then the pump will start and the results of the water level on the reservoir reservoir will be displayed on the Android HMI.So, the reservoir water that we use automatically will not be empty because before the reservoir is at a predetermined setpoint, the water pump will start automatically.

Microcontroller Planning
In this system we need a microcontroller that will be integrated with Wi-Fi modules, sensors and relays, the authors use the NodeMCU microcontroller ESP8266 because the microcontroller is already equipped with a Wi-Fi module in it.So NodeMCU is the same as Arduino which is programmed with Arduino IDE by first installing the ESP8266 Library to Arduino IDE.Following is the installation picture on the Microcontroller : Tri Lestariningsih et al.

Breadboard Power Supply Planning
On the Installation of the breadboard power supply has one DC input from the power supply and there are several output options. The USB output is connected to the microcontroller input while the 5v output is connected to each component input to be used. Here is a picture of the installation on a breadboard power supply:

Ultrasonic Sensor Planning
In the system using the HC SR04 ultrasonic sensor where this sensor has a fairly good accuracy and data readings are quite stable. Operations are not influenced by sunlight or dark colored material, but are influenced by acoustic material. The first installation connects the VCC sensor with a 5V microcontroller then connects the triggered pin with one of the pins on the microcontroller and also the echo pin with one of the pins on the microcontroller and don't forget to connect the GND Sensor with the GND microcontroller. Next is the installation on the Microcontroller:

Relay Module Planning
In Arduino Relay Installation has 3 pieces of input, each of which serves as a control to turn on the relay. These pins are GND, VCC, and IN pins. GND for ground or voltage 0 volt (-), VCC For positive voltage + 5v, While IN to enter from the other sensors that function to move a sensor relay. While the output has 3 connections namely : 1. COM: the pin used in general or commond 2. NO (Normally Open):There is no contact between the common pin and pin NO. So when you trigger the relay, connect to the COM pin and supply is provided for the load 3. NC (Normally Closed):there is a contact between the common pin and the NC pin. There is always a connection between COM and NC pins, even when the relay is turned off. When you trigger the relay, the circuit is opened and no supply is provided for the load.

Designing Applications on Android HMI
To make an Android smartphone as a monitoring tool that can display water level values in a reservoir and detect the state of the pump an application will be made on the Cayenne software. Making this application online on the website: http: // mydevices.com. Planning for making an application can be seen in Figure 7 below There are two stages in making this application, the first stage is creating a cayenne account first, after creating an account, Cayenne will send MQQT USERNAME, MQQT PASSWORD and CLIENT ID which is used as an address to send data from Arduino to the application. The second stage is making the design, by selecting the components that will be used and design appearance as needed.Display design on cayenne can be seen in Figure 8. below

NodeMCU Board Testing
Testing the NodeMCU ESP8266 board is very important to do. Considering NodeMCU ESP8266 as one of the processors in this research tool.NodeMCU ESP8266 board testing aims to determine whether the program that has been uploaded (upload) to NodeMCU ESP8266 is functioning properly or not. The following are the steps for testing the NodeMCU ESP8266 board: 1. The program was first created with Arduino IDE software. 2. Connect the NodeMCU ESP8266 connector (mini usb) cable to the USB port of the laptop or PC being used.    From the tests that have been carried out, it can be analyzed and concluded that when the pump on Android is 1 or the indicator is on, the pump is on (filling), if the pump is 0 or the indicator is off, the pump is dead. Often an error occurs on the indicator on or off the pump due to an unstable internet connection.

Android Application Testing
Testing tool on Android using the Cayenne application. Before testing the program must have been transferred first, so that no one experiences an error during data transfer and wait until the data transfer to Android is successful.There are several steps that must be known, as a reminder to make sure the program has been transferred successfully without any errors, for the test step can be explained as follows: 1. Make sure the program has been transferred to the Cayenne application.

Water discharge in reservoirs and water presentations
can be monitored on Cayenne, explained as follows:  figure 18. explained for the lower limit of water setpoint means that in the series we enter the lowest water data in units of cm in the reservoir so that the pump can fill and for the setpoint for the upper limit of water means entering the water data in units of cm in the highest reservoir for the water pump to stop filling.

Overall Testing Tool
Testing this overall tool as well as finishing in the manufacture of this tool. The following are the steps for installing tools and materials used in the tool : 1. Place the reservoir in accordance with the place that was made before. 2. Install and chain the water pipes in accordance with the paths on the pump. 3. Place the HC SR-04 Ultrasonic Sensor on the top of the reservoir. 4. Fill the water at the bottom (as a source of water) and put the pump on that part. 5. Enter the voltage source on the device to test the device.

Figure 19. Overall Tool Testing
Testing is done with 2 setpoints as follows: a. Test with Setpoint upper limit of 10 cm and lower limit of 5 cm The first test when the water level reaches 10 cm, the pump will die and when the water level has reached the Tri Lestariningsih et al. 6 EAI Endorsed Transactions on Internet of Things 10 2018 -01 2019 | Volume 5 | Issue 17 | e5 lower limit of the water that is 6 cm, the pump will start with the following test results:  The second test is when the water level reaches 15 cm, the pump will die and when the water level has reached the bottom limit of water, which is 5 cm, the pump will turn on.   From the tests that have been done, it can be analyzed and concluded that when the water level is below the lower limit of the setpoint, the pump will start and when the water level reaches the upper limit, the pump will die. On the results of monitoring tools often occur reading delay on Android HMI due to an unstable internet connection.

Conclusion
From the stages of the process of planning, manufacturing and testing tools and taking data that has been done in a study entitled "Water Level Control System Based on Microcontroller and Android HMI" there are conclusions as follows: 1. The working system of this tool is that the whole program is controlled by NodeMCU ESP8266 and uses an ultrasonic sensor used to measure water levels. 2. For monitoring including input set point for water level, pump ON / OFF indicator and water level values in percent (%) and centimeter (cm) units displayed on the Cayenne application. 3. For control, it is used to automatically turn on and turn off 1 phase water pump which is ordered from the Microcontroller program by using the relay module. 4. Internet connection speed is very influential when testing tools.