Simulation and design of smart clothesline using fuzzy for weather forecast

Information about weather is very important for human life. For this reason, a weather prediction system is needed that can read predictions correctly. One of the correct prediction systems is fuzzy systems. Fuzzy systems are used because they can make accurate and accurate weather predictions like human logic. The system used needs to be simulated to obtain the right model. The right software to simulate is Simulink MATLAB. In this study will take the DHT 22 and LDR (Light Dependent Resistor) sensor data from Arduino which will be processed by Simulink MATLAB using the Fuzzy Mamdani system. From the experiments conducted, we managed to make a simulation of predicting the weather using Mamdani fuzzy logic. The defuzzification results from this study can be used to control motors, heaters, etc.


Introduction
Human activity is strongly influenced by weather conditions in the region. For example, information about climate can represent agricultural conditions in the region, especially if a country is very dependent on agriculture as one of national security. Seasonal changes can affect farmers' cropping patterns in growing crops. In addition to agriculture, tourism and aviation require information about weather conditions [1]. Information about weather conditions is very important in human life because it can be useful to know the upcoming weather conditions so that we can anticipate the impact. Therefore, information about weather forecasting is very necessary for decision making in carrying out activities or human work [2]. Meanwhile, climate change is currently very difficult to predict. One solution is to predict the weather with a fuzzy logic system, because it is more effective and accurate [3], There are several examples of systems that use fuzzy applications such as heat exchanger [4], cameras, camcorders, washing machines, microwave ovens for industrial process control, medical instrumentation, decision support systems, and portfolios selection [5].
The advantages of fuzzy logic compared to classical logic are in fields such as artificial intelligence where simple true or false statements are not enough, and it can model ordinary linguistic variables which may be imprecise or vague in nature at a cognitive level [6]. In addition, Fuzzy Logic is very helpful in guiding computer to find the right thing to measure and count [7]. There are several studies related to weather prediction including, fuzzy logic to predict rain to estimate water levels to avoid flooding [8], fuzzy logic system to predict the weather for general farming [9], and Weather Prediction Application Based on ANFIS (Adaptive Neural Fuzzy Inference System) Method in West Jakarta Region [1], In this paper, we will make the simulation from the weather prediction system. In the paper A. Daniadi et al, (2016), using a fuzzy logic system to investigate the influence of weather on electrical  [10], simulations are carried out with Simulink MATLAB using input from the constant in Simulink MATLAB which is then processed by fuzzy, in this study will use inputs in real terms. The simulation will take the real sensor data from temperature sensor, humidity sensor, and light sensor that can produce reliable rule conditions using a fuzzy system to predict the weather system. The system can be applied to protect hydroponic plants from weather conditions such as rain, cloudy or heat.

Methodology
As shown in Figure 1, the concept of a weather prediction system is to take sensor data from Arduino to be processed into a fuzzy system in MATLAB which is then used to determine weather conditions.

Sensor system
There are two sensors in this weather prediction system. In the picture. 2 is DHT 22, this sensor is used to read the temperature and humidity in the surrounding environment. Next in Figure 3 is the LDR (Light Dependent Resistor), a sensor that is used to read the value of light intensity in the surrounding environment.

Fuzzy System
The Fuzzy Logic algorithm is used to determine whether predictions. On picture. 4 is shown in the diagram process fuzzy logic algorithm. In this study using the Mamdani fuzzy system and using 3 variable inputs, namely temperature, humidity, and light intensity. Temperature input variables have 2 linguistic variables namely low and high. The humidity input variable has 2 linguistic variables namely low and high. While the light intensity has 3 linguistic variables, namely dark, dim and bright. This study also has a weather output varibales with a cloudy and bright linguistic variable. Fuzzy logic algorithm linguistic values are determined from each variable. Fuzzification the module will map numeric values to fuzzy sets. Input value will be converted into fuzzy input as a linguistic value.
In Figure 6 is a membership function of the fuzzy input from humidity parameter. Figure 6. Member function Graphic of Humidity Parameter From the graph, members of the function of humidity parameters (Fig. 6) In Figure 7 is a membership function of the fuzzy input from light intensity parameter.  (Fig. 7), the formula for determining linguistic values of dark, dim and bright light intensity can be seen as follows.
In Figure 8 is a membership function of the fuzzy output from defuzzification.
After the fuzzification process, then continue the inference process. In the inference module simulated decision making based on fuzzy concepts using rules of knowledge. The rule can be determined by combining all linguistics of all variables. The output of the inference process is the feasibility value. We have 12 fuzzy rules based on a combination of linguistic variables and weather prediction system knowledge. The rule base fuzzy in the can be seen in Figure 9.  Figure 9. Rulebases System After the inference process, the next is the defuzzification process. The defuzzification process use the Centroid Method (Center of Gravity). Formula from The Centroid method is: A set of sample points needs to be taken to use the equation. The more samples are taken, the more accurate the results will be.

Results and Analysis
Simulations carried out in this study use data from Arduino that has been connected with DHT22 and LDR sensors. Simulink in MATLAB reads data in real time from Arduino then processes it using a fuzzy system then produces defuzzification value which is then used to control output. Matlab Simulink simulation can be seen in Figure 10.

Figure 10. Simulink MATLAB System
Simulation is done to determine the results calculation algorithm using fuzzy logic. In this case, the temperature value is 25, the humidity value is 70, and the value of light intensity is 700. First, fuzzification module maps numeric values into fuzzy sets or fuzzy input (Figure 11-15).   Figure 16. Scope in Simulink MATLAB

Conclusion
From the simulations that we do show that the system we make runs in accordance with the good and right so that it can be used as one of the supporting systems in weather prediction systems. The application of fuzzy output can be used as a controller for motors, heaters, and etc. From the simulations that we do show that the system we make runs in accordance with the good and right so that it can be used as one of the supporting systems in weather prediction systems. The application of fuzzy output can be used as a controller for motors, heaters, and etc.