IoT-Enabled K-Nearest Neighbors (KNN)-Based Soil Nutrient Recommendation System for Rice (Oryza Sativa L.) Cultivation

Authors

  • Rannie M. Sumacot Southern Leyte State University
  • Jessie R. Paragas Eastern Visayas State University

DOI:

https://doi.org/10.21512/commit.v19i2.12538

Keywords:

Soil Nutrient Recommendation, Internet of Things, Microcontroller, Soil NPK, Machine Learning, K-Nearest Neighbor

Abstract

Soil nutrient assessment is essential for optimizing crop yield. Still, existing machine learningbased soil nutrient recommendation systems face several challenges, including limited real-time adaptability, inconsistent integration with IoT frameworks, and a lack of scalability for smallholder use. Many of these systems rely heavily on static, pre-collected datasets and lack the capability to respond dynamically to field conditions. These limitations reduce the practical effectiveness of such models in achieving precision agriculture goals, particularly in resource-constrained environments. These limitations also hinder efficient soil fertility management, leading to ineffective fertilizer application, nutrient imbalances, and reduced crop productivity. To address these issues, the researchers develop an Internet of Things (IoT)-enabled K-Nearest Neighbors (KNN)-based soil nutrient recommendation system specifically for rice (Oryza Sativa L.) cultivation. The system integrates an RS485 Integrated Soil Nitrogen, Phosphorus, and Potassium (NPK) Sensor with an Arduino-based IoT framework to continuously monitor essential nutrients: nitrogen (N), phosphorus (P), and potassium (K). The collected data are processed using Naive Bayes, Support Vector Machine (SVM), Logistic Regression, Linear Regression, and KNN. After rigorous model training on Google Colab, KNN outperforms other models with an accuracy of 98%, making it the optimal choice for predictive soil fertility assessment. This system provides accurate and automated fertilizer recommendations to improve soil management efficiency and sustainability by combining real-time IoT monitoring with machine learning. The research contributes to precision agriculture by offering a scalable data-driven approach that enhances crop yield, reduces fertilizer waste, and minimizes environmental impact.

Dimensions

Plum Analytics

Author Biographies

Rannie M. Sumacot, Southern Leyte State University

Public Administration Department, Faculty of Governance and Development Studies

Jessie R. Paragas, Eastern Visayas State University

Information Technology Department, College of Engineering

References

[1] J. MacPherson, A. Voglhuber-Slavinsky, M. Olbrisch, P. Sch¨obel, E. D¨onitz, I. Mouratiadou, and K. Helming, “Future agricultural systems and the role of digitalization for achieving sustainability goals. A review,” Agronomy for Sustainable Development, vol. 42, no. 4, pp. 1–18, 2022.

[2] N. Khan, R. L. Ray, G. R. Sargani, M. Ihtisham, M. Khayyam, and S. Ismail, “Current progress and future prospects of agriculture technology: Gateway to sustainable agriculture,” Sustainability, vol. 13, no. 9, pp. 1–31, 2021.

[3] E. Taer and A. Taer, “Cultivating tomorrow: A comprehensive review of agricultural innovations in the Philippines (2018–2023),” Agricultural Research, vol. 13, no. 4, pp. 623–635, 2024.

[4] P. Mthiyane, M. Aycan, and T. Mitsui, “Strategic advancements in rice cultivation: Combating heat stress through genetic innovation and sustainable practices—A review,” Stresses, vol. 4, no. 3, pp. 452–480, 2024.

[5] M. F. Stuecker, M. Tigchelaar, and M. B. Kantar, “Climate variability impacts on rice production in the philippines,” PLOS ONE, vol. 13, no. 8, pp. 1–17, 2018.

[6] Ricelytics, “Rice industry in the Philippines.” [Online]. Available: https://ricelytics.philrice.gov.ph/rice industry

[7] R. J. Mamiit, J. Yanagida, and T. Miura, “Productivity hot spots and cold spots: Setting geographic priorities for achieving food production targets,” Frontiers in Sustainable Food Systems, vol. 5, pp. 1–15, 2021.

[8] R. J. C. Rollon, J. M. Golis, and E. Salas, “Impacts of soil nutrient management practices on soil fertility, nutrient uptake, rice (Oryza Sativa L.) productivity, and profitability,” Journal of Applied Biology and Biotechnology, vol. 9, no. 2, pp. 75–84, 2021.

[9] M. Becker, R. Clavero, Z. N. Maung, O. M. Khin, S. Kong, P. Men, M. J. C. Regalado, S. Ro, K. K. Win, and S. Pariyar, “Pathways and determinants of changing nutrient management in lowland ricebased systems of Southeast Asia,” Agronomy for Sustainable Development, vol. 43, no. 6, pp. 1–17, 2023.

[10] S. Jain, D. Sethia, and K. C. Tiwari, “A critical systematic review on spectral-based soil nutrient prediction using machine learning,” Environmental Monitoring and Assessment, vol. 196, no. 8, 2024.

[11] M. Guo, “Soil health assessment and management: Recent development in science and practices,” Soil Systems, vol. 5, no. 4, pp. 1–20, 2021.

[12] J. A. Reijneveld, M. J. van Oostrum, K. M. Brolsma, D. Fletcher, and O. Oenema, “Empower innovations in routine soil testing,” Agronomy, vol. 12, no. 1, pp. 1–20, 2022.

[13] R. S. Lalitha, R. Srinivas, C. V. Raghavendran, K. Kavitha, P. S. V. V. S. R. Kumar, and P. S. L. Sravanthi, “Real time Nitrogen, Phosphorus, Potassium (NPK) detection in soil using IoT,” in International Conference on Emerging Applications of Information Technology. West Bengal, India: Springer, November 2021, pp. 408–416.

[14] M. A. Mohammed and S. Sanjay, “IoT based soil NPK monitor via asynchronousweb-server using NodeMCU,” International Journal for Research in Applied Science & Engineering Technology (IJRASET), vol. 10, no. VII, pp. 525–530, 2022.

[15] M. K. Senapaty, A. Ray, and N. Padhy, “IoTenabled soil nutrient analysis and crop recommendation model for precision agriculture,” Computers, vol. 12, no. 3, pp. 1–34, 2023.

[16] C. Wu, Y. Chen, X. Hong, Z. Liu, and C. Peng, “Evaluating soil nutrients of Dacrydium Pectinatum in China using machine learning techniques,” Forest Ecosystems, vol. 7, pp. 1–14, 2020.

[17] M. S. Suchithra and M. L. Pai, “Improving the prediction accuracy of soil nutrient classification by optimizing extreme learning machine parameters,” Information Processing in Agriculture, vol. 7, no. 1, pp. 72–82, 2020.

[18] J. Escorcia-Gutierrez, M. Gamarra, R. Soto-Diaz, M. P´erez, N. Madera, and R. F. Mansour, “Intelligent agricultural modelling of soil nutrients and pH classification using ensemble deep learning techniques,” Agriculture, vol. 12, no. 7, pp. 1–16, 2022.

[19] H. Sajindra, T. Abekoon, J. A. D. C. A. Jayakody, and U. Rathnayake, “A novel deep learning model to predict the soil nutrient levels (N, P, and K) in cabbage cultivation,” Smart Agricultural Technology, vol. 7, pp. 1–10, 2024.

[20] I. Wickramasinghe and H. Kalutarage, “Naive Bayes: Applications, variations and vulnerabilities: A review of literature with code snippets for implementation,” Soft Computing, vol. 25, no. 3, pp. 2277–2293, 2021.

[21] Q. Liu, W. Zhu, Z. Dai, and Z. Ma, “Multitask Support Vector Machine Classifier with Generalized Huber Loss,” Journal of Classification, vol. 42, no. 1, pp. 221–252, 2025.

[22] M. S. Ahmed, M. N’diaye, M. K. Attouch, and S. Dabo-Niange, “K-Nearest Neighbors prediction and classification for spatial data,” Journal of Spatial Econometrics, vol. 4, no. 1, 2023.

[23] A. F. Castro Torres and A. Akbaritabar, “The use of linear models in quantitative research,” Quantitative Science Studies, vol. 5, no. 2, pp. 426–446, 2024.

[24] M. Seyedan and F. Mafakheri, “Predictive big data analytics for supply chain demand forecasting: Methods, applications, and research opportunities,” Journal of Big Data, vol. 7, no. 1, pp. 1–22, 2020.

[25] V. Jayaraman, S. Parthasarathy, A. R. Lakshminarayanan, and S. Sridevi, “Crop recommendation by analysing the soil nutrients using machine learning techniques: A study,” in International Conference on Computational Intelligence in Data Science. Chennai, India: Springer, March 18–20, 2021, pp. 15–26.

[26] United Nations, “The 17 goals — Sustainable development.” [Online]. Available: https://sdgs.un.org/goals

[27] V. Varbanova and P. Beutels, “Recent quantitative research on determinants of health in high income countries: A scoping review,” PLOS ONE, vol. 15, no. 9, pp. 1–21, 2020.

[28] F. Asadi, “Introduction to Arduino boards,” in Essentials of ArduinoTM boards programming. Maker innovations series. Apress, 2023.

[29] B. Johnson, Essential Visual Studio 2019: Boosting development productivity with Containers, Git, and Azure tools. Apress, 2020.

[30] D. Strauss, Getting started with Visual Studio 2019: Learning and implementing new features. Apress, 2019.

[31] S. R. Sukhdeve and S. S. Sukhdeve, “Google Colaboratory,” in Google Cloud platform for data science: A crash course on big data, machine learning, and data analytics services. Springer, 2023, pp. 11–34.

[32] iMicon System, “RS-NPK-N01-TR soil nitrogen, phosphorus,potassium three-in-one fertility sensor (Type 485) user’s guide,” 2021. [Online]. Available: http://bit.ly/4mVnYdS

[33] S. Ameer, H. Ibrahim, F. N. U. Kulsoom, G. Ameer, and M. Sher, “Real-time detection and measurements of nitrogen, phosphorous & potassium from soil samples: A comprehensive review,” Journal of Soils and Sediments, vol. 24, no. 7, pp. 2565–2583, 2024.

[34] S. Vennela and A. Velumani, “Design and fabrication of sensor based soil test analyzer to test the quality of sandy soil in comparison with experimental analysis,” in AIP Conference Proceedings, vol. 3193, no. 1. AIP Publishing, 2024.

[35] A. N. Sharkawy, M. Hasanin, M. Sharf, M. Mohamed, and A. Elsheikh, “Development of smart home applications based on Arduino and android platforms: An experimental work,” Automation, vol. 3, no. 4, pp. 579–595, 2022.

[36] A. Kumar, “Crop growth recommendations: Optimal conditions for higher yields,” 2023. [Online]. Available: https://www.kaggle.com/datasets/aksahaha/crop-recommendation/data

[37] P. d. O. Santos and M. M. de Carvalho, “Exploring the challenges and benefits for scaling agile project management to large projects: A review,” Requirements Engineering, vol. 27, no. 1, pp. 117–134, 2022.

[38] H. Dong, N. Dacre, and A. Bailey, “Sustainability in complex agriculture projects: A study of agile agricultural co-operative institutions,” 2021. [Online]. Available: https://papers.ssrn.com/sol3/papers.cfm?abstract id=3879454

[39] G. Mgendi, “Unlocking the potential of precision agriculture for sustainable farming,” Discover Agriculture, vol. 2, pp. 1–24, 2024.

[40] World Economic Forum, “Agritech: Shaping agriculture in emerging economies, today and tomorrow,” 2024. [Online]. Available: https://www3.weforum.org/docs/WEF Agritech 2024.pdf

[41] M. Luppichini, M. Bini, and R. Giannecchini, “CleverRiver: An open source and free Google Colab toolkit for deep-learning river-flow models,” Earth Science Informatics, vol. 16, pp. 1119–1130, 2023.

[42] M. J. Nelson and A. K. Hoover, “Notes on using Google Colaboratory in AI education,” in Proceedings of the 2020 ACM Conference on Innovation and Technology in Computer Science Education, Trondheim, Norway, June 15–19, 2020, pp. 533–534.

[43] M. Rana and M. Bhushan, “Machine learning and deep learning approach for medical image analysis: Diagnosis to detection,” Multimedia Tools and Applications, vol. 82, pp. 26 731–26 769, 2023.

Downloads

Published

2025-09-04

How to Cite

[1]
R. M. Sumacot and J. R. Paragas, “IoT-Enabled K-Nearest Neighbors (KNN)-Based Soil Nutrient Recommendation System for Rice (Oryza Sativa L.) Cultivation”, CommIT (Communication and Information Technology) Journal, vol. 19, no. 2, Sep. 2025.
Abstract 74  .
PDF downloaded 38  .