Automated Coffee Plantation Monitoring and Disease Recovery using IoT and Machine Learning

DOI : 10.17577/IJERTCONV10IS04041
Download Full-Text PDF Cite this Publication
Text Only Version


Automated Coffee Plantation Monitoring and Disease Recovery using IoT and Machine Learning

Binson Binoy1

1Student, Dept. Of Computer Science & Engineering, Mangalam College of Engineering, India,

Allen Joe Josepp

2 Student, Dept. Of Computer Science & Engineering, Mangalam College of Engineering, India,

Ananthakrishnan K.R3

3Student, Dept. Of Computer Science & Engineering, Mangalam College of Engineering, India,

Christy B Thomas4

4Student, Dept. Of Computer Science & Engineering, Mangalam College of Engineering, India,

Chris Chettissery5

5Assistant Professor, Dept. Of Computer Science & Engineering, Mangalam College of Engineering, India,

AbstractRapid human population growth requires a corresponding increase in food production. Easily spreadable diseases can have a strong negative impact on plant yields and even destroy the whole plantation. The importance of early illness detection and prevention cannot be overstated. Since smartphones are becoming increasingly present even in the most rural areas, in recent years scientists have turned to automated image analysis as a way of identifying crop disease. The project provides a systematic review of Machine Learning (ML) applications in the field of agriculture. The areas that focused on are the prediction of soil parameters such as pH level and moisture content, diseases, weed detection in crops and species detection. The micro- controller system predicts the precise amount of water needed by the crop. The system monitors the weather and atmosphere changes, it will predict the quantity of water that should flow accordingly through the system with the help of sensors. The system will also do the curing of diseases in the plants with an automatic pesticide sprayer attached to the hardware. All are monitored via a mobile application, and the information from the system gets tracked and recorded. The proposed system will help the farmer wisely in future.

KeywordsMachine Learning, Convolutional Neural Network (CNN), Automatic Coffee Disease Prediction, Image Processing.


    Crops can be considered as the heart of the agricultural field but sometimes various diseases arise on the plant that creates predicament as it leads to the losses, along with that the products eminence is also influenced. Manually health monitoring and identification of plant pathogens is a laborious

    and time-consuming task because farmers are not capable enough to identify diseases so the farmer requires expertise which will increase the expenditure of farming. The economy of any nation shares a major part with agriculture and crop production. Plant and agricultural diseases have a significant influence on production. Involvement of manual inspection in

    the majority poses a challenge to identify the plant diseases and in turn, the crop yield is reduced, or quality is affected. Monitoring plants and crops spread over a large area is a tedious task for the farmers or cultivators. The illness may be unknown to the farmer in some cases.

    The system involves a standard smartphone to predict plant diseases using a machine learning approach. The proposed system collects data, such as plant disease images, and that dataset is used to detect various diseases of plants and crops. It potentially benefits the cultivators as it is capable to detect diseases without minimal human intervention with prompt results. Further, the proposed technique helps in detecting diseases during their early stage to safeguard the yield. A Neural network-based model is trained to detect plant diseases and crop types. Furthermore, the algorithm suggests which insecticides to employ in each disease group.

    Plant disease has influenced food production and human society development significantly. Given poor yields and a general absence of considerable food stores, food shortages might readily emerge in the event of disease epidemics, wreaking havoc on human civilization. Plant disease detection by sight is a more time-consuming and inaccurate process that can only be performed in restricted locations. It is easier and less expensive to identify illnesses automatically by simply looking at the signs on the plant leaves. Machine vision is also supported, allowing for image-based automatic process control, inspection, and robot guiding. Identification of plant diseases is the key to preventing losses in the quality and quantity of agricultural products. Health monitoring and disease detection of the plant is critical for sustainable agriculture.

    Visually apparent patterns on plant leaves are the most common approach to researching plant disease. Visually

    diagnosing plant diseases is inefficient, complex, and time- consuming, and it necessitates plant disease knowledge as well as ongoing monitoring, which may be costly on big farms. As a result, a quick, automated, and reliable approach to detecting plant disease is critical. Hence, the image processing technique is employed for the detection of plant diseases.


    The innovations in smart agricultural systems are mainly focused on making agriculture efficient and easy for farmers. The technology of smart agricultural systems mainly focuses on Automatic smart drip irrigation systems and plant disease detection systems. A disease prediction solution relies on the size of the dataset used, i.e., the number of diseases predicted and the accuracy achieved.

    The Agriculture Cyber-Physical System (A-CPS) is becoming more essential in improving crop quality and yield while using the least amount of acreage possible. The Internet- of-Agro-Things (IoAT) is introduced in this paper, along with a description of the automatic detection of plant disease for the development of ACPS. In traditional agriculture, microbial illnesses affected the majority of the crops. Furthermore, the continually evolving diseases are beyond the farmer’s understanding, necessitating the development of a disease prediction system. To avoid this, this paper [1] analyze the crop picture recorded by a health maintenance system using a trained CNN model. The solar sensor node is in charge of picture capture, continuous sensing, and intelligent automation. A created soil moisture sensor is housed in the sensor node, which has a long lifespan when compared to its contemporaries. A solar sensor node with a camera module, a microcontroller, and a smartphone application are used to illustrate a real-time implementation of the proposed system, allowing a farmer to watch the field. The prototype was tested for three months and proved to be reliable, keeping rust-free and enduring a variety of weather conditions. The suggested plant disease prediction methodology has a 99.24 percent accuracy rate.

    A disease epidemic might severely restrict maize production, resulting in losses of millions of rupees. Machine learning techniques can be used to lessen the risk of crop loss caused by disease outbreaks. Plant diseases are mainly identified by changes in colour or the presence of spots or rotting areas in the leaves. Based on these findings, numerous image processing-based characteristics for detecting corn illnesses in this work. Color detection features such as RGB, local features on images such as scale-invariant feature transform (SIFT), speeded up robust features (SURF), and Oriented FAST and rotated BRIEF (ORB), and object detection features such as histogram of oriented gradients (HOG). This paper [2] tests the effectiveness of these attributes using a variety of machine learning techniques. Support vector machines (SVM), Decisio Tree (DT), Random Forest (RF), and Naive Bayes are the four algorithms (NB). The colour may be the most informative element for this assignment, according to our experiments. For majority of the classifiers we test, RGB is the characteristic with the best accuracy.

    [3] According to reports, every crop farmed by farmers is susceptible to one or more pomegranate diseases. Plant health monitoring and disease detection are challenging to do manually. As a result, image processing can be a beneficial and time-saving technique for plant disease diagnosis. Color characteristics and edge information are used to classify diseases. The technology delivers an infection percentage as well as preventative actions. Images recorded using a mobile camera are pre-processed, then segmented, characteristics extracted, and illnesses classified. The Open CV platform will be used to create illness detection algorithms in Python. The strategies for detecting pomegranate illnesses were addressed in this research.

    Plant disease poses a substantial threat to both plant diversity and food supply, necessitating the establishment of monitoring tools to ensure adequate food production, an important sustainable management technique. [4] Rice is one of the most important food crops in Bangladesh, with rice cultivation taking up the majority of agricultural area and rising year after year. Because rice production and quality are critical to the economy and food supply, early detection of rice illnesses is critical. The purpose of this paper is to use a basic image processing strategy based on wavelet transform to identify and classify rice plant illnesses. This method decomposes the input picture into horizontal, vertical, and diagonal sub bands using the multi-resolutional analysis Discrete Wavelet Transform (DWT). Different colour and texture characteristics are retrieved and treated as features from horizontal, vertical, and diagonal sub-bands of the input picture up to two layers. The Random Subspace Method was used to classify the data using an Ensemble of Linear Classifiers (RSM). With a classification accuracy rate of 95%, the suggested approach has effectively categorised four major rice plant diseases: rice bacterial blight, rice brown spot, rice bacterial sheath brown rot, and rice blast.

    [5] Diseases such as fungal, bacterial, and viral infections are all damaging to plants. Five types of tomato illnesses are characterised in the study, including tomato late blight, Septoria spot, bacterial spot, bacterial canker, tomato leaf curl, and healthy tomato plant leaf and stem photos. Color, shape, and texture data were extracted from healthy and diseased tomato plant images to classify them. After the segmentation procedure, the feature extraction process begins. Features extracted from segmented pictures and provided to the classification tree. Finally, these six distinct sorts of classifications were used to classify diseases. The categorization of six different types of tomato photos showed an overall accuracy of 97.3 percent
    1. Proposed System

      The main objective of the proposed system automatically monitors the crop and the diseases are detected using ML techniques and the curing of disease was done by an automatic pesticide sprayer. The CNN model is used for automatic coffee plant disease prediction. The hardware monitors different parameters of climate and soil. The collected data is stored in the cloud which then can be retrieved using a mobile application. The system monitors the coffee plant throughout

      the entire plantation. The monitoring includes rain, temperature, soil fertility, and richness of the soil using various sensors. Also, the disease in the plant is detected using ML techniques and the curing was done by automatic pesticide sprayers. All the processes were done by a single hardware device.

    2. Components

      1. Temperature sensor

      By turning the physical characteristic into an electrical voltage, the temperature sensor is utilised to determine the

      4. Solenoid pump

      Fig.3. Rain sensor

      temperature of the atmosphere. The temperature sensor’s output

      voltage is directly proportional to the current temperature (in degrees Centigrade / Celsius).

      Fig.1. Temperature sensor

      Solenoid pumps are a type of positive displacement pump that displaces fluid into the discharge line using a diaphragm and solenoid assembly. An electromagnet and a spring make up the solenoid assembly. The electromagnetic core of a solenoid pushes a diaphragm into the discharge position when electricity is provided to it.

      2. Soil moisture sensor

      Soil moisture sensor is one type of sensor used to determine the volumetric amount of water inside the soil [6]. Drying and sample weighing are essential because the straight gravimetric

      5. Camera module

      Fig.4. Solenoid pump

      dimension of soil moisture must be removed. These sensors

      estimate the volumetric water content indirectly, using other soil principles.

      Fig.2. Soil moisture sensor

      3. Rain sensor

      In the field, a rainfall sensor is used to measure rainfall. Rain sensing and control modules are included in the sensor. The control module may generate both analogue and digital outputs, with the digital output being used to detect rainfall and the intensity of rainfall, and the analogue output being used to measure rainfall. Two independent PCB tracks measuring 50 mm x 40 mm are found on the rain sensing board.

      This 5 MP sensor with a camera module is capable of 1080p video and still images that connect directly to your Raspberry Pi. This is the latest version of the Raspbian operating system, which is plug-and-play compatible and ideal for time-lapse photography, video recording, motion detection, and security applications [7].

      Fig.5. Camera module

    3. System Architecture

    The system includes a Sensor unit, Camera module, Pumps, Raspberry Pi 4, Cloud, and Mobile Application. Various data like temperature, soil moisture, and rainfall are collected from sensors. The collected data is stored in the cloud and later retrieved using a mobile application. The Raspberry Pi serves as the system’s primary controller. It processes the leaf image from the camera module and predicts if the coffee plant has any disease or not. For coffee illness prediction, the CNN model is utilised. The disease detected are Miner [8], Rust [9], Phoma [10], and Cercospora [11]. The Pesticide Sprayer spray appropriate pesticide for the disease identified automatically. The farmer can control the system using a mobile application.

    3.Image Segmentation

    Image segmentation is defined as the partitioning of a digital image into multiple segments. The main aim of image segmentation is to simplify the representation of an image into something that makes the analysis easier. Segmentation is mainly used to identify objects (such as leaves, fruits, vegetables in this case) and boundaries in the captured image. The result of this will always be a set of segments that will cover the entire image. It has a wide range of applications in image processing such as medical image analysis, recognition tasks, object detection, and traffic signals.

    Fig. 6. System Architecture

    Power supply: A power supply of at least 5V is required to turn on the Raspberry Pi.

    Sensor Unit: The sensor unit consists of temperature sensor, soil moisture sensor, rain sensor.

    Water pumps: Pumps are used to provide water to plants throughout the system. These are linked to the Raspberry Pi so that the motor turns on and off in response to Raspberry Pi commands.

    Cloud: All of the data collected on the Raspberry Pi is saved in the cloud. The saved data may be accessed using the IP address.

    Mobile Application: A mobile application developed to monitor the system results through smart phone.

    1. Image Acquisition

      After the image is obtained, it will be sent for the image preprocessing stage based on the requirement. Often in agricultural data, computation is carried out to calculate the robustness, length and width of the fruit or crops for the analysis. Suppose the image acquired from the classifier is not suitable for processing then this phase is supported with the image enhancement.

    2. Image preprocessing

    Image preprocessing is a common term that is used to process the raw image at the earlier stages. This mainly includes fine- tuning the image, suppressing the unwanted noise and enhancing some features for further processing. In agricultural image processing, the images of the crops will be obtained from the probe image captured by the camera module attached to the hardware.

    4.Feature Extraction

    Feature extraction is used extensively in the fields of image processing, machine learning and pattern recognition. This starts with obtaining the derived values (features) from the raw undefined data which is for computational purposes [12]. Dimension reduction and feature extraction are provided by most of the data analysis packages. In the case of crops, the features extracted can be the colour of the leaf, shape and thickness of the fruit. Deformable and parameterized shapes and active contours are the most flexible methods of feature extraction.


    Image processing carries out the following steps. Image preprocessing is followed by segmentation, feature extraction and classification. There are different types of classifiers such as Support Vector Machine [13], Decision tree, KNN, artificial neural network and so on. Classification in image processing mainly involves a database that contains sample images that will be compared with the test data obtained for evaluation.

    6. Disease Categorization or analysis of crop

    After successfully computing the data and obtaining the values, the necessary step according to the requirement is carried out [14]. In the case of plant disease identification, mainly the papers taken into consideration have focused on the identification of the different types of diseases.


    The drip irrigation system combined with the plant disease detection system helps the farmers to successfully monitor and reduce their workload. The atmospheric changes, soil moisture and plant diseases are accurately monitored and predicted. The attached pesticide sprayer had also shown greater performance for the plant disease. The proposed CNN model gives an accuracy of 92.83%.


    Identification of plant diseases is the key to preventing losses in the quality and quantity of agricultural products. Plant health monitoring and disease detection are essential for long-term agriculture. Visually apparent patterns on plant leaves are the most common approach to researching plant disease. Visually diagnosing plant diseases is inefficient, complex, and time- consuming, and it necessitates plant disease knowledge as well as ongoing monitoring, which may be costly on big farms. As

    a result, a quick, automated, and reliable approach to detecting plant disease is critical. As a result, image processing techniques are used to identify plant illnesses.


The smart agriculture system coupled with crop disease prediction is proposed to aid the farmer in making agriculture more profitable and less arduous. The deployment of the proposed method is demonstrated in Real time. The soil moisture values help in the automation of the water pump for irrigation, and the camera snapshots of the crops are sent to the cloud for storage and further processing. Besides, the Application is provided for tracking the irrigation process and helps in analyzing the crop images to predict the disease, if any. An insight on automatic plant disease identification and classification, crop analysis. The study clearly shows that most of the methods concentrate on studying various diseases and classifying based on their properties and symptoms. Since smart farming is the future, more research work should evolve. Those works should not only study the symptoms but also detect diseases at earlier stages thereby helping the farmers all around the world. Agriculture is the base for human kind, which is entering into the extinction phase recently. The dominance of the Deep Learning method over the classical ML algorithms. Both the simplicity of the approach and the achieved accuracy confirm that the Deep Learning is the way to follow for image classification problems with relatively large datasets. As the achieved accuracy of the Deep Learning method is already very high, trying to improve its results on the same dataset would be of little benefit.


The authors wish to thank Principal Vinodh P Vijayan, Neema George, H.O.D, Computer Science Department for providing wise advice, inspired and insightful remarks during the proofreading process.

[7] M. Sankar, D. N. Mudgal, T. varsharani jagdish, N. w. Geetanjali Laxman and M. Mahesh Jalinder, “Green Leaf Disease detection Using Raspberry pi,” 2019 1st International Conference on Innovations in Information and Communication Technology (ICIICT), 2019, pp. 1-6.

[8] D. P, L. A. Pinto, L. Mary, M. P and S. Dass, “The Real-Time Mobile Application for Identification of Diseases in Coffee Leaves using the CNN Model,” 2021 Second International Conference on Electronics and Sustainable Communication Systems (ICESC), 2021, pp. 1694- 1700.

[9] A. P. Marcos, N. L. Silva Rodovalho and A. R. Backes, “Coffee Leaf Rust Detection Using Convolutional Neural Network,” 2019 XV Workshop de Visão Computacional (WVC), 2019, pp. 38-42.

[10] L. Dutta and A. K. Rana, “Disease Detection Using Transfer Learning In Coffee Plants,” 2021 2nd Global Conference for Advancement in Technology (GCAT), 2021, pp. 1-4.

[11] M. Kumar, P. Gupta, P. Madhav and Sachin, “Disease Detection in Coffee Plants Using Convolutional Neural Network,” 2020 5th International Conference on Communication and Electronics Systems (ICCES), 2020, pp. 755-760.

[12] S. Donesh and U. Piumi Ishanka, “Plant Leaf Recognition: Comparing Contour-Based and Region-Based Feature Extraction,” 2020 2nd International Conference on Advancements in Computing (ICAC), 2020, pp. 369-373.

[13] L. Mohan, J. Pant, P. Suyal and A. Kumar, “Support Vector Machine Accuracy Improvement with Classification,” 2020 12th International Conference on Computational Intelligence and Communication Networks (CICN), 2020, pp. 477-481.

[14] S. Gayathri, D. C. J. W. Wise, P. B. Shamini and N. Muthukumaran, “Image Analysis and Detection of Tea Leaf Disease using Deep Learning,” 2020 International Conference on Electronics and Sustainable Communication Systems (ICESC), 2020, pp. 398-403.


[1] V. Udutalapally, S. P. Mohanty, V. Pallagani and V. Khandelwal, “sCrop: A Novel Device for Sustainable Automatic Disease Prediction, Crop Selection, and Irrigation in Internet-of-Agro-Things for Smart Agriculture,” in IEEE Sensors Journal, vol. 21, no. 16, pp. 17525-17538, 15 Aug.15, 2021.

[2] B. S. Kusumo, A. Heryana, O. Mahendra and H. F. Pardede, “Machine Learning-based for Automatic Detection of Corn-Plant Diseases Using Image Processing,” 2018 International Conference on Computer, Control, Informatics and its Applications (IC3INA), 2018, pp. 93-97.

[3] S. D.M., Akhilesh, R. M.G., S. A. Kumar and P. C., “Disease Detection in Pomegranate using Image Processing,” 2020 4th International Conference on Trends in Electronics and Informatics (ICOEI)(48184), 2020, pp. 994-999.

[4] S. M. Taohidul Islam and B. Mazumder, “Wavelet Based Feature Extraction for Rice Plant Disease Detection and Classification,” 2019 3rd International Conference on Electrical, Computer & Telecommunication Engineering (ICECTE), 2019, pp. 53-56.

[5] H. Sabrol and K. Satish, “Tomato plant disease classification in digital images using classification tree,” 2016 International Conference on Communication and Signal Processing (ICCSP), 2016, pp. 1242-1246.

[6] S. Puengsungwan, “IoT based Soil Moisture Sensor for Smart Farming,” 2020 International Conference on Power, Energy and Innovations (ICPEI), 2020, pp. 221-224.

Leave a Reply