A smart dustbin is an automated, touchless trash can that opens its lid automatically when it detects a person's hand or garbage approaching. It uses an ultrasonic sensor to measure distance. When an object comes within a specific range (e.g., 20 cm), the Arduino triggers a servo motor to lift the lid. After a few seconds of inactivity, the lid automatically closes. It’s a highly hygienic and practical addition to any desk or kitchen.
This is an excellent weekend project for beginners. It combines two of the most popular Arduino components: the HC-SR04 ultrasonic sensor and the SG90 servo motor. The mechanical integration of attaching the servo to the lid mechanism provides a fun, hands-on crafting experience alongside the electronics.
Take a small, lightweight plastic trash can with a hinged lid. Mount the HC-SR04 sensor on the front. Mount the servo motor near the hinge at the back. Connect a rigid wire or a piece of plastic from the servo horn to the lid. In your Arduino code, constantly read the distance from the ultrasonic sensor. If the distance is < 20cm, command the servo to rotate 90 degrees to open the lid. Use a `delay()` or a `millis()` timer to hold it open for 3 seconds before returning the servo to 0 degrees.
The standard distance-measuring sensor. It uses sound waves to accurately detect hands or objects approaching the bin.
A small, affordable motor capable of precise 180-degree rotation, perfect for lifting lightweight plastic lids.
A compact version of the Arduino Uno. Its small size makes it easy to hide inside the dustbin enclosure.
You need an Arduino (Uno or Nano), an HC-SR04 ultrasonic sensor, a micro servo motor (SG90 for small bins, MG996R for heavier lids), a battery pack (like a 9V or 4xAA), and a regular hinged dustbin.
Q: My servo motor keeps jittering and the Arduino resets when it opens. Why?
A: Servo motors draw a lot of current when moving. If powered directly from the Arduino's 5V pin, it can cause a voltage drop that resets the board. Power the servo from a separate battery pack, ensuring you connect the grounds of the battery and the Arduino together.
The smart dustbin is a clever, hygienic project that brings automation into everyday life. It’s a perfect demonstration of how simple sensors and motors can work together to solve minor inconveniences. Build your own touchless bin with components from TecnoMate today!
Explore our collection of DIY kits and components. All project components mentioned in this guide are available in our store.
Browse All Projects