Buletin Ilmiah Sarjana Teknik Elektro         ISSN: 2685-9572

Naive Bayes Method Monitoring Macro Nutrition and Soil Moisture Using Naive Bayes Method Based on Internet of Things

Herwindo Rahadian, Anton Yudhana

Department of Electrical Engineering, Universitas Ahmad Dahlan, Yogyakarta, Indonesia

ARTICLE INFORMATION

ABSTRACT

History:

Submitted 19 July 2022

Revised 14 June 2023

Accepted 20 June 2023

The different land quality causes farmers not to know the exact quality of their agricultural land. Improper processing of agricultural land can result in a decrease in the quality of a land. The content of soil macronutrients consists of nitrogen (N), phospor (P), and potassium (K), these contents that usually affect plant growth. The development of an optical transducer for which is used to measure the wavelength of an object in everyday life can use led sensors as a light source and photo diodes as light detection using the TCRT5000 sensor as an infrared wave transmitter module. The use of the internet of things at this time is very useful to facilitate monitoring. The use of naïve bayes to determine the resulting probability. the soil moisture content obtained averaged 20.63% and nitrogen content values with an average of 590, Phospor 513 and Potassium 670. The sending of data to ThingSpeak can be determined as desired. It is hoped that this research can be developed by refining the use of sensors and methods used to make it easier to apply in life.

Keywords:

Soil Fertility;

TCRT5000

Soil Sensor;

Naïve Bayes;

Internet of things;

Corresponding Author:

Anton Yudhana,

Department of Electrical Engineering,

Universitas Ahmad Dahlan, Bantul, Yogyakarta, Indonesia.

Email:

eyudhana@ee.uad.ac.id

mherwindo1500022052@webmail.uad.ac.id 

This work is licensed under a Creative Commons Attribution-Share Alike 4.0

Document Citation:

H. Rahadian and A. Yudhana, “T Naive Bayes Method Monitoring Macro Nutrition and Soil Moisture Using Naive Bayes Method Based on Internet of Things,” Buletin Ilmiah Sarjana Teknik Elektro, vol. 5, no. 2, pp. 251-259, 2023, DOI: 10.12928/biste.v5i2.6305.


  1. INTRODUCTION

The different quality of land causes farmers not to know for sure the quality of their agricultural land. Inappropriate processing of agricultural land leads to a further decline in the quality of a land [1]. Plant growth is also influenced by the level of soil fertility, the level of soil fertility can be known through the nutrient content found in the soil, these elements are elements of Nitrogen (), Phosphorus (), Potassium (), Calcium (), Magnseium () and Sulfur (). These elements are macro elements that are usually found in soil and are needed for plant growth. Analysis of macro-nutrient content in the soil for nitrogen, phosphorus and potassium [2].

Soil fertility is largely determined by the presence of nutrients in the soil, both macro nutrients, secondary nutrients and micro nutrients. Macro nutrients include nitrogen (), phosphorus (), and potassium (). While secondary nutrients include calcium (), magnesium (), and sulfur (S). Each plant requires large amounts of macronutrients such as nitrogen (), potassium (), and potassium (K) [3]. Soil testing technology is a tool to accurately determine the availability of nutrients in the soil for the determination of balanced fertilization according to plant needs. Continuous application of inorganic fertilizers at doses that exceed plant needs can disrupt the balance of nutrients in the soil due to decreased soil pH and accumulation of P and K nutrients resulting in nutrient disorder [4]. The importance of knowing the level of soil fertility conditions more easily and efficiently, it is necessary to develop existing tools. Namely with the addition of an Internet of Things-based system for easy access in knowing the level of fertility of the land to be used [5]. Nutrient content in the soil can be determined by conducting laboratory tests on soil samples. This sometimes takes a long time and of course involves several chemicals which are of course ineffective and can result in additional environmental pollution [6].

An optical transducer is used as a detection sensor which consists of three LEDs as a light source and a photo diode as a light detector at a wavelength chosen to adjust the high and low absorption of each nutrient [7]. Optical detection methods have recently been identified as having a higher potential for real-time detection due to their highly sensitive and fast response [8]. Infrared spectroscopy is used for the purpose of imaging waves using the infrared spectrum [9]. Near infrared spectroscopy is an optical technique that can measure spectral absorbing molecules [10]. The soil NIR absorbance spectra pattern has 3 peaks, namely 1400 – 1450 nm, 1900 – 1950 nm and 2200 – 2250 nm. If chemical bond information at a certain wave is placed on the spectra, it will be seen clearly the relationship between chemical bonds and soil spectra [11].

Internet of things (IoT) is a concept that aims to transmit data inherent in physical objects via the internet, thereby enabling recipients on the other end to monitor, process and ultimately make decisions based on this data. The ESP 8266 module is connected to the load sensor to send data via the internet, the measurement results are recorded in the database [12]. In this field survey activity, soil samples were also taken from each land unit at a depth of 0 – 30 cm [13]. Soil moisture sensors are used intensively nowadays because they provide real-time readings, including remote sensing available to measure soil moisture content, using electronic soil moisture sensor devices [14].

The results of its utilization are expected to be able to help farmers to make agricultural systems in an effort to monitor and control the quality of water and agricultural land more efficient [15]. Detection or estimation of soil nutrient levels must be carried out in order to monitor soil health and fertility conditions, especially soil used for agricultural and animal husbandry activities. This monitoring action is carried out so that we can determine preventive actions or follow-up actions that must be taken to maintain the health condition and soil fertility [16].

  1. METHOD

The ground is illuminated by a light source and the absorption rate is evaluated by a light detector. Most of the devices developed use additional optical components such as optical fibers to direct light to the ground [17]. The use of the Naive Bayes method refers to making decisions on soil nutrient content, it is known that the Naive Bayes method has good accuracy and can be used based on class classification at the beginning of the process [1]. Naive Bayes is that this method only requires a small amount of training data (Training Data) to determine the parameter estimates needed in the classification process. Naive Bayes often performs much better in most complex real-world situations than expected [18]. Use of the Naive Bayesian theorem for spam filtering. From the results of this study the authors hope that the Naive Bayes method can determine which areas are suitable for which plants because the culture of an area varies [19]. Naive Bayes uses a branch of mathematics known as probability theory to find the greatest opportunities for possible classifications, by looking at the frequency of each classification in the training data [20].

Equation (1) Naive Bayes method.

(1)

Where,  is the Data with unknown class,         is the Hypothesis data is a specific class,  is the Probability of hypothesis  based on condition  (posteriori probability),  is the Probability of the hypothesis  (probability prior),  is the Probability of  based on conditions in hypothesis ,  is the Probability  To explain the Naive Bayes method.

  1. Work system

        The work system is divided into several parts, namely, the sensor works system and the work system when sending value to the ThingSpeak web.

  1. Equation

Naive Bayes is that this method only requires a small amount of training data (Training Data) to determine the parameter estimates needed in the classification process. Naive Bayes often performs much better in most complex real-world situations than one might expect Bayes Theorem Equations (2).

(2)

Where,  is the data with unknown class,  is the hypothesis data is a specific class,  is the probability of hypothesis  based on condition  (posteriori probability),  is the probability of the hypothesis  (probability prior),  is the probability of  based on conditions in hypothesis ,  is the probability  To explain the Naive Bayes method.

Equation (1) is the Bayes theorem equation which is the main method used in determining the hypothesis and the probability that will be generated. In determining the average value to be searched for using equation (3).

(3)

  1. System Design

An overview of the design of the system to be used, both from the input process, data processing to the resulting output. In Figure 1 it can be seen that the process flow of the system starts from the Soil moisture sensor input and the NIRS Sensor then is processed by NodeMCU and the last Naïve Bayes classification is displayed on the ThinkSpeak LCD and web.

Figure 1. Tool work system block diagram

Figure 2 is an overview of the system circuit and the use of some of the components used, namely the 3 NIRS sensors, the Soil Moisture Sensor, the ADS1115 and the NodeMCU microcontroller.

Figure 2. System Design

In Figure 3 is an overview of the system to be used and the wiring diagram of the working system of the tools to be used.

Figure 3. General description of tool design and wiring diagram

In the series of systems above there are several components used, including:

  1. TCRT5000, used as a led sensor that functions as a photo diode which will emit infrared waves.
  2. ADS1122, is an analog converter as an additional module that is used to increase the number of analog inputs on NodeMCU
  3. Soil Moisture Sensor, used to detect soil moisture level
  4. NodeMCU, as a microcontroller used in a series of work systems
  5. LCD, used as the main viewer 

  1. Flowchart

In the system flow diagram, at the beginning the device is turned on then the TCRT5000 and Soil Moisture sensors read the value then the value will be displayed on the LCD, then the hardware system will automatically connect to an internet connection which will be sent on the Thing Speak web as can be seen in Figure 4.

Figure 4. System flow chart

Figure 5 is part of the flowchart for sending values that have been obtained by sensors which are then sent to the ThingSpeak web. Flow chart for sending data from reading sensor values, after the device is connected to the internet and there are no hardware errors.

Figure 5. Flow of sending data to ThinkSpeak

  1. RESULT AND DISCUSSION

The results of testing the hardware and sensors used

  1. TCRT5000 Sensor Testing

The TCRT5000 sensor is an optical transducer used to measure wavelengths. An optical transducer is used as a detection sensor which consists of three LEDs as a light source and a photo diode as a light detector. The wavelength chosen to adjust the high and low absorption of each nutrient. In Figure 6 it can be seen that it is part of the TCRT5000 sensor that is being tested and, on the container, there is a mirror as a wave reflector generated by the TCRT5000 sensor. The results of testing the TCRT5000 sensor can be seen in Table 1.

Figure 6. TCRT5000 sensor testing

Table 1. TCRT5000 Sensor Measurement Results

Time

Nitrogen

Phosphor

Potassium

16:55:28

761

628

523

16:56:01

737

612

544

16:56:19

712

595

565

16:56:40

688

579

586

16:57:04

664

562

607

16:57:25

639

546

628

16:59:17

615

529

649

10:48:00

590

513

670

17:00:21

566

496

691

17:00:38

542

479

713

17:00:55

517

463

734

17:01:14

493

446

755

17:01:32

469

430

776

17:02:03

444

413

797

17:03:03

420

397

818

The results of the TCRT5000 sensor test are in the form of a graph which can be seen in Figure 7. The resulting graph from the TCRT5000 sensor test, with limiting values for each sensor according to a predetermined wavelength has been determined.


Figure 7. TCRT5000 sensor test results

  1. Soil Sensor Testing

Testing the Soil Moisture sensor seen in Figure 8 is carried out to determine the limits on the sensor and determine the sensor value. The results of testing the TCRT5000 sensor can be seen in Table 2.

Figure 8. Soil Sensor Testing

Table 2. Soil Sensor Test Results

No

Results

Voltage

1

11.96

3 V

2

12.97

3 V

3

13.97

3 V

4

14.97

3 V

5

15.97

3 V

6

16.98

3 V

7

17.96

3 V

8

18.97

3 V

9

19.97

3 V

10

20.98

3 V

11

21.97

3 V

12

22.97

3 V

13

23.98

3 V

14

24.98

3 V

15

50.99

3 V

The soil sensor is used to see the moisture content in the soil and the average soil moisture level can be calculated using Equation (2).

  1. Testing Delivery to the Thingspeak Web

Sending the results of the experiment to the ThingSpeak web which is the final result of the research. In Figure 9 the display on the Arduino IDE window when the device is connected to the internet will send the test results data to the ThingSpeak web, while in Figure 10 is a display on the ThingSpeak web in the form of a graph of the results of the data sent.

Figure 9. ThingSpeak delivery conditions

Figure 10. ThingSpeak display

  1. CONCLUSIONS

Effect of macro nutrients on agricultural soil for plants. The use of synthetic fertilizers on the soil is not good if it is used excessively and is not controlled. Utilization of infrared waves to detect macro nutrients. Utilization of online systems in agriculture in the future

ACKNOWLEDGEMENT

I would like to thank the editors and reviewers for all the suggestions, input and assistance in the process of publishing the manuscript. Thanks are also shown to those who have supported the research and provided moral and material assistance.

REFERENCES

  1. P. D. Ntihinyurwa, W. T. de Vries, U. E. Chigbu and P. A. Dukwiyimpuhwe, "The positive impacts of farm land fragmentation in Rwanda," Land Use Policy, vol. 81, pp. 565-581, 2019, https://doi.org/10.1016/j.landusepol.2018.11.005.
  2. E. Nuryanto and E. Gouw, “Analysis of Macronutriens Contents in Soil With Near Infra Red (Nir) Spectroscopy,” J. Penelit. Kelapa Sawit, vol. 25, no. 2, pp. 85–94, 2017, https://doi.org/10.22302/iopri.jur.jpks.v25i2.27.
  3. S. Kavileswarapu, M. A. A. Khader, S. Ahmed and R. Radha, "IoT Based Smart Crop Recommendation Using Macro Nutrient Analysis of Soil," 2022 Seventh International Conference on Parallel, Distributed and Grid Computing (PDGC), pp. 501-506, 2022, https://doi.org/10.1109/PDGC56933.2022.10053187.
  4. A. Monteiro, S. Santos and P. Gonçalves, "Precision agriculture for crop and livestock farming-Brief review," Animals, vol. 11, no. 8, p. 2345, 2021, https://doi.org/10.3390/ani11082345.
  5. J. H. Britt, et al., "Invited review: Learning from the future-A vision for dairy farms and cows in 2067," Journal of dairy science, vol. 101, no. 5, pp. 3722-3741, 2018, https://doi.org/10.3168/jds.2017-14025.
  1. S. Chatterjee, N. Dey, and S. Sen, “Soil moisture quantity prediction using optimized neural supported model for sustainable agricultural applications,” Sustain. Comput. Informatics Syst., vol. 28, 2020, https://doi.org/10.1016/j.suscom.2018.09.002.
  2. M. Masrie, M. S. A. Rosman, R. Sam, and Z. Janin, “Detection of nitrogen, phosphorus, and potassium (NPK) nutrients of soil using optical transducer,” 2017 IEEE Int. Conf. Smart Instrumentation, Meas. Appl. ICSIMA 2017, vol. 2017-Novem, no. November 2017, pp. 1–4, 2018, https://doi.org/10.1109/ICSIMA.2017.8312001.
  3. D. Q. Huo et al., “Recent advances on optical detection methods and techniques for cell-based microfluidic systems,” Fenxi Huaxue/ Chinese J. Anal. Chem., vol. 38, no. 9, pp. 1357–1365, 2010, https://doi.org/10.1016/S1872-2040(09)60067-0.
  4. K. B. Beć, J. Grabska and C. W. Huck, "Near-infrared spectroscopy in bio-applications," Molecules, vol. 25, no. 12, p. 2948, 2020, https://doi.org/10.3390/molecules25122948.
  5. N. S. F. Alenzi, K. P. Rao, and N. D. Alotaibi, “Design And Development Of Near-Infrared Spectroscopy System For Monitoring Functional Brain Activity.,” Int. J. Adv. Res., vol. 7, no. 4, pp. 483–488, 2018, https://doi.org/10.21474/IJAR01/8843.
  1. M. Edalat, R. Naderi and T. P. Egan, "Corn nitrogen management using NDVI and SPAD sensor-based data under conventional vs. reduced tillage systems," Journal of Plant Nutrition, vol. 42, no. 18, pp. 2310-2322, 2019, https://doi.org/10.1080/01904167.2019.1648686.
  2. H. Hassan, F. Saad, N. Fazlin and A. Aziz, "Waste Monitoring System based on Internet-of-Thing (IoT)," 2018 IEEE Conference on Systems, Process and Control (ICSPC), pp. 187-192, 2018, https://doi.org/10.1109/SPC.2018.8704142.
  3. D. Liu, Y. Huang, S. An, H. Sun, P. Bhople and Z. Chen, "Soil physicochemical and microbial characteristics of contrasting land-use types along soil depth gradients," Catena, vol. 162, pp. 345-353, 2018, https://doi.org/10.1016/j.catena.2017.10.028.
  4. M. Danita, B. Mathew, N. Shereen, N. Sharon and J. J. Paul, "IoT Based Automated Greenhouse Monitoring System," 2018 Second International Conference on Intelligent Computing and Control Systems (ICICCS), pp. 1933-1937, 2018, https://doi.org/10.1109/ICCONS.2018.8662911.
  5. U. Syafiqoh, S. Sunardi, and A. Yudhana, “Pengembangan Wireless Sensor Network Berbasis Internet of Things untuk Sistem Pemantauan Kualitas Air dan Tanah Pertanian,” J. Inform. J. Pengemb. IT, vol. 3, no. 2, pp. 285–289, 2018, https://doi.org/10.30591/jpit.v3i2.878.
  6. F. Corradini, H. Bartholomeus, E. Huerta Lwanga, H. Gertsen, and V. Geissen, “Predicting soil microplastic concentration using vis-NIR spectroscopy,” Sci. Total Environ., vol. 650, pp. 922–932, 2019, https://doi.org/10.1016/j.scitotenv.2018.09.101.
  7. M. Masrie, A. Z. M. Rosli, R. Sam, Z. Janin and M. K. Nordin, "Integrated optical sensor for NPK Nutrient of Soil detection," 2018 IEEE 5th International Conference on Smart Instrumentation, Measurement and Application (ICSIMA), pp. 1-4, 2018, https://doi.org/10.1109/ICSIMA.2018.8688794.
  8. A. N. Repaka, S. D. Ravikanti and R. G. Franklin, "Design And Implementing Heart Disease Prediction Using Naives Bayesian," 2019 3rd International Conference on Trends in Electronics and Informatics (ICOEI), pp. 292-297, 2019, https://doi.org/10.1109/ICOEI.2019.8862604.
  9. P. Malik, S. Sengupta and J. S. Jadon, "Comparative Analysis of Soil Properties to Predict Fertility and Crop Yield using Machine Learning Algorithms," 2021 11th International Conference on Cloud Computing, Data Science & Engineering (Confluence), pp. 1004-1007, 2021, https://doi.org/10.1109/Confluence51648.2021.9377147.
  10. N. Kulkarni, A. Thakur, T. Rajwal, R. Tornekar and S. Patil, "Smart soil nutrients analysis and prediction of the level of nutrients using a bot," 2019 3rd International Conference on Recent Developments in Control, Automation & Power Engineering (RDCAPE), pp. 663-668, 2019, https://doi.org/10.1109/RDCAPE47089.2019.8979007.

AUTHOR BIOGRAPHY

M. Herwindo Rahadian F Complete undergraduate education at the Universitas Ahmad Dahlan Electrical Engineering Study Program in 2022.

Anton Yudhana is a Lecturer in the Electrical Engineering Study Program, Universitas Ahmad Dahlan.

Naive Bayes Method Monitoring Macro Nutrition and Soil Moisture Using Naive Bayes Method Based on Internet of Things (Herwindo Rahadian)