IoT-Project Smart Trash Can with Blynk Platform Integration

Abstarct This research is an implementation of the internet of things (IoT) for smart trash cans in places that are usually visited by many people. Currently, the Covid-19 pandemic in Indonesia is still quite high. Therefore, the Internet of Things (IoT) system is intended to help reduce the spread of the covid-19 virus. This system uses a NodeMCU ESP8266 microcontroller and several sensors that are used to support this research. The design of this IoT system focuses on measuring the distance between the trash can and the person disposing of the trash to calculate the opening and closing distance for the trash and measuring the height of the trash in the trash as a reference for cleaning workers to pick up trash at the right time. This smart trash can can open the lid automatically according to a specified distance and will send an alarm to the cleaning worker smartphone on duty when the height of the trash is full or reaches a predetermined limit.


I. INTRODUCTION
As a highly communicable disease, coronavirus disease 2019 (COVID-19) continues to ravage the state of the world's health and economy [1]. Its impact also underscores the limited progress we have made against non-communicable diseases (NCDs). Children and adults with underlying comorbidities, particularly NCDs such as diabetes, hypertension, undernutrition, and overweight/ obesity, are strikingly vulnerable to serious illness and death from COVID-19 [2].
Indonesia first reported 2 positive cases on March 2, 2020 and a positive case continued to increase. Until April 25, 2020, Indonesia already reported 8. 211 Positive cases, 689 cases died, 1.002 cases recovered from 50,563 people examined with the results of the examination is 42,352 negatives [3]. because of the high rate of Covid-19 transmission in Indonesia, we took the initiative to come up with an idea to help break the chain of transmission. The idea that we will explain in this paper is a smart trash can. Where this can help the community to be more hygienic, especially when throwing garbage out.
This also applies to cleaning officers as one of the parties at the forefront of serving the community. Because cleaners are also part of the community who need to be protected just like the others. The trash can be one of the places that has a lot of germs that can cause disease, therefore there must be some adjustments made, especially during a pandemic. Most people throw away their trash without seeing or making sure that the garbage they throw away goes into the trash. There is even worse, the discarded garbage does not enter and spills around the trash because of negligence in disposing of the trash. Especially the type of trash that is easily scattered which is very disturbing to others. It should be noted that scattered garbage can not only cause disease but also cause discomfort to the surrounding environment. Moreover, if the trash can be in an environment with lots of people. Another problem that becomes our focus in this paper is when the trash is fully filled and the cleaning staff does not realize it because there is no marker indicating that the trash can is full.
In this paper, the researcher will describe how the prototype design and implementation of a smart trash can based on Internet of Things technology. This technology implements the NodeMCU ESP8266 microcontroller, which is integrated with smartphone devices using the Blynk application. Smartphone applications such as Blynk are widespread applications in IoT implementations and I n P r e s s work with NodeMCU devices. NodeMCU is a device used in IoT technology as a microcontroller [4].
In Section 1, we explain the background and motivation for the research we conducted. Then proceed with the research method in Section 2. Next, we present the proposed method in Section 3. After explaining the proposed method, we conduct an experiment which can be seen in Section 4. And finally, Section 5 will provide a conclusion from the experiment that has been done.

Problem Identification
COVID-19 is a global health problem including Indonesia. This was initiated from the information of the World Health Organization (WHO) on 31 December 2019 there was a case of a cluster of pneumonia with a new etiology in Wuhan City, Hubei Province, China and later expanded beyond China. On 30 January 2020, COVID-19 was set to become the public health Emergency of International Concern (PHEIC) [1]. Besides that, another problem is when Indonesia enters a new normal period, where the movement of society is very limited. New normal causes garbage collectors to be able to visit service user homes freely. This condition not only in residential areas, but this also occurs in various places such as shopping malls, government institutions, educational institutions and others. Environmental controllers in residential areas and hygiene management in places such as buildings mostly pay less attention to the timing of collecting garbage so that the garbage often becomes overloaded and scattered everywhere. The smart trash can automatically open and close based the garbage disposal stand and was designed to measure the height of the trash and will send the messages to cleaning officer on duty for to pick up trash when the sensor in the trash reads the trash is full.

Literature Study
One of the studies related to the smart trash can in India that is IoT Based Waste Management for Smart City [5]. In that paper, the trash can will send an alarm when it reaches a certain height. The difference is the sensor used to measure the height of the waste, on paper IoT Based Waste Management for Smart City the height of the waste is measured using a Radio Frequency (RF) sensor, while in this research the height of the waste is measured using an ultrasonic sensor. The ultrasonic sensor itself functions to convert physical quantities (sound) into electrical quantities and vice versa. The way this sensor works is based on the principle of the reflection of a sound wave so that it can be used to interpret the existence (distance) of an object with a certain frequency. It is called an ultrasonic sensor because this sensor uses ultrasonic waves (ultrasonic sound) [6]. We see that if this trash can be used as a whole, it will indirectly support the government's new normal program. In addition to maintaining distance and avoiding crowds, maintaining hygiene is an equally important factor to stop the transmission of the Covid-19 virus.  Figure 1 shows the system architecture of smart trash can. The NodeMCU is connected to 2 sensors, which is a PIR infrared sensor and an ultrasonic sensor. These sensors will send data to NodeMCU which is then will be processed later. PIR infrared sensor will detect if there is an obstacle in the given range. The expected obstacle detected by PIR is human hand. Then the NodeMCU will communicate with a servo which allows the system to control the trash can opening and closing. If the trash can is filled, ultrasonic sensor will measure the distance from the top of detected trash inside of the trash can. This will enable data processing about how much the trash can is already filled. A passive buzzer is also connected to the NodeMCU to give alerting when certain threshold is reached. The system is also connected to internet and smartphone to enable the trash can monitoring and alerting. This system uses Blynk as a tool to connect smart trash can to the internet and smartphone.

I n P r e s s
The system workflow can be seen in figure 2. The system is connected to 2 sensors, a PIR infrared sensor and an ultrasonic sensor. These 2 sensors will be given delayed time to do their job. PIR infrared sensor will detect obstacle (in this case will be a human hand) every 100ms. If an obstacle is detected, the NodeMCU will give command to servo to turn 90 degrees. The servo arm which is connected to the top of the trash can will turn 90 degrees so the trash can will be opened, and the user can put the trash. If the PIR infrared sensor is not detecting obstacle anymore, the servo will back to 0 degrees and the trash can will be closed. After the trash can is closed, the ultrasonic sensor will measure the distance from the top of the trash can to the filled trash. NodeMCU will then get this distance data and compute the percentage of how much the trash can is already filled. Then, if the trash can is detected full in certain scanning time, the NodeMCU will then trigger the buzzer and notify to the user smartphone through Blynk. The notification will useful for trash collector company to know which trash can is ready to be picked.

Smart Trash Can Requirements
These are the component required for building smart trash can:    The Microcontroller used in this system is NodeMCU ESP8266. This microcontroller uses Espressif ESP8266 processor and supported by 4MB of memory. The NodeMCU ESP8266 module includes Wi-Fi 802.11b/g/n | 2.4 GHz module so it is relatively easier to configure the internet connection. Although this microcontroller is not yet supporting multithreading, in this use case the computation capability of NodeMCU ESP8266 is still enough.
The PIR infrared obstacle sensor is used for detecting human hand. This sensor sesitifiy can be adjusted with the trimmer. In this system, this sensor will send obstacle signal if any object is present in 5cm in front of the sensor. This sensor operates between 3.3 to 5 volts.
HC-SR04 ultrasonic sensor is a sensor that can measure distance using ultrasonic. This sensor can measure the distance from 2cm to 400cm with an accuracy of 3mm. This sensor operates on 3.3 to 5 volts. There are 4 pins in the HC-SR04 ultrasonic sensor. The VCC pin act as the input of the electric. GND or ground pin will be connected to ground pin of the NodeMCU. TRIG pin is used to trigger the ultrasonic sound pulses. And ECHO pin produces a pulse when the reflected signal is received. The length of the pulse is proportional to the time it took for the transmitted signal to be detected. [7] When the trash can is full, the system will trigger the passive buzzer to sound. Passive buzzer is used instead of an active buzzer. The active buzzer has an internal oscillating source, and the buzzer will sound as soon as it is energized. The passive buzzer does not have an internal oscillating source, and it must be driven with square wave and different frequency needed [8]. This means passive buzzer can be activated on demand.
TowerPro Motor Servo MG90 is used in this system to open or close the trash can lid. The range of the rotation motor is 175 o and rated speed 545°/s. This servo operates in 5 volts. This servo is powerful enough if the trash can used is the smaller one, in this experiment, we used 30cm height trash can so this servo is enough.   Figure 9 shows the sensors placement. The PIR infrared sensor placed below the trash can lid and on the front side. A hole is created on the center of the lid so that the ultrasonic sensor can be placed there. This ultrasonic sensor will measure the distance of the filled trash from the top. This prototype is of course still need to be improved to be ready for production. This system then will connect to a Wi-Fi endpoint. As long as the trash can is connected to the internet, the data measured will be available for monitoring in the Blynk application.

III. RESULTS AND DISCUSSION
We did an experiment using plastic waste that we measured before and put it in a smart trash can. Plastic waste used has a height of 15 cm, 10 cm, and 5 cm. This experiment is used to calculate the margin of error on the device in measuring the height of the trash with a trash bin height of 17 cm. The following is a table of results from the experiments conducted. This experiment also uses an application from BLYNK as an auxiliary medium to monitor the HR-SC04 ultrasonic sensor which is used to measure the height of the device. The following in Figure 10 is for the BLYNK application on a cellphone. From the data in table 1, it shows that the experiments carried out have been successful with an average error margin of 0.11 or the accuracy of the system is 99.99%. In the system that was built we provide a rule where if the maximum height of the waste is 12 cm. If the height of the trash is equal to or higher than 12 cm with a total of 5 seconds of data, it will give a message to the mobile device using the BLYNK application, and will also sound a buzzer in the trash can to notify or warn the user that the trash can is full. The conclusion that we get on the smart trash bin device can be used as a tool in knowing the height of the trash with a note that the device is getting less accurate when it approaches the maximum height of the smart trash can. As for the external factors that affect the performance of the device, there is the noise level of the place because when the experiment was carried out the device caught the noise from outside, making the measurement of the height of the trash can wrong.

IV. CONCLUSIONS
The smart trash system can be used to help users or business entities in knowing the amount of capacity of the trash in the user's home in real time. So that the environment around the user can always be kept clean and hygienic. The device used is connected between a microcontroller (NodeMCU), sensors (Ultrasonic and infrared), the internet, the BLYNK platform, and a smartphone that creates a smart trash can. Smartphones are used here as a monitor for the height of trash at a distance. If it is detected that trash is almost full, it will give a signal to the smartphone application that the trash is full. For further research, several more sensors can be added so that the accuracy obtained is better or height verification tools due to external disturbances such as noise affecting the ultrasonic sensor. In addition, it is also necessary to add a database to the application so that users or business entities can observe the pattern of the amount of waste on a certain day.