Smart Garbage Sorter: Color-Based Object Detection for Waste Segregation

The Problem

People are often unaware of which bin to use. A plastic bottle ends up in the organic waste bin, a banana peel goes into recycling, and a glass jar gets tossed in with general trash. The result? Contaminated recycling streams, overflowing landfills, and wasted resources that could have been repurposed.

Can we make a new technology that prevents people from doing this false deed? Can we build something that tells you exactly where to throw your waste, automatically?


Our Solution

We built a Smart Garbage Sorter — an Arduino-based system that uses object detection and color recognition to automatically sort waste into the correct bin. No more guessing. No more contamination. Just drop your waste in, and let the machine do the rest.

How It Works

  1. Object Detection: An ultrasonic sensor detects when an object is placed in the sorting compartment.
  2. Color Recognition: A TCS3200 color sensor reads the RGB values of the object.
  3. Classification: Based on the color detected, the system determines the waste category
  4. Automated Sorting: A servo motor rotates a sorting flap to direct the waste into the appropriate bin.
  5. Feedback: An LCD display shows the user which bin is being used, providing real-time feedback.

Implementation Logic and Code

Hardware Components

  • Arduino Uno — Microcontroller brain of the system
  • TCS3200 Color Sensor — Detects RGB values of the object
  • HC-SR04 Ultrasonic Sensor — Detects presence of waste
  • Servo Motor (MG995) — Rotates sorting mechanism
  • LCD 16x2 Display — Shows bin status and feedback
  • LED Indicators — Visual feedback for bin selection
  • 3 Bins — Recyclable, Organic, General Waste

Pin Assignments

Component Arduino Pin
TCS3200 Output (OUT) D2
TCS3200 S2, S3 D4, D5
Ultrasonic Trigger D9
Ultrasonic Echo D10
Servo Signal D11
LCD I2C A4 (SDA), A5 (SCL)
Red LED (Recycling) D6
Green LED (Organic) D7
Blue LED (General) D8

Color Detection Logic

The TCS3200 color sensor uses frequency measurement to detect RGB values:

// Read RGB values from TCS3200
void readColor(int &red, int &green, int &blue) {
  // Set red filter
  digitalWrite(S2, LOW);
  digitalWrite(S3, LOW);
  red = pulseIn(OUT, LOW);

  // Set green filter
  digitalWrite(S2, HIGH);
  digitalWrite(S3, HIGH);
  green = pulseIn(OUT, LOW);

  // Set blue filter
  digitalWrite(S2, LOW);
  digitalWrite(S3, HIGH);
  blue = pulseIn(OUT, LOW);
}

Built With

Share this project:

Updates