Inspiration There's so much littering around us, and trash ends up on the floor simply because the can is never close enough. We wanted to build something that closes that gap: a robot that brings the trash can to you instead of the other way around.

Beyond convenience, we saw real value for people with mobility limitations or physical conditions, and for elderly folks for whom something as small as walking across a room to throw something away can be a real chore. TrashBot handles that step automatically as it follows you, takes your trash, and drives it to the nearest bin on its own, saving time and effort for everyone, especially those who need it most.

What it does

  • Follows you: Tracks an AprilTag worn on your back, keeps a set following distance, and turns to look for you if it loses sight of you.
  • Knows when it has trash: An IR sensor inside the compartment notices when you drop something in. You can also tap "Go dump" in the iPhone app.
  • Remembers where the bins are: Every trash can it sees along the way is saved to a map built from its own movement.
  • Takes out the trash: It drives back toward the nearest known bin, searches for it with the camera, closes in using the ultrasonic sensor, and tips its compartment into the can with a servo.
  • iPhone companion app: Live camera feed, robot state, and a map of trash cans pinned with your phone's GPS.

How We Built It Hardware: A Raspberry Pi 4B runs vision and decision-making. It sends commands over USB serial to an Arduino, which drives the motors through a TB6612 motor driver and reads an HC-SR04 ultrasonic sensor, an IR sensor for trash, and the dump servo. The Arduino stops the motors on its own if the Pi goes silent for more than 500 ms.

Software: Everything is in Python. A state machine moves between FOLLOW → GO_TO_BIN → SEARCH_BIN → APPROACH_BIN → THROW and back to FIND_PERSON. Following the person is a proportional controller on the tag's distance and angle from the camera's center:

v=Kp,(dperson-dfollow),bearing

We have no wheel encoders, so we estimate position by dead reckoning from the motor commands. The rough position gets the robot close to a bin, and then the camera takes over.

Trash-can detection: We tried two approaches:

  1. We trained a YOLO11n model on about 1,000 labeled trash-can photos, including synthetic images built from backgrounds at the venue (mAP50 ≈ 0.65).
  2. We used YOLOE visual prompting. Our teach_bin.py tool lets you draw one box around a real bin, and the model then finds anything that looks like it. This was far better on the venue's bins.

App: A SwiftUI iPhone app talks to a small HTTP server on the Pi over Wi-Fi. The robot has no GPS, but your phone is always with the person it's following, so the app pins each can at the phone's location from the moment the robot first saw it.

Challenges we ran into

  • The Pi is slow: YOLOE-11m took 4.7 s per frame on the Pi 4. Switching to 11s brought that down to 1.4 s and it still found the bins. We also moved detection to a background thread so following the person stays smooth.
  • Text prompts failed on real bins: The venue's blue recycling cabinets don't look like the typical "trash can," so text prompts found nothing. One example photo with a box around a bin found all 4.
  • Position drift without encoders: Dead reckoning drifts quickly, so we built the approach to trust the camera and the ultrasonic sensor over the map once a bin is in view.
  • Timing: Detection results arrive seconds late, so we store the robot's position from when each frame was captured and place the bin relative to that.

Accomplishments that we're proud of

  • A complete loop running on real hardware: follow, collect, find a bin, dump, come back.
  • Teaching the robot a new kind of bin from one photo in a few seconds.
  • A simulation mode that runs the whole stack on a laptop with no Arduino attached, so we could all work in parallel.

What we learned We learned about fitting ML onto small hardware, controlling a robot that has no encoders, splitting work between a Pi and an Arduino, and how models that work on internet photos can fail on the objects actually in front of you.

What's next for TrashBot

  • Wheel encoders and an IMU for accurate positioning
  • Sorting recycling from landfill trash with the camera
  • A lift mechanism so it can empty into full-height bins
  • Following people without needing an AprilTag

Built With

Share this project:

Updates

Submission history