Desk Dustbin

About: Innovation is my Oxygen.

A perfect solution to trash those tiny notes that lie on your desk all day long.

It's time to declutter.

Things Required:

  • A plastic container.
  • A cardboard sheet.
  • Arduino UNO.
  • Adafruit Motor Shield.
  • Jumper wires female to female - 4 nos.
  • A Micro Servo.
  • External power supply(In my case I used a 6*AA battery holder).
  • Thread.
  • Tape.

Step 1: Let's Get Coding.........

#include<Servo.h>// Includes servo library.
#include<Ultrasonic.h> // Includes SR-04 Sensor Library.

// declaring Motor Shield

int dataPin = 8;
int latchPin = 12; 
int clockPin = 4; 
int en = 7;

// Variable to store distance

int front_d = 0;

void setup() { 
  
  // setting up shield. 
   pinMode(dataPin, OUTPUT);      
   pinMode(latchPin, OUTPUT);
   pinMode(clockPin, OUTPUT);
   pinMode(en, OUTPUT);    
   digitalWrite(en, LOW);   
     
    servo_1.attach(10);  // Attaching servo to Pin No.10
    servo_1.write(90);   // Initial position        

}


void loop() { 
    front_d = ultrasonic.Ranging(CM);// measuring fornt distance  
    if (front_d < 30){
      servo_1.write(180);
      delay(2000);
      servo_1.write(90);
      front_d = 0;
   }
}

Step 2: Hardware......

There's only one rule here, just follow the pictures:

Step 3: Let's Tinker......(electronics)

Connections:

Step 4: Voila!

Share

    Recommendations

    • Optics Contest

      Optics Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Plastics Contest

      Plastics Contest

    Discussions

    0
    None
    Ayush Arya

    4 weeks ago

    If there is any problem then please let me know in the comments.