Skip to content

RRG2003/fruit-packaging-robot

Repository files navigation

📝 Updated README.md Snippet

Replace your current README.md with this updated version:

# 🍎 Automated Fruit Packaging System

An intelligent fruit packaging system that detects fruit arrangement using computer vision, synchronizes multiple trays via MQTT communication, and automates the pick-and-place process using a suction-based gripper with NEMA23 motor control.

---

## 📁 Project Structure

- `master_pi.py`: Controls synchronization and triggers gripper operation when all trays are ready.
- `worker_pi_machine_1.py / _2.py / _3.py`: Raspberry Pi scripts with camera input to detect fruit placement on trays (3×3, 4×4, 5×5 grids).
- `gripper_controller.py`: Executes the suction gripper motion (Z, X, Z) and triggers vacuum ON/OFF.
- `mock_gpio.py`: Mock for GPIO when running code on non-Raspberry Pi systems (like Windows).
- `Assembly/`: Contains CAD references (except large files moved to Drive).

---

## 📦 Features

- Fruit presence & arrangement detection via OpenCV
- MQTT-based multi-machine coordination
- Grid-wise packaging logic (3×3 → 3 picks, 4×4 → 4 picks, etc.)
- Suction gripper controlled by Raspberry Pi via relays or MOSFETs
- SolidWorks-based final assembly design

---

## 🖼️ CAD Assembly & 3D Models

📎 [View complete CAD files on Google Drive](https://drive.google.com/drive/folders/1Q5mBoC1cDyjgxCsi8gMptka7Ut478pN6?usp=drive_link)

---

## 🔌 Relay Wiring Diagram

```text
                     +-----------------------------+
                     |        Raspberry Pi         |
                     |                             |
                     |  GPIO 17 ----------------+  |
                     |                          |  |
                     |                          |  |
                     |                         IN |
                     |                         |  |
                     |                        GND |
                     |                          |  |
                     |                          |  |
                     +--------------------------+  |
                                                |  |
                                                |  |
                                    +-----------v--v----------+
                                    |     Relay Module        |
                                    |                         |
                                    |  IN  <-- GPIO17         |
                                    |  VCC <-- 5V (Pi)        |
                                    |  GND <-- GND (Pi)       |
                                    |                         |
                                    |  COM o------------------+------------------> 24V+
                                    |                         |
                                    |  NO  o-----+            |
                                    +------------|------------+
                                                 |
                                                (+)
                                         +--------------+
                                         |  Solenoid     |
                                         |  (VABM Valve) |
                                         +--------------+
                                                |
                                                |
                                              (-)
                                                |
                                               GND
                                                |
                                            24V Power Supply

Wiring Notes:

  • Relay COM → 24V+

  • Relay NO → Solenoid (+)

  • Solenoid (–) → GND of 24V power supply

  • Add a flyback diode (e.g., 1N4007) across solenoid terminals:

    • Cathode to +24V, Anode to GND

🧠 Technologies Used

  • OpenCV for vision-based fruit counting & arrangement matching
  • Paho MQTT for inter-device communication
  • Python 3.11
  • Jetson AGX Orin (used for grading logic)
  • SolidWorks 2021 for mechanical design

🚀 How to Run

  1. Clone the repo:

    git clone https://github.com/RRG2003/Automated-Fruit-Pacaking-System.git
    cd Automated-Fruit-Pacaking-System
  2. Install dependencies:

    pip install opencv-python numpy paho-mqtt
  3. If not on Raspberry Pi, use mock_gpio.py to avoid GPIO errors.

  4. Run the master and worker scripts:

    • On Master Pi:

      python master_pi.py
    • On Worker Pis:

      python worker_pi_machine_1.py

🛠️ Hardware

  • Gripper: 3×3 / 4×4 / 5×5 suction cup arrays using VABM units
  • Actuators: 2× NEMA 23 stepper motors (X and Z axes)
  • Controller: Raspberry Pi with relay module
  • Vision: Arducam IMX787 64MP autofocus camera
  • Load Cell: Thames Side T16-05
  • Others: Baumer sensors, FRL unit, SMPS, Siemens PLC, Jetson AGX Orin

📝 License

This project is under MIT License. Feel free to use, adapt, or contribute.


📬 Contact

For queries or collaboration, reach out via GitHub.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages