Design and Build a Water and Electric Power Management System at Public Toilet Using Microcontroller-Based Hybrid Solar Cell

— The need for public facilities in densely populated areas is an important matter. One of the needs for public facilities is a public toilet or commonly called public toilet. However, the public toilet facilities do not yet have management of charging water and electricity. One way to overcome this problem is to use a system that is able to manage water filling and electrical power in the public toilet. Oftentimes, public toilet users forget to turn off the bathroom lights, so the use of power becomes wasteful. The problem of insufficient power can be overcome by implementing Solar Cell using a Hybrid system so that it becomes more efficient. This study uses a water management system in the toilet bowl using an ultrasonic sensor and a solenoid valve. The duration of public toilet use is known from the PIR sensor. The power management itself uses a hybrid solar cell system where the resources used are batteries and PLN. Then the sensor reading data is sent to firebase and displayed on the website. Based on the test, it was found that the performance of the solar cell during testing on Saturday 10 July 2021 to Monday 12 July 2021 produced an average power of 20.28Watt and the average intensity of sunlight was 680062.32lx. The power used by the load for 3 days is 0.81 kWh. The average usage on the 3 days of the trial was 9.72 Min. Quality of Service testing on a 3-day trial system obtained an average delay of 0.9637308s and packet loss of 2.2%.


I. INTRODUCTION
The need for public facilities in an area with a fairly dense population is important to support the needs that are not available or lacking in the area. One of the public facilities needed in densely populated areas is a public toilet or commonly called public toilet. Toilet is a place to provide clean water that is shared by several families for bathing, washing, and defecating in certain residential locations. However, the management and monitoring of water and electrical power needs in these toilets are sometimes inadequate. Like a water tank that runs out when it is about to be used, this makes public toilet users wait for water to be filled when they want to use this facility and the use of public toilet water becomes out of control. In addition, it is not uncommon for public toilet users to forget to turn off the lights after using the facility and this becomes a waste of electricity which is a resource, and often causes power outages at the public toilet facilities which make it difficult for the public toilet facility users to use the facility. Therefore, it is necessary to manage public toilet intelligently so that it will encourage people to utilize public toilet facilities efficiently [1]. One way to overcome this problem is to use a system that is able to manage and regulate the distribution of water and electrical power in the public toilet. The problem of insufficient power can also be overcome by applying Solar cells using a Hybrid system so that the existing power becomes more efficient.
Regarding the bathroom management system, research [2] applies the concept of a smart bathroom using motion sensors, altitude sensors and solenoid valves in the system. From the results of the study, it was found that the average delay on the PIR sensor was 1.18 seconds and the Movement Out PIR sensor was 60.32 seconds, the delay obtained from the Ultrasonic sensor in the bath was an average of 2.38 seconds, and the delay obtained from the Ultrasonic sensor in the bathtub was 2.38 seconds. shampoo container obtained an average delay of 2.5 seconds. Research [3] applies water and electricity management as a smart bathroom system, this system is integrated with the Arduino Uno microcontroller as a processing center for readings from sensors, but this system is only in the form of a prototype and data recording is not stored in the database. Regarding the power supply used, research [4] applies the design and design of the Solar Cell system as power to turn on a 125 watt water pump. There is a calculation of the amount of power, panel capacity and battery capacity. However, the data retrieval process is not carried out with a microcontroller so that data retrieval is done manually Based on this background, this thesis proposal proposes the title Design of Water and Electric Power Management System in public toilet Using Microcontroller-Based Hybrid Solar Cell. The object that will be used for observation is the public toilet facility in Buring village RT.5 RW.2 and will focus on the public toilet management system. The Solar Cell system itself uses a Hybrid system where this system is connected to the PLN network by optimizing the use of energy from Solar Cells to produce as much energy as possible, the Solar Cell type itself uses a monocrystalline type with a peak power of 100wp which is integrated with ATS (Automatic Transfer Switch) to change usage. Solar Cell power to PLN power when the Solar cell power is not enough power to turn on the system, there is an Ultrasonic sensor for the water level which will be integrated as an automatic tub water filler, a PIR sensor as a motion sensor to detect the presence of public toilet users so that the lights will turn on and off according to conditions user. Apart from the manufacture of the aforementioned devices, this system will also be packaged with wireless device control and monitoring via a website that has been integrated with a cloud database [6].

A. Research Stages
In this study, several stages of research were carried out so that the designed system could function properly. The stages of the research to be carried out are as follows.
The first stage is to identify the electrical power used in the public toilet. The use of electrical power in the public toilet uses a power of 900 VA, which is identified on the electricity meter. Charging electricity tokens is carried out approximately once a week with a total kWh of 13.9 kWh at a cost of Rp. 23,000, this value was obtained from interviews with the RT, as well as seeing the history of electricity charging transactions. The load used is in the form of 3 10 watt led lamps, 1 5 watt lamp, and 1 14 Watt fluorescent lamp.
The second stage is to identify the public toilet water reservoir. The water tank in the public toilet bathroom has a length of 130 cm, a width of 49 cm, and a height of 55 cm so that it can be seen that the water capacity that can be accommodated in the tub is 350.35 Liters.
The third stage, identification of a hybrid solar cell system Solar cell hybrid which is designed to use an external power supply in the form of a battery with a capacity of 18Ah and uses a solar cell with a capacity of 120Wp. There are 2 sources of electricity used, namely PLN and from the battery through an inverter.
Fourth stage, identify the battery capacity of the battery. The battery used has a capacity of 18Ah, which can supply 216Wh of power.
The fifth stage, device calibration and device installation Before installing all sensors used for parameter measurement, it must be calibrated so that the error value displayed is not too large. The installation of the device was carried out on the object of research, namely public toilet in the village of Buring RT.05 RW.02 Malang [13]. In figure 2, explaining the block diagram of the system, there are 3 parts, namely the input block, the process block, and the output block. In the input block there is a power supply, namely electric power from the Solar cell or PLN electrical power which will later be controlled via ATS (Automatic Transfer Switch) using a relay. In the input block there is also input in the form of sensor readings, including an ultrasonic sensor which is used as a water level in the water tank which will later be used as an indicator for filling the water tank, a PIR (Passive InfraRed) sensor which is used as a motion detector which will later be used as an indicator to turn off and on. turn on the light when the user enters and exits the public toilet.

B. Research Flow
In the process block there is an ESP32 microcontroller which is used to process input / readings from the sensor which then sends data to the cloud database using an intermediary device, namely Mifi Andromax M2Y as a device for internet access and from the database it is then displayed on the website and to regulate the output of the sensor reading process. .
Finally, in the output block, there are several relays that regulate the water and electric power management system. The solenoid valve in the water tank is used to fill the water tank automatically when the water tank height is less than the specified level according to the ultrasonic sensor reading as the water level. Bathroom lights are lights that are in each bathroom that will be controlled using a PIR sensor [12,15].
Here is a block diagram of the power supply: In figure 3, for the power supply block diagram, there are 2 sources of power supply, namely power from Solar cells and power from PLN. The power from the first solar cell will be monitored by a DC voltage and current sensor to find out how much power is generated, then the power from the solar cell will go to the Solar Charge Controller which is used to regulate the charging of the battery later, then there is a battery that is used to store the power used. generated by solar cells. Furthermore, the inverter is used to convert the DC battery voltage into AC voltage which will be used to supply load power. Furthermore, ATS (Automatic Transfer Switch) is used to switch the use of power generated by the Solar cell to power from PLN and vice versa [5].
The following are the details of the system design and a description of the wiring that will be made: 1) Power Supply Block

2)
Solar Panel Capacity Calculation For Solar cell systems with a power of 1000 Watts and below, a factor value of 20% must be added to the load as a substitute for system losses and for a safety factor [4]. Therefore, the ampere-hour of the specified load is multiplied by 1

4) DC Load Power Calculation
The power needed by the device is calculated to determine how much total power the device uses and calculate the battery's ability to supply the device.
The following is the calculation of the power on the load device: From the table above, the required power calculation is 17.932 Watt. By using a 12V 18Ah battery, the battery can supply loads for 12 hours without charging the battery.

D. System Design Illustration
The following is an illustration of the system planning that will be made. The first display shows the reading of several parameters on the Solar cell, Accu Battery, Load, and Bathroom which is displayed in real time.
There is a table for Solar cells, Accu Batteries, Loads, and Bathrooms to view the data displayed in tabular form.

F.
System Work Procedure In figure 9, the block diagram for water management and electrical power in the public toilet is explained, starting from checking the battery power through the INA219 current and voltage sensor, then if the battery is not enough to supply power, the ATS will change the power usage to switch and charge the battery, otherwise if the power is on the battery is enough then ATS will use the power from the battery to start the system.

III. RESULTS AND DISCUSSION
The results of this study begin with the display of the system flowchart. The overall system flowchart of the tool is shown in Figure 7 below:  Obtained 16 data, data collection is done hourly and when the sensor detects that the water level is less than 40 cm and will stop when the height has reached 50 cm. At 08.00 it was detected that the water level was 39.89 and the water volume was 254.13 liters this activated the relay and filled the water tank, at 08.16 the water level was 49.8 and the water volume was 317.22 where the water was fully filled and turned off the relay. At 4:21 p.m., the system filled with water with a water level of 38.76 and a water volume of 246.9 liters until 16.59 with a water level of 50.1 and a volume of 319.1 liters. On Saturday, July 10, 2021, 22 sensor reading data were obtained, where data collection was carried out by calculating the length of time the public toilet users were in the bathroom. In the table above, the average use of the bathroom on Saturday 10 July 2021 from 06.00 to 18.00 is 9.09 minutes. In the graph, it can be seen that the longest use of the bathroom is at 06.25 to 06.42 which is for 17 minutes, and the shortest usage is at 17.10 to 17.11 which is 1 minute.  From the graph above, it can be seen that the relative voltage, current, and power values rose from 06.00 to 12.00 where the highest peak was at 12.00. Furthermore, in the period from 13.00 to 17.00 the graph of voltage, current, and power decreased. The value of the relatively constant voltage ranges from 11 V to 14 V. While the current value changes with a maximum value of 2499 mA. On Saturday it was found that the battery charging time was 6 hours from 06.00 to 12.00 where at 12.00 the voltage showed the maximum voltage value of 13.67 V. Charging the battery using the float charge method where the battery charging is connected to the load.   IV. CONCLUSION From testing the water management system and electric power in the public toilet, it was found that on Saturday 10 July 2021, water filling was carried out 2 times, namely at 08.00 and 16.21 where the height was less than 40cm. the average use of public toilet is 9.09 minutes with the longest usage is 17 minutes.

A. Hardware Manufacturing Results
Testing the performance of solar panels managed to get parameter values that tend to increase from 06.00 to 12.00 after that the parameter values decrease until 17.00. the average power generated is 15.24 Watt. for charging from 11.6V to a maximum capacity of 13.6V takes 4 hours from 06.00 to 10.00 and the value of the parameter when charging is not much different from the value generated by the solar cell this is because the power output of the solar cell is directly connected to the SCC which used for battery charging. For the use of power in the public toilet the total power consumed per day is 0.06 kWh.
The ESP32 microcontroller sends data to the firebase database in realtime according to the current sensor reading. Furthermore, ESP32 also sends data to the MySQL database every hour for documentation and data recording. Sending data from ESP32 to MySQL using the HTTPClinet function on ESP32.
QoS (Quality of Service) testing on the system is carried out for 3 days of testing. On Saturday, the average delay was 0. 0,846015 s and packet loss was 2.2%.