# Energy Consumption Model for Sensor Nodes Based on LoRa and LoRaWAN
## 4 Energy Consumption Model
### Proposed Energy Model  
This part defines the different operating modes of the communicating sensor. A first approach consists in considering all elements active during a fixed time duration and inactive for the rest of the time cycle. Most of the time, the wireless sensor is in sleep mode. The consumed energy in this mode could impact the power consumption amount of the sensor. Then, it is necessary to consider the sleep mode consumption in our model. In this study, all peripherals are powered at the same voltage level  
Figure 2: Sensor working scenario. equal to 3.3 V, except the sensor unit which is powered at 2 V. The total consumed energy \(E_{Total}\) used by the communicating sensor for one cycle is given by Equation (1):  
\[E_{Total}=E_{Sleep}+E_{Active}, \tag{1}\]  
where \(E_{Sleep}\) and \(E_{Active}\) are the dissipated energy by the node in the sleep mode and the total energy consumption during the active mode of the microcontroller, respectively. \(E_{Sleep}\) is expressed as:  
\[E_{Sleep}=P_{Sleep}\cdot T_{Sleep}, \tag{2}\]  
where \(P_{Sleep}\) and \(T_{Sleep}\) are the power consumption and the time duration in the sleep mode, respectively. The total energy consumption \(E_{Active}\) is calculated as the sum of the energy consumption of each part of the sensor node. It is given by the following equation:  
\[E_{Active}=E_{WU}+E_{m}+E_{proc}+E_{WUT}+E_{Tr}+E_{R}, \tag{3}\]  
where \(E_{WU}\), \(E_{m}\), \(E_{proc}\), \(E_{WUT}\), \(E_{Tr}\) and \(E_{R}\) are, respectively, the consumed energies in the system wake-up, the data measurement, the microcontroller processing, the wake-up of the LoRa transceiver, the transmission mode and the reception mode. Then, before doing measurements, the wake-up of the sensor node is managed by the processing unit. The consumed energy \(E_{WU}\) during the wake-up duration \(T_{WU}\) is given by:  
\[E_{WU}=P_{ON}(f_{MCU})\cdot T_{WU}, \tag{4}\]  
where \(P_{ON}(f_{MCU})\) and \(T_{WU}\) are the consumed power by the microcontroller (which depends on the microcontroller frequency \(f_{MCU}\)) and the wake-up duration, respectively. After the wake-up time, the sensor realizes data measurements. Equation (5) presents the amount of dissipated energy \(E_{m}\) during this phase:  
\[E_{m}=(P_{ON}(f_{MCU})+P_{m})\cdot T_{m}, \tag{5}\]  
where \(P_{m}\) and \(T_{m}\) are the consumed power and the corresponding time duration of measurements, respectively. After the measurement step, the microcontroller proceeds to data processing. The time duration \(T_{proc}(f_{MCU})\) depends on microcontroller operating frequency \(f_{MCU}\) and on the number of instructions \(N_{inst}\) (\(T_{proc}(f_{MCU})=\frac{N_{inst}}{f_{MCU}}\)). In Equation (6), we calculate the consumed energy by the processing unit (we assume one instruction/clock period):  
\[E_{proc}=P_{ON}(f_{MCU})\cdot T_{proc}(f_{MCU}) \tag{6}\]  
Then, the consumed energy \(E_{WUT}\) during the transceiver wake-up \(T_{WUT}\) is given by:  
\[E_{WUT}=(P_{ON}(f_{MCU})+P_{WUT})\cdot T_{WUT}, \tag{7}\]  
where \(P_{WUT}\) is the consumed power during the wake-up of the transceiver. After that, the consumed energy \(E_{Tr}\) by the transmit mode is expressed as:  
\[E_{Tr}=(P_{ON}(f_{MCU})+P_{Tr})\cdot T_{Tr}, \tag{8}\]  
where \(P_{Tr}\) is the dissipated power by the transmit mode and \(T_{Tr}\) is its time duration, it is given by Equation (9):  
\[T_{Tr}=N_{bit}\cdot T_{bit},\]where \(N_{bit}\) and \(T_{bit}\) are, respectively, the number of transmitted bits and the duration of one bit transmission. In the case of acknowledgment transmission, the consumed power by the sensor node denoted \(E_{R}\) is given by the following equation:  
\[E_{Total}=E_{Sleep}+E_{Active}, \tag{1}\]0  
where \(P_{R}\) is the dissipated power by the reception mode and \(T_{R}\) is the corresponding time duration.