An AI-Powered Conveyor Belt Sorting System Using Raspberry Pi + YOLOv8 + Hailo
A real-time bolt-and-nut sorting system powered by computer vision and embedded AI. This project blends hardware engineering with object detection and real-world automation β combines hardware engineering, object detection, and creative problem-solving to efficiently sort Bolts and Nuts.
VisionSort-RPi is an edge-deployed conveyor belt system that showcases real-world applications of embedded AI.
Built using Raspberry Pi 5, YOLOv8, and the Hailo AI accelerator, it automates object classification and sorting tasks with high accuracy and speed.
3D CAD Model![]() |
Real Conveyor System![]() |
Side-by-side view of the designed CAD model and the actual built system with camera and flapper mounted.
- β Real-Time Object Detection with YOLOv8 + Hailo for bolts and nuts
- β Stepper + Servo Motor Integration for precise movement and sorting
- β Edge Deployment on Raspberry Pi 5 with hardware-accelerated inference
- β Custom Dataset with over 9,000 annotated training images
- β Optimized for speed using neural network acceleration (Hailo RT)
- β Fully Autonomous Sorting with no human-in-the-loop
Category | Tools & Hardware |
---|---|
π§ CV/AI | YOLOv8, Roboflow, Python, OpenCV |
βοΈ Embedded HW | Raspberry Pi 5, Hailo AI Kit, NEMA 17, MG996R Servo |
π· Camera | Raspberry Pi HQ Camera + 16mm 10MP Telephoto |
π Communication | GPIO, PWM, I2C |
π¦ Dataset | Roboflow custom-labeled (9000+ images) |
This project includes custom-designed mechanical components modeled in Creo Parametric and fabricated using 3D printing. Key components include:
- Flapper mechanism for nut/bolt sorting
- Servo mounting bracket
- RPi HQ camera holder
π View CAD designs & prints in CAD/
π Download full BOM: BOM.xlsx
π€ External CAD repo: GrabCAD β VisionSort-RPi
π¦ Download 3D printable CAD models: β‘οΈ GitHub Release: CAD v1.0
- Conveyor belt driven by NEMA 17 stepper motor
- Servo-controlled deflector arm for object redirection
- HQ Camera with a 16mm telephoto lens for accurate detection
- All powered and controlled via Raspberry Pi 5
- Pre-annotated dataset from Roboflow
- Bounding box labels with
nut
andbolt
classes - Trained on HPC using YOLOv8 custom config
- Inference optimized with Hailo RT SDK
- Camera Frame Capture β
- Image Preprocessing (OpenCV) β
- YOLOv8 Inference (Hailo AI) β
- Object Classification β
- Motor Control Signal β
- Stepper + Servo Movement
This project utilizes Hailoβs AI acceleration platform for deploying YOLOv8 models on the Raspberry Pi 5.
You can find the environment setup in their official repo.
git clone https://github.com/hailo-ai/hailo-rpi5-examples.git
cd hailo-rpi5-examples
./install.sh
Every time you open a new terminal session, activate the environment:
source setup_env.sh
Run the real-time detection and sorting application using:
python detection/detection.py \
--labels-json resources/nut_bolt-labels.json \
--hef-path model/nut_bolt_model.hef \
--input rpi
Press
Ctrl+C
to stop the system gracefully.
The wiring for the stepper and servo motor system was meticulously crafted for precise control and safety.
Key components include the TMC2208 stepper driver, MG996R servo motor, buck converter, and external 12V power supply.
Component | Raspberry Pi GPIO | Notes |
---|---|---|
TMC2208 - STEP | GPIO17 (Pin 11) | Step signal |
TMC2208 - DIR | GPIO27 (Pin 13) | Direction signal |
TMC2208 - EN | GND | Must be LOW to enable |
TMC2208 - VIO | 3.3V | Logic level |
TMC2208 - GND | GND | |
MG996R - SIGNAL | GPIO12 (PWM) | Servo control via PWM |
Servo Vcc | Buck Converter 5V | Ensure stable 5V using multimeter |
Buck Converter Input | 12V external supply | Powers motors + regulated 5V output |
π Full schematic is detailed in docs/Wiring_Setup.pdf
The model used in this project is a fine-tuned YOLOv8n trained on a custom Roboflow dataset (9000+ images).
Training script used: training.py
- Based on YOLOv8n.pt pretrained weights
- Trained to detect only two classes:
bolt
andnut
- Handled augmentation, batch balancing, and early stopping
YOLOv8 .pt
model was converted to Hailo-compatible .hef
format using the Hailo Dataflow Compiler (DFC).
Conversion steps are documented in Convert_YoloV8_to_HEF.ipynb
.pt
β.onnx
via Ultralytics export.onnx
β.hef
using Hailoβshef-generator
script
Guide followed: Guide to Using Hailo DFC
Real-time sorting demo using computer vision and Raspberry Pi:
- Add camera calibration + lighting normalization
- Expand dataset to include more object categories for diverse sorting applications.
- Integrate IoT for remote monitoring.
Iβm excited to connect and collaborate!
- Email: gbrohiith@gmail.com
- LinkedIn: https://www.linkedin.com/in/rohiithgb/
- GitHub: https://github.com/GBR-RL/
This project is open-source and available under the MIT License.
π If you like this project, please give it a star! π