Nutrition control in nutrient film technique hydroponic system using fuzzy method

. Hydroponics is a method of growing crops without using soil media, instead, it utilizes water or other porous materials. The automation system is applied to control the nutrient quality of the water. Some sensors were used for measuring nutrient concentration, water level, water supply, and water volume. Temperature, TDS, and ultrasonic sensors are installed on the microcontroller for data measurement. The results of the data are processed using the Mamdani fuzzy logic method. The fuzzy logic results are used in controlling nutrition and water volume. The system can be monitored remotely with the aid of the Blynk app. The results of the automation system concluded that the desired condition reaches an average time of 13 minutes 49 seconds. Finally, the results of the fuzzy logic processing of the system have an accuracy value of 94.24% after being compared with the software simulation.


Introduction
Indonesia has a tropical climate and very high rainfall, which can support the growth of many types of fruits and vegetables.The need for food for humans such as vegetables is increasing along with the population growth rate.However, this is contrary to the availability of land for plantations.
Hydroponics is a way of growing without using soil as a growing medium [1].Hydroponics has many systems including the Nutrient Film Technique (NFT), Deep Flow Technique (DFT), Aeroponic, and Drips Systems.NFT hydroponics is a system that utilizes a layer of water containing a solution of nutrients plants need.This 1-3 mm thick water flow is pumped and flowed in PVC pipes and continuously passes through the plant roots at a flow rate of about 1-2 Liters per minute.In NFT hydroponic cultivation, nutrients are given in the form of a solution containing macro and microelements [2].
The fuzzy model for controlling hydroponic cultivation has been implemented by [3,4].Whether the DFT system controlled its water pH was developed by [5] by using the Internet of Things system.[6] was developed as a hydroponic tower with a nutrient control system.
The difficulty in the hydroponic system is manually measuring and adding the volume of water and nutrients in the reservoir.Several previous studies [6,7] have tried to overcome this problem as previously mentioned before, however, it is still possible to improve the systems and mechanisms that have been proposed.
The microcontroller connected to the sensor can read the volume and nutritional value in the reservoir so that the fuzzy logic method is used in processing water and nutrient volume data to determine the solenoid valve, drain pump, and nutrient pump duration.A microcontroller connected to the internet can facilitate remote monitoring using the Blynk Application.

Material and method
This research is qualitative experimental research.First, a fuzzy logic model is created by determining the input and output functions of the system.Next, a membership function is created from the input, in this case, the nutrient level value which is determined by the quality of nutrients and water.After that, the output membership function is formulated which consists of the opening time for the pump to drain additional nutrient fluid, water, and water drainage.Finally, a fuzzy logic rule is defined that connects the input and output membership functions.
Implementation of the fuzzy logic function into the system hardware is carried out by creating a program on a microcontroller that has been connected to a TDS sensor, a water level sensor as input, and a relay connected to the nutrient and water pump as output.
The results of the implementation were then tested in planting green mustard greens, then the condition of the plant growth rate from seed to harvest was observed.Data from the trial results are analysed and used to improve the system as expected.

Nutrition control in nft hydroponic system design
Hydroponic Nutrient Film Technique (NFT) is a special type of hydroponics that was first developed by Dr. A.J Cooper at the Glasshouse Crops Research Institute, Littlehampton England in the late 1960s and commercially developed in the early 1970s.In the NFT system, plant seeds are planted first in rock wool.The NFT system can produce plants with less space, less water, and fewer nutrients [8].The design of the NFT hydroponic system can be seen in Figure 1.The TDS sensor is used to read the nutritional value in the reservoir and the DS18B20 temperature sensor is used to determine the water temperature in the reservoir and the temperature reading results help the accuracy of the TDS sensor reading.To determine the volume of water in the reservoir and the volume in nutrient containers A and B using the ultrasonic sensor HC-SR04.These sensors are connected to the Arduino Mega 2560 which is used as a microcontroller and performs data processing using the Mamdani fuzzy logic method.The results of the TDS sensor readings and the HC-SR04 ultrasonic sensor in the reservoir will be processed using the Mamdani fuzzy logic method to get the duration of the water drain pump, solenoid valve, and nutrition pump working.The ESP-01 connects Arduino Mega 2560 with Wi-Fi and Blynk networks.Sensor readings and fuzzy logic results can be monitored using the Blynk application.The block diagram of the system can be seen in Figure 2.

System devices
System devices consist of Arduino Mega 256 microcontrollers, ESP-01 Wi-Fi module, TDS Sensor, DS18B20 Temperature Sensor and 4-channel relay.Those integrated systems are connected to Blynk Cloud application.Each device specification is described as follows: Arduino Mega 2560 microcontroller is used to process sensor data using the fuzzy logic method.The choice of Arduino Mega as the microcontroller used in this system is because Arduino Mega has a storage capacity of 256KB and the number of digital pins is 54 pins [9].The physical form of Arduino Mega 2560 can be seen in Figure 3.The TDS sensor is a sensor that measures the number of solids dissolved in the water.The TDS (Total Dissolved Solids) sensor shows the number of solids dissolved in water expressed in PPM (Parts Per Million) units.The TDS sensor module gets the measurement value from a probe immersed in water and connected to the probe module [10].Analog data from the TDS sensor module will then be processed into digital data by Arduino Mega using ADC (Analog to Digital Converter).The TDS sensor uses the working principle of two separate electrodes to measure the electrical conductivity of the sample liquid.The nature of the electrolyte or the content of ionic particles of a liquid will affect the results of the electrical conductivity measurement on the TDS sensor.An increase in the temperature of the solution will cause a decrease in viscosity and an increase in the mobility of the ions.
In this system, ultrasonic sensors are used to measure the water level in water reservoirs, nutrient containers A and B. Ultrasonic sensors track the time between sending sound waves and returning sound waves [11].The distance of the reflected sound wave can be determined using the formula: The DS18B20 sensor is a digital temperature sensor that provides 9-bit to 12-bit Celsius temperature measurements.The temperature reading resolution with 9, 10, 11, and 12 bits affects the temperature increase of 0.5℃, 0.25℃, 0.125℃, and 0.0625℃.The default resolution used is 12-bit [12].DS18B20 communicates or sends data to the microcontroller with only one data line.On the DS18B20 sensor, the parasitic power mode requires only 2 pins for operation (DQ and GND).The temperature sensor plays a key role in the TDS sensor reading.Inaccurate temperature sensor readings can cause incorrect TDS sensor readings.
1-channel and 4-channel relay modules require 15-20 mA as control current.This relay module can control components with large currents.This relay module uses a relay that works at a voltage of 250 VAC 10A or 30 VDC 10 A. The 4-channel relay module is used to control the solenoid valve, water drain pump, and nutrition pumps A and B. The 1-channel relay module is used to control the wavemaker, which stirs the water in the reservoir after the nutrient and water control process.
Blynk is an Android and iOS operating system platform as a control module for Arduino, Raspberry Pi, ESP8266, and other similar devices over the Internet.Blynk in this system is used to display sensor readings and fuzzy logic calculations on microcontroller devices.

Results and discussion
The implementation of this smart controlling system was developed with a fuzzy algorithm and hardware hydroponics cultivation plan including several sensors such as TDS Sensor, water temperature sensor, and water level sensor.The system output is actuators to drive the relay in the connected water pump and valve to mix the nutrient liquid and to drain the water tank.

Fuzzy Logic Mamdani
The fuzzy logic method used in this research is Mamdani Fuzzy Logic.The reason for choosing Mamdani's fuzzy logic is because the input and output fixed values are not exact values.Input conditions, in this case the value of nutritional quality and tank volume, are within a certain range.Likewise, to determine the output value, in this case the activation times for the liquid pump and the relay for the valve are different from each other.In this system, fuzzy logic processes two inputs and produces 3 outputs.On the input, each has four variables VL (Very Low), L (Low), E (Enough), H (High), and VH (Very High).At the output, each output has five variables ZO (Zero), S (Short), M (Medium), LG (Large), and VLG (Very Large).
In designing fuzzy logic for this system sixteen rules where this rule base is less than [4].The fuzzy logic rules are shown in Table 3.

Hardware implementation
Three-inch PVC pipe is used for the hydroponic gutter and a ½" PVC pipe is used for the hydroponic water pipe.The electronic circuit is placed above the reservoir in a basket.An ultrasonic sensor is placed under the electronic basket to measure the volume of the reservoir.An ultrasonic sensor was placed under the lid of the box to measure the volume in the nutrient AB Mix container.The electric socket is placed in a box to avoid rainwater.The hydroponic system can be seen in Figure 5.
In this study, six experiments were carried out to test the reliability of the system in controlling nutrient levels as in Table 4.The first to third trials were carried out when the initial value of nutritional quality exceeded the specified limits.The time required to reach the threshold value is around 11 minutes.Meanwhile, in the fourth to fifth experiments, the initial quality value was far below the desired threshold.The time required by the system is above 14 minutes.Meanwhile, in the sixth experiment, the initial value was within the specified limit range, and the time required was 6 minutes.This shows that the further the initial condition value is from the set threshold, the relatively longer time it will take to control.These results are similar to research [3] but the time required is shorter.
Control time is based on how long the actuator is active as well as the time it takes for the system to connect to Wi-Fi and Blynk.The system will reconnect to Wi-Fi and Blynk each time control is complete.This condition is caused by a system delay that is too long and will then cause the system to disconnect from the Blynk server.This system requires control that is carried out repeatedly to achieve the desired conditions because the incoming water flow is unstable.The level of accuracy of the fuzzy results is obtained by comparing the fuzzy system measurement results with simulation software in Figure 5.The implementation results show that the desired variable values are close to the simulated values.Differences in the use of decimal values cause differences in results, although in general, the system test results are close to the simulation results.

Monitoring system
In the Blynk application display as shown in Figure 6.We can see the reading results of the TDS sensor, temperature sensor in the reservoir, volume in the reservoir, and volume in nutrient containers A and B. In addition, the results of fuzzy logic in the form of actuator life duration can be monitored on the application display.

Conclusions
The system has worked well and has quite good sensor reading accuracy.Even though there are differences in results between the implementation and the fuzzy logic system simulation, they are still quite accurate.This is due to differences in decimal usage.The fuzzy method used can produce nutritional values and water volume as desired.This is done by carrying out repeated controls due to unstable water discharge.

Fig. 3 .
Fig. 3. Arduino Mega 2560.The ESP-01 Wi-Fi module developed by Ai-Thinker uses the ESP8266EX processor core.Added the ESP-01 Wi-Fi module to the microcontroller so that it can connect to the internet network and Blynk via Wi-Fi.The ESP-01 has the following features:

Table 4 .
System control data.