Connect with Me

Connect with my social media or email me for Business

Back to projects
AI & embedded systemsFinite state machineCompleted capstone

Smart Trash Can with AI.

Recognize household waste, route it into one of four compartments, and display each compartment’s fill level. A team capstone combining YOLOv8s, Python, and a finite state machine on Raspberry Pi 4 Model B.

The completed Smart Trash Can prototype in the laboratory, with its enclosure and display
Capstone prototype · Telkom University2022–2023

Project recognition

Best Capstone Design Project

Batch 1 · July 2023

Waste categories
4
Organic, inorganic, plastic, and mixed.
Reported classification accuracy
87%
78 correct classifications in 90 prototype trials; rounded in the paper.
Average capacity height error
0.894 cm
40 fill-height measurements, reported in Table 6.

The challenge

Bring computer vision into a working physical system.

The project addressed household waste sorting with four compartments: organic, inorganic, plastic, and mixed waste. The challenge was to coordinate camera capture, classification, motor positioning, lid control, and capacity measurement in one repeatable workflow.

My contribution focused on integrating the software and hardware and implementing the system flow in Python on the Raspberry Pi.

The prototype used a controlled capture chamber with LED lighting and 640 × 480 camera images. Its object labels were mapped to the project’s four waste categories.

Interactive 3D

A closer look inside.

Powered by Raspberry Pi 4B, with camera-based recognition and motor-driven sorting. Inspect the hardware or follow a waste category through the system.

Controller, actuators & sensorsSelect a component above to inspect its 3D illustration and role in the prototype.
The completed Smart Trash Can prototype

Preparing the 3D illustration…

Choose a waste category

Fruit and vegetable waste, such as apples, bananas, and spinach.

Separate partsReveal the internal mechanism

An illustrated journey from camera to compartment.

Raspberry Pi 4B

One controller. Four waste routes.

Python coordinates the Pi Camera, YOLOv8s recognition, NEMA 17 motor, MG996R servo, and capacity feedback.

Schematic hardware illustrations based on the project paper, with simplified shapes and placement. Colors identify the four waste categories; the photos below show the physical build.

System overview

Recognize, distribute, monitor.

The Raspberry Pi connects the recognition model with the sorting mechanism and the display. A finite state machine coordinates when each part runs.

  1. 01

    YOLOv8s · Pi Camera

    Waste recognition

    An illuminated chamber captures 640 × 480 images. Recognized object labels are mapped to organic, inorganic, plastic, or mixed waste.

  2. 02

    Python FSM · NEMA 17 · MG996R

    Automatic distribution

    The state machine coordinates the rotating chamber, servo-driven lids, limit-switch calibration, and supporting door solenoid to route waste.

  3. 03

    HC-SR04 · ST7735 display

    Capacity feedback

    Calibrated ultrasonic sensing estimates the fill level. The 1.8-inch display shows the active process, classification result, and compartment capacities.

Control workflow

Explore the finite state machine.

Select a stage to see how the prototype moves from loading waste to updating the capacity display.

Stage 01

Prepare the controller and mechanism.

The system checks components, closes the lids, checks the camera, loads the recognition model, calibrates the distribution motor, and measures the initial compartment capacities.

Trigger
The system is powered on.
Next step
Display the compartment capacities and wait for the user.

Workflow summarized from the project paper.

Inside the prototype

The build and the detection results.

Annotated prototype views showing the top lid, push button, lighting, rotating mechanism, and camera chamber

Mechanical and camera integration

The paper shows the enclosure, top lid with LED lighting, rotating mechanism, and camera chamber above the bottom lid.

Project paper · Figure 6 · Select the image for full size

YOLOv8s detections of cardboard, a can, a bottle, and tissue in the prototype chamber

Object detection examples

Detection examples for cardboard, a can, a bottle, and tissue. The bounding-box confidence labels belong to these individual detections.

Project paper · Figure 11 · Select the image for full size

My contribution

Connect the software to the hardware.

  • Integrated YOLOv8s object recognition with the prototype’s Python software on Raspberry Pi 4 Model B.
  • Implemented the system flow that coordinates loading, recognition, physical distribution, and capacity feedback.
  • Connected the software to the project’s sensors, actuators, and display as part of the capstone team.

The result

A completed capstone, recognized for its design.

The team delivered a working system that recognizes waste, distributes it into the selected compartment, and updates the capacity display. The paper reports 87% classification accuracy in the prototype tests, with the detailed test scope below.

Recognized as Best Capstone Design Project, Batch 1, July 2023.

Measured results

What the prototype tests showed.

Tables 2 and 3 separate single-object and multiple-object classification. Together, they record 78 correct classifications in 90 trials, approximately 86.7%; the paper rounds the accuracy to 87%.

Classification results from Tables 2 and 3 of the project paper
Test setupCorrect / trialsReported accuracyAverage classification time
Single object · Table 252 / 6087%7.344 seconds
Multiple objects · Table 326 / 3087%7.292 seconds

Capacity monitoring · Table 6

40 measurements across eight fill heights.

At fill heights from 0 to 35 cm, the paper reports an average height error of 0.894 cm and a maximum error of 1.53 cm. The calibrated HC-SR04 measurement is converted to a fill percentage for the display.

Test scope

Results from the selected prototype conditions.

The tests used the paper’s selected object labels and a chamber with controlled lighting. Some cardboard, paper, and tissue inputs were misclassified, and some plastic inputs were undetected. Multi-object inputs could also map to the wrong waste category.

Project demonstration

See the prototype in action.

Watch the team’s project demonstration on YouTube.

Watch on YouTube

Research basis

Grounded in the project paper.

Implementation of Smart Trash Can for Household Scale Waste Management Using Raspberry Pi 4 B Model Using Finite State Machine (FSM) Method

Adhi Muhammad Fahmi, Zidan Surya Gibran, Husneni Mukhtar, and Willy Anugrah Cahyadi · Telkom University · July 2023 manuscript.

Figures 6 and 11 show the prototype and recognition examples. Tables 2–3 provide classification results; Table 6 provides capacity measurements.

Looks great to
see you in here!

Let's Connect with me on LinkedIn
or email me about your project