# Wireless Sensor Network Energy Model and Its Use in the Optimization of Routing Protocols
## 2 Description of the Energy Model  
We propose a simple energy model under the basic tasks or activities that nodes perform in the network [38]. Figure 2 conceptually describes this scheme. This model considers all the energy components that contribute to the overall energy consumption under active mode. First of all, a node remains at start time (\(t_{ON}\)) to turn on. Then, it takes a switching time (\(t_{Switching}\)) to change status before sending a packet to the medium. Here, the node first runs the CSMA algorithm using a CSMA time (\(t_{CSMA}\)). Next, the node transmits an information packet expending a transmission time (\(t_{TX}\)). Now, the node takes a switching time (\(t_{Switching}\)) to change activities, it remains inactive (\(t_{Inactive}\)) and changes task again. In addition, it takes a switching time (\(t_{Switching}\)) to start receiving information and reporting a reception time (\(t_{RX}\)). The node performs these activities as many times as it sends and receives information (messages) during the sampling period. Finally, the node turns off expending a shutdown time (\(t_{OFF}\)). All of this while the microcontroller remains in active mode. This process measures the energy required for each main node activity in the network. Depending on the task and the time a node takes to execute it, this corresponds to a given voltage and current, so that the total energy used by each node can be obtained for each of the activities run for the network based on the previous model [37]. \begin{table}
\begin{tabular}{l l l l} \hline \hline  & **Voltage (mV)** & **Current (mA)** & **Time (ms)** \\ \hline Turn on mode & 120 & 12 & 0.2 \\ Microcontroller 32-MHz clock & 75 & 7.5 & 1.7 \\ CSMA/CA algorithm & 270 & 27 & 1.068 \\ Switching from reception to transmission & 140 & 14 & 0.2 \\ Switching from transmission to reception & 250 & 25 & 0.2 \\ Radius in reception mode & 250 & 25 & 4.1915 \\ Radius in transmission mode & 320 & 32 & 0.58 \\ Turn off mode & 75 & 7.5 & 2.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Energy model base for each of the main tasks in a node [37]. To compare the performance of the energy model, we used two types of sensors: CC2530 and CC2650 from Texas Instruments. We have coded the proposed model in a wireless sensor simulator programmed in C ++ based on the previously tested events [10]. The wireless module with antenna CC2530 nodes have 256 KB Flash and 8 KB of RAM sufficient for the implementation of widely known protocols in WSN. They have an IEEE 802.15.4 RF transmitter/receiver in 2.4 GHz high sensitivity (102 dBm). These sensors have four modes of operation in terms of energy savings and 21 general purpose pins, which cover the needs for connection of extra sensors. The CC2650 nodes are ultra-low power 2.4 GHz devices. An active and very low MCU and RF current and a low power mode current consumption offer excellent battery life. These devices contain a 32-bit ARM Cortex-M3 processor that operates at 48 MHz as the main processor and a set of extensive peripheral functions including an ultra-low power single sensor controller ideal for interconnecting external sensors. Table 2 presents some results to verify the accuracy of the proposed energy model in predicting the total energy used by each node. We have taken as a basis the consumption for each type of energy proposed in the model. The described scenario is a configuration of 25 randomly and evenly distributed nodes and one of them is the coordinating or concentrating node. We left the nodes running from Monday to Sunday (seven days) on a university campus in an area of 500 \(\times\) 500 m\({}^{2}\) under the conditions described in Table 3. We observed that the model described in Table 1 can be a reliable parameter to measure the general consumption of a wireless network of small to medium sensor size if the nodes are in active mode and the types of energies described give a faithful ideal of the main functions of a node in a network, taking approximately 4 to 5% margin of measurement error.