Smart Sorting Trash Can

UC Berkeley team project, January to May 2026

Automated waste sorting with computer vision

A two-stream sorter for recyclables and general waste. An infrared break-beam sensor triggers image capture, a ResNet50 convolutional neural network fine-tuned from ImageNet weights classifies the item, and a servo-actuated tilting platform deposits it by gravity into the matching bin. Designed, built, and trained by a 14-person interdisciplinary team in one semester; the unit is now in daily use.

Peak classification confidence
95%
Training images
10,000+
Enclosure (in)
15×30×20
Team members
14
The finished sorter from above: a clear polycarbonate intake chamber between two red lids labeled Trash and Recycle, on a black-painted wood base.
Final assembly. Items enter the central polycarbonate intake chamber; the hinged lids on either side give access to the trash and recycling bins.

Sorting sequence

Every item passes through the same five-stage sequence: deposit, detection, image capture, inference, and actuation. Select an example item to step through it.

  1. 1

    Deposit

    The item lands on a single-axis hinged platform inside the intake chamber.

  2. 2

    Detection

    The item interrupts an infrared break-beam at the intake, sending a trigger signal to the Raspberry Pi.

  3. 3

    Image capture

    A lid-mounted Pi camera acquires a single frame of the item on the platform.

  4. 4

    Inference

    The frame is sent to a FastAPI inference server running the ResNet50 model, which returns a predicted class and its softmax confidence.

    Pick an item above.

  5. 5

    Actuation

    RecyclingRecyclable, confidence above threshold
    TrashGeneral waste, or confidence below threshold

The decision rule is deliberately asymmetric. Any prediction below the confidence threshold defaults to general waste, because a false positive (trash sent to recycling) contaminates the recycling stream, while a false negative only loses one recyclable item. The threshold trades recall on the recyclable class for higher precision.

Hardware

Sorting combines active actuation with passive, gravity-driven transport: the servos set the platform's inclination, and gravity moves the item.

SolidWorks model of the enclosure: two bin compartments with pull-out drawers and a raised intake box in the middle.
Final CAD. Two pull-out bins sit under a central intake chamber.

Mechanical design

Waste enters through the top intake and comes to rest on a platform hinged about a single axis. Once a classification is returned, the Raspberry Pi drives two 25 kg·cm servos mounted at the platform base with a PWM signal, rotating the platform to a preset angle toward the target bin. The item then slides off under gravity. Using gravity for transport keeps the mechanism to one degree of freedom and two actuators.

The enclosure was modeled parametrically in SolidWorks. We defined the outer enclosure and bin layout first, then integrated the intake chamber and pivoting platform, and iterated on clearances until the platform could rotate fully in both directions without interference.

Components

  • ControllerRaspberry Pi
  • SensingIR break-beam sensor, Pi camera
  • Actuation2 × 25 kg·cm servos on PWM
  • PowerUSB power bank
  • EnclosurePolycarbonate intake, painted wood frame, 15 × 30 × 20 in
Wiring diagram: Raspberry Pi connected to a camera module, an IR sensor, two servo motors, and a battery pack.
Wiring diagram

Electronics

A single Raspberry Pi handles sensing, communication, and control. The camera module connects through the CSI ribbon port and is mounted in the lid above the intake. The IR break-beam sensor and both servos connect to GPIO, with each servo receiving power, ground, and a PWM control line.

Component placement follows the item's path through the system: the sensor at the point of entry, the camera directly above the resting position, and the actuators beneath the platform.

Classification model

Binary image classification (recyclable vs. general waste) by transfer learning from an ImageNet-pretrained ResNet.

Validation accuracy per epoch for the ResNet-18 baseline (15,000 images, 12,750 train / 2,250 validation). Accuracy exceeded 95% by epoch 6 and reached 95.2% at epoch 8.

Architecture and training

The deployed classifier is a ResNet50 convolutional neural network trained on 10,000+ labeled images from a public Kaggle dataset. Initializing from ImageNet weights lets the network reuse general visual features (edges, textures, shapes), which converges faster and generalizes better on a dataset of this size than training from random initialization.

Before the final model, we trained a lighter ResNet-18 baseline with the same pipeline to validate the approach. It reached 95.2% validation accuracy after 8 epochs, as shown in the accuracy curve.

Preprocessing and augmentation

Images were resized to 224 × 224 pixels and normalized to the ImageNet channel means and standard deviations, matching the statistics of the pretrained weights. Random horizontal flips, rotations, and color jitter were applied during training to reduce sensitivity to orientation and lighting. Training used the Adam optimizer with cross-entropy loss.

Deployment

Inference runs on a FastAPI server (Uvicorn). The Raspberry Pi posts each captured frame to the server, receives the predicted class and confidence, applies the threshold rule, and issues the corresponding servo command.

Pipeline diagram: data collection from a Kaggle dataset, ResNet-18 model, preprocessing to 224 by 224 with ImageNet normalization and random flips, training loop with Adam and cross-entropy loss, deployment with FastAPI, Picamera, and Uvicorn.
Training and deployment pipeline (shown for the ResNet-18 baseline)
Terminal output from train.py showing 15,000 samples, ImageNet-pretrained ResNet-18, and validation accuracy for epochs 1 through 8.
Training log for the ResNet-18 baseline

Odor control and material selection

The chemical engineering subsystem: sanitation and odor management inside a closed container, and material choices for a moist, mixed-waste environment.

A bottle of 91% isopropyl alcohol, a small amber bottle of scented oil, and a clear spray bottle on a windowsill.
91% isopropyl alcohol, scent oil, and the spray bottle for the diluted mix.

Disinfectant

The cleaning solution is 70% (v/v) isopropyl alcohol, diluted from 91% stock. Aqueous alcohol at this concentration is a more effective disinfectant than higher concentrations: water slows evaporation, extending contact time, and is required for the alcohol to penetrate cell walls and denature proteins. We compared several dilutions to balance material cost against cleaning efficacy.

Scent

The first formulation dissolved fragrance in the alcohol carrier. Because the carrier is highly volatile, the fragrance evaporated with it and odor masking did not persist. We switched to an oil-based fragrance, whose lower vapor pressure gives a slower, sustained release inside the enclosed bin.

Materials

The intake chamber is polycarbonate, chosen for its resistance to moisture from wet waste and its optical transparency, which gives the camera a clear view of the platform. Structural members and bins are wood, which is far easier to machine and modify than polycarbonate and suited rapid iteration during prototyping.

Development

From initial CAD concept to a working, tested unit.

  1. Early CAD mock-up of the enclosure.
    Initial CAD concept
  2. Four team members assembling the unpainted plywood enclosure with the clear intake box on top.
    Enclosure assembly
  3. Two team members reviewing plans on a tablet.
    Build planning
  4. Team member at a laptop and monitor running the training script.
    Model training
  5. Two team members measuring isopropyl alcohol into a spray bottle by a window.
    Disinfectant formulation
  6. Two team members wiring the camera and electronics into the painted lid.
    Camera and sensor integration

Videos

Demo

Second demo

Assembly timelapse

Team

Fourteen UC Berkeley students across chemical, mechanical, and civil engineering, EECS, and data science.

The fourteen team members in business attire in front of a campus building.
  • Aiden ReyesEECS, 2029
  • Angel RamirezEECS, 2029
  • Boyi HuMechanical Engineering, 2029
  • Deetya SrivatsavayaMechanical Engineering, 2029
  • Genevieve MoralesChemical Engineering, 2029
  • Jerry ZhangData Science + Statistics, 2028
  • Johnson ToChemical Engineering, 2029
  • Lana MoraledaChemical Engineering, 2029
  • Megan ZhangData Science, 2029
  • Michael NguyenData Science, 2029
  • Natasha NirmalData Science, 2028
  • Nick DengEECS, 2029
  • Victor NolascoCivil Engineering, 2029
  • Wyndham WooData Science, 2029