Machine Vision based Smart Spraying System for Weed and Disease Control of Vegetables
Agriculture is considered the backbone of Pakistan's economy as it contributes 18.9% to gross domestic product (GDP) and provides employment to around 42.3% of the labor force. However, the Production of crops decreases significantly due to the direct attack of diseases, pests, and weeds at differen
2025-06-28 16:28:32 - Adil Khan
Machine Vision based Smart Spraying System for Weed and Disease Control of Vegetables
Project Area of Specialization Artificial IntelligenceProject SummaryAgriculture is considered the backbone of Pakistan's economy as it contributes 18.9% to gross domestic product (GDP) and provides employment to around 42.3% of the labor force. However, the Production of crops decreases significantly due to the direct attack of diseases, pests, and weeds at different growth stages. The dangerous disease effects are reduced by spraying agrochemicals in the fields. On the contrary, farmers practicing conventional spraying methods face several health issues due to direct exposure to agrochemicals, aquatic life, and the ecosystem is being affected.
A cost-effective smart prototype for variable-rate spraying could be a flexible solution to this challenge. Because it can only spray on the affected crop, resulting in the reduced usage of agrochemicals. The spraying system is based on deep-learning techniques and includes a solar-powered farm vehicle that can roam around the fields. A microprocessor and cameras are used to capture and process real-time images, and a microcontroller is used to control the solenoid valves and nozzles.
Throughout this phase processed images are transmitted from raspberry pi to Arduino then Arduino creates the spraying control signal which directed through the USB port activates the relay and solenoid valve opens as solenoid valve opens spraying liquid starts flowing towards spraying nozzle and applied on desired plants.
The sprayer will be tested in real-time for detecting and spraying on early-blight and late-blight-affected potato plants. The major purpose of this study is to reduce the usage of agrochemicals, which will result in fewer health risks and lower agricultural input costs.
Project Objectives- To collect a dataset for potato plant diseases and apply the data augmentation techniques on the dataset.
- To develop a CNN-based model for accurate prediction of early-blight and late-blight.
- To develop a 3d CAD model for the spraying system
- To develop a smart spraying system consisting of Arduino, sensing system, and solar power.
- To characterize the performance of the developed system.
The functions of the smart spraying system will be automated with the help of a relay and a microcontroller connected via a serial connection and an Arduino script. The trained models infer the findings in the form of bounding boxes around the targets after image acquisition by cameras. The microprocessor receives the signal from the detected targets, which triggers the relays and solenoid valves. The spraying nozzle is triggered and the spraying liquid is applied to the target as the solenoid valve opens. The serial data from the computational unit containing the "target to be sprayed" will be read using an Arduino script.
When the target is detected, the Arduino sends a 5V signal to the relay, which activates the relay module, which then opens the 12V solenoid valve. The control unit receives no signal if no target is captured by the cameras, hence the solenoid valves and spraying nozzles remain switched off.

- This project will ensure Environment protection
- This project will reduce Input Cost
- The traditional spraying methods are time-consuming this project will ensure time-saving.
- It is a solar energy-based vehicle hence doesn’t need fuel or electricity.
- This project will reduce agrochemicals investment.
- This project will reduce labor intervention.
- This project will increase the production of crops.
Our final product will be a software and hardware-based system which will process captured images of the potato plant and spray on diseased plants. The model will process the image for enrichment first, then Feature extraction techniques are used to extract features such as boundary, shape, color, and texture for the disease spots to recognize the diseases. After recognizing diseases, our model will spray the agrochemicals on the diseased plants which will help to get rid of the diseases with lesser usage of agrochemicals.
For this variable rate spraying system, we are using deep learning-based algorithms along with the following components; A spraying tank for agrochemical storage, the pump for supplying agrochemical continuously to nozzles, solenoid valves along with relay modules to actuate the spraying nozzles, and lastly, web cameras for image capturing.
Final Deliverable of the Project HW/SW integrated systemCore Industry AgricultureOther Industries IT Core Technology Artificial Intelligence(AI)Other Technologies RoboticsSustainable Development Goals Good Health and Well-Being for People, Responsible Consumption and Production, Climate Action, Life on LandRequired Resources| Item Name | Type | No. of Units | Per Unit Cost (in Rs) | Total (in Rs) |
|---|---|---|---|---|
| Total in (Rs) | 63000 | |||
| Raspberry pi | Equipment | 1 | 25000 | 25000 |
| Arduino UNO | Equipment | 1 | 1800 | 1800 |
| Camera | Equipment | 2 | 5000 | 10000 |
| Raspberry pi adapter | Equipment | 1 | 700 | 700 |
| Relay module | Equipment | 2 | 500 | 1000 |
| Micro SD Card | Equipment | 1 | 1500 | 1500 |
| Solenoid Valve | Equipment | 4 | 2000 | 8000 |
| Water Diaphragm Pump | Equipment | 1 | 3000 | 3000 |
| Nozzle | Equipment | 4 | 500 | 2000 |
| Minor pieces of Stuff | Miscellaneous | 1 | 6000 | 6000 |
| Traveling | Miscellaneous | 1 | 4000 | 4000 |