A Raspberry Pi-powered conveyor belt sorting system that uses an Intel RealSense camera to detect red objects and controls an MG995 servo motor to sort them in real-time.
- The Intel RealSense D435 camera watches the conveyor belt
- OpenCV processes the video feed and detects red objects using HSV color filtering
- When red is detected, the MG995 servo moves to 110° to sort the object
- When no red is detected, the servo returns to 170°
- A live web dashboard at
http://localhost:5000shows the camera feed and red mask in real-time
- Raspberry Pi
- Intel RealSense D435 depth camera
- PCA9685 servo controller
- MG995 servo motor
- Conveyor belt
- Python 3
- OpenCV
- pyrealsense2
- Flask
- adafruit-circuitpython-pca9685
- NumPy
| File | Description |
|---|---|
conveyor_camera.py |
Main system — red detection + servo control + live web stream |
motor_test.py |
Standalone servo test script for calibrating the MG995 |
test_realsense.py |
Standalone RealSense camera test with color detection |
python3 conveyor_camera.pyThen open http://localhost:5000 in your browser to see the live camera feed.
- PCA9685 SDA → Raspberry Pi SDA
- PCA9685 SCL → Raspberry Pi SCL
- MG995 servo → PCA9685 Channel 0
- RealSense D435 → USB 3.0 port







