Smart Dustbin Project

Due to urbanization, there is a tremendous increase in waste production. For proper waste management, the government has installed dustbins at public places. You must have noticed that the dustbins in public places aren’t so clean and hence people avoid to open it for throwing garbage. Also, their lid cannot be left open or it will attract flies and cause infections.

In order to solve this issue, we have designed a ‘Smart Dustbin’ using Arduino Uno, Servo motor and ultrasonic sensor. so, It will automatically open up the lid upon the detection of the human hand.

however, This helps in maintaining the environment clean with the help of technology. It is a sensor-based dustbin so it would be easy to use for any age group. Also, it is cost-effective so that many numbers of people can get the benefit from it.

Materials Required to make Smart Dustbin: –

1.    Arduino Uno

2.    Ultrasonic sensor

3.    Servo motor

4.    Jumper wires

5.    Battery

6.    Dustbin

7.    Cardboard

8.    Adhesive

9.    Scissor

Software used: – Arduino IDE

Connections: –

1. To open the lid, we thus use a servo motor. though, Fix a small plastic tube to the servo horn. also, Make sure the lid is parallel to the ground or else it will require more energy to push the lid.

2. thereafter the servo is successfully placed, attach the ultrasonic sensor at the front of the dustbin.

3. Now make all the necessary connections using jumper wires as per the circuit diagram and secure the wires so that they don’t hang around.

4. Upload the code in Arduino by connecting it to your laptop thus using a USB wire.

5. hence, connect the power supply to it.

Circuit Diagram of Smart Dustbin: –

Arduino Uno board also consists of ATmega328 P microcontroller, it is an important component of the UNO board.

The ultrasonic sensor echo pin and trigger pin is connected to pin digital pin D6 and D5.

The +Vcc pin is connected to +5V supply and GND pin is connected to digital ground Pin.

The PWM pin of the servo motor and the digital pin D7 of Arduino is connected. The other two pins are connected to 3.33V and Gnd.

In this way, the servo motor is used to open the lid of the dustbin.

Code: –

#include <Servo.h>                      //servo library

Servo servo;

int trigPin = 5 int echoPin = 6  int servoPin = 7;

int led= 10;

long duration, dist, average;  

long aver[3];                           //array for average

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);

}

Working: –

Arduino senses any things that come near the ultrasonic sensor. When Ultrasonic sensors detect any object for example like a hand or others, here Arduino calculates its distance and if it is less than a certain predefined value then servo motor gets activated first and with the support of the extended arm of the lid. The lid will open for a given time then it will automatically close.

Conclusion: –

hence, Smart Dustbin using Arduino was designed successfully. In this way, people can dispose of garbage without touching the dustbin and the lid also remains closed to avoid flies.

Written by: Aparna Chaurasia

Reviewed by: Batta Pruthvi

If you are Interested In Machine Learning You Can Check Machine Learning Internship Program
Also Check Other Technical And Non Technical Internship Programs

Leave a Comment

Your email address will not be published. Required fields are marked *