A Novel Energy-Safe Algorithm for Enhancing the Battery Life for IoT Sensors’ Applications

Energy safe is mandatory for all isolated IoT tools, such as in long way roads, mountains, or even in smart cities. If increasing the lifetime of these tools, the rentability of the global network loop becomes more efficient. Therefore, this paper presents a new approach for saving energy inside the source nodes by supervising the state of energy inside each source node and calculating the duty cycle factor. The relationship between these parameters is based on an optimization problem formulation. In this respect, the present paper is designed to propose a new approach that deals with increasing the lifetime of the wireless sensor network (WSN)-attached nodes, as fixed in the application. The newly devised design is based on implementing the IEEE 802.15.4 standard beacon-enabled mode, involving a cluster tree topology. Accordingly, every subgroup is allotted to apply a specifically different duty cycle, depending on the battery’s remaining energy level, which contributes to creating a wide range of functional modes. Hence, various thresholds are defined. Simulation results prove the efficiency of the proposed approach and show the energetic benefit. The proposed flowchart has minimized the consumed energy for the WSN, which improves the battery lifetime and enhances the IoT application’s robustness. Simulations and experiments have been carried out under different conditions and the results prove that the proposed method is a viable solution.

Wireless sensor networks (WSNs) are formed by many small devices called sensor nodes that detect environmental parameters and route them to a central base station (well). Batteries power the sensor nodes. However, despite several works on the WSN domain, power consumption in actual WSNs remains a big challenge.
The energy constraint of sensor nodes introduces challenges in the design of protocols associated with IoT applications. Most of the standards developed for the protocol stack highlight special attention to the power consumption of sensor nodes. Likewise, energy conservation approaches are required at the Media Access Control (MAC) layer in the IEEE 802.15.4 standard.
This system cannot be active without a robust battery and an efficient recharge method. It seems that an electric vehicle field, the battery state of charge, state of life, and protection are the most important factors that must be supervised and controlled. Different recharging techniques appear in the literature, such as in [8], which uses the deep learning technology This system cannot be active without a robust battery and an efficient recharge method. It seems that an electric vehicle field, the battery state of charge, state of life, and protection are the most important factors that must be supervised and controlled. Different recharging techniques appear in the literature, such as in [8], which uses the deep learning technology for improving the recharge method of the main energy source. In addition, managing the energy coming from the battery for feeding the other equipment seems to help with increasing the battery performance. This idea was discussed in [9], and the authors have used the deep deterministic policy gradient algorithm for carrying out this work. On the other hand, supervising the battery health will provide a clear vision about the performance of the used battery, as shown in [10]. All of the above ideas can help in increasing the battery life and can be applied to any application based on a battery energy source, as in this paper.

Problem Formulation
In such applications as the road management of vehicles, facilitating the road traffic or minimizing crashes are important issues. For some vehicle energy management problems [11], the solution is based on the IoT sensors' equipment and how to manage the overall information. The efficiency of this solution depends on the battery IoT sensors' life, and by increasing their battery life, then the overall system function will be easier and more straightforward to be tuned when needed. Figure 1 shows an explicative view of the vehicle position in a smart city where many IoT smart sensors are placed in different locations of the city to provide information about the vehicles' situation, helping to manage the road traffic or alert about crashes. Some sensors are placed on buildings, and others are placed on vehicles. The online communication between all of these sensors will use a high energy factor, and managing the energy flow will help to increase the lifetime of this equipment and then the overall supervising loop. The current designation of the IEEE 802.15.4 standard does not specify the procedure for duty-cycle configuration of sensor nodes to conserve energy. The long activation time The current designation of the IEEE 802.15.4 standard does not specify the procedure for duty-cycle configuration of sensor nodes to conserve energy. The long activation time of a sensor node leads to a quick loss of the battery capacity and minimizes the network life.
To reduce energy consumption and extend sensor nodes' lives, effective energy management methods that can dynamically adjust node duty cycles (DC) (alternate nodes between standby and active cycles) are requested and recommended. A wide range of research has been focused on investigating the WSN-associated duty cycling techniques. In [12], for instance, the authors put forward several algorithms helpful in increasing the performance of the IEEE 802.15.4 technology beacon-enabled mode. In this regard, two major strategies were advanced, namely, the beacon synchronization and duty-cycling schemes in IEEE 802.15.4, as related to the cluster tree topology. Accordingly, the authors highlight the standard IEEE 802.15.4 parameters' impacts on the network's overall performance. In [13], the authors establish a comparison between three different asynchronous radio duty-cycling techniques.
They validate the different approaches experimentally to prove their relevant efficiency concerning the IoT systems and aim to provide valuable assistance to the node designers by enabling them to reach the optimum choice to avoid the possible occurrence of any critical problems. In [14], an attractive, thorough analysis of various duty-cycled wakeup receiver schemes depending on the energy consumed is presented. In this respect, a star-topology-based network is enabled to operate throughout the functional duty cycle.
In [15], Choudhury et al. elaborated a general analysis of the different works dealing with the beacon synchronization and duty-cycle-related mechanisms associated with the IEEE 802.15.4 standard context. They ultimately ended up proposing a new correlation between both techniques. They managed to provide a practical comprehension of the existing schemes, thus helping designers save a remarkable quantity of consumed energy.
In [16], the authors put forward a special duty-cycle managing algorithm, highly reliant on the channel state and assisted by MAC parameters (macMaxFrameRetries, macMinBE, and macMaxCSMABack-offs). Their approach offers a dynamic adaptationbased duty cycle. For an adequate estimation of the delay and energy consumption within the network, a Markov model is established to fit the CSMA/CA protocol. A new method involving a dynamic beacon interval and super-frame adaptation algorithm (DBSAA) is described in [17]. It is based on an accurate adjustment of the network's duty cycle, in which the traffic load of the network generates the parameters' adaptation procedure. The adjustment mechanism (BO, SO) is proven to depend on many parameters: the collision ratio, the super-frame occupation ratio, the number of source nodes, and the number of the coordinator received packets. The attained results have been compared to the DSAA (dynamic super-frame adjustment algorithm) and the standard 802.15.4 protocol approaches' performances.
In [18], a novel energy-harvesting model is displayed, labeled the adaptable duty-cycle adjustment algorithm, ABSD (adaptive beacon order, super-frame order, and duty cycle). It is based on interfering with adjusting the BO and SO values.
On combining a pair of approaches, the energy efficiency problem associated with IEEE 802.15.4 appears to be resolved.
In [19], the authors introduced a unique modification in the IEEE 802.15.4 super-frame structure to resolve the network lifetime problem and enhance the QoS performance: energy consumption, delay, and throughput. The authors undertook to manipulate a wake-up radio mechanism for somewhat effective management of the network nodes' activity to take place. To this end, a Markov model is used to identify the nodes' state. The simulation results testify to the efficiency of such an approach, especially concerning the throughput, delay, and packet drop ratio.
By devising a novel mechanism, the authors in [20] envisage changing the superframe structure to make it liable to handle emergent data, such as periodic data (e.g., those regularly needed by doctors), as well as standard data, such as body temperature. The CSMA/CA algorithm is enabled to transmit an average traffic flow. All data are classified in terms of priorities so that only the most crucial ones could be selected. The entirety of the study is based on the notion of an inter-arrival packet. Thus, should the inter-arrival interval period be increased, the node would appear to consume a more significant amount of energy, which represents a critical issue in a wireless sensor network. The achieved simulation results indicate a special interest in this particular approach. In [21], a new study is conducted to deal with the IEEE 802.15.4 technology-associated energy/delay performance. In [22], the authors suggest some practical proceedings helpful in selecting the MAC layer-appropriate parameters, accounting for the topology variability. The authors in [23] suggest a RADutyCon approach fitted for implementation with the IEEE 802.15.4-based networks. The work is intended to achieve a highly optimized level (threshold) for energy consumption and end-to-end delay parameters by adapting the duty cycle to the IEEE 802.15.4-based networks.
The authors in [24] consider applying a unique cross-layer method, dubbed as the Battery Aware and Reliable Beacon-Enabled IEEE 802.15.4 (BARBEI). The latter's efficiency has been demonstrated through the various simulation results published. Similarly, the authors in [25] undertook to change both the beacon interval and super-frame duration relevant values to study their impacts on the performance of the wireless sensor network. In addition, another network traffic-load-based approach has been developed in [26]. The best results have been recorded at both levels of (BO = 7, SO = 5) values.

Paper Organization
The remainder of this research paper is organized as follows: Section 2 provides a detailed overview of the IEEE 802.15.4 standard. Section 3 presents the proposed method to compute the consumed energy by the node in its different states. Sections 4 and 5 describe the simulation results, by comparing the proposed solution's performance with four other methods, and the experimental results, respectively. Finally, Section 6 presents a conclusion and provides some future perspectives of this research.

IEEE 802.15.4 Standard
IEEE 802.15.4 technology is a significant standard for the IoT networks [27], as it defines the physical and medium access control (MAC) layers for a low-rate wireless personal area network (LR-WPAN). It supports two categories of devices: full-function devices (FFD) and reduced-function devices (RFD). FFDs can serve as PAN coordinators or sensor nodes, whereas an RFD is not capable of serving as a PAN coordinator and can only function as a sensor node. The FFD nodes are characterized by their remarkable energy storage capacity compared to the other RFD-associated nodes. An RFD is a node limited in energy resources and associated with a single FFD. It is an end device in the network topology. IEEE 802.15.4 technology supports two activity modes: beacon-enabled mode and non-beacon-enabled mode. In the first mode, the PAN coordinator periodically sends a beacon frame to the associated devices to program their activity and sleep duration. Synchronization between these devices is achieved using a super-frame structure depicted in beacon frames, as shown in Figure 2. This interval duration is determined by two parameters: super-frame duration (SD) and beacon interval (BI) [28]. SD and BI are described according to Equations (1) and (3), respectively: where D BS is a MAC sublayer constant and ii is equal to the number of symbols in a super-frame of order zero.
where DBS is a MAC sublayer constant and ii is equal to the number of symbols in a super-frame of order zero. The active period is divided into the CAP (Contention Access Period) and the CFP (Contention-Free Period). Nodes communicate by sending and receiving frames only during the active period. In the CAP, nodes communicate using slotted Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) [29]. Figure 3 shows the flowchart of the slotted version of the CSMA/CA protocol. A contention window (CW) is used for communication. Each node checks if the channel is idle before sending any packets. The active period is divided into the CAP (Contention Access Period) and the CFP (Contention-Free Period). Nodes communicate by sending and receiving frames only during the active period. In the CAP, nodes communicate using slotted Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) [29]. Figure 3 shows the flowchart of the slotted version of the CSMA/CA protocol. A contention window (CW) is used for communication. Each node checks if the channel is idle before sending any packets.   The number of back-offs (NB), the back-off exponent (BE), and the contention window (CW) are the three parameters that control the CSMA/CA slotted protocol. NB and CW parameters are initialized at the start (NB = 0 and CW = 2). Depending on the value of the Battery Life Extension attribute, the back-off exponent is initialized to BE = 2 or BE = min (2,macMinBE). macMinBE is a constant defined in the standard. After a random wait time between 0 and 2ˆBE−1, the MAC requests the physical layer to perform a clear channel assessment (CCA).
If before the termination of the CAP frame transmission and acknowledgment reception is completed, the MAC waits for other data to pass into the CAP. If the latter is finished, it is necessary to wait for the next CAP and repeat the process to send the current data.
If the value of NB is less than or equal to macMaxCSMABack-offs, the CSMA/CA should return to the random timeout step before CCA is performed; otherwise, the CSMA/CA algorithm should terminate with a failure of access to the canal.

Proposed Method Description
Communication between nodes is carried out with the super-frame structure in the IEEE 802.15.4 standard [19]. With the super-frame structure, the communication of each node is handled by the activity interval and the sleep interval. These intervals constitute the duty cycle (DC). The management of the DC helps to minimize the power consumption of the different nodes and subsequently improves the network lifetime.
The DC variation is performed by adjusting two IEEE 802.15.4 parameters, BO and SO. In this work, we will express the remaining energy as a function of BO and SO. In this way, we can control the duty-cycle value according to the remaining energy capacity.

Energy Expressions
The proposed energy-consumption model takes into consideration the node's various states: emission, reception, idle, sleep, as well as overhearing and overmitting [24]. Overmitting energy represents the energy wasted when a node sends data and the destination node is not ready to receive it. In this case, the node retransmits the same data several times because it is waiting for an acknowledgment. Overhearing energy occurs when a node receives packets that are not intended for it.
Many transition states could be considered when calculating energy. Even in the transmission phase, the node consumes an essential quantity of energy. When the node sends the data, it loses a quantity of energy, named emission energy, E emis , which is described by Expression (5): where Nt SD stands for the number of data frames existing in the SD, E bin denotes binary energy, F s represents the frame size, I designates the current value, U denotes the voltage value, CCA is the Clear Channel Assessment, and T back is obtained through Expression (6) as follows: where P back presents the back-off period. In addition, the node loses energy in the reception phase, labeled E recep , as depicted in (7): where N rSD is the number of received bits during the SD period.
For both overmitting and overhearing duration, the lost energy is described by E overm , and it is presented as Expression (8): where nbr tr describes the number of bits transmitted, E bin describes the binary energy, PER is the error rate which is computed as the average of the fault transmitted packet, and dtra is the size of the frame (bit). The collision energy, E coll , is calculated through (9): where N bprk is the number of attempts that it takes the node to transmit the data with the absence of all kinds of acknowledgment from the receiver node, and T att describes the short period spent to access the transmission canal. However, the sleep period presents the best technique to manage the energy quantity available in the node's battery. The technology of IEEE 802.15.4 is known for using the cited technique. Therefore, the energy lost in the sleep period, E sleep , could be computed using the following equation: The consumed energy during the idle state can be computed by (11): where U denotes the voltage value, T SIFS is the short frame spacing period SIFS, and I describes the current value. The energy remaining (E rem ) in the battery is calculated using (12): where E init is the initial energy and E cons is the energy consumed during all states. E cons , therefore, is:

IEEE 802.15.4 Parameter's Intervention
Concerning a remarkably extended network setting, the first step involves collecting the necessary parameters from the nodes to obtain the nodes' consumed energy (E cons ), thus recognizing the amount of battery energy remaining. A comparison is established between the reached amount and a well-defined threshold before computing the relevant BO and SO values in a second stage. Hence, concerning the beacon-enabled duration, the node consumed power appears to be provided by: where BI represents the beacon interval period, F s designates the frame size, and E T denotes the energy loss when frame data is sent. It is also assumed that E BI , which depicts the energy lost during the beacon interval, is inferior to the remaining energy, as expressed by the following Equation (15): Both relations (14) and (15) lead to relation (16): The interval BI is defined by (17): Equations (16) and (17) lead to (18): Equation (18) leads to (19): The value of BO is presented by (20) and (21): In order to competently manage the remaining quantity of energy, just 10% is manipulated, named E rem1 , which is expressed by (22): The value of BO is computed by (23): The value of SO is 70% of BO, as described in the relation (24):

Duty-Cycle Adjustment According to the Remaining Energy
The proposed method consists of adjusting the energy consumption of a sensor node according to the value of the energy remaining in the battery. As shown in Figure 4, depending on the value of the remaining energy, the PAN coordinator adjusts the values of the IEEE 802.15.4 parameters to calibrate the duty-cycle value and therefore vary the energy consumption by the node.
When the PAN coordinator receives the energy consumed, it calculates the remaining energy of each node. Depending on the remaining energy value, the PAN coordinator intervenes by new calculated values of the parameters BO and SO. As a result, it adopts a new duty cycle according to the remaining energy in the battery, and thus it improves the life of the node.
It is important to mention that the BO and SO parameters have an influence on the calculated duty cycle, as it is shown by Equation (25). SD and BI are calculated in Equations (1)   It is important to mention that the BO and SO parameters have an inf calculated duty cycle, as it is shown by Equation (25). SD and BI are calcul tions (1)

Implementation and Simulation Results
To attain these goals, we have used the INETMANET/OMNET++ simul

Implementation and Simulation Results
To attain these goals, we have used the INETMANET/OMNET++ simulator. The OMNET++ (Objective Modular Network in C++) is the most realistic simulator in the wireless network context. It represents an object-oriented modular fit for implementation with discrete-event network simulation frameworks. It is also considered a critical multidisciplinary tool. OMNET++ displays several advantages, mainly its capacity to model Our network incorporates twenty nodes, along with five PAN coordinators and a sink node. It involves five subgroups, and each has a single PAN coordinator and four nodes. The simulation is initiated once the sink node undertakes to send beacon frames to the entirety of the PAN coordinators for the network activities to be globally synchronized. The PAN coordinator then proceeds with sending the beacon frames to their children's nodes in the network. Every subgroup is characterized with a specifically related IEEE 802.15.4 (BO, SO). Both PAN and sink nodes must be FFD in type, although the other nodes could be RFD-type nodes. PAN 1 is primarily responsible for the nodes' allocation (0, 1, 2, and 3), forming subgroup 1. As for PAN 2, it represents the node's main parent (4, 5, 6, and 7) and makes up subgroup 2. Subgroup 3 is composed of PAN 3 and four relevant children (8,9,10,11). Regarding subgroup 4, it includes PAN 4 combined with the nodes 12, 13, 14, and 15. As regards PAN 5, it is the one responsible for the nodes 16, 17, 18, and 19, jointly forming subgroup 5. Hence, the PAN undertakes to periodically send beacon frames to its associated children to synchronize its activity. Each subgroup has its own specific beacon interval-related parameters and super-frame duration.
Accordingly, five modes are established in the same network. The present work's advantage lies in providing every subgroup with the chance to manage itself with the actual energy level of its node. The presence of five subgroups in the network leads to the possibility of implementing a wide range of modes. It consists of the ability to apply up to five modes in the same network. The PAN sets the values to the energy thresholds. Concerning our study cases, the existence of four thresholds helps to contribute to four changes of the IEEE 802.15.4 parameters, which result in a four-time manipulation of the duty cycle: DC1 = 50%, DC2 = 25%, DC3 = 12.5%, and DC4 = 6.25%, as illustrated in Figure 5.
Thus, simultaneous multi-modes and multi-thresholds manipulation could be undertaken within the network. Every node undertakes to send data to the corresponding coordinator in the first stage and based on the above-cited Equation (25). The coordinator calculates the energy consumed by its nodes. It then computes the amount of remaining power before comparing it to the initial threshold. If a node's remaining power appears to be inferior to the set threshold, it turns out to be marked as a risky node (with defective energy). The associated coordinator will then proceed with the second step of changing both nodes relating to BO and SO. possibility of implementing a wide range of modes. It consists of the ability to apply up to five modes in the same network. The PAN sets the values to the energy thresholds. Concerning our study cases, the existence of four thresholds helps to contribute to four changes of the IEEE 802.15.4 parameters, which result in a four-time manipulation of the duty cycle: DC1 = 50%, DC2 = 25%, DC3 = 12.5%, and DC4 = 6.25%, as illustrated in Figure  5.  At every level, the battery's remaining energy amount is checked by the relevant coordinator. The performance of our approach was evaluated by comparing it to four other approaches also focused on monitoring the nodes' energy consumption within the IEEE 802. 15 [30], the Optimal Beacon and Super-frame Orders in WSNs (OBSO) [28], as well as the IEEE 802.15.4 with BO = 7 and SO = 5 [29]. Several parameters were subject to testing, namely, the queuing delay and end-to-end duration, along with all kinds of consumed energy, including collision energy, sleep-state energy, emission energy, reception energy, as well as overhearing and overmitting period-associated energy.

Comparison of Simulation Results
The traffic load appears to range from 100 to 900 packets/s. Figure 6 highlights the evolution recorded in queue delay concerning all approaches, marking the evolution scored in the node's traffic load. The end-to-end parameter-associated evolution is depicted in Figure 7, marking the increase in end-to-end delays with increased network traffic load. In effect, the proposed approach appears to register and display the most effective scores concerning the AAOD approach. Thus, simultaneous multi-modes and multi-thresholds manipulation could be undertaken within the network. Every node undertakes to send data to the corresponding coordinator in the first stage and based on the above-cited Equation (25). The coordinator calculates the energy consumed by its nodes. It then computes the amount of remaining power before comparing it to the initial threshold. If a node's remaining power appears to be inferior to the set threshold, it turns out to be marked as a risky node (with defective energy). The associated coordinator will then proceed with the second step of changing both nodes relating to BO and SO.
At every level, the battery's remaining energy amount is checked by the relevant coordinator. The performance of our approach was evaluated by comparing it to four other approaches also focused on monitoring the nodes' energy consumption within the IEEE 802. 15 [30], the Optimal Beacon and Super-frame Orders in WSNs (OBSO) [28], as well as the IEEE 802.15.4 with BO = 7 and SO = 5 [29]. Several parameters were subject to testing, namely, the queuing delay and end-to-end duration, along with all kinds of consumed energy, including collision energy, sleep-state energy, emission energy, reception energy, as well as overhearing and overmitting period-associated energy.

Comparison of Simulation Results
The traffic load appears to range from 100 to 900 packets/s. Figure 6 highlights the evolution recorded in queue delay concerning all approaches, marking the evolution scored in the node's traffic load. The end-to-end parameter-associated evolution is depicted in Figure 7, marking the increase in end-to-end delays with increased network traffic load. In effect, the proposed approach appears to register and display the most effective scores concerning the AAOD approach.

The Stable State-Related Energy Consumption
For effective data transmission to occur, the node is made to involve two different states: a transient state and a stable one. In the first state, the node could be busy transmitting or receiving information. In addition, the node might well appear to suffer from the persistence of an overhearing/overmitting type of problem at this level. Besides, sleeping could also be enabled at this stage. Our study case is characterized by the presence of four phases resulting from the four relevant thresholds. Figure 8 highlights the simulation experiments' data relevant to the collision state. As could be noted, the energy consumed at this level appears to increase with the growth in the number of data packets. All the approaches under review (AAOD, BARBEI, and the IEEE 802.15.4), except for the OBSO model, were found to display an increase in energy lost during a collision problem. In effect, the most effective results appear to be scored via our proposed architecture. The same applies to the energy increasing as consumed during the node 15 emission state. All the investigated approaches (OBSO, BARBEI, AAOD) were proven to register a decrease in energy level with the increase in the number of the message packets, except for the IEEE 802.15.4 model and the proposed design, which appear to demonstrate a noticeably lower decrease. In fact, under a rate comprised of between 100 and 600 packets/s, our approach tends to exhibit the most effective results, indicating the minimum value of energy consumed. Even with a remarkably excessive number of packets, our approach reached values that appear to score the same rate value as that recorded via the AAOD method, as it is shown in Figure 9.

The Stable State-Related Energy Consumption
For effective data transmission to occur, the node is made to involve two different states: a transient state and a stable one. In the first state, the node could be busy transmitting or receiving information. In addition, the node might well appear to suffer from the persistence of an overhearing/overmitting type of problem at this level. Besides, sleeping could also be enabled at this stage. Our study case is characterized by the presence of four phases resulting from the four relevant thresholds. Figure 8 highlights the simulation experiments' data relevant to the collision state. As could be noted, the energy consumed at this level appears to increase with the growth in the number of data packets. All the approaches under review (AAOD, BARBEI, and the IEEE 802.15.4), except for the OBSO model, were found to display an increase in energy lost during a collision problem. In effect, the most effective results appear to be scored via our proposed architecture.

The Stable State-Related Energy Consumption
For effective data transmission to occur, the node is made to involve two different states: a transient state and a stable one. In the first state, the node could be busy transmitting or receiving information. In addition, the node might well appear to suffer from the persistence of an overhearing/overmitting type of problem at this level. Besides, sleeping could also be enabled at this stage. Our study case is characterized by the presence of four phases resulting from the four relevant thresholds. Figure 8 highlights the simulation experiments' data relevant to the collision state. As could be noted, the energy consumed at this level appears to increase with the growth in the number of data packets. All the approaches under review (AAOD, BARBEI, and the IEEE 802.15.4), except for the OBSO model, were found to display an increase in energy lost during a collision problem. In effect, the most effective results appear to be scored via our proposed architecture. The same applies to the energy increasing as consumed during the node 15 emission state. All the investigated approaches (OBSO, BARBEI, AAOD) were proven to register a decrease in energy level with the increase in the number of the message packets, except for the IEEE 802.15.4 model and the proposed design, which appear to demonstrate a noticeably lower decrease. In fact, under a rate comprised of between 100 and 600 packets/s, our approach tends to exhibit the most effective results, indicating the minimum value of energy consumed. Even with a remarkably excessive number of packets, our approach reached values that appear to score the same rate value as that recorded via the AAOD method, as it is shown in Figure 9. The same applies to the energy increasing as consumed during the node 15 emission state. All the investigated approaches (OBSO, BARBEI, AAOD) were proven to register a decrease in energy level with the increase in the number of the message packets, except for the IEEE 802.15.4 model and the proposed design, which appear to demonstrate a noticeably lower decrease. In fact, under a rate comprised of between 100 and 600 packets/s, our approach tends to exhibit the most effective results, indicating the minimum value of energy consumed. Even with a remarkably excessive number of packets, our approach reached values that appear to score the same rate value as that recorded via the AAOD method, as it is shown in Figure 9. Concerning the overmitting and overhearing state, the power lost following implementation of the different methods appears to increase noticeably with an increased number of packets, except for the BARBEI approach, as illustrated in Figure 10. Similarly, our designed approach reflected the most efficient results, as compared to those attained via the IEEE 802.15.4 and OBSO techniques. The proposed approach displays the lowest energy consumption values even in the reception state once the traffic loads are lower than 300 packets/s. Even with loads exceeding 500 packets/s, our design remains the most highly effective regarding the IEEE 802.15.4, BARBEI, and AAOD, as shown in Figure 11. Concerning the overmitting and overhearing state, the power lost following implementation of the different methods appears to increase noticeably with an increased number of packets, except for the BARBEI approach, as illustrated in Figure 10. Similarly, our designed approach reflected the most efficient results, as compared to those attained via the IEEE 802.15.4 and OBSO techniques. Concerning the overmitting and overhearing state, the power lost following implementation of the different methods appears to increase noticeably with an increased number of packets, except for the BARBEI approach, as illustrated in Figure 10. Similarly, our designed approach reflected the most efficient results, as compared to those attained via the IEEE 802.15.4 and OBSO techniques. The proposed approach displays the lowest energy consumption values even in the reception state once the traffic loads are lower than 300 packets/s. Even with loads exceeding 500 packets/s, our design remains the most highly effective regarding the IEEE 802.15.4, BARBEI, and AAOD, as shown in Figure 11. The proposed approach displays the lowest energy consumption values even in the reception state once the traffic loads are lower than 300 packets/s. Even with loads exceeding 500 packets/s, our design remains the most highly effective regarding the IEEE 802.15.4, BARBEI, and AAOD, as shown in Figure 11.
As a matter of fact, and with the noticeable evolution in traffic load and development of the duty cycle of the node with faulty energy, the energy lost during the sleep period tends to increase. Once again, the proposed design appears to stand as the most efficient method in terms of energy consumption compared to the examined algorithms, especially at loads' level of 300 packets/s, as justified through Figure 12

The Transient State-Related Energy Consumption
As shown in Figure 13, at this level, still, the proposed approach displays a noticeable decrease in energy consumption, displaying decreased value levels. It is noteworthy that the IEEE 802.15.4 appears to exhibit the most effective results regarding all the other methods. As a matter of fact, and with the noticeable evolution in traffic load and development of the duty cycle of the node with faulty energy, the energy lost during the sleep period tends to increase. Once again, the proposed design appears to stand as the most efficient method in terms of energy consumption compared to the examined algorithms, especially at loads' level of 300 packets/s, as justified through Figure 12.

The Transient State-Related Energy Consumption
As shown in Figure 13, at this level, still, the proposed approach displays a noticeable decrease in energy consumption, displaying decreased value levels. It is noteworthy that the IEEE 802.15.4 appears to exhibit the most effective results regarding all the other methods.   As a matter of fact, and with the noticeable evolution in traffic load and developmen of the duty cycle of the node with faulty energy, the energy lost during the sleep period tends to increase. Once again, the proposed design appears to stand as the most efficien method in terms of energy consumption compared to the examined algorithms, especiall at loads' level of 300 packets/s, as justified through Figure 12.

The Transient State-Related Energy Consumption
As shown in Figure 13, at this level, still, the proposed approach displays a noticeabl decrease in energy consumption, displaying decreased value levels. It is noteworthy tha the IEEE 802.15.4 appears to exhibit the most effective results regarding all the other meth ods.   As a matter of fact, and with the noticeable evolution in traffic load and developmen of the duty cycle of the node with faulty energy, the energy lost during the sleep period tends to increase. Once again, the proposed design appears to stand as the most efficien method in terms of energy consumption compared to the examined algorithms, especially at loads' level of 300 packets/s, as justified through Figure 12.

The Transient State-Related Energy Consumption
As shown in Figure 13, at this level, still, the proposed approach displays a noticeable decrease in energy consumption, displaying decreased value levels. It is noteworthy tha the IEEE 802.15.4 appears to exhibit the most effective results regarding all the other meth ods.

Experimental Results
After comparing our simulation method with four other methods, we concluded that our proposed method is more efficient. In this section, we will present an experimental implementation of our method on a real IoT platform. The platform used is of the Waspmote Libelium type as it is exposed in [31]. Figure 14 shows the waspmote used in our experiment. implementation of our method on a real IoT pla mote Libelium type as it is exposed in [31]. Figur periment. The characteristics of the platform are prese The waspmote platform is widely used in Io The characteristics of the platform are presented in Table 2. The waspmote platform is widely used in IoT applications. We can connect several types of industrial sensors to the waspmote node by using a sensor board. The experimental tests were carried out in a laboratory. The platform is composed of 5 nodes which are dispersed in the laboratory as shown in Figure 15. Each node was equipped with an XBee-Pro 802.15.4 radio module, from the manufacturer DIGI at the address "9350 Excelsior Blvd Suite 700 Hopkins, MN 55343". The XBee modules were attached to an antenna. The used space is shown in Figure 15, and is 30 m in length and 20 m in width. We implemented our energy optimization method in the waspmote node, which acts as the PAN coordinator.
As we mentioned, our approach is based on the duty-cycle adaptation according to the amount of remaining energy associated with each node. In our test, node 1 suffered from an energy shortage. This node sends the amount of energy consumed. The PAN coordinator intervened by changing the BO and SO parameters by changing the duty-cycle value.
We have set a threshold equal to 50% of the battery level. As shown in Figure 16, the remaining energy level in the node battery reaches the threshold set at a time of 36 h. After the detection of this threshold, the coordinating PAN intervenes by varying the values of BO and SO. From the experimental result shown in Figure 17, we can see that the energy consumption is optimized. We implemented our energy optimization method in the waspmote node, which acts as the PAN coordinator.
As we mentioned, our approach is based on the duty-cycle adaptation according to the amount of remaining energy associated with each node. In our test, node 1 suffered from an energy shortage. This node sends the amount of energy consumed. The PAN coordinator intervened by changing the BO and SO parameters by changing the duty-cycle value.
We have set a threshold equal to 50% of the battery level. As shown in Figure 16, the remaining energy level in the node battery reaches the threshold set at a time of 36 h. After the detection of this threshold, the coordinating PAN intervenes by varying the values of BO and SO. From the experimental result shown in Figure 17, we can see that the energy consumption is optimized.
After an intervention at the instant t = 36 h, our approach optimizes the energy consumed by 0.4% of the battery capacity at the instant t = 48 h, over a period of 12 h. It optimizes power consumption by 3.2% of battery capacity after a time interval of 96 − 36 = 60 h.  After an intervention at the instant t = 36 h, our approach optimizes the energy consumed by 0.4% of the battery capacity at the instant t = 48 h, over a period of 12 h. It optimizes power consumption by 3.2% of battery capacity after a time interval of 96 − 36 = 60 h.

Conclusions
In this paper, we proposed a novel energy efficiency algorithm for increasing the battery life for IoT wireless sensor applications. It is noteworthy that these WSNs appear to display several shortcomings, above all, the limited or low energy capacity. In this respect, the present work constitutes a modest attempt to resolve such a challenging issue. By proposing a new approach, we intended to help to increase the nodes' lifetime duration through somewhat effective exploitation of the battery residual energy amount.
Hence, following a crash, our designed algorithm undertakes to carefully detect the battery's current energy level by allowing a new mathematical model to compute the nodes' energy consumption levels throughout the different relevant states. Accordingly,  After an intervention at the instant t = 36 h, our approach optimizes the energy consumed by 0.4% of the battery capacity at the instant t = 48 h, over a period of 12 h. It optimizes power consumption by 3.2% of battery capacity after a time interval of 96 − 36 = 60 h.

Conclusions
In this paper, we proposed a novel energy efficiency algorithm for increasing the battery life for IoT wireless sensor applications. It is noteworthy that these WSNs appear to display several shortcomings, above all, the limited or low energy capacity. In this respect, the present work constitutes a modest attempt to resolve such a challenging issue. By proposing a new approach, we intended to help to increase the nodes' lifetime duration through somewhat effective exploitation of the battery residual energy amount.
Hence, following a crash, our designed algorithm undertakes to carefully detect the battery's current energy level by allowing a new mathematical model to compute the nodes' energy consumption levels throughout the different relevant states. Accordingly, Figure 17. Energy consumption.

Conclusions
In this paper, we proposed a novel energy efficiency algorithm for increasing the battery life for IoT wireless sensor applications. It is noteworthy that these WSNs appear to display several shortcomings, above all, the limited or low energy capacity. In this respect, the present work constitutes a modest attempt to resolve such a challenging issue. By proposing a new approach, we intended to help to increase the nodes' lifetime duration through somewhat effective exploitation of the battery residual energy amount.
Hence, following a crash, our designed algorithm undertakes to carefully detect the battery's current energy level by allowing a new mathematical model to compute the nodes' energy consumption levels throughout the different relevant states. Accordingly, once the energy level appears to reach the determined threshold, the proposed scheme would start to operate. The implemented simulations' achieved results testify to the proposed architecture's noticeable efficiency compared to four investigated state-of-the-art algorithms. On the other hand, we implemented our method on an IoT platform of the waspmote-Libelium type. The experimental results proved the effectiveness of our method.
Referring to the results in the corresponding section, the algorithm was started at the instance t = 36 h, so the economic mode will start. The evaluation process obtains a yield of 0.4% if the algorithm controls the process for 12 h. It is possible to obtain a yield of 3.2% in addition to the battery capacity if the algorithm is run for 60 h. When this algorithm is in action, the yield is increasing.
Some of the future endeavors of this work can be assigned to the use of some receivers' equipment based on the wakeup principle, which will reduce the running time and give orders to send information only when the data arrives. This solution can help to save energy, and thus to increase the battery life. It is important to mention that the battery temperature has an influence on the battery yield. It is also possible to add this extension to the algorithm, which can be extended by supervising the battery temperature parameter. When the battery temperature value exceeds the nominal one, the system can react and stop the transmission to help to have more security on the material by increasing the battery life. If concentrating on the used equipment for building, using the LoRa technology, this transmission system can reduce the global emission points as the communication distance can reach 20 km. This will help in reducing the communication points using the IEEE 802.15.4 equipment. However, it is also important to mention that with a piezoelectric solution, the battery state of life can be ameliorated as this equipment can help in feeding the system with a portion of the needed power. Therefore, further research in these fields can help in improving this work.