Touchless Dustbin for COVID-19

Published Aug 29, 2021
 2 hours to build
 Beginner

->The smart dustbin is a carefully designed solution that solves the social issue of waste disposal. ->The smart dustbin identifies the kind of material being thrown inside it. -> Being in a pandemic situation,touchless or contactless smartdustbin is to avoid viruses.

display image

Components Used

Arduino Nano
Arduino Nano
1
Connecting Wire Jumper Wires
Connecting Wire Breadboard wires
1
Ultrasonic Module HC-SR04
Ultrasonic module HC-SR04 is generally used for finding distance value and obstacle detection. It can operate in the range 2cm-400cm.
1
SG90 Servo Motor
Power Management IC Development Tools SG90 Servo
1
5VDC Adapters Power Supply
Wall Mount AC Adapters ac-dc, 5 Vdc, 2 A, SW, wall-plug, EU, P5 center pos, level VI, black
1
Mini USB Cables
USB Cables / IEEE 1394 Cables USB3.0 SuperSpeed A to Micro B 1M BLK
1
Description

Circuit Diagram

4.Circuit  Diagram

Video

 

Code

#include <Servo.h>   //servo library
Servo servo;     
int trigPin = 5;    
int echoPin = 6;   
int servoPin = 7;

long duration, dist, average;   
long aver[3];   //array for average


void setup() {       
    servo.attach(servoPin);  
    pinMode(trigPin, OUTPUT);  
    pinMode(echoPin, INPUT);  
    servo.write(0);        
    delay(1000);
    servo.detach();
} 

void measure() {  
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;
}
void loop() { 
  for (int i=0;i<=2;i++) {   
    measure();               
   aver[i]=dist;            
    delay(50);           
  }
 dist=(aver[0]+aver[1]+aver[2])/3;    
if ( dist<50 ) {
 servo.attach(servoPin);
  delay(1);
 servo.write(90);  
 delay(5000);  
 servo.write(0);    
 delay(1000);
 servo.detach();      
}
}

 

2.CONNECTION OF ARDUINO AND ULTRASONIC SENSOR

1.Compile and Upload the code to the Arduino-Nano board using arduino software.

 

2.In a ultrasonic sensor connect the jumper wire to trig,echo,vcc,gnd.

 

3.In a Servomotor connect the jumper wire to 5V,GND,PWM.

 

4.  Arduino and ultrasonic sensor connection:

 

  • Trig-D5
  • echo-D6
  • GND-GND
  • Vcc-5V

 

5. Arduino and Servomotor Connections:

 

  • PWM-D7
  • GND-GND
  • +5V-5V

 

6.Connect the powerbank to the Arduino   board for the supply.

3.Connections of ARDUINO with power bank

 

             1.Materials Required
Codes

Downloads

TOUCHLESS SMART DUSTBIN FOR COVID-19 Download

Institute / Organization

PSNA COLLEGE OF ENGINEERING AND TECHNOLOGY
Comments
Ad