Recycling Sorting Robot Powered by Google Coral Edge TPU
Did you know that contamination rates in recycling facilities can reach up to 25%? That means one in four items never makes it into the recycling stream, largely due to human error during sorting. As climate change intensifies, reducing contamination is more critical than ever. Our solution—an autonomous sorting robot that uses Google Coral Edge TPU and machine‑learning object detection—cuts contamination rates dramatically while lowering operational costs.
Demo
Code Repository
Clone the full project on GitHub to follow along.
Step 1: Acquire the Dataset
Training an accurate object‑detection model requires a diverse set of labeled images. We used the TrashNet dataset, which contains 2,527 images across six classes:
- Glass – 501 images
- Paper – 594 images
- Cardboard – 403 images
- Plastic – 482 images
- Metal – 410 images
- Trash (non‑recyclable) – 137 images
The dataset is available for download on Google Drive. For quick training, download the pre‑resized archive (dataset-resized.zip). If you prefer custom resizing, use dataset-original.zip.
Step 2: Label the Images
We used labelImg to annotate bounding boxes around each object. Bounding boxes should snugly fit each item to maximize model accuracy. All annotation files (.xml) are stored in a dedicated folder. If labeling is time‑consuming, download our pre‑annotated dataset here.
Step 3: Train the Model
We employed TensorFlow’s transfer‑learning pipeline with the MobileNet‑SSD v2 (COCO) backbone, which is fully compatible with the Coral Edge TPU. Training can be performed locally or in the cloud. Local training is straightforward but slower; for accelerated results, use Google Cloud TPU or AWS GPU instances following Google’s tutorial or the EdjeElectronics guide.
Step 4: Compile for the Coral Edge TPU
After training, export the model as a frozen graph (.pb), then convert it to TensorFlow Lite with post‑training quantization. Finally, compile the TFLite model to an Edge TPU binary using edgetpu_compiler. For full instructions, see the Edge TPU compiler documentation.
Step 5: Deploy on Raspberry Pi
Set up a Raspberry Pi 4 with the Coral USB Accelerator and the Raspberry Pi Camera Module following the official setup guide. Once ready, run:
python test_detection.py \
--model recycle_ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03/detect_edgetpu.tflite \
--labels recycle_ssd_mobilenet_v2_quantized_300x300_coco_2019_01_03/labels.txt
A live window will display detections; press q to exit.
Step 6: Build the Robotic Arm
The arm is a 3D‑printed, six‑degree‑of‑freedom manipulator sourced from Thingiverse. Follow the assembly instructions and connect the servos in the following order (bottom to top): 3, 11, 10, 9, 6, 5. Upload basicMovement.ino to the Arduino to test grabbing and placing.
Step 7: Integrate RPi and Arm
Mount the camera at the base of the arm’s claw to minimize perspective distortion. Upload roboticArm.ino to the Arduino, then connect the Raspberry Pi to the Arduino via USB to establish serial communication. Configure the serial port in the Arduino code to match the Pi’s /dev/ttyUSB0 interface.
Step 8: Final Touches
Encapsulate the electronics in a custom project enclosure for safety and aesthetics. A finished build looks like this:

Pre‑Trained Model
If you prefer to skip training, download our ready‑to‑deploy model here.
By leveraging machine learning on the Coral Edge TPU, this robot delivers precise, low‑contamination sorting at a fraction of the cost of human labor.
Manufacturing process
- Lionel Model Trains: History, Manufacturing & Future
- Python/MicroPython Sensor Logger: Seamlessly Store Sensor Data in Google Sheets
- Vision‑Based Obstacle‑Avoiding Mobile Robot on Raspberry Pi
- gatoBot: Raspberry Pi Zero W Web‑Controlled Robot with Live Video Streaming
- UV Disinfection Robot Powered by Arduino Mega: Remote‑Controlled Germicidal System
- Servo‑Driven Obstacle‑Avoiding Robot: Build with Arduino & HC‑SR04
- Build Your Own AI Assistant Robot Using Arduino & Python
- Arduino‑Powered Robot Arm with Custom Controller – Servo & Potentiometer Build
- Control Your Arduino with Google Assistant – A Complete Step‑by‑Step Tutorial
- Build a Wire‑Free Arduino Robot Arm, Controlled from Your Smartphone