Intelligent Automation & Soft Computing

Smart Garbage Bin Based on AIoT

Wen-Tsai Sung1, Ihzany Vilia Devi1, Sung-Jung Hsiao2,* and Fathria Nurul Fadillah1

1Department of Electrical Engineering, National Chin-Yi University of Technology, Taichung, 411030, Taiwan
2Department of Information Technology, Takming University of Science and Technology, Taipei City, 11451, Taiwan
*Corresponding Author: Sung-Jung Hsiao, Email: sungjung@gs.takming.edu.tw
Received: 19 August 2021; Accepted: 27 September 2021

Abstract: Waste management and monitoring is a major concern in the context of the environment, and has a significant impact on human health. The concept of the Artificial Intelligence of Things (AIoT) can help people in everyday tasks in life. This study proposes a smart trash bin to help solve the problem of waste management and monitoring. Traditional methods of garbage disposal require human labor, and pose a hazard to the worker. The proposed smart garbage bin can move itself by using ultrasonic sensors and a web camera, which serves as its “eyes.” Because the smart garbage bin is designed for indoor use and mobility, we use a Bluetooth beacon for location tracking, whereby the bin transmits a constant signal that the other devices in the environment can detect. A smart garbage bin was developed in this study to be used in the E315 research room in the Electrical Engineering Department of the National Chin-Yi University of Technology. An Android application was also developed to help users monitor waste in the smart bin.

Keywords: AIoT; ultrasonic sensor; edge detection; indoor positioning system (IPS); Bluetooth low energy (BLE)

1  Introduction

Garbage collectors are used in a variety of settings, including businesses, offices, schools, hospitals, and streets [1]. Waste management plays a crucial role in creating a clean environment in cities across the globe [2]. In an enclosed environment, garbage becomes an obstacle and a health hazard for residents because it can affect air quality and cleanliness. The disposal of trash is the problem considered in this paper. The main challenge in the typical garbage collection procedure is inspecting dust containers without knowing the baseline information, which is the level of waste. This technique leads to fuel and time being wasted [3]. The timely collection of waste minimizes overflowing garbage and helps keep the indoor environment clean [4]. Because solid waste management is a crucial aspect of environmental hygiene, it must be incorporated into environmental planning to create a clean and comfortable living atmosphere.

According to the World Health Organization (WHO), sanitation services and workers are essential for operational support during the COVID-19 pandemic, but they also incur a high risk of contracting this and other diseases due to the nature of their work [5]. The garbage bin is a hotbed for germs, and people frequently come into contact with it. A smart garbage bin can help minimize human contact when disposing of garbage. According to Cheong et al. [6], a garbage bin that can automatically retrieve trash and move it to the local waste disposal center is the trend of the future.

The procedure of garbage collection and its operational effectiveness can be improved by enhancing its intelligence [7,8]. A smart bin is a waste management dustbin that is self-aware, and detects the level of waste in it. It sends corresponding alerts to public authorities, thus allowing them to arrange for it to be emptied. Because timely checks would not suffice in regions where the frequency of use of the bin changes, this sort of bin is very useful [9]. Such a system can identify the amount of waste in the container and can be controlled by an app, thus eliminating the need for consumers to approach it. According to research on smart garbage bins [10], they can be divided into two types: bins for biodegradable waste and those for non-biodegradable waste. This is also how the smart waste bin system works: When biodegradable trash reaches a particular level as detected by a sensor, the smart garbage bin notifies the relevant authorities via the app and automatically closes. When the threshold of the non-biodegradable bin is exceeded, it also reacts similarly. As a result [11], AIoT-based solutions are the most suitable alternative given the problems that municipalities encounter in such work. The quality and efficiency of the smart waste bin can be improved by combining the IoT and AI. Such a system uses ThingSpeak as a server; it collects, stores, analyzes, and visualizes sensor data [12]. At the beginning of this paper, we will briefly explain the motivation for making the smart trash can. Next is the literature discussion. The subsequent paper will explain the system architecture and system process. In the next chapter, this paper will explain the process and experiment of using a fuzzy algorithm. The next content will mention the operation screen of smart mobile devices. Finally, this thesis will put forward conclusions and contributions.

2  Literature Review

2.1 AIoT

According to Harry Henderson, Artificial Intelligence (AI) is a quest to create software or robotic systems that act in ways that most people would consider to require humanlike intelligence [13]. According to Wiley, the IoT encapsulates a vision of a world in which billions of objects with embedded intelligence, communication means, sensing, and actuation capabilities connect over Internet Protocol (IP) networks. The “things” in the IoT are the objects of everyday life, augmented with micro-controllers, optical radio transceivers, sensors, actuators, and protocol stacks suitable for communication in constrained environments where the target hardware has limited resources. This allows them to gather data from the environment and act upon it, thus giving them an interface with the physical world [14]. This is why we choose AI and the IoT as the basis of the technology to create a smart garbage system.

Research that combines AI and IoT technology is called the Artificial Intelligence of Things (AIoT). AI and IoT technologies are used to integrate data, knowledge, and intelligence. The IoT can provide data flows required by AI. The hope is that this smart garbage bin can map rooms independently without needing to be controlled by humans.

2.2 Edge Detection

Edges are significant local changes in a given image, and are remarkable features for analyzing images. Edges typically occur along the boundary between regions in a picture. Edge detection is frequently the first step in recovering information from images [15]. It is a technique of image segmentation that determines the presence of an edge or a line in an image, and outlines it in an appropriate way. In general, an edge is defined as the boundary pixels that connect separate regions with changing amplitude attributes of the image, such as different values of constant luminance and tristimulus in the image [16].

This paper uses the Canny edge detector, which is commonly used. It performs smoothing with a linear combination of exponential functions and then detects edges by higher-order derivative operators [17]. There are three main criteria to assess the Canny algorithm: a low error rate; good localization, which involves minimizing the distance between the detected edge pixels and actual edge pixels; and the minimal response, of only one detector response per edge [18].

2.3 Indoor Positioning System (IPS)

The localization of a device in an open space can be carried out with the global positioning system (GPS). Indeed, embedded GPS chips are used in such devices as mobile phones and tablet PCs. GPS can make it easy to locate things, but tracking the location of someone who is in an open space is difficult because of external factors. Researchers have investigated various ways to detect a person’s location in an enclosed space. The most suitable method in this regard is called the indoor positioning system (IPS).

The IPS is a system for locating objects in a room by using radio waves, magnetic fields, or other sensors obtained by mobile devices [19]. There are three kinds of position estimation techniques for the IPS. The first is triangulation, in which geometric calculation is used to find a position based on angles to the object from prior positions at either end of a line of known length. The second is trilateration, which is a crucial component of GPS-based estimation. It is a process to estimate the position of a mobile device given the positions of at least three other objects as well as their distances to the device. The third technique for position estimation is multilateration, which is commonly used to accurately track aircraft at airports by using time difference of arrival (TDOA) ranging. Multilateration uses range measurements of the “difference in the distance” between two or more reference devices. Multilateration involves transmitting signals from the reference devices at specific times [20].

3  Proposed System

3.1 System Architecture

Fig. 1 shows the system architecture used in this study. The architecture of the AIoT consists of three layers: a physical layer, a network layer, and an application layer.


Figure 1: System architecture

3.2 Hardware

3.2.1 NodeMCU

NodeMCU is an open-source firmware for the ESP8266 that uses the on-module flash-based SPIFFS file system, as show in Fig. 2. NodeMCU is implemented in C, and is layered on the SDK. It is a micro-controller like Arduino but has additional specifications, such as a Wi-Fi module, so that there is no need to add other modules to it.


Figure 2: NodeMCU

3.2.2 Ultrasonic Sensor

The ultrasonic sensor can detect the distance between itself and an object so that the user can determine or adjust this distance, as shown in Fig. 3. This sensor operates according to the reflection of waves from the given object. An ultrasonic sensor is used to detect the distance between the smart garbage bin and objects around it to prevent it from colliding with objects.


Figure 3: Ultrasonic sensor

3.2.3 Gas Sensor MQ4

Methane is a greenhouse gas produced by the decomposition of organic matter by anaerobic bacteria, when certain types of microorganisms decompose organic matter in the absence of air. It is also produced naturally during the decomposition of biomass. The MQ4 sensor is highly sensitive to methane, and is resistant to interference by alcohol and other gases, as shown in Fig. 4. Its range of detection is between 300 and 10000 ppm.


Figure 4: MQ4 gas sensor

3.2.4 Beacon Bluetooth Low Energy

Bluetooth low energy focuses on short-range communication, as shown in Fig. 5. The distance between wireless devices is influenced by many factors, including the place of operation, antenna design, and tool orientation. The power of transmission (Tx power) is generally measured in units of dBm, and is configured for a certain distance (−30 to 0 dBm). A higher transmission power increases the range of the transmitted signal but uses up more battery [21].


Figure 5: Beacon Bluetooth low energy

3.2.5 Logitech C505

Logitech C505 is a webcam with a resolution of 720 pixels and a long-range mic that supports clear and natural conversation up to several meters, as shown in Fig. 6. We used this web camera for edge detection because it produces a clear image and reduces noise in it, making it easier for the system to detect edges. The mic can capture sound up to 3 m away. In the future, it is hoped that the smart garbage bin can be controlled by voice commands alone.


Figure 6: Logitech C505

3.3 Software

3.3.1 System Design

Figs. 7 and 8 shows the system design used in this study. The first flowchart shows waste management, where the initialization of the sensor is an important step. The sensor reads the waste level and stores the data in the cloud, as shown in Fig. 7. The second flowchart, in Fig. 8, is a block diagram of the self-moving smart garbage bin. The most important parts of it are BLE mapping and the transmission of its exact location to the Android device. Data from the Android device, camera, and sensor are sent to the server until the smart garbage bin moves to the exact desired location, as shown in Fig. 8. We used room E315 of the Department of Electrical Engineering in the National Chin-Yi University of Technology as the mapping location for the smart garbage bin, as shown in Fig. 9.


Figure 7: Flowchart of sensing for waste management


Figure 8: Block diagram of self-moving smart garbage bin


Figure 9: Indoor mapping

Tab. 1 shows the conditions of the bin as the reference for this research. These parameters are used in a fuzzy method.


3.3.2 Arduino IDE

The Arduino IDE, or the Arduino Integrated Development Environment, software contains a text editor for writing code, a message area, a text console, a toolbar with buttons for trivial functions, and a series of menus. It connects to the Arduino hardware and uploads the data to facilitate communicate between devices. We use the Arduino IDE to easily code our NodeMCU.

3.3.3 Blynk

Blynk is a hardware-agnostic IoT platform with white-label mobile apps, private clouds, device management, data analytics, and machine learning. It combines a cloud platform with applications that put things, people, and data at the heart of business operations. The Blynk library can connect any hardware over the ethernet, Wi-Fi, GSM, 2G, 3G, and LTE.

4  Experiments

4.1 Fuzzy Method

We used the fuzzy logic architecture based on the mathematical model of MISO (multiple input single output) to calculate and analyze the variables. Fig. 10 shows the architecture used in this research. Two parameters were used as input: the percentage of waste and methane level. The output shows an ON/OFF notification. Each input was divided into the three categories mentioned in Tab. 1.


Figure 10: Architecture of fuzzy logic

Fig. 11a shows the fuzzy inference based on past research obtained using MATLAB. The result of fuzzy inference shows that if the bin was 50% full of waste and the methane level was 650 ppm (1 ppm=1 mg/l), the smart bin sent a notification to the relevant authorities. This calculation was in accordance with the provisions set. Fig. 11b shows the surface viewer obtained using MATLAB. This graph shows the relation among all variables used in this research. The higher the percentage of waste and the methane level were, the more likely was the notification to be turned to ON.


Figure 11: Graphical results of (a) fuzzy inference and (b) surface viewer

4.2 Canny Edge

In the smart garbage bin 315 experiment, four points of view were taken from various cameras as shown in Tab. 2. The image will be captured in the second frame rate unit, and the Canny filter will be applied to make it easier for the 315 smart bin to detect edges. According to this explanation, the smart bin 315 traveled toward the user by using BLE to make it easier for it to reach its destination without colliding with items surrounding it. This was accomplished using edge detection. According to the case shown in Tab. 2 scene 1, when the smart bin was called, it began identifying the edges by using a Canny filter and followed the path with the fewest lines. The smart bin was spun once so that it would memorize the corners of the room in a process akin to indoor mapping. As shown in Tab. 2 scene 2, the smart bin moved until it found the general user. The user then disposed of their trash in the smart bin, after which it reverted to mapping and edge detection, as shown in Tab. 2 scenes 3 and 4.

Edge detection is a basic problem in image processing and computer vision. The purpose of edge detection is to identify points with obvious brightness changes in digital images. Significant changes in image attributes usually reflect important events and changes in attributes. These include (1) discontinuities in depth, (2) discontinuities in surface orientation, (3) changes in material properties, and (4) changes in scene lighting. Edge detection is a research field in image processing and computer vision, especially in feature detection. Image edge detection greatly reduces the amount of data, and eliminates information that can be considered irrelevant, retaining the important structural attributes of the image.


4.3 Mathematical Model

After field surveys and multi-stakeholder discussions, we analyzed the smart garbage bin system in terms of its ability to determine the edges and its rate of waste disposal.

4.3.1 Rate of Waste Disposal

We calculated the weight of each recycling bin and organics in it to compute the amount of waste:

(WDWA)100%=DiversionRate (1)

In Eq. (1),

WD : weight of the disposed waste; and

WA : weight of all waste.

Because the smart garbage bin system separates waste,

(R1+O2R1+O2+G)100% (2)

In Eq. (2),

R1 : weight of recyclables;

R2 : weight of organics; and

G : weight of garbage

4.3.2 Edge Detection

Edge detection is a form of image segmentation used to detect the presence of an edge or line in an image and draw an appropriate outline of it. The major goal is to simplify visual data by reducing the amount of data that need to be processed.

f(x)=IrIl2(erf(x2σ)+1)+Il (3)

In Eq. (3),

f(x) : one-dimensional image;

Ir : intensity of the right side of the edge;

Il : intensity of the left side of the edge;

X : one edge equivalent to zero (0);

σ : blur scale of the edge; and

erf : error function.

5  Analyses of Experimental Results

The outcome of this research is a prototype of a smart garbage bin, called SB-315. This Android-based application can show the percentage of waste and level of methane in each garbage box. Fig. 12a shows the homepage of the smart garbage bin application. It has various features, such as a bell sound for a notification if the waste level exceeds the given threshold, a waste level button to see the level and percentage of waste, and a “Call SB-315” function for the user to call the smart garbage bin. Fig. 12b shows the page representing the level and percentage of waste in each box of the smart garbage bin. Level 1 is indicated in green, with the percentage of waste ranging from 0–20% of the total capacity of the box; level 2 is indicated in yellow, and represents a percentage ranging from 20%–50%; level 3 is indicated in red, and reflects a percentage of garbage above 50%. If the waste level reaches the red threshold, a notification appears on the home page. Level 3 notifications continue to run even if the smart garbage bin has been dispatched [2224].


Figure 12: Application design: (a) home page on mobile phone; (b) waste level and recycling capacity

The SB-315 prototype was constructed with two manual waste separations: one for recyclable waste and the other for non-recyclable waste. This smart garbage bin was designed to be as small as possible in order to fit through the narrow hallway of room 315. Fig. 13a shows that SB-315 has a height of 0.68 m, side width of 0.35 m, front width of 0.6 m, and a hole for a trash box of size 0.22 m. When the trash box is lifted and removed, this box has a height of 0.51 m, with a front width of 0.16 m and a side width of 0.23 m. Fig. 13b shows that this garbage box also has an ultrasonic sensor near the lid of each recyclables’ and non-recyclables’ box, so that when the bin arrives at the user’s location, the user simply needs to place their hand on the sensor to open the lid of the garbage box. The bin also has a camera on the front for edge detection.


Figure 13: Design of smart garbage bin: (a) front view, and (b) recyclables’ and non-recyclables’ boxes

6  Conclusions

This study developed a self-monitoring and self-moving smart trash bin for research room E315 of the Engineering Building of the National Chin-Yi University of Technology. The idea for this smart trash bin came about because of the activities of students at the lab. It uses the concept of the Artificial Intelligence of Things. The results of experiments showed that it functions well by using the fuzzy method and Canny edge detection. The main parameters of the system are the percentage of waste, obtained from the readings from an ultrasonic sensor, and the methane level, obtained from readings from an MQ4 gas sensor. This system is also connected to an Android device that can be used to call the smart trash bin through a Bluetooth beacon connection.

Now due to the outbreak of COVID-19, the method studied in this paper will effectively avoid direct or indirect contact between people. This method will directly avoid people's doubts about contact with trash cans and will also prevent COVID-19 from invading people's bodies through trash or trash cans. Therefore, the use of smart trash cans can prevent people from directly touching germs.

Acknowledgement: This research was supported by the Department of Electrical Engineering at National Chin-Yi University of Technology. The authors would like to thank the National Chin-Yi University of Technology, Takming University of Science and Technology, Taiwan, for supporting this research. We thank Cwauthors (www.cwauthors.com) for its linguistic assistance during the preparation of this manuscript.

Funding Statement: The authors received no specific funding for this study.

Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.


 1.  C. J. Chen, Y. Y. Huang, Y. S. Li, C. Y. Chang and Y. M. Huang, “An AIoT based smart agricultural system for pests detection,” IEEE Access, vol. 8, pp. 180750–180761, 2020. [Google Scholar]

 2.  F. Tan, Y. Wang, Y. Yang, L. Li, Tian Wang et al., “A ReRAM-based computing-in-memory convolutional-macro with customized 2T2R bit-cell for AIoT chip IP applications,” IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 67, no. 9, pp. 1534–1538, 2020. [Google Scholar]

 3.  W. T. Su, L. Y. Jiang, T. H. O, Y. C. Lin, M. H. Hung et al., “AIoT-cloud-integrated smart livestock surveillance via assembling deep networks with considering robustness and semantics availability,” IEEE Robotics and Automation Letters, vol. 6, no. 4, pp. 6140–6147, 2021. [Google Scholar]

 4.  T. C. Chiu, Y. Y. Shih, A. C. Pang, C. S. Wang, W. Weng et al., “Semisupervised distributed learning with non-IID data for AIoT service platform,” IEEE Internet of Things Journal, vol. 7, no. 10, pp. 9266–9277, 2020. [Google Scholar]

 5.  Y. H. Lai, T. C. Wu, C. F. Lai, L. T. Yang and X. Zhou, “Cognitive optimal-setting control of AIoT industrial applications with deep reinforcement learning,” IEEE Transactions on Industrial Informatics, vol. 17, no. 3, pp. 2116–2123, 2021. [Google Scholar]

 6.  H. Zhang, Y. Shu, W. Jiang, Z. Yin, W. Zhao et al., “A 55nm, 0.4V 5526-TOPS/W compute-in-memory binarized CNN accelerator for AIoT applications,” IEEE Transactions on Circuits and Systems II: Express Briefs, vol. 68, no. 5, pp. 1695–1699, 2021. [Google Scholar]

 7.  K. Wang, P. Xu, C. M. Chen, S. Kumari, M. Shojafar et al., “Neural architecture search for robust networks in 6G-enabled massive IoT domain,” IEEE Internet of Things Journal, vol. 8, no. 7, pp. 5332–5339, 2021. [Google Scholar]

 8.  L. Lei, Y. Tan, K. Zheng, S. Liu, K. Zhang et al., “Deep reinforcement learning for autonomous internet of things: Model, applications and challenges,” IEEE Communications Surveys & Tutorials, vol. 22, no. 3, pp. 1722–1760, 2020. [Google Scholar]

 9.  W. J. Chang, L. B. Chen, C. H. Hsu, C. P. Lin and T. C. Yang, “A deep learning-based intelligent medicine recognition system for chronic patients,” IEEE Access, vol. 7, pp. 44441–44458, 2019. [Google Scholar]

10. W. J. Chang, L. B. Chen and K. Y. Su, “Deepcrash: A deep learning-based internet of vehicles system for head-on and single-vehicle accident detection with emergency notification,” IEEE Access, vol. 7, pp. 148163–148175, 2019. [Google Scholar]

11. W. J. Chang, L. B. Chen, M. C. Chen, Y. C. Chiu and J. Y. Lin, “Scalpeye: A deep learning-based scalp hair inspection and diagnosis system for scalp health,” IEEE Access, vol. 8, pp. 134826–134837, 2020. [Google Scholar]

12. W. J. Chang, L. B. Chen, C. Y. Sie and C. H. Yang, “An artificial intelligence edge computing-based assistive system for visually impaired pedestrian safety at zebra crossings,” IEEE Transactions on Consumer Electronics, vol. 67, no. 1, pp. 3–11, 2021. [Google Scholar]

13. W. J. Chang, L. B. Chen, C. H. Hsu, J. H. Chen, T. C. Yang et al., “Medglasses: A wearable smart-glasses-based drug pill recognition system using deep learning for visually impaired chronic patients,” IEEE Access, vol. 8, pp. 17013–17024, 2020. [Google Scholar]

14. P. S. Chiu, J. W. Chang, M. C. Lee, C. H. Chen and D. S. Lee, “Enabling intelligent environment by the design of emotionally aware virtual assistant: A case of smart campus,” IEEE Access, vol. 8, pp. 62032–62041, 2020. [Google Scholar]

15. J. Zhang and D. Tao, “Empowering things with intelligence: A survey of the progress, challenges, and opportunities in artificial intelligence of things,” IEEE Internet of Things Journal, vol. 8, no. 10, pp. 7789–7817, 2021. [Google Scholar]

16. M. Hina, M. Ali, A. R. Javed, F. Ghabban, L. A. Khan et al., “SeFACED: Semantic-based forensic analysis and classification of e-mail data using deep learning,” IEEE Access, vol. 9, pp. 98398–98411, 2021. [Google Scholar]

17. F. L. Huang, Z. Z. Liao, T. H. Wang, Q. M. Chen, T. H. Wu et al., “Intelligent and disaster prevention hard hat based on AIOT and speeches recognition,” in Proc. 2019 Int. Conf. on Machine Learning and Cybernetics (ICMLCKobe, Japan, pp. 1–5, 2019. [Google Scholar]

18. Y. C. Hsu and R. C. H. Chang, “Intelligent chips and technologies for AIoT era,” in Proc. 2020 IEEE Asian Solid-State Circuits Conf. (A-SSCCHiroshima, Japan, pp. 1–4, 2020. [Google Scholar]

19. C. K. Wu, Y. He, K. F. Tsang and S. Mozar, “The IDex case study on the safety measures of AIoT-based railway infrastructures,” in Proc. 2020 IEEE Int. Sym. on Product Compliance Engineering-Asia (ISPCE-CNChongqing, China, pp. 1–4, 2020. [Google Scholar]

20. W. P. Ma, C. Y. Nian and H. Xu, “Application of AIoT in wireless image transmission to rotating machinery,” in Proc. 2020 3rd IEEE Int. Conf. on Knowledge Innovation and Invention (ICKIIKaohsiung, Taiwan, pp. 45–47, 2020. [Google Scholar]

21. J. W. Lai, “Opportunity and challenge of chiplet-based HPC and AIoT,” in Proc. 2021 Int. Sym. on VLSI Design, Automation and Test (VLSI-DATHsinchu, Taiwan, pp. 1–2, 2021. [Google Scholar]

22. W. S. Cheong, S. F. Kamarulzaman and M. A. Rahman, “Implementation of robot operating system in smart garbage bin robot with obstacle avoidance system,” in Proc. 2020 Emerging Technology in Computing, Communication and Electronics (ETCCEBangladesh, pp. 1–6, 2020. [Google Scholar]

23. T. M. N. Vamsi, G. K. Chakravarthi, P. Lanka and B. Divakar, “An IoT based smart garbage monitoring and disposal support system,” in Proc. 2021 5th Int. Conf. on Computing Methodologies and Communication (ICCMCErode, India, pp. 438–442, 2021. [Google Scholar]

24. A. Medehal, A. Annaluru, S. Bandyopadhyay and T. S. Chandar, “Automated smart garbage monitoring system with optimal route generation for collection,” in Proc. 2020 IEEE Int. Smart Cities Conf. (ISC2Piscataway, NJ, USA, pp. 1–7, 2020. [Google Scholar]

images This work is licensed under a Creative Commons Attribution 4.0 International License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.