Turn a cardboard bin into a magic, hands-free trash can! This DIY smart dustbin uses an Arduino Uno, an ultrasonic sensor, and a servo motor to open automatically when you wave your hand. No hands, no mess, just wave and toss! A simple, fun, and hygenic gadget that makes tossing trash oddly satisfying!
- Hands-free operation – Wave your hand and the lid opens automatically.
- Compact & DIY-friendly – Built from simple materials like cardboard and small electronics.
- Educational & fun – Learn about Arduino, sensors, and servo motors in one project.
- Hygienic – Perfect for keeping your workspace or kitchen clean.
- Arduino Uno
- Ultrasonic Sensor
- Servo Motor
- Jumper wires
- Breadboard
- Cardboard (or any small bin)
- The ultrasonic sensor detects your hand approaching the bin.
- The Arduino processes the signal.
- The servo motor opens the lid automatically.
- After a short delay, the lid closes on its own.
This simple loop creates a hands-free trash disposal system that’s surprisingly satisfying to use!
Follow these steps to assemble your DIY Mini Automatic Smart Dustbin:
- Cut 4 trapezoid-shaped panels for the sides of the bin:
- Top width: 10 inches
- Bottom width: 8 inches
- Height: 15 inches
(These dimensions are a good starting point for a mini bin, but you can adjust as needed.)
- Tape or glue the 4 panels together to form the bin structure.
- Cut a square piece for the bottom and attach it securely to the base.
- Create the lid:
- Cut a rectangle larger than the top opening.
- Fold the extra edges over the top of the structure.
- Tape only the back edge of the lid to the structure.
⚠️ Do not tape the other edges. This will lock the lid and make it very difficult to open.
- A final image is attached at the end.
- Attach the servo motor near the top inside the bin.
- Cut a small opening on the side for the wires to pass through.
- Connect the servo motor to the Arduino and breadboard using jumper wires.
- Connect the ultrasonic sensor to the Arduino and breadboard.
- Secure the sensor to the front of the bin using tape or glue.
Retrived from EAZYTRONIC's video
- Attach a popsicle stick to the servo arm (or circular hub).
- The stick should point from the back of the bin to the front, within the inside of the bin.
- Trim one end if necessary to allow full range of motion.
- This popsicle stick will lift the lid when the servo is activated.
- Close the lid and ensure the servo and stick can move freely.
- Reinforce the back of the lid to the bin structure using tape, glue, or another popsicle stick.
- Connect the Arduino to your computer.
- Upload the provided code using the Arduino IDE or PlatformIO.
- Test the bin:
- Wave your hand in front of the sensor.
- Adjust sensor range or servo movement if needed.
- Ensure the lid opens and closes smoothly.
- Secure any loose wires or components.
🎉 Congratulations! Your Mini Automatic Smart Dustbin is now ready to use!
The Arduino sketch handles:
- Reading distance from the ultrasonic sensor.
- Opening and closing the lid with the servo motor.
- Timing the lid open duration for smooth operation.
The primary code is included in
src/main.cpp, but you should verify thattest/.gitignoreandtest/platformio.inimatch, as you may need to change a few lines. .
- Add an IR sensor for even more accurate detection.
- Use a rechargeable battery to make it portable.
- Upgrade to a larger bin for more practical use.
TrashSense.-.Video.1.mp4
TrashSense.-.Video.2.mp4
I decided to build this system to make throwing away trash easier and more hygienic, especially when your hands are full or messy. This project helps keep things clean while also being a fun and practical way to learn about Arduino and automation.
Thanks to EAZYTRONIC for the inspiration and guidance throughout this project. You can see their original video here.
Feel free leave a comment with any questions or concerns, and I will be happy to help you!
This project is open-source. Feel free to use, modify, and share your own versions!