Design and Development of Embedded System for Grading and Classification of Agricultural Products

Almost half of the labour (45% according to economic survey2019) in Pakistan is attached with agriculture and related fields. This huge participation signifies the vital importance of agriculture for Pakistan. Unfortunately, despite such widespread attachment, agriculture sector of Pakistan lags beh

2025-06-28 16:31:22 - Adil Khan

Project Title

Design and Development of Embedded System for Grading and Classification of Agricultural Products

Project Area of Specialization Electrical/Electronic EngineeringProject Summary

Almost half of the labour (45% according to economic survey2019) in Pakistan is attached with agriculture and related fields. This huge participation signifies the vital importance of agriculture for Pakistan. Unfortunately, despite such widespread attachment, agriculture sector of Pakistan lags behind in terms of innovation, productivity and efficiency. This can be observed by looking at contribution of agriculture sector to GDP which is just 20%.

 Reason for this low contribution lies in centuries old methods being used to get work done which act as a bottleneck for productivity. For instance, fruit production and export require vigilant inspection throughout the process to ensure standard and uniform quality. Usage of human labour to inspect, sort and classify the fruits leads to lower productivity and inconsistent results.

This project is aimed at solving the problem being faced by fruit industry. By using Digital image processing techniques and Artificial Intelligence, a solution is being prepared to ensure that fruits and vegetables are sorted and classified efficiently. This will not just improve the efficiency but also will lead to enhanced quality for a better health. Moreover, cost for farmer will hugely go down both in terms of low labour cost and elimination of middleman.

This project is about designing and developing a prototype for classification of fruits and aims to minimise cost and human error. A product will be passed through conveyer belt where it will be tested with the help of special sensors like optical sensor, gas sensor, and colour sensor. The data received from sensors will be fed into neural network for the purpose of drawing a distinction between healthy and spoiled product. It will also help in categorisation of products based on quality, shape, colour and ripeness.

Project Objectives

Objectives of this project include

Project Implementation Method

Firstly,  a container having agricultural products is placed allowing the products to be placed one by one on the conveyor belt for its processing. When a specific product is placed on the conveyor belt, a mounted camera will take the picture of that product and will send it to the microcontroller for its processing. Microcontroller will perform image processing operations on that image for its pre-processing and feature extraction.

Processing involves conversion of that captured image into grayscale and then application of background subtraction technique to remove the unwanted background objects and foreground desired object will be segmented. As has been established, we want to classify our products on the base of shape color and size. In order to do so, we’ll find the average color temperature at different points of the object, hue, saturation and value terms on that object to gauge its color. After colour detection, different edge detection techniques will be applied in order to find its shape and size.

After successful extraction, the features are used to train our model using machine learning algorithms to make different decisions. We’ve implemented State Vector Machine (SVM) algorithm in order to make decisions related to classification and grading. We’ve trained our machine learning algorithm at different datasets collected on fruits and vegetables. We’ve collected our dataset on different types and conditions of fruits and vegetables. There are also other sensors like color sensor, ethylene gas sensor and pressure sensors implemented and used for data acquisition for the better classification of agricultural produces.

After all that feature extraction and data processing, our machine learning algorithm decides that how that product will be classified. Firstly, we’ll check if the fruit is diseased or not. If it is diseased, then a flapper is implemented and operated by the motors and microcontroller. That flapper will push that product into the diseased container. In case of no disease, we’ll check that if the product is ripe or not. If it is not ripe, then that product will be pushed into the unripe container with the help of the flapper. If the product is ripe, then we’ll check the quality of fruit. Our classifier will decide that this particular product is of A class, B class or C class and then classify accordingly and the product will be pushed into the respective quality container with the help of that flapper.

The flow chart of this process is provided in the link below: 

https://www.dropbox.com/s/0eex8km34kbqrmy/Flow Chart.PNG?dl=0

We’ve also implemented an online database system on which details of the agricultural products will be displayed throughout the country so that anyone can see the quality of agricultural products online.

The overall conceptual diagram is provided in the below:

https://www.dropbox.com/s/p1jmcv4js2qt273/3.jpg?dl=0

Benefits of the Project

Manual labour to classify and sort the agricultural products causes loss in revenue and health problems. Moreover, cost also increases which ultimately adds in the burdens of end customer and often times middleman is the person reaping benefits by sorting and classifying the products. Our project is aimed to tackle all of the above issues.

Technical Details of Final Deliverable

Intended project is all about delivering best quality agricultural products. This ultimately leads to better health and more revenue for the farmer. A sophisticated approach involving well organized and coordinated array of varied components has been designed. The core of the project is Optical Sensor.  A Camera is used for its high frame rate and pixel density. Optical sensor captures the image of product which is then processed for identification and feature extraction. Along with optical sensor, importance of conveyor belt cannot be ignored. Its speed is synchronised with frequency of optical sensor and also the time required for complete identification of the product. After identification, next sensor is colour sensor which helps in determining the both ripeness and quality of the product. Microcontroller uses all of the data coming from sensors to make a decision about its quality. Another Microcontroller is used for successful operation of conveyor belt and a feedback loop has been created between both microcontrollers. After successful identification, microcontroller signals the flapper to place the product in desired box according to its quality. Object tracking is important in this regard because it is necessary to ensure that the product which has received processing treatment is placed by flapper. Thus, flapper also houses an optical sensor which is used to coordinate with the main optical sensor.

Final Deliverable of the Project HW/SW integrated systemCore Industry FoodOther Industries IT , Agriculture , Telecommunication Core Technology Internet of Things (IoT)Other Technologies Artificial Intelligence(AI), Cloud Infrastructure, Shared EconomySustainable Development Goals No Poverty, Zero Hunger, Industry, Innovation and Infrastructure, Responsible Consumption and ProductionRequired Resources
Item Name Type No. of Units Per Unit Cost (in Rs) Total (in Rs)
Total in (Rs) 80000
Raspberry Pi 4 Model B Equipment11500015000
NVIDIA Jetson Nano Developer Kit Equipment12000020000
Arduino Mega 2560 R3 Equipment220004000
Logitech HD Webcam C525 Equipment180008000
12V DC Motor Equipment3500015000
Rubber Conveyor Belt Equipment150005000
Micro SD Card 32 GB Equipment215003000
Miscellaneous Miscellaneous 11000010000

More Posts