Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Programming Fundamentals

DEC20012
Mini Project Proposal

Mini Project Proposal


Automatic Smart Dustbin
Name of Students: No Registration:

NABIL AIMAN BIN ROSLEE 14DET21F2031

MUHAMMAD AIMAN BIN IDRIS 14DET21F2025

Background
• The Smart Dustbin Project comes under the domain of Environment, Health, and Hygiene.
Through this Smart Dustbin project, we aimed to build a working prototype of a dustbin whose lid
opens automatically, without any contact when a person comes near it (in the range of 2 – 30
centimeters) to throw the trash. Since the process is contactless it maintains public hygiene and
sanitation. Moreover, there are many instances in public places where the dustbins overflow
because of irregularity in the waste collection from the dustbin (which is usually done by the
municipality sanitation workers).

Objectives
• Reduces the energy used to open the lid of the bin.
• Increasing technological progress in the country in the era of globalization.
• Reduce the workforce working in municipalities.

Scope
1. Arduino Uno
2. Ultrasonic Sensor
3. Micro Servo 9g
4. Jumper Wires
5. USB Cable
6. Dustbin
7.Double Tap
8.LED

Timeframe
Description of Work Start and End Dates
Phase One …
Phase Two … …
Phase Three … …

Project Budget
ITEM Description of Work Anticipated Costs
UNO Arduino UNO is the best RM40.00
board to get started with
electronics and coding.
Ultrasonic Sensor Ultrasonic sensors work by RM3.00
sending out a sound wave at a
frequency above the range of
human hearing.
Micro Servo9g Tiny and lightweight with RM6.50
high output power. Servo can
rotate approximately 180
degrees (90 in each direction),
and works just like the
standard kinds but smaller.

LED 220 Ohm resistor is one of the RM1.00


most common resistors in
electronics
USB Cable This cable is used to interface any RM4.00
of the Arduino board with your
computer, you can also connect
your USB printer, scanner, and
more to your computer. These
cables Transmits data at high
speeds with the error-free, high-
performance transmission.
Jumper Wires Small wire products that can be RM2.50
used to connect components to
each other on breadboards
TOTAL RM57.00

Project Flow 1 (Software)

STEP:

1. First step, insert the jumper wire from the VCC ultrasonic sensor into the 5V hole of the arduino
uno. Next, insert the jumper wire from the Trigo ultrasonic sensor into hole 9 of the arduino uno.
Then, insert the jumper wire from the Echo ultrasonic sensor into hole 8 of the arduino uno. Finally,
insert the jumper wire from the Gnd ultrasonic sensor into the Gnd hole of the arduino uno. Insert
the LED positive leg into hole 13 of the arduino uno and the negative leg into the Gnd(D) hole of the
arduino uno. Enter the ultrasonic sensor coding using arduino uno.

2. Second step, insert the orange jumper wire from the micro servo into hole 7 of the arduino uno.
Next, insert the red jumper wire from the micro servo into the 5V hole of the arduino uno. Then,
insert the brown jumper wire from the micro servo into the Gnd hole of the arduino uno. Enter
micro servo coding using arduino uno.

3. Third step, make a hole in the side of the trash can using a screwdriver or a suitable tool. Place a
mark before making a hole on the side of the bin so it's easier to estimate. Next, stick the micro
servo on top of the trash can lid.

4. Step four, connect all the materials that have been prepared. after that do a test on the
completed project.

CODE:

ULTRASONIC SENSOR/MICRO SERVOR


//define Pins
#include <Servo.h>

Servo servo;

int trigPin = 9;
int echoPin = 8;

// defines variables
long duration;
int distance;

void setup()
{
servo.attach(7);
servo.write(0);
delay(2000);

// Sets the trigPin as an Output


pinMode(trigPin, OUTPUT);
// Sets the echoPin as an Input
pinMode(echoPin, INPUT);
// Starts the serial communication
Serial.begin(9600);
}
void loop()
{
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time
in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
if ( distance <= 25 ) // Change Distance according to
Ultrasonic Sensor Placement
{

servo.write(0);
delay(3000);
}
else
{
servo.write(90);
}

Project Flow 2 (Hardware)

Monitoring and Evaluation


The end result of this project is not the same as planned because there are several problems that occur either
in terms of components or coding. It is caused when when we insert the coding into the arduino uno micro
servo moves while the ultrasonic sensor does not work. We also tried to use the battery, the problem was that
both did not work well. Today as we know population is flourishing in our country like ever before so more and
more apartment complexes and houses are constructed every day, so due to this the rate of waste generated
is significantly high and due to this the bins get full at a faster rate and hence after a point the bins start to
overflow, although the corporation people are trying their level best to send garbage trucks to every single
area to empty the bins but after an hour or so the bins get full again also sometimes these garbage trucks go
the areas where the bins are hardly even full rather than assigning these trucks to the right places where they
need to be.so instead of exploiting manpower, fuel, etc we can let technology to do its work with the new and
improved user friendly automated SmartDustbin

Attachment:

LED Sequential Control:


https://youtu.be/mHaeDoFOVX0

You might also like