Smart Dustbin Using IOT
Smart Dustbin Using IOT
Abstract
The main objective of the project is to design a smart dustbin which will
help in keeping our environment clean and also eco friendly. We are
inspired from Swaach Bharat Mission. Nowadays technologies are
getting smarter day-by-day. So to clean the environment we are designing
a smart dustbin by using Arduino. This smart dustbin management system
is built on the microcontroller based system having ultrasonic sensors on
the dustbin. If dustbin is not maintained than these can cause an unhealthy
environment and can cause pollute that affect our health. In this
proposed technology we have designed a smart dustbin using ARDUINO
UNO, along with ultrasonic sensor, servo motor, and battery jumper
wire. After all hardware and software connection, now Smart Dustbin
program will be run. Dustbin lid will when someone comes near at some
range than wait for user to put garbage and close it. It’s properly running or
not. For social it will help toward health and hygiene, for business for we
try to make it affordable to many as many possible. So that normal people
to rich people can take benefit from it.
Introduction
The rate increasing population in our country has increasing rapidly and
also we have increase in garbage which have increased environmental
issue. Dustbin is a container which collects garbage’s or stores items which
recyclable or non-recyclable, decompose and non-decompose. They are
usually used in homes, office etc , but in case they are full no one is there
to clean it and the garbage are spilled out. The surrounding of a dustbin is
also conducive for increasing the pollution level. Air pollution due to a
dustbin can produce bacteria and virus which can produce life harmful
diseases for human. Therefore, we have designed a smart dustbin using
ARDUINO UNO, ultrasonic sensor which will sense the item to be thrown in
the dustbin and open the lid with the help of the motor. It is an IOT based
project that will bring a new and smart way of cleanliness. It is a decent
gadget to make your home clean, due to practically all offspring of home
consistently make it grimy and spread litter to a great extent by electronics,
rappers and various other things. Since the smart dustbin is additionally
intriguing and children make fun with it so it will help to maintain
cleanliness in home. It will be applied for various type of waste. Dustbin will
open its lid when someone/object is near at some range then it will wait for
given time period than it will close automatically. Here lid will close when
you don’t want to use and it will only open when it required.
ARDUINO IDE:
1. ARDUINO UNO:
2. ULTRASONIC SENSOR:
3. SERVO MOTOR:
A Servo Motor is a small device that has an output shaft. This shaft can be
positioned to specific angular positions by sending the servo a coded signal.
As long as the coded signal exists on the input line, the servo will maintain
the angular position of the shaft.
4. 9V BATTERY:
5. SOLAR BATTERY:
A solar battery is a device that you can add to your solar power system to
store the excess electricity generated by your solar panels. IT IS THE
ALTERNATIVE OF 9V BATTERY.
6. DUSTBIN:
Dustbins are containers which are used to dump the waste generated at
homes and in public places.
After wiring and attaching all the devices and setting up to the Smart
Dustbin, now observe all the important setup whether they are well
connected or something missed. After connection set up now next step is
to submit/upload code in Arduino and supply power to the circuit. When
system is powered ON, Arduino keeps monitoring for any things that come
near the sensor at give range. When Ultrasonic sensor detect any object for
example like hand or others, here Arduino calculates its distance and if it
less than a certain predefines value than servo motor get activate first and
with the support of the extended arm of the lid. Lid will open for a given
time than it will automatically close.
EXECUTION CODE
#include <Servo.h>
Servo myservo;
void setup()
{
pinMode(trigPin,OUTPUT); // trigger as output
pinMode(led,OUTPUT); // led as indication
pinMode(echoPin,INPUT); // echo as input
myservo.attach(9); // giving commands to servo
Serial.begin(9600);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
if(dist<=50&&dist>=10){
digitalWrite(led,HIGH);
myservo.write(235);
delay(5000);
}
else{
digitalWrite(led,LOW);
myservo.write(0);
}
delay(1000);
CODE EXPLANATION
The Servo library is imported at the beginning of the sketch with the
statement #include <Servo.h>, and a Servo object named myservo is defined
later in the setup() function with the statement myservo.attach(9). The 9
specifies that the servo is connected to pin 9 on the Arduino board.
The pins and variables used in the sketch are also defined in the setup()
function. Pin 2 is defined as the echo pin, pin 3 is defined as the trigger pin,
and pin 6 is defined as the LED pin. The pinMode() function is used to set
the pin modes for the trigger and LED pins as outputs, and the echo pin as
an input.
The loop() function is where the main functionality of the sketch is located.
The first few lines of the loop function use the ultrasonic sensor to measure
the distance of an object by sending a trigger pulse to the sensor, then
measuring the duration of the echo pulse that is returned. The distance is
then calculated using the formula dist = dur*0.034 / 2 (the speed of sound is
approximately 34 cm/s).
Next, the sketch checks if the object is within a range of 10cm to 50cm
above the sensor or dustbin with the if statement if(dist<=50&&dist>=10).
If an object is detected within this range, the LED is turned on with the
statement digitalWrite(led,HIGH), and the servo motor is used to move the
dustbin lid with the statement myservo.write(235). The servo angle of 235 is
used to open the dustbin lid.
After a delay of 5 seconds with the delay() function, the LED is turned off
with the statement digitalWrite(led,LOW), and the servo motor is used to
close the dustbin lid with the statement myservo.write(0). The servo angle of
0 is used to close the dustbin lid.
If an object is not detected within the specified range, the LED remains off
and the dustbin lid remains closed.
DISCUSSION
After wiring and attaching all the devices and setting up to the Smart
Dustbin, now observe all the important setup whether they are well
connected or something missed. After connection set up now next step is to
submit/upload code in Arduino and supply power to the circuit. When
system is powered ON, Arduino keeps monitoring for any things that come
near the sensor at give range. When Ultrasonic sensor detect any object for
example like hand or others, here Arduino calculates its distance and if it
less than a certain predefines value than servo motor get activate first and
with the support of the extended arm of the lid. Lid will open for a given
time than it will automatically close.
CONCLUSION