## 5 Fuzzy Logic-Based WSN Power Management and Optimization
The output value is determined using fuzzy rules according to the IF-THEN statement. The FLC converts fuzzy output variables into crisp values by using the de-fuzzification process, so that the values of the variable are retable by the sensors. The de-fuzzification method used in this study is the centroid of area method, which is evaluated for each membership function for each rule. The output is then determined as the average of the individual centroid weighted by their membership values. [PERSON] et al. [53] proposed a distributed fuzzy logic-based sink selection mechanism for one-hop WSN that manages the nodes' selection process to the sink nodes. Having multiple sink nodes in WSNs can improve network throughput and reduce packet loss and energy consumption. In this study, a fuzzy logic-based algorithm was used to assign a sink node for each node on the basis of the network congestion status between the sink and ordinary nodes. This one-hop network paradigm not only reduces the transmission delay but also reduces the packet loss due to the high congestion encountered in single sink-multiple hop network architecture. The input variables of the fuzzy logic controller are congestion, energy, and distance between a node and the sink. Figure 12 depicts the proposed fuzzy sink selection, which uses the FLS described in Figure 1. This algorithm was designed to avoid congestion at the sink nodes and distribute the nodes' loads between multiple sink nodes. Each node uses a fuzzy inference engine, which receives information such as distance to sink, the energy of node, and the average load on each sink. By using the proposed algorithm, each node can choose the closest  
Figure 11: The proposed FLC architecture. TH/WL: throughput to workload. and uncongested sink to transfer its data to it. The results obtained from simulations indicated that the proposed mechanism can minimize the congestion in the sink nodes and balance the nodes' load on multiple sink nodes. Moreover, the proposed mechanism can minimize the transmission power consumption and delay by minimizing the number of packet retransmissions to the sink nodes. Furthermore, the authors proposed a distributed fuzzy sink selection solution consisting of the following: a fuzzification module, a knowledge base, an inference engine, and de-fuzzification module. The input linguistic variable distance is used to represent the distance between a node and its sink. This variable has three Mamdani membership functions: close, mid, and far, whereas the input linguistic variable congestion is used to indicate the average congestion of a sink node in previous rounds. This variable has three Mamdani membership functions: low, medium, and high. Finally, the input linguistic variable energy is used to represent the remaining energy of nodes. This variable has three Mamdani membership functions: low, medium and high. As the fuzzification step is performed, the gained membership values are applied to the IF-THEN rules to define the fuzzy output set. The authors used the Mamdani method as a fuzzy inference method. In the de-fuzzification step, the crisp value represents the suitability of the sink node and the sensor node selects the sink, which has the highest value of the sink output variable. In this scheme, the COA is used in the centroid de-fuzzification. The authors in [54] proposed a fuzzy logic-based mechanism utilizing the particle swarm optimization (PSO) algorithm that works with the challenging nature of the energy consumption in industrial wireless sensor network (IWSN). The proposed mechanism is an extension of the work done in [52]. The input variables of the fuzzy system are the battery level and the ratio of throughput to workload, which define the sleeping time of sensor devices in an IWSN on the basis of the IEEE 802.15.4 protocol. The authors added PSO to get the best values concerning the battery life of nodes and optimizing the membership functions by changing their range parameters.