Skip to main content
Version: ACS CC

Smart Trash Can

A contactless, smart solution for detecting full trash bins and automatically opening the lid.

INFO

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

Architecture Diagram

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.

poza1 poza2 poza3

Demo

Watch the demo video on YouTube

Schematics

schematics Diagram

Bill of Materials

ComponentQuantityDescriptionPrice (RON)
Raspberry Pi Pico W2Main microcontroller unit37.00 x 2
HC-SR04 Ultrasonic Sensor2Measures distance to detect if the trash bin is full9.00 x 2
Infrared Obstacle Sensor1Detects hand movement near the trash can3.50
SG90 Micro Servo Motor1Opens the bin lid automatically11.99
Passive Buzzer1Alerts when the bin is full and whose turn it is0.99
Breadboard Kit with Wires & Power Supply1For prototyping and connecting components22.00
Female Pin Headers4 stripsConnect to male pins on the board and sensors2.00 x 4
Battery Holder (2x18650)1Provides portable power to the system3.99
DC-DC Step-Down Module LM2596HV1Regulates voltage from battery to appropriate level for components12.99

Software

LibraryDescriptionUsage
embassy-executorAsynchronous executor for embedded systemsUsed to define and run concurrent tasks (e.g., servo control, buzzer)
embassy-timeTime and delay utilities for embedded async RustUsed for delays, timers, and periodic sampling
embassy-rpRaspberry Pi Pico HAL with Embassy supportUsed to initialize and interact with PWM, GPIO, and other peripherals
fixedFixed-point arithmetic libraryUsed to configure PWM divider values precisely
defmt-rttLogging over RTTUsed for lightweight logging/debugging during development
panic-probePanic handler with debug infoUsed to report errors if something goes wrong at runtime
  1. Embassy async embedded framework – Modern embedded async executor used in your project.
  2. HC-SR04 Ultrasonic Sensor in Rust – Crate for controlling the HC-SR04 distance sensor.
  3. Rust Embedded on Raspberry Pi Pico – PWM control example for servos on the Raspberry Pi Pico using Embassy.
  4. Sneha711/Smart-Trash-Can – A similar project written in Python using a Raspberry Pi and motion detection.