A Final Project on “Smart Waste Management System Based On A IoT Platform” was submitted by Nikhil S Ambigar (from the Indian Institute of Information Technology,(IIIT) Dharwad, India) to extrudesign.com.
Many metropolitan cities produce tons of waste every day, so efficient methods for collection and disposal are crucial. To make people’s lives happier, safer, and healthier we developed an IoT prototype. The Internet of things (IoT) plays a vital role in connecting human life with machines and the internet.
We developed a collection management system by fixing our prototype onto the dustbins, and now they can be called Smart Bins. Our IoT prototype consists of a sensor, microcontroller, and a Wi-Fi module. It collects data from sensors and passes it to the cloud via the internet. It measures the filled levels of the waste bins, if the bins are full then it sends an alert message to the organization/controller stating “Bin is completely filled” and it also predicts the future levels of the bin.
Keywords: Internet-Of-Things (IoT), Smart waste management, Thingspeak, Machine learning, Future prediction.
In the 20th century, there is a huge advancement in technology. Internet of things or IoT for short is one of the rapidly increasing technology, IoT changes everything around us in day-to-day life. It plays a major part in developing a smart city. Kevin Ashton “the father of the IoT” believed that IoT could turn the world into data that could be used to make decisions on resource utilization and management.
One of the major hurdles in most cities is its waste management, and effective management of the waste produced becomes an integral part of a smart city. On average every Indian produces around .5 kg of waste daily. Nearly 1.5 lakh metric tons of waste are produced every day. And it has become a fundamental reason for an increase in pollution.
We propose a smart waste management system using IoT. Our model collects data from the garbage bin, sends the data to the cloud, the garbage trucks can be directed to only those garbage bins that need to be cleared. Our work ensures proper garbage collection takes place and the trucks do not waste time visiting the garbage bins that are not filled. We even use a future prediction algorithm to predict the Future levels of the bin. Waste can be monitored efficiently, and we get proper statistical models indicating the filled levels to ensure waste management.
2. REVIEW OF LITERATURE
Memon S. K  proposed a smart waste management system in which they are collecting the data from ultrasonic sensors and writing the data to the thing speak channel using the Wemos D1 mini (it is like a little Arduino with a Wi-Fi module). Their work is only limited to glowing the led in the thing speak channel on reaching the threshold value, or in other words glowing the led when the bin gets filled. Our proposed work not only glows the led on reaching the threshold but also sends a mail alert to the municipal corporation and it is capable of predicting the future levels of the bin.
Aaditya Jain  implemented a model of smart waste management by using an ultrasonic sensor, for detecting the distance between waste and the lid of the bin and also used a force sensor to calculate the weight of the bins. The use of force sensors is impractical as waste can be of low weight or even heavyweight.
M H A Wahab et al. have suggested the concept of ‘Smart Recycle Bin’ with the help of RFID tags, to identify the person throwing the garbage. RFID-based systems are not possible, as we cannot provide each person with RFID tags and they cannot carry them every time they go on to dispose of waste into a garbage bin. In this model, they are not transferring the data to the cloud.
Haribabu  implemented a smart waste management model by using an ultrasonic sensor, Arduino, and a GSM module. The use of GSM module and sim-card for all dustbins becomes costlier.
We proposed an intelligent management system, The paper is organized in the following manner. Proposed work is covered in Section-3 which consists of hardware development, flowchart, and future prediction. Results are covered in Section-4 and Conclusion in Section-5.
3. PROPOSED WORK
We propose a smart waste management system by developing an IoT prototype that collects data(filled level) from the sensors and passes it to the thing speak cloud via the internet for storage and processing purposes. Our module collects data every hour and passes it to the cloud. Every day the organization/controller receives the update about the filled levels of the dustbins. One key feature is we implemented future predictions based on the previous data. Based on the historical data we can say at what instance of time the dustbin gets filled on a particular day. Fig-1 shows the system architecture and its components are briefly described below:
- Sensors: We used an ultrasonic sensor(HC-SR04) which is used for calculating the distance between the object and the sensor. In our scenario, an ultrasonic sensor calculates the distance between the lid of the bin and the waste. It uses sound waves for calculating the distance. It ispower efficient as it consumes less power for sensing the data and forwarding it to a microcontroller.
|Sensing range||2cm – 400cm|
|Response Time||50ms to 200ms|
- Microcontroller(Arduino Uno): Arduino Uno is a cost- efficient microcontroller board that is based on an ATmega328p, and is used for serial communication.
|SRAM & EEPROM||2KB & 1KB|
|Digital, Analog pins||14, 6 pins|
- Esp8266 module-1: Esp8266 is a wireless transceiver module that accepts data from the microcontroller and passes it to the cloud via the internet withthe help of Wi- Fi.
|Wi-Fi standards||802.11 b/g/h|
|Packets||TCP and UDP|
|Encryption||Up to WPA2-PSK|
- Database: Thingspeak is used as a database for storing data collected from the sensors.
A. Hardware development
Hardware plays a vital role, so proper wiring, coding the circuit is essential. Firstly, we need to set up the cloud part as cloud write API keys and channel id are required while programming the esp8266 module.
Thingspeak is an open-source free cloud service. It can be used for storing, analyze, and triggering.
Fig-2 is a flow chart for creating Thingspeak channel
After successfully creating a channel we can observe an interface as shown in Fig-3.
1. Programming ESP8266 Module:
The esp8266 module from the market comes with execution mode, so we need to configure it to programming mode before uploading code to it. For doing so, we need to connect the reset pin of esp8266 to the push button and name that push-button a reset button and connect GPIO0 of esp8266 with another push button and name it as a flash button. Connect the ground of esp8266 with the ground of Arduino, Rx of esp with Rx of Arduino, Tx of esp with Tx of Arduino, enable pin to 3.3V, and Vcc to 3.3V.
And then we need to follow the below-mentioned steps to configure it to programming mode:
Step1: Press the flash button and hold it
Step2: Press the reset button once
Step3: Release the flash button.
Note: Esp8266 module-1 works on 3.3v, 5v volts will damage your module.
We are using Arduino IDE for uploading code to esp8266.To program the esp module using Arduino software we need to change the board to generic ESP8266 and also download the esp8266 library.
Then we need to write a program, compile and upload it.
2. Programming Smart waste management module:
We need to wire up the circuit as shown in Fig-4.
After wiring it up we need to upload the code using Arduino ide, before uploading the code make sure that the board is selected as Arduino Uno.
After successfully compiling and uploading, our module is ready to fit on any of the bins.
We fixed our module onto the Dustin in such a way that the ultrasonic sensor is placed at the lid of the bin and we can notice it in Fig-7.
After fixing our module onto the dustbin we need to open the serial monitor to observe the distance detected by the ultrasonic sensor. Arduino Unoconverts the sensed data to serial data and is passed to esp8266. Then esp8266 checks the wifi connection status, if it’s connected it will write the data to the thingspeak channel. If it’s not connected it will wait until the connection is built. Based on the data written to the thingspeak channel, we analyze it if we get true on our condition specified then we will trigger a mail to the municipal corporation/workers/controlling authorities
B. Flow Chart:
C. Future Prediction:
We used machine learning to build future predictions. As the name machine learning, it suggests the machine learns from the data, and further, the trained model can be used for predicting the future. Machine learning is defined as the science of training machines without being explicitly programmed. Fig-8 shows the block diagram for building a machine learning model.
To train the model we require data, as our sensed data is stored in the thingspeak channel we can download data from the thingspeak channel dashboard.
Our dataset consists of 5 columns and they are as follows: Sl-no, Date, Day, Time, and Empty level (in cm).
We should train our model in such a way that in the future, a model should be capable of predicting the empty levels by taking Date, Day, and Time as input.
The downloaded dataset from thingspeak needs to be preprocessed in such a way that it should be filled and it shouldn’t contain NaN values in any row/column.
Data preprocessing includes statistical analysis of the dataset and we can notice that in Fig-9. Before training the ML model we should convert data types of the features to float types.
Choose a model:
Based on the feature set and behaviour of our data we choose a model. Fig-10 shows the correlation of our dataset and we can notice that the features are completely independent of one another. So, we can’t use a linear regression model and we instead used Decision tree classifiers, K-th nearest neighbour’s (KNN) to train our model.
Train the model:
To train the machine learning model we divide the dataset into two types, and they are Train set (80% of the dataset) and Test set (20% of the dataset). We train our model by using a train set and calculate its accuracy, errors by using a test set.
As already the models are implemented there is no need of coding them from scratch, we can instead import them and use them for training by using the .fit() method.
Fig-11 shows the accuracy, MSE, and R2 score of the Decision Tree Classifiers and K-th Nearest Neighbor’s (KNN). So we can say that the Decision Tree classifier is the best model for future prediction with an accuracy of almost 80%.
|Model||Accuracy||Mean Square Error (MSE)||R2 score|
|Decision Tree Classifiers||77.51%||2.34||0.769|
|K-th Nearest Neighbor’s (KNN)||24.90%||9.07||-0.86|
We predict the future by using the trained tree model, to do so we make use of the .predict() method.
The working prototype of the proposed system is observed over the ThingSpeak platform in different scenarios. In each case, the data being observed is according to the empty level status of the dustbin. We receive data and by computing it through the thingspeak channel we receive further recommendations such as we set a threshold limit as 15 cm if the dustbin gets filled more than 15 cm then we receive an indication, A green LED light starts blinking, which states that we should empty the bin.
In fig12 as we see the plot between the empty level of the bin vs time. Initially, the bin is empty, the indicating level is 29.54 cm. The LED does not glow. The graph indicates the level of the bin and at what time after some time we start filling the bins the empty level of the bin keeps on decreasing. As seen Fig 13 is indicating. The plot shows the bin level of 13.64 cm then the green LED keeps blinking suggesting that the bin should be emptied.
Each bin has a unique channel id, if we open a channel id in the thingspeak website then we can see the location of the bin as shown in Fig-14
The municipal corporation receives a mail suggesting that the bin needs to be emptied including date and time as shown in Fig-14 and also by the use of channel id we can find the location of the bin through thingspeak.
Our work describes the hardware development, setting up of the cloud service, implementation in real-time, future prediction. Our module is cost-efficient, accurate, and is intelligent enough to make decisions on its own. We use ultrasonic sensors to detect bin level and send the data to ThingSpeak using the ESP8266 module where data is further processed for action. Even we predict the future using future prediction algorithms. The collected data is saved for further use. This system can be used to automate the waste collection of the entire city.
- Memon, S. K., Memon, A. R., & Memon, A. A. (2020). Smart Garbage Bin: An IoT Platform for Smart Waste Management System in Pakistan. 2020 3rd International Conference on Computing, Mathematics and Engineering-Technologies-(iCoMET). doi:10.1109/icomet48670.2020.9074108
- Shyam, G. K., Manvi, S. S., & Bharti, P. (2017). Smart waste management using Internet-of-Things (IoT). 2017 2nd InternationalConference on Computing and Communications Technologies (ICCCT). doi:10.1109/iccct2.2017.7972276
- Folianto, F., Low, Y. S., & Yeow, W. L. (2015). Smart bin: Smart waste management system. 2015 IEEE Tenth International Conference on Intelligent Sensors, Sensor Networks and Information Processing (ISSNIP). doi:10.1109/issnip.2015.7106974
- Jain, A., & Bagherwal, R. (2017). Design and implementation of a smart solid waste monitoring and collection system based on the Internet of Things. 2017 8th International Conference on Computing, Communication and Networking Technologies (ICCCNT). doi:10.1109/icccnt.2017.8204165
- M. H. A. Wahab, et.al, “Smart Recycle Bin: A Conceptual Approach of Smart Waste Management with Integrated Web Based System,” International Conference on IT Convergence and Security (ICITCS), 2014, Beijing, 2014, pp. 1-4. doi: 10.1109/ICITCS.2014.7021812
- Haribabu, P., Kassa, S. R., Nagaraju, J., Karthik, R., Shirisha, N., & Anila, M. (2017). Implementation of a smart waste management system using IoT. 2017 International Conference on Intelligent Sustainable Systems (ICISS). doi:10.1109/iss1.2017.8389367
- ESP8266 module-1 https://www.microchip.ua/wireless/esp01.pdf
- “Arduino-Introduction”.Arduino.cc https://www.arduino.cc/en/guide/introduction
- Thingspeak cloud https://in.mathworks.com/help/thingspeak/collect-data-in-a-new-channel.html
Credit: This Project “Smart Waste Management System Based On A IoT Platform” was completed by the following students from IIIT Dharwad, India.