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
- 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
-
Clone the repo:
git clone https://github.com/RRG2003/Automated-Fruit-Pacaking-System.git cd Automated-Fruit-Pacaking-System -
Install dependencies:
pip install opencv-python numpy paho-mqtt
-
If not on Raspberry Pi, use
mock_gpio.pyto avoid GPIO errors. -
Run the master and worker scripts:
-
On Master Pi:
python master_pi.py
-
On Worker Pis:
python worker_pi_machine_1.py
-
- 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
This project is under MIT License. Feel free to use, adapt, or contribute.
For queries or collaboration, reach out via GitHub.