Prototype of Control and Monitor System with Fuzzy Logic Method for Smart Greenhouse

secara otomatis


Greenhouse System
The term greenhouse comes from the words "green" and "house", which means home for plants. It is named greenhouse because when seen from the outside, the greenhouse which walls are made from glass or plastic will appear green. At first the greenhouse walls were made of glass, so it is called as a glasshouse, but the term glasshouse is often identical to environmental pollution. In the further development, the glass material of greenhouse wall is replaced with plastic [5]. Greenhouse systems are designed in different forms for different climatic conditions. One plant has certain conditions that help the plant to thrive and be more productive. Climate adjustment in greenhouses should be optimized through systems that can create the same climate as needed to grow the crops [6].

Temperature and Relative Humidity
Plant growth is strongly influenced by temperature and humidity. If the humidity of the environment is over the limits, then the plant growth will not be optimum. Each group of plants needs different air humidity for its optimal development. The ideal humidity for plant growth is about 60% to 80%. Besides that, air temperature also affects plant life activities such as in the process of photosynthesis, respiration, transpiration, growth, pollination, fertilization, and absorption. The significance of this temperature is related to other factors such as humidity, the availability of water, and the ideal temperature for plant growth ranging from 15°C to 40°C [7].

Soil Moisture
Soil moisture is water that fills part or all of the pores of the soil above the water table [8]. Another definition states that soil moisture indicates the amount of water stored between the pores of the soil. Soil moisture is very dynamic, this is caused by the evaporation through soil level, transpiration and percolation [9].

Light Intensity
Light means a lot to plants, mainly because of its role in physiological activities such as photosynthesis, respiration, growth and flowering, opening and closing of stomata, germination and plant growth. Irradiation of the sun affects the growth, reproduction and yield of plants through the process of photosynthesis. The absorption of light by pigments will affect the division of photosynthate to other parts of the plant through the process of photomorphogenesis [10].

Arduino Mega 2560
Arduino is an open-source hardware prototype platform based on flexible and easy-to-use hardware and software. Arduino is intended for artists, designers, and anyone interested in creating interactive objects or environments [11].
The technical data board of Arduino Mega2560 is addressed in Table 1 as the following:

DHT22 Sensor
DHT22 is a digital sensor of relative humidity and temperature. DHT22 sensors use capacitors and thermistors to measure the surrounding air and signal output on the data pin. DHT22 is claimed to have good reading quality, judged by the rapid response of the data acquisition process and its minimalist size, as well as the relatively cheap price when compared to other thermohydrometer tools [12].

Soil Moisture Sensor
The soil moisture sensor consists of two probes used to measure the volumetric content of water. Both probes allow currents to pass through the soil and then get resistance values to measure moisture values. When there is more water, the soil will do more electricity which means that there will be less resistance. Therefore, the humidity level will be higher [13].

Water Level Sensor
Water Level Sensor is a tool used to signal the alarm/automation panel that the water level has reached a certain level. The sensor will give a dry contact signal (NO/NC) to the panel. Water level detector by reading the voltage value generated by each voltage division circuit composed by four outputs [14].

RTC DS3231
DS3231 is a cheap and accurate real-time I2C clock with Temperature Compensated Crystal Oscillator (TCXO) which crystals are integrated. On this device there are inputs for batteries that serve to maintain accurate punctuality when the main power to the device is disconnected. The integration of crystal resonators improves the long-term accuracy of the device as well as reduces the number of pieces inside the manufacturing line. The DS3231 is available in commercial and industrial temperature ranges, and is offered in an 800-mile or 300-mile SO package [15].

Fuzzy Logic
Fuzzy logic is a development of a technology that no longer uses conventional means to obtain the desired results by using mathematical equations. Instead, it applies a system of human ability to control something, namely in the form of rules: Ifthen (If -Then Rules). Therefore, the control process will follow the approach linguistically. This system is called fuzzy logic control system, where the fuzzy logic control system has no dependence on variables -control process variables. The system is developed in the field of control engineering, especially for nonlinen and dynamic systems [16].
Fuzzy logic system consists of three stages namely fuzzification, fuzzy rule and defuzzification (output in the form of calculation results) converted to a certain value. Fuzzy input membership function determines the variables such as temperature and humidity to develop controls and to minimize microcontroller memory data [13]. The mechanism of inference system in this research is addressed in Figure 1.  The fuzzification process is used to convert the enter data firmly into the form of membership degree. The knowledge base is used to connect the input set with the output set. Decision-making logic is used to combine the rules contained in the rule base into a mapping of a fuzzy set of inputs to a fuzzy set of outputs.

Inference Mechanism
Fuzzy inference applies fuzzy rules to fuzzy input then evaluates each rule. The fuzzy logic principle is used to combine the IF-THEN rules contained in the rule base into a mapping of a fuzzy input set to a fuzzy output set. Decision-making logic is the second step in fuzzy logic processing. There are several methods of decision making in fuzzy logic including the Mamdani method. The implication function uses MIN in decision making by Mamdani method and MAX in doing composition. This method of composition is often called MAX-MIN. Fuzzy Inference in this study is shown in Figure 3 below. Input from the defuzzification process is a fuzzy set obtained from the composition of fuzzy rules, while the resulting output is a number in the domain of the fuzzy set. So, if given a set of fuzzy in a certain range, it must be taken a certain crisp value as its output. Defuzzification in this study is shown in Figure 4 below.

Methodology
The material needed to make a greenhouse material are wood beams, PVC boards and plastic mica 0.50 mm, with dimensions on the greenhouse is a length = 40 cm, width = 25 cm, height = 35 cm. To create a program that will be planted on the Board Arduino Mega 2560, the greenhouse requires programming software or text editor called Arduino IDE (Integrated Development Environment) which uses C language as the programming language. Fuzzy logic method is used to control water pump with the variables of temperature, humidity, soil moisture and water level, and to control LED strip with the variable of light intensity. Then, it will be controlled using logic IF-Else with set value IF temperature ≥ 31 then FAN HIGH/ON, Else FAN LOW/OFF. The system flowchart in this study is shown in Figure 5 below.

Circuit Design
At this stage, the design is carried out on the entire electronic hardware series, consisting of system inputs circuits, system output circuits, processing circuits, voltage regulators, power supply and wiring. The circuit design in this study is shown in Figure 6 below.

Blok Diagram Design
A control system consists of several components and a block diagram is used to show the function of each component. A block diagram of a system is an image representation of the functions performed by each component and its signal flow. This diagram illustrates the relationships between different components. Unlike abstract mathematical representations, block charts have advantages because they can describe more realistically the flow of signals from the actual system. In block diagrams, all system variables are connected to each other through functional blocks. The block diagram of this study is shown in Figure 7 below.

Fuzzy Water Pump Set
The fuzzy Mamdani method for water pump control uses four input variables and one output variable with 48 fuzzy rules, as follows: 1. Input Variable of Temperature Input variables temperature will be divided into several sets of fuzzy set namely, cold, normal and hot, with the value range of 0 -50, as shown in Figure 8 below.

Input Variable of Relative Humidity
The input variable of air humidity (RH) will be divided into several fuzzy sets namely, low, medium, and high, with the value range of 0 -100 as shown in Figure 9 below.

Input Variable of Water Level
Water Level input variables will be divided into several fuzzy sets namely, zero, water low, water medium and full, with the value range of 0 -100 as shown in Figure 11 below: Figure 11. Variable of Water Level

Output Variable of Water Pump
Output variable water pump will be divided into several fuzzy sets namely off, short, rather, and long, with the watering duration range of 0 -10 as shown in Figure 12 below:

Fuzzy Rule of Water Pump
After the input and output variables are made along with the membership value, then the rule base is made to determine the decision on the control of the water pump, as shown in Figure 13 below: Figure 13. Fuzzy Rule of Water Pump

Fuzzy Logic LED Strip Set
This fuzzy Mamdani method for LED control uses one input variable and one output variable with five fuzzy rules, as follows: 1. Input Variable of Light Intensity Variable Light Intensity will be divided into several fuzzy sets namely dark1, dark2, remang, remang2 and terang, with the value range of 0 -1000 as shown in Figure 14 below: 2. Output Variable of LED LED variables will be divided into several fuzzy sets namely redup, remang2, remang1, terang2 and terang1, with the value range of 0 -1000 as shown in Figure 15 below:

Fuzzy Logic Testing
This stage is to find out the suitability of fuzzy logic results in Greenhouse with Fuzzy Logic on Matlab through 10 tests. As shown in Table 2 and Table 3 below, the percentage calculation of accuracy is obtained from the division of the smallest value (Min) in the fuzzy ratio with the largest value (Max) then multiplied by 100%.

RTC Testing
This stage is to find out the suitability of the results of the time schedule that has been in the program based on the timing of the RTC against the entire output of the system. T previous system flow has discussed that all output in the greenhouse system will be in sleep mode when the time on the RTC shows at 18.00 -06.00 or 6 pm to 6 am, as shown in Table 4 below:

User Interface View
There are two user interfaces in this application, namely the user interface in Blynk application that must be connected to the internet network and the 20x4 LCD user interface that do not have to be connected to the internet network. This can be seen in Figure 17 below:

Conclusion
Based on the results of tests that have been done 10 times against Fuzzy Logic Water Pump on Smart Greenhouse compared to Fuzzy Logic on Matlab, it was obtained an accuracy value of 98.3%, and testing of Fuzzy Logic LEDs on Smart Greenhouse compared to Fuzzy Logic on Matlab, obtained an accuracy value of 99.6%. Based on the test results against RTC that will be used as a timer on Water Pump, LED and FAN, get the appropriate results.