Introduction: Arduino Smart Trashcan

This trash can is inspired by DIY Smart Dustbin With Arduino by AhsanQureshi

I followed his step, but the main difference is that I added a button to the trashcan.

This is the Arduino Smart Trashcan. When you hands, with the trash, moves close to the trashcan, the lid would automatically lift up. If you need the lid to lift up a bit longer, just press the button.


Small Trashcan/Bucket

Cardboard (You can also use plastic boards)

Arduino Leonardo (You can also use Arduino Uno)

Breadboard (Not necessary, but you can organize the wires this way)

Servo Motor


Ultrasonic Sensor

Male-to-male Jumper Wires

Resistor (1000 ohm)

Drill (BE CAREFUL! I injured my finger while using the drill.)

Color Paper (Or other decorating materials)

Power Bank (You can use any kind of power sources)



Paper Clip (You can replace this with a small object that you can tie the thread on)

Step 1: The Lid

Place the trashcan upside down on top of the cardboard. Trace the trashcan, then cut off the piece of cardboard. Put the cardboard on top of the trashcan to see if it fits.

Step 2: Insert the Sensor

Drill two holes on one side of the trashcan. Put the ultrasonic sensor in.

Step 3: Circuit and Code

Connect everything to Arduino as shown in the picture. Note that the wiring could be a bit different since I used the breadboard, but the general idea remains the same. If my circuit is too confusing, check out the original post (the link at the very top). However the button isn't in the original design.

Access the Code here.

Step 4: Assembly

Put the circuit in side of the trashcan.

Cut a hole on the lib to place the button.

Tape the Servo Motor on top of the lid.

Cut another hole so the wires of the servo motor can go through.

Tie one of the thread to the Servo Motor, and the other end to a paper clip.

Cut one other hole on the edge of the lid. Put the paper clip (tied up to the thread) through the hole.

Put the tape on the end of the thread near the Servo Motor (as shown in the picture).

Secure the lib. I used tape because I had to take the circuit out later to reuse the materials.

Step 5: Decorate

Decorate the trash can how ever you like it. I used color paper.

Watch the Video of the finished trashcan here.