Skip to main content
Version: ACS CC

Smart Bin

info

Author: Robert Postolache
GitHub Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-RobertP1021

Description​

Smart Bin is a trash bin that automatically sorts waste without any user intervention. When it detects a hand nearby, it opens a flap and lets the object fall onto an internal analysis platform. There, humidity, metal, and weight sensors analyze the object and classify it into one of three categories: wet, dry, or metal. A motor then rotates the container platform until the correct one is in position, after which the object is released. If a container is full, the system refuses to accept new waste for that category.

Motivation​

My motivation to tackle this project came from my daily commute to work. Every day, before getting on the metro, I would buy a coffee cup and something to eat. Sometimes, if the metro was in the station, I hurriedly threw the cup and the food wrapper in the nearest trash bin, without looking for the correct label. So while I was searching for a project idea, I remembered that it would be nice to have a trash bin that could automatically sort the waste, without me having to worry about it.

Architecture​

Smart Bin is built around an STM32U545RE-Q Nucleo board that coordinates all sensors and actuators through firmware written in Rust with Embassy.

Main flow:

  1. The proximity sensor detects a hand at the entry and the first servo opens the entry flap
  2. The object falls onto the analysis platform where the following are read simultaneously:
    • humidity sensor
    • metal sensor
  3. Based on the readings, the microcontroller classifies the object as WET / DRY / METAL
  4. If the container is available: the stepper motor rotates the turntable to the correct position, the second servo releases the object
  5. The display shows feedback to the user about the classification result and if a container is full or not
  6. The fill level of the containers is checked (one infrared sensor per container)

Interfaces used:

  • SPI: ST7735 LCD Display
  • PWM: servo × 2
  • GPIO: stepper motor, metal sensor, infrared reflective sensors × 3
  • ADC: humidity sensor

Architecture Diagram

Log​

Week 5 - 11 May​

I bought the hardware components, and mapped out the pin connections. I started testing each component with simple and minimal code.

Week 12 - 18 May​

I completed the initial testing for each component, and presented them to the lab assistant.

Week 19 - 25 May​

I started integrating the components, and writing the main logic for the project. I also assembled the final version for PM Fair.

Hardware​

Schematics​

Hardware Schematic

Bill of Materials​

DeviceUsagePrice
STM32U545RE-Q NucleoMicrocontroller90 RON
Servo Motor SG90 × 2Entry flap + platform trapdoor13,99 RON × 2
TCRT5000 Infrared Line Sensor Module with Adjustable Sensitivity x 3Container fill level detection3.87 RON × 3
ULN2003 Stepper Driver + 5V Stepper MotorStepper motor control for turntable16.97 RON
Rain Sensor ModuleHumidity sensor for wet/dry9.99 RON
Senzor inductiv de proximitate - LJ12A3-4-Z/BXInductive proximity sensor for metal detection15.57 RON
Senzor Ultrasonic de Distanță HC-SR04+Ultrasonic sensor for hand detection14.99 RON
1.8 Inch 128 x 160 SPI TFT LCD Display Module ST7735 51/AVR/STM32/ARM 8/16 Bit Display for user feedback45.86 RON
Breadboard + Jumper WiresConnections15 RON
Resistors assortedPull-ups, current limiting5 RON

Software​

Embassy framework​

  • embassy-executor
  • embassy-stm32
  • embassy-time
  • embassy-embedded-hal
  • embassy-sync

Display​

  • mipidsi
  • display-interface-spi
  • embedded-graphics

Hardware​

  • embedded-hal

Software Diagram​

Software Diagram

LibraryDescriptionUsage
embassy-stm32Async HAL for STM32Pin control, PWM, SPI, ADC
embassy-executorAsync executor for embeddedRunning concurrent tasks
embassy-timeAsync timers and delaysTiming for sensors and motors
embassy-embedded-halEmbedded HAL adapters for EmbassySPI bus sharing for display
embedded-graphics2D graphics library for embeddedRendering text on the display
embedded-halHardware abstraction layer traitsPWM control for servo motors
mipidsiDisplay driver for MIPI displaysST7735 display driver
display-interface-spiSPI display interfaceSPI communication with ST7735

Project Photos​

photo1

photo2

photo3

photo4

photo5

  1. Embassy - Async framework for embedded Rust
  2. STM32U545RE-Q Nucleo Documentation
  3. embedded-graphics
  4. PM Course Website