# Wireless Sensor Network Energy Model and Its Use in the Optimization of Routing Protocols
## 2 Description of the Energy Model
In this paper, an analytical model is proposed and exemplified by the operation parameters of the Texas Instruments CC2530 chip [35], which has a radio interface as per the IEEE 802.15.4 standard. This model shows the energy expended for each of the activities performed from the moment a node is added to a network and becomes part of it, listens to the channel, receives and sends messages, executes the link layer algorithms data, and changes states, ending with the energy consumed when it turns off and disconnects from the network. Figure 2: Conceptual energy scheme. The energy used by the microcontroller depends on the node's operation mode. For example, techniques for turning nodes off reduce energy consumption by setting the microcontroller in idle mode for certain time intervals [39]. However, for this analysis, it is assumed that the mentioned SoC at each node operates in continuous active mode at 32 MHz (the microcontroller's clock frequency) to better study how energy consumption behaves under a specific routing protocol without the influence of techniques used for turning nodes off. Thus, the total energy used by the microcontroller will be given by (1):  
\[E_{\text{MC}}=T_{\text{MC}}\times I_{\text{MC}}\times V_{\text{MC}}, \tag{1}\]  
where \(T_{\text{MC}}\) is the time (seconds) taken by the microcontroller unit to consume \(V_{\text{MC}}\) (Volts) and \(I_{\text{MC}}\) (Amperes). The starting energy is estimated based on the voltage, current, and time nodes required to turn on and be ready for the network, as described in (2):  
\[E_{\text{ON}}=T_{\text{ON}}\times I_{\text{ON}}\times V_{\text{ON}}, \tag{2}\]  
where \(T_{\text{ON}}\) is the time (seconds) that it takes to turn a node on and is given by \(V_{\text{ON}}\) (Volts) and \(I_{\text{ON}}\) (Amperes). The model also describes the energy consumed when nodes turn off when the network time has ended (the sampling period). This energy is given by (3) and it is called shutdown energy. \[E_{\text{OFF}}=T_{\text{OFF}}\times I_{\text{OFF}}\times V_{\text{OFF}}, \tag{3}\]  
where \(T_{\text{OFF}}\) is the time (seconds) that it takes to turn a node off and is given by \(V_{\text{OFF}}\) (Volts) and \(I_{\text{OFF}}\) (Amperes). Switching energy is expended when the node changes from receiving to transmission mode or vice versa. It is given by (4):  
\[E_{\text{Switching}}=T_{\text{Switching}}\times I_{\text{Switching}}\times V _{\text{Switching}}, \tag{4}\]  
where \(T_{\text{Switching}}\) is the time (seconds) that it takes a node to change from the reception mode to the transmission mode or vice versa and it is given by \(V_{\text{Switching}}\) (Volts) and \(I_{\text{Switching}}\) (Amperes). The CSMA/CA algorithm states that each time a node intends to transmit, it first checks if the channel is free from other transmissions. If it is, then the node proceeds to transmit. Otherwise, it calculates a random waiting time before attempting to listen to the channel again. The energy consumed by the CSMA/CA algorithm is given by (5):  
\[E_{CSMA}=T_{CSMA}\times I_{CSMA}\times V_{CSMA}, \tag{5}\]  
where \(T_{CSMA}\) is the time (seconds) in which a node computes the CSMA/CA algorithm and is given by \(V_{CSMA}\) (Volts) and \(I_{CSMA}\) (Amperes). Transmission energy depends directly on the distance and interference. In this case, the nodes transmit their packets or forward packets from other nodes. Transmission energy is described as (6):  
\[E_{TX}=P_{Length}\times T_{TX}\times I_{TX}\times V_{TX}, \tag{6}\]