IoT : smart garbage monitoring using android and real time database

Every single day, garbage is always produced and sometimes, due to the unbalance between high volume produced and the garbage volume transported to the landfill; it then leads to the buildup. To prevent any negative impact on environment, a system is needed to support the waste management process. Smart Garbage Monitoring System consists of two parts: portable garbage can and monitoring application using android smartphone. The use of ultrasonic sensor, GPS and GSM Module on the garbage can aims to provide the data on the garbage and send it to the real time database, in which the data will be processed by the monitoring application on smartphone to determine the time of garbage transport purposely to prevent any buildup. The system doesn't need a server to process, because the entire process of will be run by android application on a smartphone. Test results showed the capability of the system in monitoring the garbage can with the minimum distance between the wastes by three meters. The information on the height level of garbage can be synchronized in real time to smartphone, with an average delay on the EDGE network of 4.57 seconds, HSPA+ of 4.52 seconds and LTE of 3.85 seconds.


Introduction
Waste management is an important issue that needs to have a concern in every country including Indonesia.As reported by the Report of Study from Ministry of Environment and Forest, that only 38,653 million tons of waste handled in 360 cities, and garbage increased 7% from 2015-2016 [1].Waste management in Indonesia at this time, is still limited and manually, the officer will clean up at a specified time according to the schedule, this is very ineffective because the trash can has been fully before the garbage collection schedule, the delay of garbage collection will cause the garbage on the trash can overflow and smell.Waste volume produced by inefficient waste management would cause insects, bacteria and viruses multiply rapidly that can infect humans [2][3][4].Traditional waste management through a garbage burning system would cause air pollution produced, which can be health problems to the surrounding community [5].With a large amount of waste, Indonesia certainly needs a system to assist the waste management process properly and efficiently.
Internet of Things (IoT) refers to a technology that can connect the embedded system devices to run various functions that can be used and controlled through internet connectivity [6][7][8][9].It has been widely used to support Smart City Management in transportation [10][11][12][13][14].In the health sector, IoT is used to monitor the patients' health by means of smartphones [15][16][17][18].Other research using smart devices to support the health industry [19], and in E-commerce it is used for the company's business development [20,21].IoT-based research on waste management has been largely conducted, say Smart Garbage System (SGS) [22].Another study proposed a waste management system using the method of grouping the garbage location [23].Then, a design of smart management system for waste management has been done, but still not coping with the problem occurred in the suburb area or outside the urban.Also, the system does not provide any information about the time limit of waste transport and the location of the garbage can to the users [24].
Research using Load cell and proximity sensor on the trash monitoring system has been done, but the system is't real time, so officers still have to make decisions about where trash that must be taken, based to the collected information [25].The waste management  ISSN: 1693-6930 TELKOMNIKA Vol.17, No. 3, June 2019: 1483-1491 1484 research especially from its information collection system, has been carried out [26,27], however the research only focuses on collecting waste that can be recycled.Next research has reported a monitoring system using QGIS model, as a supporting tool for management of solid waste in city, but the proposed system does not consider the dynamics of the population [28].The limitations in the previous research have, as a consequence, made the vision to reach the smart city particularly regarding waste management difficult to be realized.
Based on the explanation above, the focus of this research is on the utilization of IoT technology in designing and implementing android application on smartphone for Smart Garbage Monitoring System, to improve the function of waste management in each region, and make it working more efficiently and optimally.The system doesn't need a server to process the data, because entire process of the system will be run by an android application on a smartphone, The system is designed to read the garbage volume in garbage can, map the garbage can location, and determine the time of garbage transport in which the entire system can work in real time without any human intervention in its process.

Research Method
The design of the garbage can system is shown in Figure 1 where the system is divided into two parts: portable garbage can and monitoring applications on android smartphone.The garbage can used was the garbage with a cover, and a number of hardware including ultrasonic sensor, GPS module, GSM/GSM Modul SIM808 850/900/1800/1900 MHz Quad-Band and Arduino UNO microcontroller were installed at the upper part or on the cover of the garbage can.

Figure 1. IoT-based smart garbage can model
Ultrasonic sensor is a sensor that uses echolocation [29], the sensor was placed attached on the inside cover of garbage can purposely to calculate the height of garbage volume in the garbage can, as shown in Figure 1.A Microcontroller would send pulse to ultrasonic sensor and transmitted the ultrasonic wave.The transmitted ultrasonic wave would be reflected from the garbage object and received by the ultrasonic transducer.Thus, the volume of garbage height was possible to be calculated see Figure 2.
The system would be active when the garbage can was in a closed position and the ultrasonic sensor detected any changes in the height of the garbage volume.The data of garbage height was then be processed by the Arduino uno microcontroller along with the data of the garbage can location (latitude and longitude) provided by the GPS module.Then the data was sent to firebase real time database with HTTP protocol, using GSM SIM808 module via cellular network.Figure 3  The database used was Firebase Real time database stored in cloud in which the data was stored as JSON and would experience a synchronization process in real time to each client connected [30] either to the garbage can or to the application on the Android smartphone.Thus, every smartphone installed in the garbage monitoring application would automatically receive data update at any time, when connected to the database via the internet network [31].The program code of data synchronization process from the android application to the database is presented as follows.Application on android smartphone functioned to receive information from the database that included the location and level of garbage height in each garbage can.If the height level or time is in certain condition, the status notification would appear on the smartphone to the waste transport officer to immediately process the garbage transport.The flowchart of the system can be seen in Figure 4.
Each garbage can has been made with the time limit and maximum height level of garbage as illustrated in Figure 5.This time limit is functioned to make the garbage not piled up for so long.If the time set by the time limit has been reached, the notification is then sent to the application as a sign that the garbage should be soon transported.Similarly, for the volume of garbage height, if it has met the condition, then the notification would be sent as a sign that the garbage should immediately be transported.
The data sent to the application of garbage can is shown in the Data of Flow Diagram in Figure 6.Information from the garbage can was sent to the system and forwarded and processed on the android application as a real time report.The information from the garbage can would be sent and stored to the database based upon the location and the height level of the garbage can was, then combined with the time to be sent to Android, as shown in Figure 7. Monitoring application can control the time to determine when the maximum limit for the garbage can must be transported.It is aimed to repeat the time calculation in the limit of transportation as shown in Figure 8.The progress bar shows the height level in the garbage can and the button "date" and "clock" would provide the selection of time limit for the next garbage transport.Meanwhile, the button "confirm" is for making confirmation if the garbage can has been transported and to update the time limit of transport, button "go to" will open the location of the garbage can based on the latitude and longitude provided on the database.

Results and Analysis
To observe the system performance, it was deemed necessary to do some testings in each part or the whole system.The tests included: ultrasonic sensor test and garbage height TELKOMNIKA ISSN: 1693-6930  IoT: smart garbage monitoring using android … (Riyan Hadi Putra) 1487 application, garbage can location on the monitoring application, delay data test on garbage can height, test on the garbage height level notification, and test on the transport time limit.

The Test of Ultrasonic Sensor and the Application for the Garbage Height
This test aimed to measure the accuracy of the ultrasonic sensor and information displayed on the smartphone application.In calculating the garbage level, the test of ultrasonic sensor was placed in the middle of cover of garbage can with the height at 100 centimeter.In the database, the information of the garbage height would be converted into percentage (%) from the total height of garbage can.The test result as seen in Table 1 showed that the errors in calculation occurred only minimally in the range of 1-2%.
In the monitoring application, the height level of the garbage can was marked with the difference in color.Green level indicated the height of garbage volume<50% of garbage can height, orange indicated the height of garbage volume >50% and <70% of garbage height and red indicated the garbage volume height >70% from the garbage can height.The test was conducted by comparing the markers of each garbage can at certain distance as shown in Figure 8.The results of the tests showed that the monitoring application could read the results obtained from ultrasonic sensor detection to the garbage objects in smart garbage can.

Garbage Can Location on Smartphone Application
The test was done by taking the data about the location from the garbage can stored in the database.Location data used in the test was adjusted with the location on the map that has been made on the application and it was compared to the coordinate on the google map.The results of the test that used the smartphone application and google map are shown in Figure 9 (a) and in Figure 9 (b) respectively.

Test on the Delay of Data Sending
The test was conducted by equalizing the data in the level of garbage can height in the database to the data displayed on the application and by calculating the delay of receiving data to the application using some telecommunications technologies.The test results are shown in Figure 10.The results of the test as seen in Figure 10 showed that the reading of height levels in the application for the garbage height acceptance from 0 cm to 100 cm has been suitable with the reception data.At the garbage can height above 100 cm, the database did not update the data because the garbage can did not send to the database.Hence, the application kept on reading the previous data.The average for each reading of height level changes from the garbage can to the application on smartphone included: delay on the EDGE network was at 4.57 seconds, HSPA+ was at 4.52 seconds and LTE was at 3.85 seconds.Based on testing the delay on the LTE network is smaller than using EDGE and HSPA+ networks.

Test on the Notification of the Height Level of Garbage Can
The test was carried out to find out the feature of notification on the height level that has been made on the application as expected.There were two different conditions in the test: when the application was turn on and when the application was ongoing in the background with an initial value of height level at 0%.The notification would appear if the data of height level has exceeded 50% or 76% of the height of the garbage can.
The results of notification test on the application of height level in Figure 11 is shown in Table 2.When the application was turned on, the notification ran as expected.However when the application ran in the background, some results were not as expected as the application stopped due to the number of caches on the smartphone or due to RAM memory that was fully used.

Test on the Transport Time Limit
The test on alarms as shown in Figure 12 functioned for time warning could run with repetition that has been set for 2 minutes.Some alarms not emerging might be due to applications running in the background stopped due to the high number of caches in the smartphone or full RAM memory.The test results showed that with the time limit notification, the system could facilitate the waste transport officer to remember the time of waste transport in each location of the garbage can.

Conclusion
This paper shows the implementation of IoT-based smart garbage system using the ultrasonic sensor on internet network.The sensory device integrated to the monitoring system was able to monitor the height level of garbage volume, and display it on the location map.When the garbage can is already full, automatically there will be an alarm notification for the waste transport officer.From the test results, it has been figured out that the notification could appear on the application when the garbage can has accommodated the garbage by 50% and 70% of the garbage can height.The application could take and display the data of the garbage can that has been sent and stored on the firebase database.The test in reading the data of the geight level had the average of delay in the network of EDGE at 4.57 seconds, the network of HSPA+ at 4.52 seconds and the network of LTE at 3.85 seconds.The IoT-based smart garbage system that proposed could simplify the waste management more efficiently and optimally in terms of time management.The imperfection that discovered after using this system, all officers will received the same notification, it make confused who must collect the garbage from several irregular location.

Figure 2 .
Figure 2. Working principle of an ultrasonic sensor

Figure 4 .Figure 6 .Figure 7 .
Figure 4. Flowchart system Figure 5. Flowchart of the notice of smart garbage can application

figure 8 .
figure 8. Monitoring application on Smartphone

Figure 9 .
Figure 9. Location of Smart Garbage Can via: (a) monitoring application and (b) google maps

Figure 10 .
Figure 10.Comparison of the delay on the data

Figure 11 .
Figure 11.Notification on the smartphone application

Figure 12 .
Figure 12.Notification of time limit alarm

Table 2 .
Height Level when the Application was Turned On