Why This Project Matters
Recycling systems are only as effective as the quality of the waste being sorted. Mixed waste streams reduce recycling efficiency and can contaminate reusable materials.
This project addresses that problem by:
- Automatically identifying waste items using AI
- Physically sorting recyclables with a servo
- Flagging hazardous batteries with a buzzer
- Reducing the need for manual intervention
- Demonstrating a real-world use case for TinyML
It is well-suited for:
- Engineering student projects
- Science fairs
- Smart city prototypes
- Recycling awareness demonstrations
- Embedded AI learning

How It Works
A USB camera continuously captures images of objects placed in front of the system.
A custom object detection model trained with Edge Impulse recognizes four classes:
- Paper
- Cardboard
- Plastic
- Battery
The Python application validates each detection using confidence thresholds and stability counters to avoid false triggers.
Once an object is confirmed:
| Detected Item | Action |
|---|---|
| Paper | Servo rotates to 0° |
| Cardboard | Servo rotates to 0° |
| Plastic | Servo rotates to 180° |
| Battery | Buzzer sounds for 2 seconds |
After sorting, the servo returns to its neutral 90° position.

Hardware Used
- Arduino UNO Q
- USB webcam
- SG90 micro servo motor
- Active buzzer
- USB hub
- Jumper wires
- Cardboard or acrylic frame
- A laptop for running the Python application
Software Stack
Edge Impulse
Used to collect images, label datasets, train the object detection model, and export it for deployment.
Arduino App Lab
Runs the Python-based application and bridges high-level AI decisions to the microcontroller.
Python
Handles camera input, detection filtering, and command execution.

Wiring Summary
| Component | Arduino Pin |
|---|---|
| Servo Signal | D9 |
| Buzzer | D8 |
| Power | 5V |
| Ground | GND |
The camera connects to the host computer through USB.

Machine Learning Workflow
The object detection model was trained using images of:
- Paper sheets
- Plastic containers
- Cardboard pieces
- Batteries
The dataset was labelled in Edge Impulse and trained as an object detection model. After deployment, the model runs in real time and outputs class labels and confidence scores.
To improve reliability:
- Confidence threshold: ~82%
- Battery threshold: ~88%
- Stable detections required across multiple frames
- Cooldown periods prevent repeated actions

Control Logic
The project uses a two-layer architecture:
Python Layer
- Receives detections from the model
- Filters noise
- Determines sorting action
- Sends commands to the Arduino
Arduino Layer
- Receives commands using RouterBridge
- Moves the servo
- Activates the buzzer
This separation keeps the system modular and easy to upgrade.

Build Notes
The prototype bin was constructed from cardboard, making it inexpensive and quick to iterate.
The servo acts as a diverter gate:
- Left position: biodegradable items (paper/cardboard)
- Right position: plastic
- Neutral: waiting state
Batteries are not dropped automatically; instead, the buzzer alerts the user to remove them for safe disposal.

Performance and Observations
During testing, the system reliably sorted well-lit objects presented one at a time.
What worked well:
- Stable multi-frame confirmation reduced false positives
- Servo sorting was repeatable
- Battery alerts were highly effective
Areas for improvement:
- Larger dataset for better generalization
- Conveyor-based feeding
- Fill-level sensors
- Cloud dashboard for usage analytics
Future Enhancements
Potential upgrades include:
- ESP32-S3 for standalone inference
- Additional classes such as metal, glass, and organic waste
- Mobile notifications
- Solar power
- IoT monitoring
Applications
This project can be adapted for:
- Smart homes
- Schools and universities
- Recycling centers
- Public spaces
- Smart city initiatives
What I Learned
This build was an excellent exercise in combining embedded...
Read more »
ElectroScope Archive