Smart Trash Can
A contactless, smart solution for detecting full trash bins and automatically opening the lid.
Author: Delia Tudor
GitLab Project Link: https://github.com/UPB-PMRust-Students/proiect-Delia37
Description
The Smart Trash Can is designed to make household waste management more hygienic, intelligent, and fair — especially in shared living spaces. The bin opens its lid automatically when a person approaches, using an infrared motion sensor that detects hand movement without requiring any physical contact.
To monitor the trash level, the system uses an ultrasonic distance sensor, which determines when the bin is full. When this happens, an audible buzzer alert is triggered to let users know it’s time to empty it.
What makes the project more engaging is its roommate-friendly logic: the software allows you to enter the number of people in the apartment, and when the trash fills up, the buzzer plays a personalized alert to indicate whose turn it is to take the trash out — solving the eternal “not my turn” dilemma in a smart, automated way.
Motivation
Taking out the trash is a task often postponed, especially in shared living spaces where no one feels responsible. Additionally, touching the bin lid can be unpleasant or unhygienic. This project was created to solve both problems by building a smart trash can that opens automatically when someone approaches and signals clearly when it’s full. The goal is to make waste disposal more hygienic, efficient, and user-friendly.
Architecture
Log
Week 5 - 11 May
Week 12 - 18 May
Week 19 - 25 May
Hardware
- Raspberry Pi Pico W – the microcontroller that runs the software and controls all components.
- Infrared Sensor – detects movement (e.g., a hand) near the trash can to trigger the lid to open automatically.
- Ultrasonic Sensors (HC-SR04) – used to measure the distance from the top of the bin to the trash, helping determine when it’s full.
- SG90 Servo Motor – lifts the lid of the trash can when motion is detected.
- Buzzer – sounds an alert when the bin is full and indicates whose turn it is to take out the trash.
- Breadboard, wires, power supply – used for prototyping and connecting all components easily.
- Male and Female Pin Headers – allow modular, solder-free connections between components and the microcontroller.
- Battery Holder (2x 18650) – powers the entire circuit without needing a USB connection.
- Mounting Bracket – securely holds the ultrasonic sensor inside the trash can.
Schematics
Bill of Materials
Component | Quantity | Description | Price (RON) |
---|---|---|---|
Raspberry Pi Pico W | 2 | Main microcontroller unit | 37.00 x 2 |
HC-SR04 Ultrasonic Sensor | 2 | Measures distance to detect if the trash bin is full | 9.00 x 2 |
Infrared Obstacle Sensor | 1 | Detects hand movement near the trash can | 3.50 |
SG90 Micro Servo Motor | 1 | Opens the bin lid automatically | 8.00 |
Active Buzzer 5V | 1 | Alerts when the bin is full and whose turn it is | 2.00 |
LED & Resistor Kit | 1 set | Provides visual indicators (e.g., full bin signal) | 15.00 |
Breadboard Kit with Wires & Power Supply | 1 | For prototyping and connecting components | 22.00 |
Female Pin Headers | 4 strips | Connect to male pins on the board and sensors | 2.00 x 4 |
Battery Holder (2x18650) | 1 | Provides portable power to the system | 6.50 |
Bracket for HC-SR04 Sensor | 1 | Mounts the ultrasonic sensor in position inside the trash can | 3.00 |
Software
Library | Description | Usage |
---|---|---|
embassy-executor | Asynchronous executor for Rust embedded systems | Used for task scheduling and asynchronous programming |
embassy-time | Time management library | Used for time-based operations such as delays |
embassy-rp | Peripheral access library | Used for initializing and interacting with peripherals |
gpio | GPIO control library | Used to control the pins connected to the sensors, buzzer, and servo |
panic-halt | Panic handler for embedded Rust | Used to stop the program safely in case of an unrecoverable error |
HC-SR04 | HC-SR04 manipulation | Used for controlling the ultrasonic sensor |
Links
- Embassy async embedded framework – Modern embedded async executor used in your project.
- HC-SR04 Ultrasonic Sensor in Rust – Crate for controlling the HC-SR04 distance sensor.
- Rust Embedded on Raspberry Pi Pico – PWM control example for servos on the Raspberry Pi Pico using Embassy.
- Sneha711/Smart-Trash-Can – A similar project written in Python using a Raspberry Pi and motion detection.