Design of Liquid Refill Station for Dish Soap Product Based on Internet of Things

The abundance of plastic waste from liquid products such as dish soap, shampoo, mineral water, etc., has been a big problem so far. Therefore, a liquid refill station for liquid products has been designed to reduce plastic waste, and in this research, we used dish soap as liquid product. The tool works equipped with two pumps and a water flow sensor. So that customers can choose the volume and type of dish soap they want to buy from the two available brands. All purchase data in the form of customer ID, the brand of dish soap purchased, the volume of dish soap bought, and the date of the purchase were saved in the database. The residual volume in the tank is monitored and displayed on the Grafana dashboard. The timeout of dish soap volume in the tank is predicted using linear regression with the independent variable in the form of time (days) of purchase and the dependent variable in the form of the remaining dish soap in the tank. The prediction uses training data taken from the remaining volume data in the tank when it is first filled until it is first used up. The training data found that the coefficient of determination R2= 0.99 for the two brands.


Introduction
Plastic waste is one of the biggest contributors to the environment pollution and a problem that is difficult to control [1,2].Plastic waste is a type of inorganic waste, this type of waste cannot be decomposed or takes years to decompose.The decomposition of plastic waste takes about 50-100 years; it takes two generations to decompose plastic waste [3,4].According to the data from the Ministry of Environment and Forestry (2018), Indonesia produces 65 million tons of waste daily, and 16% of it is plastic waste and become waste that damages the environment [5].One of the efforts that can be made to reduce the accumulation of plastic waste is to reduce the use of single-use plastics, especially those from products that are used daily, such as plastic containers from dish soap, shampoo, mineral water, etc.
A liquid Refill Station is a device used to refill liquid products, such as drinks, soap, etc.The method is simple; consumers provide a container for the product they want to buy and refill the desired product through the device.The use of this device is aimed to reduce plastic waste from the container for these liquid products (we use dish soap in this research).Each consumer who buys dish soap brings their container/bottle for refilling.The base instrument used for processing was an Arduino Mega 2560 microcontroller and Raspberry Pi as an Internet of Things-based device for remote communication that connects the output from the liquid refill station, namely consumer data and basic data purchases to the database [6].We used the cashless method for the payment system so that the customers top up the balance on the Mifare card that has been set up for the liquid refill station using Near Field Communication (NFC) technology so that the customers can make payments more efficiently.Mifare cards are a type of contactless smart card that is used for a wide variety of purposes, including access control, public transportation, and payment systems.Mifare cards contain memory in addition to a microchip, and so are able to store information [7][8][9].Purchase data consists of brand data, purchase volume, buyer ID, date of purchase, and the remaining volume in the tank that are stored in a MySQL database [10].For further data processing, we applied Machine Learning Linear Regression which predicts the time of the run-out volume in the tank so that the seller can supply the liquid product (dish soap) before the liquid product in tank is completely running out [11][12][13].

Method
The liquid refill station hardware system consists of several sensors and display devices (LCD), input hardware (keypad), and Arduino Mega 2560 that are integrated into one system.

Figure 1. Hardware design of liquid refill station
The hardware design consists of a filling system that consists of two pumps that pump each tank based on the brand and one water flow sensor to adjust the volume produced according to the customer's choice.Furthermore, the system has a keypad to select the brand and volume of dish soap by pressing the keypad buttons set for each brand and volume.So that customers only need to press the keypad button that has been set to select the brand and volume of dish soap they want to buy.Furthermore, the hardware consists of an NFC reader PN532 that is used as a payment device.The balance digits are stored on the Mifare card block.The NFC reader reads the balance data stored on the Mifare 1K card when checking balances, reducing the balance at the time of payment and top-up the balance.
The customers tap the Mifare card to the NFC reader so that the filling or checking balances can be processed to the final stage.The hardware is also equipped with a solenoid valve which becomes a channel switch connected to a water flow sensor and an HC-SR04 ultrasonic sensor.The solenoid valve will open the valve when the ultrasonic sensor detects the presence of a container right parallel to the outlet.Installing a solenoid valve and ultrasonic sensor is aimed to make the liquid flow right into the container provided without splashing to the outside of the bottle/container.Ultrasonic sensors are also placed on the dish soap tank to measure the height of the dish soap, which will be used to measure the remaining volume in the tank.The LCD displays the data of selected brand and volume, balance, and filling process.The entire hardware is controlled by the Arduino Mega 2560 and connected to the Raspberry Pi 3 B. The VNC (Virtual Network Computing) viewer is an interface between the Raspberry Pi and the laptop.After the hardware and software from the liquid refill station are integrated, the data from Arduino Mega 2560 in the form of purchase volume, brand purchased, customer ID, date of purchase, and volume in the tank are sent automatically to the MySQL database via Raspberry Pi.The data from Arduino must be set to be JSON object first in the Arduino IDE program so that it can be sent to the MySQL database.Besides being sent to the database, the volume data on the dish soap tank is monitored through the Grafana dashboard so that the seller can find obtain the information of real-time remaining dish soap volume in the tank.Arduino Mega 2560 is connected serially with the Raspberry pi 3 B so that the hardware of the liquid refill station can be connected to the internet.
The Arduino Mega 2560 is serially connected to the Raspberry Pi.The Node on Node-RED will display the word "connected" if it is connected.Furthermore, data from Arduino Mega 2560 in JSON object format will be sent to Node JSON on Node-RED.It will be read and sent to the MySQL database by the system.
In the database, three separate tables are created; the first is the purchase data table consisting of the brand, volume purchased, price, customer ID, and date of purchase.The second and third tables consist of the remaining volume and timestamps.See Figure 4. for both brands.The next thing that will be displayed on the Grafana dashboard is data from the Table of the remaining volume of the dish soap tanks for the monitoring process.LEDs are also installed as a hardware marker if the volume of dish soap in the tank is running out.After the residual volume data in the dish soap tank is stored in a MySQL database, the next step is to predict when the dish soap in the tank is running out.Data of the remaining volume in the tank from the first time it is full until it runs out for the first time is used as training data.Furthermore, a linear regression equation from the training data will be generated and used as a predictive model.To make predictions, the values of ߚ0 dan ߚ1 from equations 1 and 2 are updated continuously based on the latest data in the dataset.Meanwhile, x is the independent variable (volume), and y is the dependent variable (time of dish soap volume is running out) [5][6][7]. (2)

Results and Discussions
The physical form of the liquid refill station and operating data on the system (purchase, fluid filling, filling) are displayed on the LCD device, as shown in Figure 3. Furthermore, Figure 4 shows the electronic circuit of the fluid filling system consisting of a pump, water flow sensor, and a tank containing two types of dish soap selected by the customer.All the tools in Figure 3 are integrations for the liquid refill station system controlled by the Arduino Mega 2560.The volume rate of dish soap that is pumped is 2 mL/s.This value is obtained from measurements using a water flow sensor installed in the system.The size of the container/bottle used for refilling dish soap must be between 20-35 cm high and a minimum container diameter of 8 cm.card of each customer.All that data are automatically stored in the database whenever the purchase occurs.This automatic delivery occurs by connecting Arduino Mega 2560 with Raspberry Pi, Node-RED, and Node-RED to the MySQL database.The remaining volume data on the dish soap tank is sent to the Grafana software to be monitored.The snapshot of the monitoring dashboard and the database system can be seen in Figure 4.  1.The prediction value of the run-out volume time of each brand is compared to its actual value, and we calculate the quality metric, namely RMSE (Root Mean Squared Error).From the RMSE value that we obtained; it can be said that we have good accuracy for both brands.The highest accuracy results are obtained for the Sunlight brand.Better accurate results can be obtained if more training data is owned to represent the trend model.These results can prove that the method used can predict remaining volume because it has the same range of RMSE values as previous research using the same [10,11] or different methods [13][14][15].Furthermore, the prediction results are used as a reference by the seller in preparing the supply (stock) of the dish soap in the tank a few days before it runs out.This aims to prevent the dish soap empty at the estimated run-out time.The liquid refill station is also equipped with an LED marker set to light up three days before the runs out of dish soap.

Conclusion
The liquid refill station system has been worked properly.All the integrated hardware worked properly by synchronizing each other to be a robust integrated system.The IoT system has succeeded in accepting the data from the hardware, so the data has already been stored in the database and monitored through the dashboard.

Figure 2 .
Figure 2. Design of liquid refill station system integrated with IoT software

Figure 3 .
Figure 3.The hardware of liquid refill station Purchase data and the volume of residual data in the dish soap tank are the data sent to the MySQL database.Purchase data is sent to the database in the form of dish soap brand; volume purchased, dish soap price, date of purchase, and customer ID, which is obtained from the characteristics of the Mifare

Figure 4 .
Figure 4. Residual volume monitoring on grafana dashboard (A) and purchase data MySQL database system (B).The results of volume run-out time prediction are obtained as shown in Table1.The prediction value of the run-out volume time of each brand is compared to its actual value, and we calculate the quality metric, namely RMSE (Root Mean Squared Error).From the RMSE value that we obtained; it can be said that we have good accuracy for both brands.The highest accuracy results are obtained for the Sunlight brand.Better accurate results can be obtained if more training data is owned to represent the trend model.These results can prove that the method used can predict remaining volume because it has the same range of RMSE values as previous research using the same[10,11] or different methods[13- 15].Table1.Prediction