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: | ||
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. |
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].
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.
The work system is divided into several parts, namely, the sensor works system and the work system when sending value to the ThingSpeak web.
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) |
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:
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
The results of testing the hardware and sensors used
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
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).
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
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
AUTHOR BIOGRAPHY
Naive Bayes Method Monitoring Macro Nutrition and Soil Moisture Using Naive Bayes Method Based on Internet of Things (Herwindo Rahadian)