Project tutorial
Smart Dustbin

Smart Dustbin © GPL3+

This is smart dustbin using an Arduino Uno, an ultrasonic sensor and a servo motor.

  • 16 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

Thread
Tape
Glue gun

Apps and online services

About this project

This project is all about how you can make a smart dustbin at home just using minumum of 5 or 6 things.

Have you ever wondered you can make a smart dustbin for your home.

Just take a look at this project.

In this project I use Arduino Uno, Ultrasonic sensor, jumper wires, servo motor, thread, a small steel washer and a dustbin.

steps:

1. Take Arduino uno, Ultrasonic sensor, servo motor, Jumper wires, 9v battery and dustbin box.

2. Connect servo motor yellow pin(signal pin) to Arduino digital pin no. 9

3. Connect servo +Vcc pin to Arduino +5V pin.

4. Connect servo GND pin to Arduino GND pin.

5. Take Ultrasonic sensor connect sensor TRIG pin to Arduino pin no. 2.

6. Connect sensor ECHO pin to Arduino pin no. 3.

7. Connect servo at the top of Dustbin with the help of glue gun.

8. Connect washer and thread to the dustbin box.

9. Make a hole infront of dustbin box and fit ultrasonic sensor as shown in image.

10. Upload the code.

11. Power the Arduino with a 9V battery.

YAYYYY....!!!!! Your smart dustbin is ready.

Components required..

stick servo on the top of the dustbin half fold end cap.

paste washer with the help of glue gun inside the half fold cap.

Make 2 holes infront of dustbin box and fit ultrasonic sensor inside it.

Stick all the components inside the dustbin box and sealed it with tape after uploading the code.

Connect battery or power source to Arduino.

Code

CodeArduino
//Electronics is Fun
//www.facebook.com/Electronics is Fun
//www.yotube.com/Electronics is Fun
#include <Servo.h>   //servo library
Servo servo;     
int trigPin = 2;    
int echoPin = 3;   
int servoPin = 9;

long duration, dist, average;   
long aver[3]; 


void setup() {       
    servo.attach(servoPin);  
    pinMode(trigPin, OUTPUT);  
    pinMode(echoPin, INPUT);  
    servo.write(0);         //close dustbin cap on power on
    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;    //obtain distance
}
void loop() { 
  for (int i=0;i<=2;i++) {   //average distance
    measure();               
   aver[i]=dist;            
    delay(50);              //delay between measurements
  }
 dist=(aver[0]+aver[1]+aver[2])/3;    //average distance by 3 measurements

if ( dist<40 ) {
 //if hand on the distance 10...50 cm
 servo.attach(servoPin);
  delay(1);
 servo.write(90);  
 delay(5000);       //wait 5 seconds
 servo.write(0);    
 delay(1000);
 servo.detach();      
}
}

Schematics

Connection Diagram
New new yrwjtia8lf

Comments

Similar projects you might like

Smart Home - Smart Rules using ARTIK Cloud & Photon

Project tutorial by Raghavendra Ponuganti

  • 3,801 views
  • 2 comments
  • 12 respects

Smart Garbage Monitoring System Using Arduino 101

Project tutorial by Technovation

  • 20,749 views
  • 6 comments
  • 29 respects

IOT - Smart Jar Using ESP8266, Arduino and Ultrasonic Sensor

Project tutorial by Smazee

  • 6,092 views
  • 4 comments
  • 12 respects

Smart Doorbell

Project showcase by Kaustubh Agarwal

  • 49,740 views
  • 20 comments
  • 103 respects

Smart Blinds

Project tutorial by Froz3nArcher

  • 13,730 views
  • 3 comments
  • 47 respects

Smart Garage

Project in progress by Chris Hockuba

  • 7,600 views
  • 5 comments
  • 26 respects
Add projectSign up / Login