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
- This week, I focused on shaping the overall concept of the project. I worked on the documentation, clarified the main functionalities, and outlined how the system should behave. I also made a first draft of the list of components I would need, researching their roles and how they would connect together.
- This week, I focused on shaping the overall concept of the project. I worked on the documentation, clarified the main functionalities, and outlined how the system should behave. I also made a first draft of the list of components I would need, researching their roles and how they would connect together.
Week 12 - 18 May
- I began working on the hardware side of the project. I started assembling the components, connecting the sensors and microcontroller, and testing how they work together on the breadboard. During this stage, I also finalized and completed the Bill of Materials based on the actual needs of the system.
- I began working on the hardware side of the project. I started assembling the components, connecting the sensors and microcontroller, and testing how they work together on the breadboard. During this stage, I also finalized and completed the Bill of Materials based on the actual needs of the system.
Week 19 - 25 May
- This week, I focused on implementing the software functionalities. I tested each hardware component individually to ensure proper operation. Once confirmed, I integrated them into an asynchronous system, allowing them to work together smoothly. Additionally, I strategically assembled and mounted each component on the physical trash can to ensure optimal placement and functionality.
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.
Demo
Watch the demo video on YouTube
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 | 11.99 |
Passive Buzzer | 1 | Alerts when the bin is full and whose turn it is | 0.99 |
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 | 3.99 |
DC-DC Step-Down Module LM2596HV | 1 | Regulates voltage from battery to appropriate level for components | 12.99 |
Software
Library | Description | Usage |
---|---|---|
embassy-executor | Asynchronous executor for embedded systems | Used to define and run concurrent tasks (e.g., servo control, buzzer) |
embassy-time | Time and delay utilities for embedded async Rust | Used for delays, timers, and periodic sampling |
embassy-rp | Raspberry Pi Pico HAL with Embassy support | Used to initialize and interact with PWM, GPIO, and other peripherals |
fixed | Fixed-point arithmetic library | Used to configure PWM divider values precisely |
defmt-rtt | Logging over RTT | Used for lightweight logging/debugging during development |
panic-probe | Panic handler with debug info | Used to report errors if something goes wrong at runtime |
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.