## 3 Proposed Method  
### Cluster-Head Rotation  
The objective of the proposed method is to prolong the lifetime of WSN by appropriately rotating the CH role among smart sensor nodes. It should be kept in mind that the considered WSN lifetime corresponds to time interval before death of the first sensor node. The problem of achieving maximum WSN lifetime is illustrated in Figure 1 for a network composed of two sensor nodes. The examples shown in Figure 1a,b) assume that both nodes have the same initial energy level (energy = 100 for time = 0). In the example from Figure 1a)a static assignment of the CH role is considered, i.e., node 1 takes the CH role for the entire analyzed period. Thus, the residual energy of node 1 decreases faster than the energy of node 2. As a result, node 1 dies after 400 cycles, while node 2 has still 40 units of energy (it should be noted that time in Figure 1 is expressed in cycles of sensor node operations). The lifetime of WSN in this example equals 400 cycles. The second example (Figure 1b) shows that the lifetime of WSN can be extended by changing the sensor node, which takes the CH role. In this example, node 1 takes the CH role for cycles 0-249, and then the CH role is performed by node 2. Both sensor nodes deplete their energy at the same time step, after 500 cycles. It means that lifetime of the WSN is prolonged to 500 cycles. The lifetime of 500 cycles is the maximum time for the considered WSN example. It should be noted that the maximum lifetime is achieved when both sensor nodes die at the same time step. Lifetime of the WSN for different initial energy levels of sensor nodes is analyzed in Figure 1c,d). In these examples the initial energy equals 100 units for sensor node 1 and 60 units for sensor node 2. Figure 1d) shows that without CH role rotation (node 1 is CH) both nodes die simultaneously after 400 cycles of the WSN operation. Thus, for the above-mentioned levels of initial energy the maximum WSN lifetime is equal to 400 cycles. In Figure 1c) the change of CH node after 250 cycles results in decreased WSN lifetime, as node 2 depletes its energy approximately at cycle 330. When analyzing the examples from Figure 1b,d) it can be observed that the WSN lifetime is maximized if both nodes die at the same time. This observation is also confirmed by conclusions of the related works, e.g., [23; 28], where more complex scenarios were considered than those discussed above. Therefore, the general rule can be formulated that energy consumption of sensor nodes has to be balanced to prolong the WSN lifetime. Expected lifetime of sensor node \(i\) can be evaluated as \(EI_{i}/e_{i}\), where \(EI_{i}\) denotes initial energy level of \(i\)-th node and \(e_{i}\) is average energy consumed per one cycle of WSN operation by sensor node \(i\). For instance, in Figure 1b) \(e_{1}\) = \(e_{2}\) = 0.20, while in case of Figure 1d) \(e_{1}\) = 0.25 and \(e_{2}\) = 0.15. Thus, the following condition must be satisfied to achieve the maximum lifetime:  
\[\frac{EI_{1}}{e_{1}}=\frac{EI_{2}}{e_{2}}, \tag{1}\]  
Figure 1: Changes of residual energy in WSN for different CH rotation scenarios: (**a**) the same initial energy levels without CH change, (**b**) the same initial energy levels with CH change, (**c**) different initial energy levels with CH change, (**d**) different initial energy levels without CH change. The average energy consumption (\(e_{i}\)) of \(i\)-th sensor node in time period \(T\) depends on the fraction of time \(T\) in which sensor node \(i\) takes the CH role. Let us denote this fraction of time as \(t_{i}\) then the average energy consumption can be expressed as follows:  
\[e_{i}=EH\cdot t_{i}+EM\cdot(1-t_{i}), \tag{2}\]  
where \(t_{i}\in[0,1]\), \(EH\) and \(EM\) denote energy consumed during one cycle by a sensor node which takes cluster-head role or cluster member role, respectively. In the considered WSN with smart nodes the energy consumption of cluster member takes different values depending on event detection.