This project creates a hands-free rubbish bin that automatically opens its lid when it detects someone approaching.
The system uses an ultrasonic sensor to measure the distance between the bin and any object in front of it. When someone moves within 30cm of the sensor, a servo motor smoothly opens the lid. The lid remains open for 5 seconds, giving users ample time to dispose of their waste, before automatically closing again. An LED indicator also illuminates when the lid is open.
Parts List
- Arduino board
- HC-SR04 ultrasonic distance sensor
- Servo motor
- LED
- 220Ω resistor
- Connecting wires
- Bin or container with a lid
- Mounting materials (brackets, screws, hot glue, etc.)
Assembly Instructions
- Connect the ultrasonic sensor to the Arduino:
- VCC to 5V
- GND to GND
- TRIG to pin 12
- ECHO to pin 11
- Connect the servo motor to the Arduino:
- Red wire to 5V
- Brown/Black wire to GND
- Orange/Yellow wire to pin 9
- Connect the LED to the Arduino:
- Anode (longer leg) to pin 5 via the 220Ω resistor
- Cathode (shorter leg) to GND
- Mount the ultrasonic sensor to the front of your bin where it can detect approaching users
- Attach the servo motor to the bin in a position where it can open and close the lid
- Secure the lid to the servo arm, ensuring it can move freely between open and closed positions
- Mount the LED in a visible location on the bin