Textile Sort AI Smart Bin

by humna fatima in Circuits > Raspberry Pi

42 Views, 0 Favorites, 0 Comments

Textile Sort AI Smart Bin

ChatGPT Image Jun 15, 2026, 09_21_37 PM.png

The Textile Sort AI Smart Bin is a prototype designed to automate textile sorting using Artificial Intelligence and computer vision. The system captures images of textile samples using a Digital Microscopic camera mounted inside the bin and classifies the material as Cotton, Denim, Polyester, or Wool using a deep learning model(Semantic Segmentation) which is mainly focus on image pixel.

After classification, the system provides visual and audio feedback through an LCD display, RGB LED, and buzzer. A servo-controlled trapdoor mechanism can automatically sort recyclable materials into the compartment and Non-recycle material take it back from Compartment.

This project demonstrates how AI can contribute to smarter textile recycling and support future circular economy initiatives.


Key Features

  1. AI-powered textile classification
  2. Raspberry Pi 5 based system
  3. Digital Microscopic Camera-based fabric detection
  4. LCD display for classification results
  5. RGB LED status indicators
  6. Buzzer notifications
  7. Servo-controlled sorting mechanism
  8. Database logging
  9. Gradio web dashboard for monitoring and control

Supplies

Screenshot 2026-06-02 202433.png
Screenshot 2026-06-03 125722.png
Screenshot 2026-06-14 204513.png
Screenshot 2026-06-15 131409.png
ChatGPT Image Jun 16, 2026, 10_34_18 AM.png
ChatGPT Image Jun 16, 2026, 10_35_38 AM.png

Raspberry Pi 5

USB Digital Microscope Camera

I2C LCD Display

RGB LED

Buzzer

Push Button

2 × Servos

Breadboard

T-Cobbler GPIO Breakout

Jumper Wires

1kΩ Resistors

Power Supply

Cardboard Enclosure

Overview

textile_bin_trapdoor_view.png
ChatGPT Image Jun 15, 2026, 09_21_37 PM.png
Screenshot 2026-06-17 113505.png

In this project, a textile sample is placed under a camera inside the bin. The camera captures an image and sends it to an AI model running on the Raspberry Pi.

The AI model analyzes the textile texture and predicts whether the sample is:

  1. Cotton
  2. Denim
  3. Polyester
  4. Wool

The prediction result is displayed on the LCD screen and stored in database. Depending on the classification result, RGB LEDs, buzzer, and servo motors provide feedback and sorting actions.

System Architecture

Screenshot 2026-06-18 111825.png

Raspberry Pi 5

Camera

AI Model

LCD

RGB LED

Buzzer

Servo Motors

PostgreSQL Database

Gradio Interface

Connect All Components to the Raspberry Pi GPIO Pins:

textile_bin_electronics_view.png
WhatsApp Image 2026-06-14 at 20.51.09.jpeg
WhatsApp Image 2026-06-14 at 20.50.08.png
ChatGPT Image Jun 16, 2026, 10_38_58 AM.png

To make wiring user friendly ,make 20x20 enclosure box.Then Digital Microscopic Camera connect to Raspberry pi to capture the image ,LCD,RGB LED ,2 x servo motors are also connected to Arduino to Display Results, RGB LED turn green and Buzzer beep once or twice to show the indication and 2x servo motors to open and close the trapdoor . Wiring for this mechanism ensure all grounds are connected together and use current-limiting resistors for all components.

Collection and Training of AI Model

20260527-140149-970.png
20260530-124321-846.png
20260530-125826-543.png
20260530-130500-525.png
Screenshot 2026-06-15 233657.png
Screenshot 2026-06-15 233706.png
Screenshot 2026-06-15 233718.png
Screenshot 2026-06-15 233646.png

Step 4: Collection of the Dataset

For this dataset,100 microscopic images per class were collected as following:

  1. Cotton
  2. Denim
  3. Polyester
  4. Wool

There are some limitations for collection of dataset for this project. For example Camera should be mounted at the specific distance from trapdoor which also act as a base for textile. for this project ,distance from Camera to base was 13 cm.Light and Camera's focus/Resolution should be static.

After collecting dataset,it was annotated by drawing Polygon shape in Roboflow and export as 50/25/25 to Train model locally .

A UNet MobileNet semantic segmentation model was used to learn textile texture patterns from microscope images.

For Training Model for this project,semantic segmentation's model UNet-MobileNet used in google colab.Because this is fast and simple model to train . And in attached images the confusion matrix ,heatmap and F1 score are present .

The final model achieved reliable classification performance suitable for prototype testing.

Hardware and Software Deployment

Screenshot 2026-06-14 211712.png
ChatGPT Image Jun 15, 2026, 09_28_15 PM.png
ChatGPT Image Jun 15, 2026, 09_30_55 PM.png

After training the dataset ,need to deploy hardware and software wireless.so for testing ,prototype should work like actual Smart Bin.

For this need to following following steps:

  1. After plugin the pi start.
  2. Lcd shows the IP adress with welcome note and ready for scan/test.
  3. Place the fabric/piece of textile on base/Trapdoor.
  4. Mounted Camera scan with the short press of GPIO button.
  5. Model predict the Reult or class of Textile/Fabric.
  6. Based on predicted result ,LCD shows name,confidence score and status(recycle/non-recycle)
  7. If Recycle,RGB LED turns green ,buzzer beep once,Servo move 90 rightside and -90 leftside to open trapdoor,represent class cotton,
  8. If DownScale,RGB LED,turns blue,buzzer beep 3 ,servo movement same as cotton(trapdoor open) represent class Denim .
  9. If DownScale,RGB LED,turns blue,buzzer beep 3 ,servo movement same as cotton(trapdoor open)represent class wool.
  10. If Non-Recycle,RGB LED turns red,buzzer beep 2,servo dont move and fabric need to be take it out from base,represent class Polyester.
  11. this operation perfom without directly connect to Gradio/interface but with IP adress can be possible.

Database Logging

Screenshot 2026-06-18 214618.png

For Datalogging,use this erd to save every scan into database. And by connectiong gradio with databse,its easy to get scan history .

Future Work

Future improvements include increasing the dataset size, adding support for blended fabrics, improving segmentation accuracy, integrating multiple sorting bins, and implementing automatic dataset expansion through user feedback. The system could also be adapted for industrial textile recycling facilities and smart waste management systems.