Automated Water Heating Management with Internet of Things

—IoT devices can range from smart home devices such as thermostats and security systems to industrial control systems used in manufacturing and other industries. One focus of the IoT-based monitoring and control concept is monitoring and controlling water heaters based on IoT technology to support the creation of a smart home. The purpose of this research is to create a system that can control and monitor water heaters remotely using the Android Studio application so that the water temperature in the heater can be ensured for safety, comfort, reliability, and energy efficiency. The system is designed using temperature sensors and water flow sensors, and then the data is processed with the NodeMCU microcontroller and then sent to the Firebase website to be displayed on the application. The application built can set a large amount of water and heat it to the desired temperature before sending it to Firebase and then to NodeMCU. The result of this research is an application that is able to control and monitor a water heater with an average measurement difference of 0.38 liters and an average error percentage of 7.11% The relay control system in the application has an average delay time of 3.6 seconds .


I. INTRODUCTION
The Internet of Things (IoT) is a rapidly growing technology today because it promises to revolutionize the way people live and work by connecting everyday devices and objects to the internet [1]. IoT devices can range from smart home devices such as thermostats and security systems to industrial control systems used in manufacturing and other industries [2]. One of the main benefits of IoT is the ability to remotely monitor and control these devices, thereby enabling increased efficiency, automation, and data collection.
In recent years, IoT has become an increasingly important technology in the field of home automation because it can monitor energy consumption and control energy performance [2]. The use of IoT in smart home development is increasingly in demand. The presented studies focus mainly on energy management through the control of electrical units [3][4][5][6][7]. The results shown are also very interesting and are increasingly being used in everyday life. With the existence of the IoT, it allows for remote monitoring and control of various household devices [8]. One area that will greatly benefit from IoT technology is water heating, as it can help optimize energy use and ensure that hot water is available when needed.
In this paper, research focuses on the concept of monitoring and control based on IoT, namely monitoring, and controlling water heaters based on IoT technology to support the creation of a smart home by exploring the benefits, challenges, and current state of technology. The benefits of a water heater monitor, and control system include increased energy efficiency, cost savings, and convenience [9]. Technical challenges regarding designing reliable and secure IoT-based water heating systems, including data privacy and security, network reliability, and real-time control [10]. The simple solution of this research is to help users, especially for the elderly or children when they are going to use a water heater because it is very dangerous if the user does not know the temperature of the water to be used.
A survey stated that a hybrid water heating system needs to be implemented to efficiently use energy in water heaters [11]. Energy use needs to be planned in the long term so that the supply of electrical energy is maintained [12]. One way to plan energy use is to utilize IoT technology on household devices. With the IoT, household appliances can be monitored and controlled so that energy efficiency can be achieved. Thus, the research objective to be achieved is to build an IoT-based water heater monitor and control to increase the efficiency and convenience of managing hot water in a household or commercial environment.
The IoT-based water heater monitor, and control system allows users to remotely monitor, adjust the temperature, and operate the water heater using a smartphone application. This means users can turn the water heater on and off, change the temperature, and monitor usage from anywhere with an internet connection. In addition, IoT water heater control and monitoring systems can increase energy efficiency by allowing users to set schedules or adjust temperatures based on usage patterns. This can assist in reducing energy waste and lowering monthly electricity bills. Overall, the main goal of creating an IoT-based water heater monitor and control system in this study is to provide users with greater convenience and control over the use of hot water they need while helping to save energy and reduce costs [13].

II. METHOD
Methodological research is a systematic process that is used to design, create, collect, and analyse data to achieve goals and solve problems. The research method for building an IoT-based water heater monitoring and control system is shown in Fig. 1. The first stage is identifying the problems to be solved by the system and collecting tools and materials to design and build an IoT-based water heater monitoring and control system. The second stage is the study of literature involving technology and existing solutions related to the problem to be solved. This stage can be completed by reviewing scientific papers or patent applications. Designing system architecture, components, and interfaces is the third stage of system design. The system to be built consists of a sensor to measure water temperature, a microcontroller to process data, and a cloud-based platform for remote monitoring and control. The fourth stage of system development involves creating a system based on the design carried out in the previous stages. selection and integration of sensors, microcontrollers, and cloud platforms, and programming systems to meet system requirements. The fifth stage of testing and evaluation involves system testing to ensure that the system meets the requirements and functions as expected.

A. Block Diagrams
Block diagrams were used to explain how the system worked. The IoT-based water heater monitoring and control system block diagram is shown in Fig. 2. The components used are 1 unit water heater, 1 unit NodeMCU ESP8266, 1 unit 12V 5A power supply, 1 unit 4 channel relay module, 1 unit step down module, 1 unit DS18B20 temperature sensor, 1 unit water flow sensor, 1 DC water pump 12V, 1 piece iron pipe, PVC pipe to taste, 2 buckets, 1 panel box, 1 regulator, wooden boards to taste, and 1 water faucet.
Based on Fig. 2, there is a component function consisting of a power supply as a voltage source for each system component, Stepdown module to convert 12 v voltage to 5 v, sensor YF-201 to calculate the amount of water flow in units of liters, sensor DS18B20 to read the temperature value of heated water, NodeMCU, namely the microcontroller to regulate the components on the device, Relay four channels, with the switch acting as a contact to power the DC water pump and water heater. A buzzer will sound if the flowing water is too hot, a servo motor will rotate the Water Heater valve, a DC water pump will pump water from the bucket to the Water Heater, and the Water Heater will heat the water that flows from the pump.

1) Receiver System for Android
In designing this system, a system for receiving data from monitoring water temperature and water flow was created on the Android application. Fig. 3 shows how the receiver system works from the NodeMCU ESP8266 to Android, which is explained via a flowchart.
The first step is to initialize the NodeMCU ESP8266, specifically with the temperature sensor reading and water flow sent via the Wi-Fi network intermediary on the NodeMCU ESP8266.The next step is to check the WiFi network connection process on the NodeMCU ESP8266. Then, if the Wi-Fi network is connected, NodeMCU ESP8266 will retrieve data from the Firebase website; if not, then NodeMCU ESP8266 will initialize it again. The data taken from the Firebase data then displays the sensor reading results in real time on the Android application in the form of a numeric value.

2) Android Relay Control Receiver and Transmitter System
A receiver and transmitter system were created during the design of this system to relay control on the Android application. The relay control system is used to turn on or turn off the water heater and also the water pump, which works according to sensor output. Fig. 4 shows how the receiver and transmitter system work for relay control, which is explained through a flowchart.  Figure 4. Android relay control receiver and transmitter system The first step is for the system to check Wi-Fi connectivity on the NodeMCU ESP8266. If the Wi-Fi network is connected, the system will enter the Android Studio application's monitoring and control view. The next step is for the user to provide input for the temperature and amount of water, then click the update button and click the ON button so that the water heater and water pump are active. After that, hot water comes out through the output hose.

3) Transmitter System Android Servo Control
In designing this system, a transmitter system was created for servo control on an Android application. Servo motors in water heaters help provide accurate and consistent temperature control and ensure the water heater operates efficiently and effectively. In water heaters, servo motors can be used to control the mixing of hot and cold water to reach the desired temperature. The servo motor is connected to a mixing valve, which regulates the flow of hot and cold water into the water heater tank. Transmitter system flowchart Servo control in the Android application is described in Fig. 5. The first step, according to the flowchart in Fig. 5, is to test the Wi-Fi connectivity on the NodeMCU ESP8266.The system will open the Application Monitoring and Control view if the Wi-Fi network is connected. Then rotate the servo 1 slider a certain degree, and then the fire valve will rotate according to the degree input in the application. Turn the Servo 2 slider to a certain degree, and then the water valve will rotate according to the degree input in the application.

4) Electrical system design
The design of the electrical system aims to realize the working principles of the Internet of Things-based water heater monitoring and control tool. In the mechanical drawing of the tool, there is a water heater on the front, then there are two buckets that are used as a bucket for cold water and a bucket for heated water, and inside the cold-water bucket there is a water pump that functions to pump water from the bucket up. The IoT system was successfully implemented to monitor and control the water heater. The system consists of temperature sensors, water discharge sensors, microcontrollers, and relays, all of which are connected to the firebase platform. Temperature sensors continuously monitor water temperature and send data to Firebase in real-time. The microcontroller receives commands from firebase and activates a relay to turn on or turn off the water heater as needed to maintain the desired temperature.
The system has been tested, and the results show that the water temperature is maintained accurately within the desired range. Temperature data is also consistently transmitted to Firebase and can be accessed through the Android application. The reliability of the monitoring and control system on the water heater can be tested through the following tests:

A. Temperature sensor testing
Testing the DS18B20 temperature sensor aims to determine the value of the water temperature released by the water heater. The testing procedure is carried out by displaying the results of reading values on the serial monitor of the NodeMCU ESP8266 and the android application. The following is a picture of the testing process, and the temperature sensor data retrieval table can be seen in the Table 1.
Based on the data obtained, it can be seen that the difference in temperature readings between the thermometer measuring instrument and the sensor is quite large, with the highest error value of around 4.45% and an average error value of 2.35%. can be seen in the table I, if the initial value of the measured temperature test on the temperature sensor is 28.25 o C, the temperature value on the thermometer measuring instrument is 29.6 o C. If the final value of the measured temperature test on the temperature sensor is 41 o C, then the temperature value on the measuring instrument thermometer at 41.6 o C. The biggest difference in temperature measurement on the sensor and thermometer measuring device is obtained at a temperature value of 28.25 o C which is equal to 1.35 o C or equivalent to 4.45 % percentage error, then the difference in temperature nails is followed by 32, 25 o C is 0.85 o C or 2.56% and 33.25 o C is 0.65 o C or 1.91%. the greater the temperature value measured on the temperature sensor, the greater the temperature value measured on the thermometer measuring instrument, and vice versa. this shows that the temperature value measured on the temperature sensor is directly proportional to the temperature value measured on the thermometer measuring instrument. The difference in temperature values between the temperature sensor and the thermometer measuring instrument occurs due to user error; calibration level; and the quality of the sensors used.
From the results of the test and calculation of the comparison of these measurements it can be said that the temperature reading is almost the same as the reading using a thermometer used as a comparison. Then testing the system and temperature accuracy is also carried out to find out how precise the value is obtained between the sensor value and the temperature value input from the Android application. This test is carried out by entering the same water input in each test, namely 5 L, and different temperature inputs to get varying reading values. Based on the data obtained, it can be seen that the difference in temperature readings between the thermometer measuring instrument and the sensor is quite large with an average error proportion value of 5.3 8%, the highest error value is around 7.7 % and the lowest value is around 3.2%. can be seen in Table  II, if the initial value of the measured temperature test on the thermometer measuring instrument is 38 o C, then the temperature value on the temperature sensor is 36.75 o C. If the final value of the temperature test measured on the thermometer measuring instrument is 50 o C, then the temperature value on the sensor is 46.5 o C. The difference in the largest temperature measurement is on a thermometer measuring instrument and the sensor is obtained at a temperature value of 50 o C which is 3.5 o C or equivalent to a 7 % proportion of error, then the difference in nail temperature is followed by 42 o C of 3.25 o C or 6.7 % and 40 o C is 2.5 o C or 6.25 %. the greater the temperature value measured on the temperature sensor, the greater the temperature value measured on the thermometer measuring instrument, and vice versa. this shows that the temperature value measured at the sensor temperature is directly proportional to the temperature value measured on the thermometer measuring instrument. Differences in temperature values between the temperature sensor and the measuring instrument thermometer occur due to user error; calibration level; and the quality of the sensors used.
Based on the measurement data above, we get a comparison of the readings between the temperature value input from the application and the reading value from the temperature sensor. The difference in reading values produced is quite large, with the highest reading error percentage of 7 % and an average error percentage of 5.38 %. The reason for the large difference in reading the existing values is due to the long delay in sending the off-relay command from the application to NodeMCU, so that when the temperature value input from the application is met, the water heater relay is a little late to turn off and causes the water heater to turn off late.

B. Water Flow Sensor Testing
Testing the Water Flow sensor aims to determine the volume of water released by the Water Heater, as well as the precision level of the sensor, whether the volume of water input via a smartphone is the same as the volume of water released by the Water Heater, and what the difference in the resulting values is. The following is the process of testing and retrieving water flow sensor data when heating water. Based on the data obtained, it can be seen that the difference in input water volume readings between the volume meter and the sensor is quite large with an average error proportion value of 7.11%, the highest error value is around 13% and the lowest value is around 4.59%. can be seen in table III, if the initial value of measuring the input water volume on the measuring instrument is 3 L, then the air volume value on the sensor is 3.176 L. If the final value of the temperature test measured on the measuring instrument is 7 L, then the air volume value at sensor is 7.43 L. The largest difference in measurement of the volume of input water on the measuring instrument and sensor is obtained at a value of 5 L, which is 5.752 L or equivalent to 13% of the proportion of error, then the difference in the volume of input water is followed by 4 L of 4.286 L or 6 .67% and 7 L is 7.43 L or 5.78%. the greater the input water volume value measured on the sensor, the greater the input water volume value measured on the measuring instrument, and vice versa. this shows that the value of the input water volume measured on the sensor is directly proportional to the value measured on the measuring instrument. The difference in the value of the input water volume between the sensor and measuring instrument occurs due to user error; calibration level; and the quality of the sensors used.
Based on the resulting measurement data, we get a comparison of the readings between the value of the amount of water input through the application and the value of the water flow sensor. The difference in reading the resulting value is quite large, with the highest reading error percentage of 13% (there is an error in the calibration, or the sensor cannot work properly) and an average error percentage of 7.11%. The large difference in value obtained is caused by the delay in sending data from the website to NodeMCU. Also, when the water input value in the android application has been fulfilled and the Water Heater is off, the remaining water from the Water Heater flows back from above to the bucket through the pipe, and the water flow sensor causes the sensor to recalculate the remaining water flow so that the reading of the sensor value goes up.

C. Android Studio application testing
Android application testing aims to determine whether the application can function properly or not. Testing this android application includes testing the relay control system, servo motor, and monitoring system for temperature and water flow sensors.

1) Control system testing
This test aims to determine the response of the relay using the Android Studio application that has been installed on the smartphone. In this test, the android application is used to control the water heater relay and servo motors via a Wi-Fi network to send data commands. Pictures of the testing process can be seen below: Test results for comparison of responses based on the speed of data transmission can be seen in Table 4: Based on the results of the control tests above, it can be concluded that the control system can respond well if the network is good and smooth, but if the connectivity is slow, it will affect data transmission, resulting in a delay. The above results show that if the ping test is 2 ms, the control system can work in 3 seconds; if the ping is 3 ms, the data transmission will be slightly slower, namely 4-5 seconds. As long as the device is connected to a Wi-Fi network, this control system can be accessed from anywhere and at any time.

2) Monitoring System Testing
This test is carried out to determine the value displayed through the Android application. These values include temperature sensor readings and water flow sensor readings. The following is the display result on the Android system for sensor measurements in real time. The test results can be seen in the image below. The results of this study demonstrate the feasibility of using IoT technology to monitor and control water heaters. The system was able to accurately maintain water temperature within the desired range, and real-time data transmission and accessibility via a mobile app were found to be convenient and useful features. Figure 9. Monitoring display Compared with traditional water heater control systems, IoT systems offer several advantages, such as increased accuracy, real-time monitoring, and remote control. These features can be particularly useful for households where several people have different hot water temperature preferences or for commercial settings where hot water usage needs to be monitored and controlled for energy efficiency.

IV. CONCLUSION
Based on the objectives that have been determined, a conclusion with the Internet of Things-based water heater monitoring and control tool that has been implemented, the sensor on the tool can function properly even though some readings are far away. The monitoring system implemented on the Firebase server has been shown to be able to display sensor readings in real time with a slight delay; the delay in sending data is also influenced by network conditions. The temperature sensor is the input into the NodeMCU, which will provide output to the relay, where the relay is the main control, namely as an actuator that will turn on and turn off the water heater. When heating water, the average percentage of error in temperature sensor measurements and thermometers is 2.35%. Knowing the difference between the value of the input water from the application and the value of the amount of water produced from the measurement of the water flow sensor with an average measurement difference of 0.38 liters and an average error percentage of 7.11% The relay control system in the application has an average delay time of 3.6 seconds.

FUTURE WORK
With the advancement of IoT, water heaters will become more intelligent and efficient. Some potential areas for future work in this field are:  The water heater can integrate with other smart home devices, enabling central control and monitoring of all household appliances. This will certainly help improve energy efficiency and provide greater comfort for homeowners.  Energy management in IoT-enabled water heaters optimizes energy use based on real-time data, such as outside temperature and home water usage patterns.