SMART WASTE MANAGEMENT SYSTEM - ESP32


This Mini Project was constructed by:

1:   Faheem Haikal Bin Bakri                                                               212010890
2:   Azmin Izwan Bin Md Zaki                                                             212010878
3:   Choong Shao Herng                                                                      212010885
4:   Ilham Hakimy Bin Mohd Azaharin                                                212010897
5:   Anas Bin Abdul Aziz                                                                     212011441
    


1.0 Introduction




Smart Waste Management System - ESP32

    Smart waste management systems have emerged as a promising solution to tackle the issues associated with inefficient waste collection and disposal practices. These innovative systems harness technologies like data analytics, Internet of Things (IoT) sensors, artificial intelligence, and machine learning to oversee and streamline waste collection and disposal procedures. By delivering real-time data regarding waste levels, collection routes, and bin locations, these systems empower municipalities and waste management companies to enhance their operations, cut costs, and boost overall efficiency.

Furthermore, these systems yield environmental advantages by reducing the volume of waste destined for landfills, encouraging recycling and composting, and curtailing greenhouse gas emissions. In this project, a smart dustbin system was developed to alert garbage collectors only when the dustbin reaches capacity. The primary objective of this project is to optimize the efficiency of the garbage collection route and promote the 3R concept which is reduce, reuse, and recycle by ensuring that waste containers are consistently nearly full when collected. 



2.0 Objectives

  To design a smart waste management system that can implement the 3R (reduce, reuse, recycle) concepts.

  To create a system that can measure the capacity and weight of rubbish accurately and monitor by users easily.

  To implement the smart waste management system into an embedded platform which is ESP 32



3.0 Problem Statement 

    Because of population growth and rapid urbanisation, waste generation has skyrocketed, rendering traditional waste collection methods inefficient and costly. The most efficient way to deal with this massive amount of waste is through smart waste management using outdated waste collection methods. 

The traditional waste management system consists of waste collection trucks and their drivers who follow a predetermined route without checking the fullness level of the containers. Because this system cannot detect container fullness, half-full containers can be emptied while pre-filled containers must wait until the next collection period. 

 

4.0 Literature Review


4.1 An efficient waste management technique with IoT based smart garbage system

    M. Karthik, L. Sreevidya, R. Nithya Devi, M. Thangaraj, G. Hemalatha, R. Yamini (2021)  developed a waste management system that employing autonomous garbage level detection through an ultrasonic sensor. Real-time information is relayed using a PIC microcontroller to notify the bin collector when the waste bin reaches its maximum capacity. To enable wireless network connectivity, low-cost ESP32 Wi-Fi modules were integrated into the microcontroller units. The ESP32 Wi-Fi module is a system-on-a-chip with a 2.4 GHz range capability, featuring a 32-bit RISC processor running at 80 MHz and support for TCP/IP (Transfer Control Protocol). This module plays a pivotal role in executing IoT actions, equipped with 64 kilobytes of ROM, 520 kilobytes of RAM.

    The Wi-Fi unit facilitates IoT operations by transmitting data to a webpage accessible through an IP address. The Arduino microcontroller's ports seven and eight are connected to the TX and RX pins of the sensor. When the waste level reaches the threshold, an LCD displays the remaining percentage of the dustbin's capacity. The LED turns red when the dustbin is full and green when it is not at capacity.


4.2 Real-time smart garbage bin mechanism for solid waste management in smart cities

    Dominic Abuga and N.S Raghava (2021) identified numerous drawbacks in traditional garbage collection and management systems, including data inaccessibility, low throughput, and delayed unloading. In response, they devised a real-time smart garbage bin system to manage solid waste effectively in smart cities. 

    Their proposed Smart Garbage Bin Mechanism (SGBM) comprises three key components: the Smart Garbage Bin (SGB), the Garbage Collecting Vehicle (GCV), and a Centralized Database (CDB). The SGB serves as an intelligent node for waste storage in both public and private areas within the city. It transmits essential information to the Centralized Database, specifically the Smart Garbage Bin Level (SGBL) indicated as a percentage.

    The GCV plays a crucial role in transporting SGBs across smart cities along the most efficient routes. It operates in close coordination with the database, receiving notifications about SGBs that have surpassed the 75% threshold, signifying they are ready for unloading and recycling. Upon receiving this signal, the GCV transports these SGBs to designated recycling sites.

    The Central Database also functions as an information hub, housing comprehensive data on SGB attributes such as levels, color, weight, and identification. The system's architecture follows a three-tier structure, including the lower tier with sensor nodes like the Arduino Mega 2560, Ultrasonic sensors (HC-SR04), and weight sensors (SEN-10245SEN-10,245). The middle tier hosts the gateway, while the upper tier houses the CDB, integral to system optimization.

    The CDB continuously receives updates from the SGBs, storing data on the status of solid waste through various gateways after establishing a stable connection with the server. This data is then analyzed, and optimal routes for the GCV are determined using a linked optimization model. The system provides a limited Graphic User Interface (GUI) accessible to city residents and system administrators, tailored to their respective roles.


4.3 IoT based sustainable smart waste management system evaluation using MCDM model under interval-valued q-rung orthopair fuzzy environment


According to Sukran Seker (2022), The significance of IoT in municipal waste management, particularly concerning sustainability factors encompassing economic, social, and environmental aspects, cannot be overstated. In anticipation of future advancements and environmental sustainability, the choice of the most suitable smart technology for waste collection can have enduring consequences.

    In this context, the author undertook an evaluation of IoT-based smart waste collection systems, considering uncertain parameters. This evaluation incorporated a modified Entropy measure and a Multi-Criteria Decision-Making (MCDM) approach, tailored for the local municipal in Istanbul. To address the inherent uncertainty and ambiguity inherent in decision-making processes, Interval-valued q-rung 
orthopair fuzzy sets (IVq-ROFSs) were employed.

    Ultimately, the waste collection system developed through the integration of RFID, GIS, and GPRS emerged as the most fitting IoT-based smart waste collection system for municipal use.



5.0 Methodology






Block Diagram - Methodology


Firstly, the system will detect the weight and percentage of waste and using ultrasonic sensor and weight sensor (load cell). The LCD display will then display the percentage of waste using the data given by the two sensors. The buzzer will activate only when the weight is more than 180 grams, and the percentage of waste is over 70 %.

The reason for adding the weight sensor is to prevent waste blockage of the ultrasonic sensor sending wrong data to the user. The ultrasonic sensor only triggered when the object weight is bigger than 180grams. By add the weight sensor, this error can be avoiding even the ultrasonic sensor is triggered but the weight sensor isn’t. Instead, the LCD display will show ‘Low capacity’. In order for the LCD display to show the percentage of weight, the weight sensor and the ultrasonic sensor need to be both triggered. Moreover, the buzzer will only be activated when the weight is exceeding 180 grams, and the percentage is higher than 70%.

 Firstly, the power source 5v will provide the needed power supply to the system for the components to starts working. Once the ESP32 receive the voltage supply, it will power the weight sensor and ultrasonic sensor to receive data. And send it back to itself to do further processing tasks. After processing the data, the ESP32 will send the calculated data to LCD to display and decide the activation of the buzzer.




Flow Chart-Methodology



The system flows are stated as Figure flow chart above. First, the system will be started by reading the weight of the waste. If the weight of the waste is less than 180g, the ESP32 will ignore the data from the ultrasonic sensor and directly command the LCD to display ‘Low capacity’. If the weight of the waste is more than 180g, the ultrasonic sensor will be activated and read the distance. After the ultrasonic sensor collected the data, the weight and distance measured will be send to ESP32 for further calculated and processing. The processed data will be display on the LCD display, weight and percentage of waste. If the percentage of waste is higher than 70%, the ESP32 will activate the buzzer as the second output.


5.1 Hardware development.

List of Components Used:
  1. ESP32 development board
  2. Ultrasonic sensors
  3. LCD Display Screen 16x2 L2C
  4. power supply
  5. Buzzer
  6. weight sensor

Put together the devices following the schematic diagram provided below:




Circuit design on a Breadboard


Hardware Setup Configuration:

the ESP32 serves as the central component, interconnecting all elements on a breadboard. It takes charge of controlling and analyzing signals from the DT and SCK ports in the HX711 amplifier module, connected to ports D7 to D8, and the positive connection to the 5V power port. Subsequently, the ESP32 makes decisions and triggers the activation of the ultrasonic sensor HC-SR04, linked to Digital Input Output (I/O) ports D5 and D6, which encompass signal processing. The resulting data is displayed on the LCD screen.

The HX711 amplifier functions as a breakout board facilitating the measurement of weight using load cells. Wire connections are established between the load cell wires and the microcontroller as shown in Table 3.2. The load cell wires can be directly soldered to the E+, E-, A-, and A+ pins.
The HC-SR04 ultrasonic sensor employs sonar technology to gauge distances from objects, covering a range from 2cm to 400cm (0.8 inches to 157 inches) with an accuracy of 0.3cm (0.1 inches). This particular module comprises both ultrasonic transmitter and receiver components. Wire connections are connected as shown in Table 3.3.

The 16x2 Liquid Crystal Display (LCD) incorporates data pins, such as VSS, VOD, VEE, RS, RW, E, and D0~D7. These pins are connected to all pins of the LCM 1602 I2C, facilitating a simplified connection to the breadboard and ESP32, reducing the number of pins from 16 to 4. Four primary pins from the LCM 1602 I2C include GND, VCC, SDA, and SCL. GND and VCC are linked to the breadboard, ensuring proper voltage at +5V for effective program execution, scanning, and control. SDA and SCL (Serial Data and Serial Clock) enable the transfer of data in message form, segmented into data frames as shown in Table 3.4. Each message encompasses an address frame with the slave's binary address and one or more data frames containing the transferred data. This functionality allows the LCD panel to display essential data such as weight and percentage.

The buzzer is installed to the D3 pin of the ESP32 as shown in Table 3.5 to address two key conditions: when the measured weight within the waste bin exceeds 180 grams and when the calculated waste percentage surpasses the 70% threshold. The buzzer, functioning as an audible indicator, plays a pivotal role in this innovative system. When triggered, it serves as a real-time notification mechanism, alerting waste management personnel to take immediate action when specific predefined thresholds are met.






complete hardware setup



To further enhance our Smart Waste Management System, we placed all the properly installed components into a decorated prototype.




5.2 Software Development


#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <HX711.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change the I2C address to your LCD's address
const int trigPin = D6; // Trigger pin of the HC-SR04 connected to D1
const int echoPin = D5;// Echo pin of the HC-SR04 connected to D2
#define BUZZER_PIN D3
HX711 scale;
float calibrationFactor = -100000.00 / 100000000;
const int dustbinHeight = 17; // Height of the dustbin in cm
void setup() {
lcd.init(); // Initialize the LCD
lcd.backlight(); // Turn on the backlight
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(BUZZER_PIN, OUTPUT);
Serial.begin(115200);
// Initialize the HX711 module with data pin D7 and clock pin D8
scale.begin(D7, D8);
39
scale.set_scale(); // Set the scale to 1
scale.tare(); // Reset the scale to 0
}
void loop() {
long duration;
int distance;
// Send a 10us pulse to trigger the HC-SR04
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Measure the pulse duration from the echo pin
duration = pulseIn(echoPin, HIGH);
distance = duration * 0.0343 / 2;
// Read weight from the load cell (maximum 1 kg)
float weight = scale.get_units(10); // Read weight data, averaging over 10 readings
weight = weight * calibrationFactor;
40
// Calculate the percentage of waste based on the distance, limiting it to 100%
float percentage = 100 - ( (static_cast<float>(distance) / dustbinHeight) * 100 );
if (percentage > 100) {
percentage = 100; // Limit to 100% max
}
if (percentage < 0) {
percentage = 0; // Limit to 0% min
}
if (weight < 0) {
weight = 0; // Limit to 0 g minimum
}
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
Serial.print("Weight: ");
Serial.print(weight);
Serial.println(" g");
Serial.print("Percentage: ");
Serial.print(percentage);
Serial.println("%");
41
// Display the information on the LCD
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Weight: ");
lcd.print(weight);
lcd.print(" g");
lcd.setCursor(0, 1);
// Check if the weight is below 180g to indicate "Low Capacity"
if (weight < 180) {
lcd.print("Low Capacity");
} else {
lcd.print("Waste : ");
lcd.print(percentage);
lcd.print("%");
}
if (percentage > 80 && weight > 180) {
digitalWrite(BUZZER_PIN, HIGH);
} else {
digitalWrite(BUZZER_PIN, LOW);
}
delay(500); // Delay for readability
}


5.2.1 Summary of The Code:

The Smart Waste Management System operates effectively as programmed, offering an innovative approach to waste collection in urban environments. The system distinguishes between low-capacity and waste that exceeds 180 grams, and it utilizes the ultrasonic sensor to determine the waste percentage based on the lid-to-waste distance. This dynamic display, ranging from 0% to 100%, ensures users receive accurate information without negative weight values. The integrated buzzer provides an auditory alert when both the weight and percentage exceed the predefined thresholds, enhancing the system's utility.




6.0 Result and Discussion

The measured data were displayed in the serial monitor of Arduino IDE Software as programmed is shown below:



Displayed data in the serial monitor.

First, no object is placed on top of the cardboard platform to demonstrate waste that are light weight, the result is no percentage is display and the buzzer is off. Instead, the LCD will display ‘Low capacity’ as shown in below. Secondly, a known weight that is exceeded 180g is placed on top of the platform and an object is placed far in front of the ultrasonic sensor to demonstrate waste that is weighted over 180g but small in size. The LCD will display the weight of the object and the percentage of dustbin based on the distance between the ultrasonic sensor and the reflected object, result is shown in below. Lastly, the distance between the object and the ultrasonic sensor is reduce as shown in below to demonstrate the high capacity of waste in the dustbin, resulting to activate the buzzer if the percentage is higher than 70%.




No weight placed on the platform, display ‘low capacity’






Display the weight of object and percentage.








Display the weight of object and different percentage and activate the buzzer.




7.0 Video Demonstration

Below is our Mini Project's Video Presentation:






8.0 Conclusion

In conclusion, this project, which encompasses the objectives of designing a smart waste management system focusing on the 3R concepts, creating a system for accurate rubbish measurement, and implementing it on the Arduino platform, highlights the importance of ensuring each objective is meticulously executed. The successful interconnection of devices, the creation of a functional model, and the prototype development are all crucial steps in achieving the desired outcome. The seamless execution of each stage ensures a flawless and efficient operation of the Arduino-based smart waste management system.

In summary, this project not only serves as a significant learning opportunity for Diploma Electronic students but also lays a solid foundation for further exploration of electronic devices and sensor, device interconnection using Arduino, and smart waste management systems in future studies. By achieving the set objectives, this project paves the way for a more sustainable and environmentally conscious future, promoting the principles of reduce, reuse, and recycle through innovative technology.





9.0 Future Work

In the realm of our Smart Waste Management System project, our vision for the future encompasses several key areas that we intend to focus on. First and foremost, we plan to enhance the bin's sensor technology using multiple ultrasonic sensors allowing it to detect waste more accurately and efficiently. Furthermore, we aim to establish a robust connectivity infrastructure, enabling real-time data transmission to a centralized system for monitoring and management. Our goal is to implement a user-friendly mobile app that allows users to track the dustbin's status, receive notifications when it's full, and even schedule waste pickups. We also intend to work on sustainability aspects by incorporating energy-efficient components and materials, as well as exploring the possibility of utilizing renewable energy sources for the smart dustbin's operation for example using solar energy as power supply. Ultimately, our future work for the Smart Waste Management System project is geared towards creating a more intelligent, connected, and eco-friendly waste management solution that will contribute to a cleaner and smarter environment.
















Comments