COA Project Report
COA Project Report
PROJECT REPORT
Arduino based Smart dustbin
CERTIFICATE
This is to certify that the Project Titled “Arduino based Smart Dustbin” which is
submitted by Rutvik Chavan Roll No. 2K20/CO/378 and Shashwat Dalal Roll No.
2K20/CO/422; Computer Engineering, Delhi Technological University in partial
fulfilment of the requirement for the award of the degree of Bachelor of Technology, is a
record of the project work carried out by the students under the supervision of Professor,
Ashish Girdhar, of course “Computer Organisation and Architecture” during the 4th
semester, Academic year 2021-2022.
Index
• Abstract
• Components Used
• Description
• Flowchart
• Circuit Design on Tinkercad
• Source Code
• Innovation/Advantages
• Conclusion
• Result
Abstract
In the recent decades, Urbanization has increased tremendously. At the same phase there is an
increase in waste production. Waste management has been a crucial issue to be considered. This
paper is a way to achieve this good cause.
In this paper, smart bin is built on a microcontroller-based platform Arduino Uno board which is
interfaced with servo motor and Ultrasonic sensor. Ultrasonic sensor is placed at the top of the
dustbin which will measure the stature of the dustbin. The threshold stature is set as 50cm.
Arduino will be programmed in such a way that when the dustbin is being filled, the remaining
height from the threshold height will be displayed. Once the garbage reaches the threshold level
ultrasonic sensor will trigger the servo motor which will continuously alert the required authority
until the garbage in the dustbin is squashed.
Once the dustbin is squashed, people can reuse the dustbin. At regular intervals the dustbin will
be squashed. Once these smart bins are implemented on a large scale, by replacing our traditional
bins present today, waste can be managed efficiently as it avoids unnecessary lumping of wastes
on the roadside. Foul smell from these rotten wastes that remain untreated for a long time, due to
negligence of authorities and carelessness of the public may lead to long term problems. Breeding
of insects and mosquitoes can create nuisance around promoting an unclean environment. This
may even cause dreadful diseases.
Components used
★Arduino UNO
★Servo Motor
★Jumper Wires
★Bread Board
Description
➢ Once the system is powered ON, Arduino keeps monitoring for any object near the
Ultrasonic Sensor.
➢ If the Ultrasonic Sensor detects any object like a hand for example, the sound gets reflected
and Arduino uses the duration in microseconds and speed of sound to calculate its
distance accordingly.
➢ If the distance is less than a certain predefined value, Arduino will activate the Servo
Motor and with the support of the mount, it will lift the lid open till the specified
angle.
➢ After a certain time, the lid is automatically closed again. Once the system is powered ON,
Arduino keeps monitoring for any object near the Ultrasonic Sensor.
Flowchart of the working of the smart dustbin circuit :
Arduino Uno Board
Arduino is an open-source electronics platform based on easy-to-use hardware and
software.
Arduino Uno is one of the simplest boards available. The boards on the basic level have
MCU chips.The board is equipped with sets of digital and analog input/output (I/O) pins
that may be interfaced to various expansion boards (shields) and other circuits. The board
has 14 digital I/O pins (six capable of PWM output), 6 analog I/O pins, and is
programmable with the Arduino IDE (Integrated Development Environment), via a type B
USB cable
At its core, the HC-SR04 Ultrasonic distance sensor consists of two ultrasonic transducers. The
one acts as a transmitter which converts electrical signals into 40 KHz ultrasonic sound pulses.
The receiver listens for the transmitted pulses. If it receives them, it produces an output pulse
whose width can be used to determine the distance the pulse travelled, this can be worked out
using simple distance-speed-time equation It finds out the distance from the object within the
range of 2cm to 400 cm
- Pin 3 (Echo): pin produces a pulse when the reflected signal is received. The length of the pulse
is proportional to the time it took for the transmitted signal to be detected.
In our case the ultrasonic sensor is basically used to detect the garbage as an obstacle in front of
the dustbin, if it lies in the specified distance range. If an obstacle is detected, the servo motor
rotates and the lid of the dustbin opens up on its own.
Micro Servo Motor (SG90)
It consists of a control circuit that provides feedback on the current position of the motor shaft,
this feedback allows the motor to rotate with great precision.
Servos are controlled by sending an electrical pulse of variable width, or pulse width
modulation (PWM), through the control wire. There is a minimum pulse, a maximum pulse,
and a repetition rate. A servo motor can usually only turn 90° in either direction for a total of
180° movement.
Circuit designed and simulated on Tinkercad:
Source code
The following code was written in C in the Arduino IDE and deployed to the Arduino Uno Board using
the USB cable:
int trigPin = 4;
int echoPin = 2;
int servoPin = 7;
int led= 10;
void setup() {
Serial.begin(9600);
servo.attach(servoPin);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
servo.write(0); //close cap on power on delay(100);
servo.detach();
}
void measure() {
digitalWrite(10,HIGH);
digitalWrite(trigPin, LOW);
delayMicroseconds(5);
digitalWrite(trigPin, HIGH);
delayMicroseconds(15);
digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
dist = (duration/2) / 29.1; //obtain distance
}
void loop() {
for (int i=0;i<=2;i++) { //average distance
measure();
aver[i]=dist;
delay(10); //delay between measurements
}
dist=(aver[0]+aver[1]+aver[2])/3;
if ( dist<50 ) { //Change distance as per your need
servo.attach(servoPin);
delay(1);
servo.write(0); delay(3000);
servo.write(150); delay(1000);
servo.detach();
}
Serial.print(dist);
}
Innovation/Advantages
➢ While turning things smart can be costly, be it in terms of memory, power consumption or
the hardware cost. Embedded system provides an upper edge in this case since it is cost
efficient, small in size so can fit in easily.
Conclusion
This project work is the implementation of a Smart Dustbin System using Ultrasonic sensor,
Arduino Uno, Servo Motor and Arduino. Once the system is powered ON, Arduino keeps
monitoring for any object near the Ultrasonic Sensor. If the Ultrasonic Sensor detects any object
like a hand for example, the sound gets reflected and Arduino uses the duration in microseconds
and speed of sound to calculate its distance accordingly. If the distance is less than a certain
predefined value, Arduino will activate the Servo Motor and with the support of the mount, it will
lift the lid open till the specified angle. After a certain time, the lid is automatically closed again.
Once the system is powered ON, Arduino keeps monitoring for any object near the Ultrasonic
Sensor. To accomplish this project we have utilised the important concepts that include Input
Output Interface, Serial Synchronous Data Transfer, Modes of Data Transfer and Analog to
Digital Conversion.
We first designed the circuit and simulated our project on the Software Tinkercad, and then
implemented it on the Hardware. The snapshots of the hardware implementation are attached in
the following section:
Result
The lid of the dustbin will automatically open when you approach with trash, and close automatically
once the trash is thrown.