Sanitary Mechanisms: EasyTrash 1.0 Smart Bin
The EasyTrash 1.0 (often called the Smart Dustbin) is the undisputed king of beginner Arduino robotics. It marries the mathematical distance-checking of an HC-SR04 sonar module with the physical push-and-pull mechanics of a Micro Servo, preventing users from ever having to touch a disgusting garbage can lid in their kitchen.

The Sonar Cone of Detection
The HC-SR04 Ultrasonic Sensor is mounted on the front lip of the garbage can, facing straight forward horizontally.
- The Arduino
loop()fires a 40kHz ping every 100 milliseconds. - The user walks up holding a huge pile of trash. The sound waves hit their body and bounce back!
- The State Threshold:
if(distance < 30cm) { OpenLid(); } - By keeping the distance small (30cm), the can won't open accidentally if a dog walks past the kitchen 5 feet away.
The Servo Kinematic Fulcrum
A massive garbage can lid is incredibly heavy. A cheap SG90 servo has almost zero torque. Understanding the mechanical fulcrum is mandatory!
- The Wrong Way: Glueing the servo directly to the hinge. The lid acts like a massive lever arm, and the servo's plastic gears will instantly strip off and shatter.
- The Right Way:
- Mount the servo to the back wall of the can.
- Drill a hole in the lid edge. Attach a stiff metal paperclip wire from the servo horn to the lid hole.
- When the Arduino executes
servo.write(90);, the servo arm simply pulls straight down on the wire rod, utilizing leverage to effortlessly fling the heavy lid 90-degrees upward! delay(5000); servo.write(0);The system gracefully drops the lid closed.
Core Robotic Mechanics
- Arduino Nano (Hot glued inside a small tupperware box to protect it from juice spills).
- HC-SR04 Ultrasonic Distance Sensor.
- MG996R Metal Gear Servo (Highly recommended over the tiny blue SG90 for longevity).
- A 9V Battery or USB Power Bank for long-term kitchen deployment.