An automated waste sorting prototype using microcontrollers, servo motors, and computer vision.
SmartSort is an engineering prototype built to test automated segregation of mixed household waste into three categories: Wet (organic/food scraps), Dry (clean recyclables), and Reject (soiled wrappers, composites, non-recyclables).
- Feeding: A rotating paddle wheel (driven by an Arduino Uno and an MG996R servo) meters waste items one at a time from a hopper onto an inspection platform.
- Drop Detection: An IR sensor detects when an item falls onto the inspection plate and signals the camera.
- Image Capture & Classification: A USB webcam captures a still frame. A Python script sends the image to Google's Gemini Vision API (or a local YOLO model) to classify the item into
WET,DRY, orREJECT. - Mechanical Diversion: Based on the classification, an ESP32 rotates a diversion chute to the target angle and drops the item into the corresponding bin.
- Microcontrollers: Arduino Uno (feeding wheel control) + ESP32 (inspection flaps & diversion chute)
- Actuators: 4 × MG996R standard hobby servo motors
- Sensors: 2 × IR proximity modules (drop confirmation) + USB webcam
- Chassis: Acrylic/wood experimental test rig with 3-way bin collection
waste_detector.py: Webcam capture, Gemini Vision API call, and serial command dispatcher.main_dashboard.py: Motion-settling frame detector and local model testing interface.Espcode/: Arduino/ESP32 C++ firmware controlling servo angles and serial command reception.
- Mechanical Jams: Real waste is irregular, sticky, and heterogeneous. Tangled plastic bags or food scraps frequently stick to the paddles or fail to drop cleanly from the inspection plate.
- Cloud Latency: Using Gemini Vision over a network introduces a 1–3 second roundtrip delay per item, which limits throughput.
- Lighting Sensitivity: Shadows, uneven ambient lighting, or a dirty webcam lens noticeably hurt classification accuracy.
- Hobby Servos Under Load: Standard MG996R servos are prone to overheating, gear stripping, or jitter under continuous mechanical resistance.
- Academic / Benchtop Scope: This is a small-scale student proof of concept, not a finished industrial waste sorting machine.
python3 -m venv venv
source venv/bin/activate
pip install opencv-python pillow pyserial google-genaiIn waste_detector.py:
- Set
GEMINI_API_KEYwith your Google AI Studio API key. - Set
ESP32_PORTto your microcontroller's serial device (e.g./dev/cu.usbserial-0001orCOM3).
Upload the code in Espcode/ to your ESP32 and Arduino boards using the Arduino IDE.
python waste_detector.pyMIT