**3. Proposed System**

#### *3.1. Proposed Solution*

Our main goal is to collect e-waste and send it for recycling in an efficient and automated manner. We are using the combination of the IoT and machine learning for gathering e-waste for recycling purposes. We will be placing the processing part of our system in a dumpster with the help of a Field-Programmable Gate Array (FPGA) using the GAN algorithm to distinguish the e-waste from other wastes. Our proposed solution entails the deployment of a smart bin to collect waste, which utilizes cloud-based technology

to monitor and update the garbage level automatically. If the bin reaches its maximum capacity, the SIM900A module generates a message alerting the collectors. Upon collection, we implement a process to separate the metallic and plastic components of the waste. The plastic components undergo a pyrolysis process to yield bio-fuel, while the metallic components are repurposed for solar panel and battery production.

#### *3.2. System Architecture*

The proposed system architecture is depicted in Figure 1. The system includes several steps aimed at effectively managing e-waste. The initial phase (step-1) involves the classification of wastes based on their type, which will be conducted by machine learning. Subsequently, e-waste is collected and deposited into a smart bin, and based on the trash level data, a data-driven decision-making process is implemented in Figure 2 to determine whether a notification should be sent to the trash collector. This process involves evaluating the trash -level data against predetermined thresholds, and if the data exceeds these thresholds, a notification is triggered and sent to the trash collector in step-2 and step-3.

**Figure 1.** System architecture of our proposed solution.

The cloud-based system is continuously monitoring the level of trash in the background. In step-4, the e-wastes are separated into two categories, plastic and metal. The metal waste is processed for solar batteries in step-8, while plastic waste is converted into bio-fuel using the pyrolysis process and we obtain bio-char as a by-product in step-9 and step-10. In the final step of the process, the repurposed and transformed wastes are converted into valuable assets.

Figure 2 illustrates a data-driven decision-making process for e-waste collection. Trash level data are continuously monitored using an ultrasonic sensor in the trash bin. This data are collected, enabling real-time analysis of e-waste levels. Based on the analysis, notifications are sent to e-waste collectors, prompting them to collect e-waste from specific bins. The collectors follow the notifications, collect the e-waste, and ensure proper recycling methods are employed. This data-driven process optimizes the collection efficiency and helps in the timely and targeted collection of e-waste, contributing to environmental sustainability and proper e-waste management.

Figure 3 is depicting three layers [23]. The sensor layer consists of a smart dustbin with an ultrasonic sensor that detects the level of trash inside the bin. The data collected from the sensors are sent to the cloud layer using the ESP-8266 Wi-Fi Module. The cloud layer receives the data from the sensor layer and stores it in a time series database. A time series database is designed to handle data that are collected over time, such as the trash level in the bin. The data stored in the time series database can be queried and analyzed to generate insights and predictions about the future. The Auto-regressive Integrated Moving Average algorithm is applied to the database to forecast the trash level for the future. The cloud layer also provides an interface for the user to view the trash level and other information in real time and send the value in the microcontroller. The user can access this interface through a web or mobile application. If the level of trash in the bin reaches a certain threshold, the microcontroller sends the notification using the GSM module to the application layer. The application layer receives the notification, and the collector collects the data after receiving it. The smart dustbin system uses a combination of sensors, cloud computing, and predictive algorithms to collect and analyze data about the trash level in the bin. These data are used to provide real-time notifications to the user and improve waste management processes.

**Figure 3.** System architecture of collecting and monitoring trash using cloud and IoT.

#### *3.3. Methodology*

Our working process entails a dustbin for e-waste. The waste will move along a conveyor belt, and in the initial section of the belt our processing part will be incorporated, featuring a trained camera with machine learning and a Generative Adversarial Network (GAN) algorithm. The GAN requires high computation power and memory resources [24]. A powerful, dedicated hardware platform such as FPGA provides the high computation power. There are two sections to the GAN, namely the discriminator and the generator.

We provide the dataset to the discriminator, and the generator monitors the waste and creates an image according to it. The generator and discriminator images are then compared, and if they match the waste will be thrown into the e-waste smart bin, while other waste will be deposited in a different pile. The smart bin contains an ultrasonic sensor, which sends waste-level data to the database in the cloud through an ESP8266 Wi-Fi module; each data point that is sent from the sensor to the time series database should include a timestamp and the trash level reading in Figures 6–8. The time series database will store these data and make them available for querying and analysis. To forecast the trash level, we are using the ARIMA model [25]. The forecasting can be used to optimize the system by predicting when the trash level will reach the threshold and scheduling pick-ups accordingly. This can help reduce costs and improve efficiency. If the garbage level exceeds a threshold value, a notification will be sent to the collector via the SIM900A GSM module, and it will be sent for recycling. In the recycling process, the e-waste is churned through a robust blade and separated into plastic and metallic parts using a magnetic field. The plastic parts will be sent for the pyrolysis process. In pyrolysis there are several steps:

As the plastic is already shredded, it will increase the surface area for improved pyrolysis. Shredded plastic is fed into a pyrolysis reactor. Pyrolysis is a type of thermal treatment that breaks down complex organic materials (plastic) into simpler compounds using heat in the absence of oxygen. The end products of pyrolysis are typically a liquid fuel known as pyrolysis oil or bio-oil and a gaseous mixture known as syngas, which can be used for various applications, such as energy generation and chemical production [26]. Since pyrolysis takes place in the absence of oxygen, the reactor is sealed to prevent air ingress. The reactor is heated to an elevated temperature. The temperature and pressure inside the reactor are carefully controlled to ensure that the plastic is efficiently converted into bio-fuel. When plastic is heated, it begins to decompose into components, such as gas, liquid, and char. Gases and liquids are condensed and collected as bio-fuel.

Once the pyrolysis process is complete, the reactor is cooled and the bio-fuel is recovered from the condenser. The collected bio-fuel may require further purification to remove impurities such as water and acids. This can be performed by methods such as filtration or distillation. Finished bio-fuel products are stored in tanks or containers until use. If any organic material is mixed with the plastic waste, such as bio-solids, the by-products of pyrolysis, bio-char, can be recycled and used in various applications, such as soil amendment, carbon sequestration, and energy production [15]. This product has shown notable advantages in eliminating pollutants from wastewater [27] and enhancing soil quality [28]. Moreover, we are using scrubber and electrostatic precipitators to control pollution [29]. Metallic waste can be used for making solar batteries. The process of converting metal churns from e-waste into solar batteries involves several steps: The shredded metal is treated with acid or other chemicals to extract impurities and separate the pure metals. The pure metals are then processed using electrolysis, which involves passing an electric current through a solution containing the metal ions. This process causes the metal ions to gain or lose electrons, resulting in the formation of metal deposits on electrodes. The metal deposits are then used to produce various components of a solar battery, including the anode, cathode, and electrolyte. These components are assembled to create a functional solar battery that can store and release energy. The exact process of converting metal churns into solar batteries can vary depending on the specific type of metal and the desired end product. However, in general, the process involves a combination of chemical and electro-chemical techniques to purify and refine the metal and then assemble it into battery components.

The technical aspects of our methodology are as follows: Data collection method:

Camera and machine learning: trained camera system with machine learning capabilities was used to monitor and capture images of the waste on the conveyor belt.

Ultrasonic sensor: the e-waste smart bin was equipped with an ultrasonic sensor to measure the waste level.

ESP8266 Wi-Fi module: the waste level data from the ultrasonic sensor were transmitted to a cloud database using an ESP8266 Wi-Fi module.

SIM900A GSM Module: when the garbage level exceeded the threshold, a notification was sent to the collector via a SIM900A GSM module.

Data analysis techniques: the ARIMA model was employed for forecasting the trash level.

#### *3.4. Flowchart*

In Figure 4, the flowchart describes the process of our IoT- and cloud-based e-waste management, starting with the aggregation of various types of waste. We utilize a trained camera, which has been trained with a GAN algorithm, for the classification of e-waste. Through image processing, it determines whether the waste is e-waste or not. If it is not e-waste, it is dumped in a different pile; otherwise, it is deposited in the smart bin. As ewaste is being disposed of, the waste level continues to increase; this increased level data are then updated in the cloud, and the system checks if the bin is full through an ultrasonic sensor. If it is not full, the process continues, or else a notification is sent to the collector. After collecting the e-waste, the recycling steps begin. It starts with churning the e-waste, followed by magnetic field separation. From separation, there are two parts—plastic and metallic churns. Plastic goes through pyrolysis and becomes bio-fuel, while metallic churns are processed for solar batteries. The process ends with the production of bio-fuel, with biochar as a by-product, and solar batteries, representing our system's effective transformation and the recycling of e-waste into sustainable and eco-friendly materials.

**Figure 4.** Flowchart of Proposed System.

#### *3.5. Algorithm*

For image processing, we are using the GAN, which is a very high-level algorithm. The accuracy of GAN algorithms for image processing is highly dependent on the specific use case and the techniques employed to train and optimize the model. Here, using GAN, the machine will be trained with real-life e-waste images and with the help of those images it will provide its decision. The pseudo code of the GAN algorithm is given below:

In Algorithm 1, the generator network G and discriminator network D are initialized with random weights. The hyper-parameters *α*, *β*, and *γ* are initialized. For a specified number of training iterations, the following steps are executed. For a specified number of discriminator updates per generator update, the following steps are executed. A minibatch of m real images from the dataset is sampled. A mini-batch of m noise samples from a noise distribution is sampled. Fake images are generated using the generator network G. The discriminator network D is updated by minimizing the binary crossentropy loss between the real images and the fake images, with the gradients computed using back-propagation. A mini-batch of noise samples from a noise distribution is sampled. The generator network G is updated by taking a gradient step on the loss function that maximizes the binary cross-entropy loss between the generated images and the real images, with the gradients computed using back-propagation. The hyper-parameters *α* and *β* are updated using a decay factor *γ*. The trained generator network G is returned.

#### **Algorithm 1** Image classification using Generative Adversarial Networks


16: **end for**

```
17: return the trained generator network G
```
We use generator and discriminator neural networks to train on a dataset of real e-waste images. The goal is to train the generator network to produce images that are indistinguishable from real images, while the discriminator network learns to distinguish between real and generated images. During training, the generator produces images to try and fool the discriminator, and the discriminator tries to become better at distinguishing between real and generated images. Once trained, the generator can generate new images, which can be evaluated by comparing them to real images. If they are similar, the waste can be disposed of in the appropriate destination dustbin.

Algorithm 2 is used to detect the level of e-waste in a smart dustbin and send a notification to the garbage collector when the dustbin is almost full. The input variables for this algorithm are *n* (the number of iterations), *x* (the echoP input), and *y* (the trigP input). The algorithm starts by initializing *x* and *y* with the echoP and trigP inputs, respectively. The threshold distance is set to 4, which is the maximum distance at which the smart dustbin can detect e-waste. The algorithm then puts e-waste in the smart dustbin and enters a loop that runs as long as n is not equal to 0. Inside the loop, the value of *y* is set to

0 or Low initially. Then, the algorithm runs for 10 iterations, and the value of *y* is set to 1 or High. After 10 iterations, *y* is again set to 0. The value of *x* is set to 1 or High.

The algorithm then calculates the distance between the smart dustbin and the e-waste using time and the speed of sound. The garbage level is calculated by subtracting the distance from the total dustbin distance. This information is sent to the cloud using ESP8266. If the distance is greater than or equal to the threshold distance, the algorithm sends a notification using the SIM900A GSM module to the garbage collector. Otherwise, the smart dustbin collects the e-waste.

**Algorithm 2** An algorithm for calculating the e-waste level in a smart dustbin

**Require:** *n* ≥ 0 *x* = *echoPin y* = *trigPin n* = *iteration thresholdDistance* = 4 Put e-waste in Smart dustbin **while** *n* = 0 **do** *y* ← 0 or Low **for** number of 10 iterations **do** *y* ← 1 or High **end for** *y* ← 0 *x* ← 1 or High *distance* <sup>←</sup> *time*×0.034 2 *garbageLevel* = *totalDustbinDistance* − *distance* - Send the distance and garbage level in cloud **if** *distance* ≥ *thresholdDistance* **then** Sent notification to garbage collector **else** Smart dustbin collects the e-waste **end if end while**

#### **4. Performance Analysis**

*4.1. Graphical Analysis of E-Waste Level Updates in Cloud*

Figure 5 depicts the updates of the garbage level in the cloud of a certain time period, where the initial level (at time = 1) was recorded as 28 cm, indicating an empty smart dustbin. As observed from the time axis (y-axis), the garbage level gradually decreased until it reached 9 cm at time = 8. At time = 9, the garbage level reached a threshold distance of 4 cm, after which it remained constant until time = 12. During this period, a notification was sent to the collector, who subsequently collected and emptied the e-waste from the smart bin. Following the trash collection, the garbage level increased and was recorded as 28 cm at time = 13.

**Figure 5.** Graphical analysis of e-waste level update.

Figures 6–8 illustrate the empty space available in the smart trash bin and the process of updating the corresponding values in the cloud for a certain period of time. The distance between the contents and the top of the trash bin indicates the level of empty space available. A greater distance corresponds to a higher amount of empty space, while a lesser distance corresponds to a lower amount of empty space.

**Figure 6.** E-waste level update information in cloud.

**Figure 7.** E-waste level update information in cloud with timestamp.

**Figure 8.** E-waste level update information in cloud showing in serial monitor.

#### *4.2. Accuracy Chart of GAN Algorithm*

We are using the GAN algorithm where we are dividing our dataset into training, validation, and testing sets. The training set is used to train the model, the validation set is used to tune the model's hyper-parameters, and the testing set is used to evaluate the model's performance on unseen data.

This accuracy chart in Table 3 shows the performance of an e-waste recognition system that uses the GAN algorithm. The chart shows the precision, recall, and F1-score for each category of e-waste that the system is designed to recognize: smartphones, laptops, televisions, monitors, and other, which includes all other types of e-waste.


**Table 3.** Accuracy Chart for E-waste Recognition System using GAN Algorithm.

In Figure 9, precision is a performance metric that measures the accuracy of a system in identifying relevant items. It quantifies the proportion of correctly identified items among the total items identified by the system. The precision is calculated as the ratio of true positives (items correctly identified) to the sum of true positives and false positives (items incorrectly identified). A high precision value indicates that the system is effective in accurately identifying relevant items. It signifies that the system has a low rate of falsely identifying unrelated items as the target item. In our example, a precision of 95% implies that the system has a relatively low rate of falsely identifying non-smartphone items as smartphones.

**Figure 9.** Precision of each category.

However, it is important to note that precision alone may not provide a complete picture of the system's performance. It should be considered in conjunction with other performance metrics, such as recall and the F1-score, to have a comprehensive evaluation of the system's effectiveness in identifying relevant items. This was considered in Figure 12. For instance, let us consider the example of a system that identifies smartphones among various items. The precision of the system in identifying smartphones is 95%, which means that out of all items identified as smartphones, 95% were actually phones. The remaining 5% could be items incorrectly classified as smartphones.

In Figure 10, recall serves as a performance metric that quantifies the completeness or comprehensiveness of a system in identifying relevant items. It is calculated by dividing the number of true positives (correctly identified items) by the sum of true positives and false negatives (items that were not identified as belonging to a particular category but should have been). Recall is particularly significant in situations where the consequences of false negatives are critical. By achieving a higher recall value, the system minimizes the chances of overlooking relevant items and provides a more comprehensive identification process.

For instance, consider a system designed to identify laptops among various objects. If the system achieves a recall of 85%, it indicates that out of all the actual laptops in the sample, 85% of them were correctly identified by the system. The remaining 15% represents the instances where the system failed to recognize laptops that were present.

A higher recall value suggests that the system is effective in capturing a larger proportion of the relevant items. It indicates a lower rate of false negatives, meaning that fewer items belonging to the target category are missed by the system. In our example, a recall of

91% signifies that the system has a relatively high ability to detect and include televisions in its identification process.

**Figure 10.** Recall of each category.

In Figure 11, the F1-score is a metric that encompasses both precision and recall to provide a comprehensive evaluation of the performance of a classification model. Precision and recall are both crucial aspects in assessing the effectiveness of such models. The F1-score offers a balanced measure by taking the harmonic mean of precision and recall.

**Figure 11.** F1-Score (%) of each category.

This choice is made because the harmonic mean assigns more weight to smaller values, ensuring that both precision and recall are given equal consideration. By considering both precision and recall in the F1-score, it provides a unified indicator of overall performance. It strikes a balance between the two metrics, giving equal importance to correctly identifying relevant items (precision) and capturing the full extent of relevant items (recall). The F1-score is particularly valuable when the class distribution is imbalanced or when both precision and recall are of equal importance. It offers a single value that represents the overall effectiveness of the classification model, allowing for easier comparison and decision making.

In Figure 12, the overall performance of the system is represented by the "Overall" row of Table 3. Here, P represents precision, R represents recall, and F represents the F1-Score. This row displays the key performance metrics, including the precision, recall, and F1-score. According to the table, the system achieves an overall precision of 90%, recall of 88%, and F1-score of 89%. These metrics provide a comprehensive assessment of the system's performance across all categories. With a precision of 90%, the system demonstrates a high level of accuracy in correctly identifying e-waste items. Similarly, the recall of 88% indicates that the system is effective in capturing a significant portion of the actual e-waste items present in the sample.

**Figure 12.** Overall performance of each category.

The F1-score of 89% is a balanced measure that combines precision and recall. It considers both metrics to provide an overall evaluation of the system's performance. This score indicates that the system maintains a good balance between precision and recall, achieving a harmonious trade-off between accurately identifying e-waste items, but may have some minor errors in specific categories.

### *4.3. Graphical Analysis of Pyrolysis Method*

Figure 13 shows the yield of bio-fuel from plastic waste using the pyrolysis method. The x-axis represents the temperature in degrees Celsius, while the y-axis represents the yield of bio-fuel as a percentage. The blue line shows the relationship between the temperature and bio-fuel yield. As the temperature increases, the yield of bio-fuel also increases. At a temperature of 300 °C, the yield is 20%, which increases to 50% at a temperature of 500 °C. This graph suggests that the pyrolysis method can be an effective way of producing bio-fuel from plastic waste and that higher temperatures can result in a higher yield of bio-fuel. The legend indicates that the red line represents the bio-fuel yield.

**Figure 13.** Yield of bio-fuel from plastic waste using pyrolysis method.

Table 4 [30] displays the results of the elemental analysis of mixed waste plastic pyrolysis liquid samples obtained from both thermal pyrolysis and catalyzed pyrolysis processes. The table shows the weight percentages of carbon (C), hydrogen (H), nitrogen (N), and sulfur (S) in the samples. The results indicate that the catalyzed pyrolysis process had a higher percentage of carbon and a lower percentage of hydrogen compared to the thermal pyrolysis process. Additionally, both processes showed similar percentages of nitrogen and sulfur in the pyrolysis liquid samples.


**Table 4.** Elemental analysis of mixed waste plastic pyrolysis liquid samples.
