An automated waste sorting system that combines computer vision and Arduino control to classify waste and route it physically in real time.
The project uses a camera with YOLO for object detection, a Gemini vision model for material classification, and an Arduino Uno to control doors and a conveyor belt based on the classification result. So in brief the system detects an object, classifies its material, and activates motors and doors to guide it to the correct path.
- 0: Carton
- 1: Plastic
- 2: Other
- Pin 2: Responsible for returning the left and right doors to their normal state (closed).
- Pin 3: Opens the left door to route carton waste after classification.
- Pin 4: Opens the right door to route plastic waste after classification.
- Pin 7: Runs the conveyor belt, moving the waste item through the system during sorting.
- The camera runs continuously and monitors the scene in real time.
- YOLO performs object detection on the live video feed.
- When an object is detected and the cooldown period has passed, a frame is captured.
- The captured image is saved to the
imagesfolder with a timestamp. - The saved image is sent to the Gemini vision model for waste classification.
- The model returns a single label: 0 (carton), 1 (plastic), or 2 (other).
- The label is sent from Python to the Arduino via serial communication.
- The Arduino starts the sorting cycle by activating Pin 2 to reset the system.
- Based on the received label:
- Label 0 (Carton): Opens the left door (Pin 3) and runs the belt (Pin 7).
- Label 1 (Plastic): Opens the right door (Pin 4) and runs the belt (Pin 7).
- Label 2 (Other): Keeps both doors closed and only runs the belt (Pin 7).
- After the belt finishes running, all pins are reset and the system waits for the next object.