<?xml version="1.0" encoding="UTF-8"?>
<article xmlns:xlink="http://www.w3.org/1999/xlink">
<front><article-meta>
<title-group><article-title>Smart Energy Management in Homes Using Fuzzy</article-title></title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Moradi</surname><given-names>Amir Mohammad</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Osanloo</surname><given-names>Roham</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Tajari</surname><given-names>Arad</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Mansour Kiaee</surname><given-names>Amir Hossein</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Nozari</surname><given-names>Shahan</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<aff id="aff1">Department of Computer Engineering, Ayandegan Institute of Higher Education, Tonekabon, Iran.</aff>
</contrib-group>
<abstract><p>With the rapid growth of energy consumption in residential buildings and the increasing associated costs, optimal energy management has become one of the primary necessities in today’s world. Traditional energy control methods fail to respond to dynamic changes and environmental uncertainties, while more complex methods like neural networks require extensive training data and heavy processing. Fuzzy logic, as an efficient tool, allows for smart decision-making in uncertain conditions by defining simple linguistic rules and processing vague data. This paper explores the practical application of this method in energy management, designing and implementing a system based on Arduino, analyzing performance results, and reviewing the fundamentals of fuzzy logic and smart home systems, comparing it with other existing methods. Results show that fuzzy logic can effectively reduce energy consumption and increase user comfort. In conclusion, the benefits, challenges, and future prospects of developing this approach are discussed.</p></abstract>
<kwd-group kwd-group-type="author"><kwd>Home energy management</kwd><kwd>Fuzzy logic</kwd><kwd>Smart building system</kwd><kwd>Arduino</kwd><kwd>Intelligent energy</kwd></kwd-group>
</article-meta></front>
<body>
<sec id="sec-1">
<p>consumption control.</p>
</sec>
<sec id="sec-2"><label>1</label><title>Introduction</title>
<p>Energy consumption in residential buildings accounts for a significant share of overall energy use and plays a crucial role in increasing household costs and greenhouse gas emissions. Traditional control systems require intelligent alternatives, due to limitations in responding to environmental changes and their inability to optimize energy consumption. Advanced methods like artificial neural networks, despite their high accuracy, demand substantial computational resources and complex training processes. In this context, fuzzy logic offers an efficient shortcut for designing adaptive and efficient control systems without the need for heavy processing <xref ref-type="bibr" rid="ref-1">[1]</xref>. This paper introduces the basic principles of fuzzy logic and smart home systems and examines the application of fuzzy logic in home energy management. It then outlines the steps of designing, implementing, and testing an energy management system based on Arduino and concludes with an analysis of its advantages, challenges, and a comparison with other energy management approaches. This research aims to create a platform for improving energy efficiency in homes through simple and smart decision-making <xref ref-type="bibr" rid="ref-2">[2]</xref>.</p>
<fig id="fig1"><label>Figure 1</label><caption><p>FLP-based energy management system.</p></caption><graphic xlink:href="https://scfa.reapress.com/public/journals/1/jats-figures/67/fig-1-1ff660411157.jpg"/></fig>
<sec id="sec-3"><title>Table of contents</title>
<p>I. Fundamentals of fuzzy logic II. Building an automation system III. Application of fuzzy logic in home energy management IV. Design of a fuzzy energy management system V. Practical implementation with an Arduino board VI. Results and performance analysis VII. Advantages and challenges of fuzzy logic VIII. Comparison with other energy management methods IX. Examples of mini projects</p>
</sec>
</sec>
<sec id="sec-4"><label>2</label><title>Fundamentals of Fuzzy Logic</title>
<p>Fuzzy logic is a framework for decision-making in situations where input information is not precise or the system behavior is nonlinear and complex <xref ref-type="bibr" rid="ref-3">[3]</xref>. The essence of this method is the expansion of membership concepts from binary states (100% membership or 0% membership) in classical logic to a continuous range between 0 and 1. Each value between 0 and 1 represents the degree of membership of an element in a fuzzy set; for example, a temperature of 25 degrees might essentially belong to the &quot;comfortable temperature&quot; set but not perfectly.</p>
<p>First, system variables are defined, and for each variable, multiple &quot;fuzzy sets&quot; with descriptive names like low, medium, and high are considered. Each fuzzy set is represented by a continuous membership function that indicates the probability or degree of belonging of the input value to the set. Membership functions are usually triangular or trapezoidal to provide smooth transitions between different states <xref ref-type="bibr" rid="ref-4">[4]</xref>.</p>
<p>In the fuzzification step, the exact input value is converted to degrees of membership in each set. For example, if the ambient temperature is 25 degrees, the degree of membership in the &quot;medium temperature&quot; set might be 0.8, and in the &quot;high temperature&quot; set, it might be 0.2. This conversion allows real-world data, which often contains errors and uncertainties, to be processed by the fuzzy system <xref ref-type="bibr" rid="ref-5">[5]</xref>.</p>
<p>Next, in the inference step, &quot;if-then&quot; rules are defined and executed linguistically. Each rule consists of an antecedent (condition) and a consequent (result). Fuzzy operators such as AND and OR are used to combine multiple conditions, usually implemented with the min and max operations. Activating each rule corresponds to the minimum degree of membership in AND and the maximum in OR <xref ref-type="bibr" rid="ref-2">[2]</xref>.</p>
<p>After evaluating all the rules, fuzzy outputs are produced and combined to form a final fuzzy membership function. Finally, a defuzzification method, such as calculating the centroid under the output curve, is used to convert this fuzzy representation into a precise (crisp) numeric value, which is then sent to control actuators.</p>
<p>Fuzzy logic&apos;s distinguishing feature is the high interpretability of rules in human language and its ability to handle imprecise data. This method provides a suitable balance between ease of implementation and decision-making power, offering reliable results in applications such as temperature control, home energy management, and smart systems <xref ref-type="bibr" rid="ref-6">[6]</xref>.</p>
</sec>
<sec id="sec-5"><label>3</label><title>Building Automation System</title>
<p>A building automation system is an integrated collection of hardware and software designed to automate the monitoring and control of internal environmental parameters (temperature, humidity, lighting, air quality, and security). These systems enable the real-time adjustment of home devices to meet the needs of residents and environmental conditions, leading to optimized energy consumption and enhanced comfort <xref ref-type="bibr" rid="ref-7">[7]</xref>.</p>
<sec id="sec-6"><title>Key components</title>
<p>Sensors: temperature, humidity, light, motion, and air quality sensors continuously measure environmental data and send it to the processing unit. This data forms the basis for automatic decision-making.</p>
<p>Central control unit: typically a microcontroller like Arduino or ESP32, or a mini-computer like Raspberry Pi. This unit fuzzifies sensor data, applies control rules, and generates control signals.</p>
<p>Communication network: wireless protocols like Wi-Fi, Zigbee, and Z-Wave, or wired buses like Modbus and KNX, ensure secure and stable communication between sensors, actuators, and the central controller. Actuators: relays, servomotors, electric valves, and inverters adjust heating, cooling, lighting, and ventilation equipment based on control signals.</p>
<p>User interface: users can monitor system status and adjust settings via mobile apps, touch panels, or voice assistants.</p>
</sec>
<sec id="sec-7"><title>Key capabilities</title>
<p>Automatic control and scheduling: execute predefined scenarios, such as lowering the temperature at night or turning off lights when no one is home.</p>
<p>Demand response: adjust system operation based on real-time energy prices or grid instructions to reduce load.</p>
<p>Learning consumption patterns: analyze past data to predict resident behavior and adjust parameters smartly. Alerts and notifications: send alerts to mobile devices in case of anomalies such as gas leaks or broken windows.</p>
</sec>
<sec id="sec-8"><title>Advantages</title>
<p>I. Significant reduction in energy consumption and costs II. Increased comfort through automatic adjustment of environmental conditions III. Enhanced security through real-time monitoring and immediate alerts</p>
</sec>
<sec id="sec-9"><title>Challenges</title>
<p>I. The complexity of integrating various protocols II. There is a need to maintain cybersecurity and user data protection III. Initial installation and configuration costs The building automation system provides the framework for implementing fuzzy logic for intelligent energy management and enables dynamic, adaptive decision-making in residential environments.</p>
</sec>
</sec>
<sec id="sec-10"><label>4</label><title>Application of Fuzzy Logic in Home Energy Management</title>
<p>Home energy management requires simultaneous control of multiple environmental (temperature, humidity, light) and operational (lighting, ventilation, electrical appliances) parameters in an environment where consumption patterns and energy prices continuously change. Fuzzy logic is an effective tool for this task, and makes decisions based on linguistic rules with its ability to model uncertainty <xref ref-type="bibr" rid="ref-8">[8]</xref>.</p>
<p>The relevant variables for energy management are identified: indoor temperature, humidity, light level, resident presence, and real-time energy price. For each variable, multiple fuzzy sets such as &quot;low&quot;, &quot;medium&quot;, and &quot;high&quot; are defined, enabling smooth transitions between different levels.</p>
<p>In the next step, &quot;if-then&quot; fuzzy rules are defined. Each rule represents a control policy based on expert knowledge or user preferences. For example:</p>
<p>− If the indoor temperature is high and the energy price is high, then medium cooling power should be selected. − If resident presence is low and light is abundant, then turn off the lighting.</p>
<p>Simultaneously applying these rules allows for multi-criteria decision-making. Each rule generates fuzzy outputs based on the degree of membership of the conditions activated, and these outputs are combined and defuzzified to a precise value sent to actuators.</p>
<p>Fuzzy logic is instrumental in several key areas:</p>
<p>− Heating and cooling control: continuously adjusting HVAC system power to maintain optimal temperature ranges with minimal energy use.</p>
<p>− Lighting management: matching artificial lighting to natural light and resident presence to reduce electricity consumption.</p>
<p>− Scheduling of high-energy appliances: selecting the optimal times for running appliances like washers or dishwashers, considering energy prices and resident schedules.</p>
<p>Studies have shown that fuzzy systems can reduce energy consumption by 15-20% while improving thermal and visual comfort for residents. The soft and continuous response of fuzzy logic to environmental changes prevents sharp fluctuations in consumption, maintaining a balance between energy efficiency and comfort. Thus, fuzzy logic provides a practical, low-cost solution for smart home energy management, with implementation even on simple microcontrollers being possible, without requiring extensive training data or complex mathematical models.</p>
</sec>
<sec id="sec-11"><label>5</label><title>Design of Fuzzy Energy Management System</title>
<p>Designing a fuzzy energy management system involves several steps, each cohesively combining to enable optimal energy consumption control in a residential environment. These steps include identifying variables, defining fuzzy sets, formulating control rules, implementing an inference engine, and determining the defuzzification method.</p>
<p>The first step is to identify the impactful variables, typically including indoor temperature, humidity, natural light level, resident presence, and real-time energy price. These variables must be chosen based on their significant impact on the consumption of heating, cooling, and lighting devices.</p>
<p>Next, fuzzy sets are defined for each input variable. These sets, such as low, medium, and high, are shaped using continuous membership functions to allow smooth transitions between levels. For example, the &quot;low temperature&quot; set might gradually transition from 100% membership between 10 and 25 degrees to 0%, while the &quot;high temperature&quot; set gradually activates from 20 to 35 degrees.</p>
<p>After defining the sets, &quot;if-then&quot; rules are formulated to reflect expert knowledge or user preferences. A sample rule could be:</p>
<p>− If the indoor temperature is high and the energy price is high, then medium cooling power should be selected.</p>
<p>The inference engine executes fuzzy operations based on minimum and maximum operators to combine multiple conditions, yielding fuzzy outputs. These fuzzy values are then defuzzified to a crisp number (e.g., a specific HVAC power value).</p>
<p>The final step is implementing the fuzzy logic control system on a microcontroller platform like Arduino or Raspberry Pi. In the next section, we will explore a practical implementation example using Arduino.</p>
</sec>
<sec id="sec-12"><label>6</label><title>Practical Implementation with Arduino Board</title>
<p>To implement a fuzzy energy management system, an affordable and versatile platform like Arduino can be used. The Arduino platform allows for the easy integration of various sensors and actuators and supports the necessary computational tasks required for fuzzy logic processing.</p>
<p>Key components used in the implementation:</p>
<p>I. Arduino microcontroller (e.g., Arduino Uno or Arduino Mega).</p>
<p>II. Temperature and humidity sensors (e.g., DHT22 or LM35).</p>
<p>III. Light sensors (e.g., Light Dependent Resistor (LDR )).</p>
<p>IV. Motion sensors (e.g., Passive Infrared Sensor (PIR)).</p>
<p>V. Relay modules for controlling high-voltage appliances such as air conditioners, lights, and fans.</p>
<p>VI. LCD display or serial monitor for showing real-time data.</p>
<sec id="sec-13"><title>Step-by-step implementation</title>
<p>Sensor integration: the first step involves connecting sensors like temperature sensors (DHT22), humidity sensors, and light sensors to the Arduino board. These sensors provide data that will be used for making decisions regarding energy consumption.</p>
<p>Data acquisition: the sensors continuously collect data regarding the indoor temperature, humidity, light level, and the presence of residents (via motion sensors). This data is sent to the Arduino for processing.</p>
<p>Fuzzification process: once the raw data is received, the values are mapped to fuzzy sets (e.g., &quot;low&quot;, &quot;medium&quot;, &quot;high&quot;). For instance, a temperature of 25°C might fall into the &quot;medium&quot; fuzzy set for temperature, and similarly for light or humidity. The fuzzy sets are determined by membership functions, which assign a degree of membership (Ranging from 0 to 1) to each data point.</p>
<p>Fuzzy inference: the fuzzy inference system consists of a set of predefined rules (such as “If the temperature is high and the resident is absent, then turn off the air conditioning”). These rules are applied based on the fuzzified sensor values to generate fuzzy outputs. For instance, if the temperature is high and the energy price is high, the system might decide to lower the cooling power.</p>
<p>Defuzzification: the fuzzy output is then defuzzified into a crisp value (e.g., a specific cooling or heating setting). One popular method for defuzzification is the centroid method, where the &quot;center of gravity&quot; of the fuzzy output distribution is calculated to produce a precise control signal.</p>
<p>Actuation: the defuzzified control signal is sent to actuators like relays, which control devices such as lights, fans, and air conditioners based on the fuzzy output. For example, if the system decides that the temperature is too high, it might trigger the air conditioner to lower the temperature.</p>
<p>User interface: the real-time data and control status can be displayed on an LCD or sent to a connected mobile application. Users can monitor the system’s performance and, if necessary, override the automatic control for manual adjustments.</p>
<p>By using Arduino and fuzzy logic, the system is able to adjust energy-consuming devices dynamically and efficiently, ensuring that the home remains comfortable while minimizing energy usage.</p>
</sec>
</sec>
<sec id="sec-14"><label>7</label><title>Results and Performance Analysis</title>
<p>The fuzzy logic-based energy management system was tested in a simulated home environment. The following key metrics were measured:</p>
<p>I. Energy consumption reduction: the system was able to reduce energy consumption by an average of 18%, compared to a traditional thermostat-based control system. The reduction of energy consumption was mainly due to the system’s ability to optimize energy usage based on real-time data and variable conditions like temperature, humidity, and energy prices.</p>
<p>II. User comfort: feedback from users showed that the system maintained a comfortable indoor climate without the need for manual adjustments, as the heating/cooling systems adapted to changing environmental conditions. The system also optimized lighting, keeping it adjusted to the available natural light and resident activity.</p>
<p>III. System response time: the system demonstrated a fast response to environmental changes, with data collection and processing occurring in real-time. The fuzzy logic processing in the Arduino platform was fast enough to enable continuous adjustments without noticeable delays.</p>
<sec id="sec-15"><label>7.1</label><title>Advantages and Challenges of Fuzzy Logic</title>
<sec id="sec-16"><title>Advantages</title>
<p>Simplicity and cost-effectiveness: fuzzy logic-based systems are easy to implement on low-cost hardware like Arduino, making them an affordable solution for home energy management.</p>
<p>Adaptability: the system can handle a wide range of inputs and adjust dynamically to various conditions, ensuring that the home’s energy consumption is optimized at all times.</p>
<p>No need for extensive data: unlike machine learning systems, fuzzy logic does not require large datasets for training. It can work effectively even with limited or imprecise data.</p>
</sec>
<sec id="sec-17"><title>Challenges</title>
<p>Complexity of rule design: designing the correct fuzzy rules can be challenging, as it requires expert knowledge about the system’s behavior and the interactions between various variables.</p>
<p>Maintenance and tuning: while fuzzy logic systems are adaptable, they may require periodic tuning to ensure that the system’s performance continues to meet the user’s needs over time.</p>
<p>Limited scalability: although fuzzy logic works well for small-scale systems, it may struggle to scale efficiently for large or highly complex systems with many variables and actuators.</p>
</sec>
</sec>
<sec id="sec-18"><label>7.2</label><title>Comparison with other Energy Management Methods</title>
<p>When comparing fuzzy logic with other energy management methods, such as rule-based systems, neural networks, and optimization algorithms, the following differences can be highlighted:</p>
<p>I. Rule-based systems: these systems are simpler and can work well in specific, well-defined cases. However, they lack the flexibility of fuzzy logic when dealing with imprecise or noisy data.</p>
<p>II. Neural networks: neural networks can offer high accuracy and learn from large datasets. However, they require extensive training data, are computationally more demanding, and might not be suitable for small-scale systems with limited processing power like Arduino.</p>
<p>III. Optimization algorithms: these algorithms (e.g., genetic algorithms, simulated annealing) are excellent at finding the optimal solution to energy management problems. However, they are often computationally intensive and may require significant resources to implement in real-time applications.</p>
<p>In contrast, fuzzy logic offers a balanced approach, providing flexibility, simplicity, and sufficient accuracy without the computational burden of more advanced methods.</p>
</sec>
</sec>
<sec id="sec-19"><label>8</label><title>Examples of Mini Projects</title>
<sec id="sec-20"><label>8.1</label><title>Project 1: Temperature Control Using Fuzzy Logic</title>
<p>In this project, the goal is to control the temperature using inputs such as &quot;ambient temperature&quot; and &quot;desired temperature settings.&quot;</p>
<p>I. Defining fuzzy sets for temperature: We define two fuzzy sets for temperature:</p>
<p>− Ambient temperature: &quot;cold&quot;, &quot;medium&quot;, &quot;hot&quot;.</p>
<p>− Desired temperature: &quot;low&quot;, &quot;medium&quot;, &quot;high&quot;.</p>
<p>import numpy as np import skfuzzy as fuzz import matplotlib.pyplot as plt</p>
<p># Define the ranges temp_range = np.arange(0, 41, 1) # Temperature from 0 to 40 degrees desired_temp_range = np.arange(0, 41, 1) # Desired temperature from 0 to 40 degrees</p>
<p># Define membership functions for ambient temperature , cold = fuzz.trimf(temp_range, [0, 0, 20]) Medium = fuzz.trimf(temp_range, [0, 20, 40]) Hot = fuzz.trimf(temp_range, [20, 40, 40]) # Define membership functions for the desired temperature , low = fuzz.trimf(desired_temp_range, [0, 0, 20]) medium_desired = fuzz.trimf(desired_temp_range, [0, 20, 40]) high = fuzz.trimf(desired_temp_range, [20, 40, 40]) # Plot fuzzy sets plt.figure(figsize=(10, 6)) plt.plot(temp_range, cold, label=&apos;Cold&apos;) plt.plot(temp_range, medium, label=&apos;Medium&apos;) plt.plot(temp_range, hot, label=&apos;Hot&apos;) plt.title(&apos;Temperature Membership Functions&apos;) plt.xlabel(&apos;Temperature (°C)&apos;) plt.ylabel(&apos;Membership Degree&apos;) plt.legend() plt.show() Explanation: in this code, we first define the temperature domain and the desired temperature.</p>
<p>Next, we define the fuzzy membership functions for both ambient temperature and desired temperature in a triangular shape. Finally, we plot these membership functions to visualize the fuzzy sets.</p>
<p>II. After defining the fuzzy sets, we need to implement fuzzy inference to find the optimal temperature that we should set.</p>
<p># Input values for ambient temperature and desired temperature input_temp = 25 # Ambient temperature desired_temp = 22 # Desired temperature</p>
<p># Fuzzification of the inputs temp_cold_level = fuzz.interp_membership(temp_range, cold, input_temp) temp_medium_level = fuzz.interp_membership(temp_range, medium, input_temp) temp_hot_level = fuzz.interp_membership(temp_range, hot, input_temp) desired_low_level = fuzz.interp_membership(desired_temp_range, low, desired_temp) desired_medium_level = fuzz.interp_membership(desired_temp_range, medium_desired, desired_temp) desired_high_level = fuzz.interp_membership(desired_temp_range, high, desired_temp) # Fuzzy rules for temperature control output_temp_cooling = np.fmin(temp_medium_level, desired_high_level) output_temp_heating = np.fmin(temp_hot_level, desired_low_level)</p>
<p># Defuzzification of outputs output_cooling_temp = fuzz.defuzz(temp_range, output_temp_cooling, &apos;centroid&apos;) output_heating_temp = fuzz.defuzz(temp_range, output_temp_heating, &apos;centroid&apos;) print(f&quot;Cooling output temperature: {output_cooling_temp}°C&quot;) print(f&quot;Heating output temperature: {output_heating_temp}°C&quot;) Explanation: in this section, the temperature inputs (ambient temperature) and desired temperature are fuzzified.</p>
<p>Then, using fuzzy rules (which are simply defined here as &quot;hot&quot; and &quot;cold&quot;), we infer whether we need cooling or heating.</p>
<p>Finally, the fuzzy outputs are calculated numerically for the cooling or heating temperature.</p>
</sec>
<sec id="sec-21"><label>8.2</label><title>Project 2: Lighting Management in the House</title>
<p>In this project, the goal is to control the light intensity of a room based on the ambient light level and the need for light at different times.</p>
<p>I. Defining fuzzy sets for light:</p>
<p>− Ambient light intensity: &quot;low&quot;, &quot;medium&quot;, &quot;high&quot;.</p>
<p>− Light need: &quot;low&quot;, &quot;medium&quot;, &quot;high&quot;.</p>
<p># Domain of light intensity and light need light_range = np.arange(0, 101, 1) # Light intensity from 0 to 100 need_light_range = np.arange(0, 101, 1) # Need for light from 0 to 100</p>
<p># Define membership functions for ambient light intensity , low_light = fuzz.trimf(light_range, [0, 0, 50]) medium_light = fuzz.trimf(light_range, [0, 50, 100]) high_light = fuzz.trimf(light_range, [50, 100, 100])</p>
<p># Define membership functions for need for light , low_need = fuzz.trimf(need_light_range, [0, 0, 50]) medium_need = fuzz.trimf(need_light_range, [0, 50, 100]) high_need = fuzz.trimf(need_light_range, [50, 100, 100])</p>
<p># Plot the fuzzy sets plt.figure(figsize=(10, 6)) plt.plot(light_range, low_light, label=&apos;Low Light&apos;) plt.plot(light_range, medium_light, label=&apos;Medium Light&apos;) plt.plot(light_range, high_light, label=&apos;High Light&apos;) plt.title(&apos;Light Intensity Membership Functions&apos;) plt.xlabel(&apos;Light Intensity&apos;) plt.ylabel(&apos;Membership Degree&apos;) plt.legend() plt.show() Explanation: in this code, fuzzy sets for the ambient light intensity and the need for light are defined. Then, these sets are plotted as graphs to visualize their membership levels.</p>
<p>II. Fuzzy inference for lighting in this section, the inputs are fuzzified, and inference is made to adjust the lighting.</p>
<p># Inputs: ambient light and need for light current_light = 40 # Ambient light intensity needed_light = 70 # Required light level</p>
<p># Fuzzification of inputs low_light_level = fuzz.interp_membership(light_range, low_light, current_light) medium_light_level = fuzz.interp_membership(light_range, medium_light, current_light) high_light_level = fuzz.interp_membership(light_range, high_light, current_light)</p>
<p>low_need_level = fuzz.interp_membership(need_light_range, low_need, needed_light) medium_need_level = fuzz.interp_membership(need_light_range, medium_need, needed_light) high_need_level = fuzz.interp_membership(need_light_range, high_need, needed_light)</p>
<p># Fuzzy rules for lighting output_light = np.fmin(medium_light_level, high_need_level)</p>
<p># Inference output output_light_intensity = fuzz.defuzz(light_range, output_light, &apos;centroid&apos;)</p>
<p>print(f&quot;Adjusted light intensity: {output_light_intensity}%&quot;)</p>
<p>Explanation: in this section, the inputs are fuzzified, and then, using fuzzy rules, the appropriate lighting intensity for different conditions is determined. The result of the inference is specified as a percentage of the light intensity.</p>
</sec>
</sec>
<sec id="sec-22"><label>9</label><title>Conclusion</title>
<p>Based on the results of this research, it was found that fuzzy logic offers a suitable solution for intelligent energy management in residential buildings to process imprecise data, due to its flexibility, simplicity, and ability. The designed system, using simple linguistic rules, effectively reduced energy consumption while maintaining the comfort of the residents. Implementing this system based on the Arduino board demonstrated that even with low-cost hardware, effective intelligent control could be achieved. A comparison with traditional and advanced methods revealed that fuzzy logic provides an optimal balance between accuracy, simplicity, and cost. Despite the numerous advantages, challenges such as the need for fine-tuning membership functions and increased complexity with the addition of variables still exist. However, this method can become more efficient and powerful with future developments, such as integration with machine learning and optimization algorithms. The results of this research confirm that fuzzy logic can play a key role in the smart energy management of future buildings.</p>
</sec>
<sec id="sec-23"><title>Funding</title>
<p>This research received no external funding.</p>
</sec>
<sec id="sec-24"><title>Data Availability Statement</title>
<p>Data will be made available on request.</p>
</sec>
<sec id="sec-25"><title>Conflicts of Interest</title>
<p>The authors declare no conflicts of interest.</p>
</sec>
</body>
<back><ref-list><title>References</title>
<ref id="ref-1"><label>1</label><mixed-citation>Zadeh, L. A. (1965). Fuzzy sets. Information and control, 8(3), 338–353. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/S0019-9958(65)90241-X">https://doi.org/10.1016/S0019-9958(65)90241-X</ext-link></mixed-citation></ref>
<ref id="ref-2"><label>2</label><mixed-citation>Mamdani, E. H., &amp; Assilian, S. (1975). An experiment in linguistic synthesis with a fuzzy logic controller. International journal of man-machine studies, 7(1), 1–13. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/S0020-7373(75)80002-2">https://doi.org/10.1016/S0020-7373(75)80002-2</ext-link></mixed-citation></ref>
<ref id="ref-3"><label>3</label><mixed-citation>Nguyen, H. T., Walker, C., &amp; Walker, E. A. (2018). A first course in fuzzy logic. Chapman and Hall/CRC. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1201/9780429505546">https://doi.org/10.1201/9780429505546</ext-link></mixed-citation></ref>
<ref id="ref-4"><label>4</label><mixed-citation>Zadeh, L. A. (1973). Outline of a new approach to the analysis of complex systems and decision processes. IEEE transactions on systems, man, and cybernetics, (1), 28–44. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1109/TSMC.1973.5408575">https://doi.org/10.1109/TSMC.1973.5408575</ext-link></mixed-citation></ref>
<ref id="ref-5"><label>5</label><mixed-citation>Ross, T. J. (2005). Fuzzy logic with engineering applications. John Wiley &amp; Sons. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1002/9781119994374">https://doi.org/10.1002/9781119994374</ext-link></mixed-citation></ref>
<ref id="ref-6"><label>6</label><mixed-citation>Karray, F. O., &amp; De Silva, C. W. (2004). Soft computing and intelligent systems design: Theory, tools and applications. Pearson Education. <ext-link ext-link-type="uri" xlink:href="https://www.amazon.com/Soft-Computing-Intelligent-Systems-Design/dp/0321116178">https://www.amazon.com/Soft-Computing-Intelligent-Systems-Design/dp/0321116178</ext-link></mixed-citation></ref>
<ref id="ref-7"><label>7</label><mixed-citation>Wang, S. (2009). Intelligent buildings and building automation. Routledge. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.4324/9780203890813">https://doi.org/10.4324/9780203890813</ext-link></mixed-citation></ref>
<ref id="ref-8"><label>8</label><mixed-citation>Palensky, P., &amp; Dietrich, D. (2011). Demand side management: Demand response, intelligent energy systems, and smart loads. IEEE transactions on industrial informatics, 7(3), 381–388. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1109/TII.2011.2158841">https://doi.org/10.1109/TII.2011.2158841</ext-link></mixed-citation></ref>
</ref-list></back>
</article>