Smart Trash Bin with Web Integrated Volume Monitoring and Sorting System via MQTT Protocol

—The increasing human population makes each year its production increase significantly. People's ignorance to separate the types of waste has triggered various disasters. Many studies have aimed at tackling this problem, such as smart trash bins that can sort various types of organic and inorganic materials and detect waste. However, it can products with many functions are not all integrated into one product. Purpose of this research is to provide a product that can integrate various smart trash bin functions with a volume monitoring system and sorting metal, non-metal, and organic waste types monitored via the web using the MQTT Protocol. This research prototype consists of several devices, namely smart trash bin equipped with proximity sensors, capacitive proximity sensors, and infrared sensors. In addition, this system is equipped with an ultrasonic sensor to detect the height of the trash. The Wi-Fi module integrated this system with web applications and the MQTT protocol. Based on the test, the system has been running well since the sensor data collection test is 70%, the delay test from the sensor input to the actuator is 3.48 s, the ultrasonic sensor reading accuracy is 97.16%, and the throughput on the monitoring website is 5084.75 bytes/sec.


I. INTRODUCTION
Smart trash as a solution is a trash box that has a role more than just a trash can in general. There have been many studies aimed at tackling this problem, such as smart trash bins that can sort various types of materials, be they organic or inorganic (metal and non-metal), and also detect the height of the waste. However, smart trash can products with many functions are not all integrated into one product [1].
Based on the advantages and disadvantages of research on intelligent trash bins, in this study, a smart trash can product was designed to sort by type, measure, and monitor the height of the trash can and is connected to the web. This tool works because the trash can detect objects and types of metal, organic, and inorganic waste through various sensors installed in the trash box. These sensors will send data and be processed on Arduino. After processing Arduino, the lid of the trash can will open according to the type of garbage detected. The garbage opening and closing mechanism are driven by a motor (9G micro servo). This tool is also equipped with a garbage height measuring sensor using an ultrasonic sensor. The data from the trash bin system will be sent through the officer via the Wireless Fidelity (Wi-Fi) module, which is integrated with the web application. The application will notify if the trash volume exceeds the specified capacity [2].
Several methods have been carried out regarding the technology supporting the waste sorting system. It includes an experiment conducted by Temmy Julianul Ichsan [1] which designed a waste sorting device that utilizes an inductive proximity sensor and an infrared sensor to detect non-metallic and metallic waste. LDR sensor is used for detection to detect non-organic waste that is translucent and organic waste that is not translucent.
A study by A. Rizal Musthofa AA [2] designed a waste sorting system that can sort out the types of waste, namely organic, inorganic, and metal waste, using touch, IR proximity, IR sensors, inductive proximity sensors, and Atmega16.
Penni M N Silitonga [3] designed an intelligent trash can with a capacitive proximity sensor component, HC-SR04 sensor, 9G micro servo, 16x2 LCD, which displays garbage status detected by the tool, and uses Arduino Uno as a microcontroller.
Ernes Cahyo Nugroho [4] designed a garbage box that uses a PIR sensor to detect the presence of people in front of the garbage box. The LCD will display the type of garbage detected, three LEDs as an indicator of the full trash can, an ultrasonic sensor HC SR-04, and a capacitive proximity sensor to detect inorganic and organic waste.
Yusuf Ari Bahtiar in [5] made an automatic waste sorter with an infrared sensor for detecting all types of waste and a capacitive sensor for detecting plastic, glass, and metal waste. Inductive sensors distinguish between metals and inorganics. In this case, the infrared sensor is operated to identify organic waste.
Faisal Irsan Pasaribu [6] designed an automatic waste sorting device consisting of 4 waste sorting types using the LDR sensor.
Fahmi Alfian [7] designed a waste sorting device with a machine learning consisting of a servo motor and a USB cam is done in real-time, which is then read by a USB cam with a servo motor as a driver.
Prengky L.E. Aritonang [8] designed a trash can to detect non-metallic and metallic waste with an automatic sorting system using an inductive proximity sensor and a capacitive proximity sensor. The conditions and types of waste are displayed via the LCD.
M. Sidik Hasibuan [9] designed a tool to monitor the fullness of the trash can using the Short Message Service (SMS) and Global Positioning System (GPS) features. This design utilizes Arduino Nano, buzzer, GPS Ublox Neo 6MV2, IR sensor, and an inductive proximity sensor.
Yogi Herawan [10] designed a waste sorting device that utilizes the Arduino UNO microcontroller for component automation. The sensors used are ultrasonic sensors, inductive proximity sensors, and FC-37 rain sensors to detect dry and wet waste. The servo motor drives the litter box valve in a closeopen mechanism. OLED interface to perform data reading, and the buzzer will sound if the bin is full.
Based on the backgrounds and previous research, the output to be achieved from the design of this system is a final report and a prototype of a smart trash separating organic, inorganic and metal waste and monitoring the height of the waste that can be displayed on the web using the MQTT Protocol.

III. METHODS
In this section, the author will discuss the concept of the system to be realized. In the overall system made in this study, there are three parts, as shown in Figure 1, namely input, process, and output.
At the input, there are several devices, namely one inductive proximity sensor, one infrared proximity sensor, and three ultrasonic sensors. These devices have different functions. The first device is an inductive proximity sensor that functions to detect the presence of metal-based waste. The second device is a capacitive proximity sensor that functions to detect the presence of metal-based and non-metallic waste. The third device is an infrared sensor detecting waste made from nonmetallic metals and organics. The fourth device is an ultrasonic sensor that detects the garbage's height. The three ultrasonic sensors will provide input whose data will be processed through the Atmega328 microcontroller (Arduino Uno).
Next in the process section, there are several devices: One Atmega 2560 Microcontroller and one Login V3 ESP8266 Module (WiFi Module). Atmega 2560 microcontroller has a function to process input data obtained at the input. The input data were obtained from the capacitive proximity sensor, inductive proximity sensor, and infrared sensor function to process the types of waste detected by the three sensors. In addition, the Atmega 2560 Microcontroller has a function to process input data obtained from the HC-SR04 ultrasonic sensor. The input obtained from the sensor is the height of the trash in the trash box. The following device is an ESP 8266 module that functions to make wireless communication with laptops and smartphones using a 2.4 GHz frequency.
Furthermore, several devices are in the output section, namely three 9G micro servo motors and one website. Three 9G micro servos function moves the trash box cover according to the type of waste after being adjusted by the Atmega 2560 Microcontroller. Furthermore, the role of the website is to display the output sent by the WiFi module using the MQTT protocol.  Figure 2, it can be seen that there is a flow chart that visualizes the flow of waste sorting on the Atmega 2560 microcontroller. Initially, there are three sensors, namely an inductive proximity sensor (A), a capacitive proximity sensor (B), and an infrared sensor (C). The three sensors are exposed to a certain type of waste. If the waste is metal, then A will have logic = 1, B has logic = 1, and C has logic = 0. Then if the waste is non-metallic, then A has logic = 0, B has logic = 1, and C has logic = 0. If the waste is organic, then A has logic = 0, B has logic = 0, and C has logic = 1. If there are types of waste other than metal, non-metal, or organic, then the waste is not detected.
The data obtained from the testing process were analyzed using quantitative. The method's output is in the form of several parameters, namely the percentage of error, accuracy, throughput, and delay. These parameters are obtained after doing the mathematical method..

IV. RESULTS AND ANALYSIS
The first test data is the reading of the three sensors used to detect the type of waste material. The three sensors consisting of Capacitive Proximity, Inductive Proximity, and Infrared sensors have LED lights that are valuable indicators of whether the sensor is active. Ten types of waste material were tested against the three sensors used in this test. The results of this test are then used to classify the types of waste materials into the categories of waste used by the system: metal, non-metallic, and organic. Metal category trash will be marked from the three sensors that are on. Non-metallic waste will be marked when the Capacitive and Infrared Proximity sensors are on while the Inductive Proximity sensors are off. Moreover, organic waste will be marked when the proximity sensor is off and the infrared sensor is on. The results can be seen at Table 1. The second test data in this research is a throughput parameter to determine the number of incoming packets that have successfully arrived and received at the receiver side (website) during a particular time when the MQTT communication process is carried out. This parameter is measured by conducting packet sniffing of information when data is sent using the MQTT protocol and then saving it as a .pcap file using the Wireshark application. There are 60 .pcap files generated, consisting of 20 test files for each type of garbage test. Calculate this parameter, and it is done by checking the statistical data of the packets that have been successfully sniffed. In this case, only packets that are checked using the MQTT protocol and those from the public IP address of the MQTT server are checked. Displaying the statistics of these packages is done by clicking the statistics tab and selecting capture file properties. The results of statistical packages can be shown at figure 3. Testing of the type-sorting sensor is carried out to determine the success rate of capacitive proximity, inductive proximity, and infrared sensors in identifying objects based on their constituent materials. They are categorized into three types called metal, non-metal, and organic. This test is carried out by placing the object to be tested on the surface of the sensor. Afterward, it shifts its position to other parts of the sensor crosssection that have not been exposed. After all the sensor crosssections have been passed, the sensor readings are then carried out based on the output on the serial monitor. Table 2. shows the test results of the waste sorting sensor.

Table 2. Classification of Types of Objects Based on Test Results
Based on table 2 above, testing the type-sorting sensor was carried out 17 times using objects of different types in terms of size and constituent materials. There were several objects that were detected, but the classification based on the constituent materials did not match what was read, namely, five trials; the success percentage value could be calculated as follows: ISSN : 2745-9292 Vol. 03, No. 1, Juni 2022 Referring to the calculation results, it can be seen that the success of the experiment in terms of testing the typesorting sensor is 70.59%. It is also known that the percent error is: Error = (100success) % Error = (100 -70,59) % Error = 29,41 % Based on the above equation, the error value is 29.41%. Testing the time required for the process of reading objects by the sensor is carried out to determine the length of the process of reading objects by the sensor to move the actuator (servo motor). It is compared with the delay that has been set in the Arduino program. This test is done by selecting one type of object made from metal, non-metal, and organic. These three objects are placed on the cross-section of the sorting sensor until the servo moves open. Delay measurement is done using a stopwatch. Based on the data obtained from Table IV.3, the average delay in each process of detecting objects made of metal, non-metal, and organic is as follows: =

V. CONCLUSION
From the results, the design of smart trash bin with a Web-Integrated Volume Monitoring and Type Sorting System through the MQTT Protocol in terms of testing the waste sorting sensor consisting of capacitive and inductive proximity sensors gives relevant results to the specifications. However, on the capacitive proximity sensor, several types of material are not identified, and only some of the materials include mica plastic, aluminum coins, fingers, bottles containing mineral water, and also plastic shampoo sachets. Based on the test results, the system has been running well because the sensor data collection test has been successful at 70%. The testing of a delay from the sensor input to the actuator is 3.48 s, the ultrasonic sensor reading accuracy is 97.16%, and the throughput on the monitoring website is 5084.75 bytes/s. As in the previous discussion, the system tested for detecting special metal sensors (inductive proximity) has successfully identified materials according to their specifications. In contrast, capacitive proximity sensors are limited to a few materials. Therefore, a suggestion in developing this system is to design this waste sorting system using a capacitive proximity sensor with better sensing power.