Anna University::Chennai - 600025: TEAM ID: PNT2022TMID25602
Anna University::Chennai - 600025: TEAM ID: PNT2022TMID25602
Anna University::Chennai - 600025: TEAM ID: PNT2022TMID25602
TEAM SIZE : 4
TEAM ID : PNT2022TMID25602
1
PNT2022TMID25602
Project Report
Team ID PNT2022TMID25602
Project Name Smart waste management
system for metropolitan cities
1. INTRODUCTION
With the increasing population and industrialization of nations throughout the globe,
waste has become a great concern for all of us. Over years, researchers figured that only
waste management is not enough for its proper treatment and disposal techniques to
preserve our environment and keeping it clean in this era of globalization. With the help of
technology researchers have, introduced IoT based Smart Waste Management solutions and
initiatives that ensures reduced amount of time and energy required to provide waste
management services and reduce the amount of waste generated. Unfortunately, developing
countries are not being able to implement those existing solutions due to many factors like
socio-economic environment. Therefore, in this research we have concentrated our thought
on developing a smart IoT based waste management system for developing countries like
INDIA that recycling of
household waste with the minimum amount of resources being available
1.2 Purpose:
Waste management has become an alarming challenge in local towns and cities across the
world. Often the local area bins are overflowing and the municipalities are not aware of it. This
affects the residents of that particular area in numerous ways starting from bad odour to
unhygienic and unsafe surroundings. Poor waste management - ranging from non-existing
collection systems to ineffective disposal -causes air pollution, water and soil contamination.
Open and unsanitary areas contribute to contamination of drinking water and can cause infection
and transmit diseases. Toxic components such as Persistent Organic Pollutants (POPs) pose
particularly significant risks to human health and the environment as they accumulate through the
food chain. Animals eating contaminated plants have higher doses of contaminants than if they
were directly exposed. Precipitation or surface water seeping through waste will absorb hazardous
components from landfills, agricultural areas, feedlots, etc. and carry them into surface and
groundwater. Contaminated groundwater also poses a great health risk, as it is often used for
drinking, bathing and recreation, as well as in agricultural and industrial activities. Landfills and
waste transfer stations can attract various pests (insects, rodents, gulls, etc.) that look for food
from waste. These pests can spread diseases through viruses and bacteria (i.e., salmonella and e-
coli), which are a risk to human health.
2.2
Paper 1
PAPER 2:
AUTHOR NAME: Mohammad Aazam, Marc St-Hilaire, Chung-Horng Lung, Ioannis
Lambadaris
PUBLICATION YEAR: 2016
DESCRIPTION:
Each bin in the Cloud SWAM system that Mohammad Aazam et al suggested has sensors
that can detect the amount of waste inside. There are separate bins for organic,
plastic/paper/bottle/glass, and metal waste. This way, each form of waste is already divided, and
it is known how much and what kind of waste is collected thanks to the status. Different entities
and stakeholders may benefit from the accessibility of cloud-stored data in different ways.
Analysis and planning can begin as soon as garbage is collected and continue through recycling
and import/export-related activities. Timely garbage collection is provided via the Cloud SWAM
system. A timely and effective method of waste
disposal.
Paper 3:
TITLE: Arduino Microcontroller Based Smart Dustbins for Smart Cities
AUTHOR NAME: K. Suresh, S. Bhuvanesh and B. Krishna Devan
PUBLICATION YEAR: 2019
DESCRIPTION:
In this paper, a technique for cleaning up our surroundings and environment is described.
The Indian government just began work on a smart city initiative, and in order for these towns to
be smarter than they already are, the garbage collection and disposal system must be improved
upon. Self-Monitoring Automated Route Trash (SMART) dustbins are intended for use in smart
buildings such as colleges, hospitals, and bus stops, among other places. In this study, we have
employed the PIR and Ultrasonic sensors to detect human presence, the Servomotor to open the
dustbin lid, and the Ultrasonic sensor to detect the level of rubbish. Signals between two trash
cans are transmitted using a communication module, and the GSM module sends the message to
the operator.
PAPER 4:
AUTHOR NAME: Mohd Helmy Abd Wahab, Aeslina Abdul Kadir, Mohd Razali Tomari and
Mohamad Hairol Jabbar
PUBLICATION YEAR: 2014
DESCRIPTION:
Proposed a smart recycle bin that can handle the recycling of plastic, glass, paper, and
aluminium cans. It generates a 3R card after automatically determining the value of the trash
thrown away. The recycle system makes it possible to accumulate points for placing waste into
designated recycle bins. By allowing the points to be redeemed for goods or services, such a
system promotes recycling activities. The system keeps track of information on disposal
procedures, materials disposed of, user identification, and points accrued by the user.
PNT2022TMID25602
PAPER 5:
TITLE: Waste Management Initiatives in India For Human Wellbeing
AUTHOR NAME: Dr. Raveesh Agarwal, Mona Chaudhary and Jayveer Singh
PUBLICATION YEAR: 2015
DESCRIPTION:
The objective of this paper is to examine the present methods used in India for the welfare
of its people in different waste management efforts. The other goal is to offer advice on how to
make Indian municipalities' trash disposal procedures better. On secondary research, this essay is
founded. The system is improved by looking at the reports that have already been written about
waste management and the suggestions made for improvement by planners, NGOs, consultants,
government accountability organisations, and important business leaders. It provides in-depth
understanding of the various waste management programmes in India and identifies areas where
waste management might be improved for societal benefit. The essay makes an effort to
comprehend the crucial part that our nation's official waste management sector plays in the waste
management process.
S. No Parameter Description
4. REQUIREMENT ANALYSIS
FR-2 Eliminate inefficient picks. Get rid of the collection of half-empty trash cans. Picks
are recognized by sensors. We can demonstrate to you
how full the bins you collect are using real-time data on
FR-3 Plan waste collection routes. Route planning for rubbish pickup is semi-automated
using the tool. You are prepared to act and arrange for
garbage collection based on the levels of bin fill that are
now present and forecasts of approaching capacity. To
find any discrepancies, compare the planned and actual
FR-4 Adjust bin distribution. Ensure the best possible bin distribution. Determine
which regions have a dense or sparse distribution of
bins. Ensure that each form of waste has a
representative stand. You can make any required
adjustments to bin position or capacity based on past
data.
FR-5 Expensive bins. We assist you in locating containers that increase
collection prices. The tool determines a collection cost
rating for each bin. The tool takes local average depo-
bin discharge into account. The tool determines the
distance from depo-bin discharge and rates bins (1–10).
FR-6 Detailed bin inventory. On the map, you can see every monitored bin and stand,
and you can use Google Street View at any timeto visit
them. On the map, bins or stands appear as green,
orange, or red circles. The Dashboard displays
information about each bin, including its capacity, trash
kind, most recent measurement, GPS position, andpick-
up schedule.
PNT2022TMID25602
5. PROJECT DESIGN
5.1 Data Flow Diagrams
A Data Flow Diagram (DFD) is a traditional visual representation of the information flows within a system.
A neat and clear DFD can depict the right amount of the system requirementgraphically.
It shows how data enters and leaves the system, what changes the information, and where data is stored.
A smart waste management platform uses analytics to translate the data gather in your
bins into actionable insights to help you improve your waste services.
You can receive data on metric such as:
• The first test conducted is the situation where the garbage bin is empty or its garbage level
is very low
• Then, the bin is filled with more garbage until its level has surpassed the first threshold
value, which is set to 80% then the first warning SMS is being sent, as depicted
• The first notification SMS sent by the system, once the waste reaches the level of 85% full
• The second notification SMS sent by the system, indicating that bin is at least 95% full and
the garbage needs to be collected immediately
• Locations prone to overflow
• The number of bins needed to avoid overflowing waste
• The number of collection services that could be saved
• The amount of fuel that could be saved
• The driving distance that could be saved.
PNT2022TMID25602
5.2 Data flow diagram:
Table-2:Application Characteristics:
S.no Characteristics Description Technology
1. Open-Source Frameworks GitHub Internet hosting service
2. Security Implementations Application Network automation
security:
Veracode.
3. Scalable Architecture It provides the room for expansion Cloud storage
more databaseof smart bins added
additionally can be updated.
4. Availability As the system control is connected to Server, Appleixe, reple
web server itis available 24*7 and can
be accessed whenever needed.
5. Performance Performance is high it uses 5mb Wireless Sensor Network
caches
PNT2022TMID25602
5.3 User Stories
Use the below template to list all the user stories for the product.
User Type Functional User User Story / Task Acceptance criteria Priority Release
Requirement Story
(Epic) Number
Admin Login USN-1 As an administrator, I I can control my Medium Sprint-1
assigned user namesand online account
passwords to each and dashboard.
employee and managed
them.
Co-Admin Login USN-2 As a Co-Admin, I'll I can handle High Sprint-1
control the waste level the waste
monitor. If a garbage collection.
filling alert occurs, I will
notify the trash truck of the
location and rubbish ID.
Truck Driver Login USN-3 As a Truck Driver, I can take the Medium Sprint-2
I'll follow Co shortest path to
Admin'sinstruction to reach the waste
reach the filled filled route specified.
garbage.
Local Garbage Login USN-4 As a Local Garbage I can collect the Medium Sprint-3
Collector Collector, I’II gather all trach, pullit to the
the waste from the truck, and send it
garbage, load it onto a out.
garbage truck, and
deliver it to Landfills
Municipalit Login USN-5 As a Municipality All of these High Sprint-4
yofficer officer, I'll make sure processes areunder
everything is my control.
proceeding as planned
andwithout any
problems.
PNT2022TMID25602
ADVANTAGES:
DISADVANTAGES:
System requires a greater number of waste bins for separate waste collection as per population
in the city.
This results into high initial cost due to expensive smart dustbins compare to other methods.
Sensor nodes used in the dustbins have limited memory size.
10. CONCLUSION
A Smart Waste Management system that is more effective than the one in use now is achievable by
using sensors to monitor the filling of bins. Our conception of a "smart waste management system"
focuses on waste systems,
eliminating human intervention, minimizing human time and effort, and producing a healthy and trash-
free environment. The suggested approach can be implemented in smart cities where residents have
busy schedules that provide little time for garbage management. If desired, the bins might be put into
place in a metropolis where a sizable container would be able to hold enough solid trash for a single
unit. The price might be high.
There are several future works and improvements for the proposed system, including the
following:
1. Change the system of user authentication and atomic lock of bins, which would aid in protecting
the bin from damage or theft.
2. The concept of green points would encourage the involvement of residents or end users, making
the idea successful and aiding in the achievement of collaborative waste management efforts, thus
fulfilling the idea of Swachh Bharath.
3. Having case study or data analytics on the type and times waste is collected on different days or
seasons, making bin filling predictable and removing the reliance on electronic components, and
fixing the coordinates.
12) APPENDIX
Source Code
print("data pushed")
c=1
break
LOAD.py
import
time
import sys
EMULATE_HX711=False
referenceUnit = 1
if not EMULATE_HX711:
import RPi.GPIO as GPIO
from hx711 import HX711
else:
from emulated_hx711 import HX711
def cleanAndExit():
print("Cleaning...")
if not EMULATE_HX711:
GPIO.cleanup()
print("Bye!")
sys.exit()
hx = HX711(5, 6)
# I've found out that, for some reason, the order of the bytes is not always the same between versions of python,
numpy and the hx711 itself.
# Still need to figure out why does it change.
# If you're experiencing super random values, change these values to MSB or LSB until to get more stable values.
# There is some code below to debug and log the order of the bits and the bytes.
# The first parameter is the order in which the bytes are used to build the "long" value.
# The second paramter is the order of the bits inside each byte.
# According to the HX711 Datasheet, the second parameter is MSB so you shouldn't need to modify it.
hx.set_reading_format("MSB", "MSB")
PNT2022TMID25602
hx.reset()
hx.tare()
def loop():
try:
# These three lines are usefull to debug wether to use MSB or LSB in the reading formats
# for the first parameter of "hx.set_reading_format("LSB", "MSB")".
# Comment the two lines "val = hx.get_weight(5)" and "print val" and uncomment these three lines to see what
it prints.
# np_arr8_string = hx.get_np_arr8_string()
# binary_string = hx.get_binary_string()
# print binary_string + " " + np_arr8_string
# Prints the weight. Comment if you're debbuging the MSB and LSB issue.
val = hx.get_weight(5)
print(val)
return val
# To get weight from both channels (if you have load cells hooked up
# to both channel A and B), do something like this
#val_A = hx.get_weight_A(5)
#val_B = hx.get_weight_B(5)
#print "A: %s B: %s" % ( val_A, val_B )
PNT2022TMID25602
hx.power_down()
hx.power_up()
time.sleep(0.1)
def distancesensor():
try:
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
PIN_TRIGGER = 23
PIN_ECHO = 33
GPIO.setup(PIN_TRIGGER, GPIO.OUT)
GPIO.setup(PIN_ECHO, GPIO.IN)
GPIO.output(PIN_TRIGGER, GPIO.LOW)
time.sleep(2)
GPIO.output(PIN_TRIGGER, GPIO.HIGH)
time.sleep(0.00001)
GPIO.output(PIN_TRIGGER, GPIO.LOW)
while GPIO.input(PIN_ECHO)==0:
pulse_start_time = time.time()
while GPIO.input(PIN_ECHO)==1:
pulse_end_time = time.time()
pulse_duration = pulse_end_time - pulse_start_time
global distance
distance = round(pulse_duration * 17150, 2)
print(distance)
return distance
finally:
GPIO.cleanup()
HX711.py import RPi.GPIO as
GPIO
PNT2022TMID25602
import time
import threading
class HX711:
self.DOUT = dout
self.GAIN = 0
self.OFFSET = 1
self.OFFSET_B = 1
self.lastVal = int(0)
self.DEBUG_PRINTING = False
self.byte_format = 'MSB'
self.bit_format = 'MSB'
self.set_gain(gain)
PNT2022TMID25602
def is_ready(self):
return GPIO.input(self.DOUT) == 0
GPIO.output(self.PD_SCK, False)
def get_gain(self):
if self.GAIN == 1:
return 128
if self.GAIN == 3:
return 64
if self.GAIN == 2:
return 32
def readNextBit(self):
# Clock HX711 Digital Serial Clock (PD_SCK). DOUT will be
# ready 1us after PD_SCK rising edge, so we sample after
# lowering PD_SCL, when we know DOUT will be stable.
PNT2022TMID25602
GPIO.output(self.PD_SCK, True)
GPIO.output(self.PD_SCK, False)
value = GPIO.input(self.DOUT)
def readNextByte(self):
byteValue = 0
# Read bits and build the byte from top, or bottom, depending
# on whether we are in MSB or LSB bit mode.
for x in range(8):
if self.bit_format == 'MSB':
byteValue <<= 1
byteValue |= self.readNextBit()
else:
byteValue >>= 1
byteValue |= self.readNextBit() * 0x80
def readRawBytes(self):
# Wait for and get the Read Lock, incase another thread is already
# driving the HX711 serial interface.
self.readLock.acquire()
# HX711 Channel and gain factor are set by number of bits read
# after 24 data bits.
for i in range(self.GAIN):
# Clock a bit out of the HX711 and throw it away.
self.readNextBit()
# Release the Read Lock, now that we've finished driving the
HX711
# serial interface.
self.readLock.release()
if self.DEBUG_PRINTING:
print("Twos: 0x%06x" % twosComplementValue)
# Convert from 24bit twos-complement to a signed value.
signedIntValue =
self.convertFromTwosComplement24bit(twosComplementValue)
# If we're only average across one value, just read it and return it.
if times == 1:
return self.read_long()
for x in range(times):
valueList += [self.read_long()]
valueList.sort()
backupReferenceUnit = self.get_reference_unit_A()
self.set_reference_unit_A(1)
value = self.read_average(times)
if self.DEBUG_PRINTING:
print("Tare A value:", value)
self.set_offset_A(value)
# Restore the reference unit, now that we've got our offset.
self.set_reference_unit_A(backupReferenceUnit)
return value
def tare_B(self, times=15):
# Backup REFERENCE_UNIT value
backupReferenceUnit = self.get_reference_unit_B()
self.set_reference_unit_B(1)
value = self.read_average(times)
if self.DEBUG_PRINTING:
print("Tare B value:", value)
self.set_offset_B(value)
# Restore gain/channel/reference unit settings.
self.set_gain(backupGain)
self.set_reference_unit_B(backupReferenceUnit)
return value
def set_reading_format(self, byte_format="LSB",
bit_format="MSB"):
if byte_format == "LSB":
self.byte_format = byte_format
elif byte_format == "MSB":
self.byte_format = byte_format
else:
raise ValueError("Unrecognised byte_format: \"%s\"" %
byte_format)
if bit_format == "LSB":
self.bit_format = bit_format
elif bit_format == "MSB":
self.bit_format = bit_format
else:
PNT2022TMID25602
def get_offset(self):
return self.get_offset_A()
def get_offset_A(self):
return self.OFFSET
def get_offset_B(self):
return self.OFFSET_B
def set_reference_unit(self, reference_unit):
self.set_reference_unit_A(reference_unit)
def set_reference_unit_A(self, reference_unit):
# Make sure we aren't asked to use an invalid reference unit.
if reference_unit == 0:
raise ValueError("HX711::set_reference_unit_A() can't accept 0
as a reference unit!")
return
self.REFERENCE_UNIT = reference_unit
def power_down(self):
# Wait for and get the Read Lock, incase another thread is already
# driving the HX711 serial interface.
self.readLock.acquire()
time.sleep(0.0001)
# Release the Read Lock, now that we've finished driving the
HX711
# serial interface.
self.readLock.release()
def power_up(self):
# Wait for and get the Read Lock, incase another thread is already
# driving the HX711 serial interface.
self.readLock.acquire()
# Lower the HX711 Digital Serial Clock (PD_SCK) line.
GPIO.output(self.PD_SCK, False)
# Wait 100 us for the HX711 to power back up.
time.sleep(0.0001)
# Release the Read Lock, now that we've finished driving the
HX711
# serial interface.
self.readLock.release()
# HX711 will now be defaulted to Channel A with gain of 128. If
this
# isn't what client software has requested from us, take a sample
and
# throw it away, so that next sample from the HX711 will be from
the
# correct channel/gain.
if self.get_gain() != 128:
self.readRawBytes()
def reset(self):
PNT2022TMID25602
self.power_down()
self.power_up()
WEBSITE CODING
Index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-
ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Garbage Management System</title>
<link rel="icon" type="image/x-icon" href="/Images/DUMPSTER.png">
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.10.1/firebase-database.js"></script>
<script>
var firebaseConfig =
{
apiKey: "AIzaSyB9ysbnaWc3IyeCioh-aJQT_UCMd5CBFeU",
authDomain: "fir-test-923b4.firebaseapp.com",
databaseURL: "https://fir-test-923b4-default-rtdb.firebaseio.com",
projectId: "fir-test-923b4",
storageBucket: "fir-test-923b4.appspot.com",
messagingSenderId: "943542145393",
appId: "1:943542145393:web:9b5ec7593e6a3cbd7966d0",
measurementId: "G-BN7JNX1Q7B"
};
firebase.initializeApp(firebaseConfig)
</script>
<script defer src="database.js"></script>
</head>
<body style="background-color:#1F1B24;">
<script src="map.js"></script>
<div id="map_container">
<h1 id="live_location_heading" >LIVE LOCATION</h1>
<div id="map"></div>
<div id="alert_msg">ALERT MESSAGE!</div>
</div>
</div>
<center><a href="https://goo.gl/maps/G9XET5mzSw1ynHQ18"
type="button" class="btn btn-dark">DUMPSTER</a></center>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBBLyWj-
3FWtCbCXGW3ysEiI2fDfrv2v0Q&callback=myMap"></script></div>
</body>
</html>
Database.js
const cap_status = document.getElementById('cap_status');
const alert_msg = document.getElementById('alert_msg');
ref.on("value", function(snapshot)
{
snapshot.forEach(function (childSnapshot) {
var value = childSnapshot.val();
alert_msg.innerHTML= `${alert_msg_val}`;
});
}, function (error) {
console.log("Error: " + error.code);
});
Map.js
const database = firebase.database();
function myMap()
{
var ref1 = firebase.database().ref();
ref1.on("value", function(snapshot)
{
snapshot.forEach(function (childSnapshot) {
var value = childSnapshot.val();
const latitude = value.latitude;
const longitude = value.longitude;
}
Style.css
html, body
{
height: 100%;
margin: 0px;
padding:0px;
}
#container
{
display: flex;
flex-direction: row;
height: 100%;
width: 100%;
position: relative;
}
#logo_container
{
height: 100%;
width: 12%;
background-color: #C5C6D0;
display: flex;
flex-direction: column;
vertical-align: text-bottom;
}
.logo
{
width:70%;
PNT2022TMID25602
margin: 5% 15%;
/* border-radius: 50%; */
}
#logo_3
{
vertical-align: text-bottom;
}
#data_container
{
height: 100%;
width: 20%;
margin-left: 1%;
margin-right: 1%;
display: flex;
flex-direction: column;
}
#data_status
{
height:60%;
width:8%;
margin:7%;
background-color: #691F6E;
display: flex;
flex-direction: column;
border-radius:20px;
}
#load_status
{
background-image: url("/Images/KG.png");
background-repeat: no-repeat;
background-size: 170px;
background-position: left center;
}
#cap_status
{
background-image: url("/Images/dust.png");
background-repeat: no-repeat;
background-size: 150px;
background-position: left center;
}
.status
{
width: 80%;
height: 40%;
margin:5% 10%;
background-color:#185adc;
border-radius:20px;
display: flex;
justify-content: center;
align-items: center;
color: white;
font-size: 60px;
}
.datas
{
width:86%;
margin:2.5% 7%;
height:10%;
background: url(water.png);
background-repeat: repeat-x;
animation: datas 10s linear infinite;
}
#map_container
{
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
}
PNT2022TMID25602
#live_location_heading
{
margin-top:10%;
text-align: center;
color: GREY;
}
#map
{
height: 70%;
width: 90%;
margin-left: 4%;
margin-right:4%;
border: 10px solid white;
border-radius: 25px;
}
#alert_msg
{
width:92%;
height:20%;
margin:4%;
background-color:grey;
border-radius: 20px;
display: flex;
justify-content: center;
align-items: center;
color: #41af7f;
font-size: 25px;
font-weight: bold;
}
.lat
{
margin: 0px;
font-size:0px;
}
@keyframes datas{
0%
{
background-position: -500px 100px;
}
40%
{
background-position: 1000px -10px;
}
80% {
background-position: 2000px 40px;
}
100% {
background-position: 2700px 95px;
}
}
PNT2022TMID25602
For simulator python code
BIN1.PY
import requests
import json
import ibmiotf.application
import ibmiotf.device
import time
import random
import sys
organization = "4yi0vc"
devicType = "BIN1"
deviceId = "BIN1ID"
authMethod= "token"
authToken= "123456789"
def myCommandCallback(cmd):
global a
print("command recieved:%s" %cmd.data['command'])
control=cmd.data['command']
print(control)
try:
deviceOptions={"org": organization, "type": devicType,"id": deviceId,"auth-method":authMethod,"auth-
token":authToken}
deviceCli = ibmiotf.device.Client(deviceOptions)
except Exception as e:
print("caught exception connecting device %s" %str(e))
sys.exit()
#connect and send a datapoint "temp" with value integer value into the cloud as a type of event for every 10 seconds
deviceCli.connect()
while True:
distance= random.randint(10,70)
loadcell= random.randint(5,15)
data= {'dist':distance,'load':loadcell}
time.sleep(4)
success=deviceCli.publishEvent ("IoTSensor","json",warn,qos=0,on_publish= myOnPublishCallback)
TECHNOLOGY : IOT
TEAM ID: PNT2022TMID25602