Introduction: Automatic Trash Can

Everything is getting better and better ? But why not your Trash can ? This trash can Opens and Closes its own lid if it sees any Rubbish or your hand or body in front of you. You will just need to bring the trash or anything you want to throw in front of it and it'll open automatically and will wait for you to put it more trash than after a certain delay it'll close automatically. Watch the video to see what did it look like and how do it closed.

Supplies

1.Arduino (any board)In here is Leonardo

2.Servo motor (i'm using micro servo S03T STD)

3. HC-sr04 ultrasound sensor

4. Servo arms

3. Card Board (just a little piece)

4. Trash Can

Step 1: Step 1:Draw Your Own Circuit

The circuit is very easy. As the servo and sonar only takes less power you can just power them directly from Arduino 5v source.

Servo data (yellow) to pin 3 of Arduino Servo vcc (red) to 5v of Arduino Servo ground (black/gray) to Arduino Gnd Sonar sensor trig to Arduino 6 Sonar sensor echo to Arduino 5 Vcc to Arduino 5v Gnd to Arduino Gnd

Step 2: Connect to Servo Arm

Just take this servo arm and connect it to a long card board piece with hot glue or other glues. You can also use Ice Cream stick instead of Card Board. Then connect the long servo arm to servo motor.Use thermoplastic to stick the wood stick on the servo.

Step 3: Add Sonar Sensor

Connect he sonar sensor facing up to the Bin like this. And put it to check the sensor is good about it.And put it in your box.

Step 4: Code

The code is under the line.

https://create.arduino.cc/editor/evansu/81034b0a-1...

Copy it or download it.

Step 5: You Are Done

Just see if there is any problem and dig holes put it in the box.If the ultra sensor is too sensitive and you can add some wood piece at the top to not make it to sensitive.

Step 6: Finished

Finished your final product