# A Low Power IoT Sensor Node Architecture for Waste Management Within Smart Cities Context
## 5 Energy-Saving Policy and Consumption Estimation
### Estimation of the Lifetime of the Batteries  
In order to obtain an estimate of the lifetime of the batteries, at first an evaluation of the node consumption is needed. Such a consumption will be computed by accounting the nominal absorption of the main components of the node, according to the relative datasheets, as well as the time they spend running according to the policy. Passive components as well as capacitors and MOSFETs could be considered having a negligible contribution to this estimate. All these data is reported in Table 2.  
Notice that the counter, the only component permanently activated, has a running time per period equal to \(T_{m}\). As explained earlier on, the microcontroller has a running time per period equal to 30 s and because it is supplied by the switching regulator, also the latter must have the same activation time. Concerning the nominal consumption of the ATmega328, it is equal to 10 mA due to the fact that its clock frequency was set to 16 MHz: if it was set to 8 MHz by using an appropriate quartz crystal, then the consumption would be halved. By the way, the clock frequency might be set to the lower one since the sampling measurement frequency is by far inferior. Anyway, the clock frequency was set to 16 MHz so to maximize the microcontroller performances. The level sensor has a running time per period equal to 5 s so to perform three consecutive measurements. Then, the microcontroller computes the mean among these data achieving a better accuracy. After some empirical transmission tests, it was found out that 10 s, on average, are sufficient to ensure a correct transmission by the LoRa module driven by the microcontroller. Therefore, the linear regulator must be activated for the same amount of time since it powers the LoRa module. The consumption of the transmission module is 28 mA since it do not operate in boost mode. Indeed, after some tests, the transmission distance range was successfully covered without resorting to such expedient. At this point, the node consumption per cycle (\(c_{t}\)) can be evaluated as:  
\[c_{t}=\frac{c_{1}t_{1}+[(c_{2}+c_{3})t_{2}]+c_{4}t_{3}+[(c_{5}+c_{6})t_{4}]}{T _{m}}\simeq 0.29\,\mathrm{mA}. \tag{7}\]  
On purpose to ease the treatise, it is better to evaluate the hourly node consumption (\(c\)):  
\[c=\frac{3600c_{t}}{T_{m}}\simeq 0.299\,\mathrm{mA}. \tag{8}\]  
Considering that the capacity of the four 1.5 V AA lithium batteries is 3500 mAh, then the lifetime of the batteries (\(L\)) can be computed as:  
\[L=\frac{3500}{c}\simeq 12,\!040\,\mathrm{h}, \tag{9}\]  
which approximately corresponds to 502 days. If comparing this result with the achievable lifetime using a prototype composed by an Arduino UNO board instead of the ATmega328 microcontroller \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Device Type** & **Device Name** & **Nominal Consumption** & **Running Time** \\ \hline Counter & HEF4060B & \(c_{1}\) = 0.036 mA & \(t_{1}=3490\,\mathrm{s}\) \\ Switching regulator & Pololu D24V22F5 & \(c_{2}=1\) mA & \(t_{2}=30\) s \\ Microcontroller & ATmega328 & \(c_{3}=10\) mA & \(t_{2}=30\) s \\ Level sensor & HC-SR04 & \(c_{4}=15\) mA & \(t_{3}=5\) s \\ Linear regulator & MC33269T & \(c_{5}=20\) mA & \(t_{4}=10\) s \\ LoRa module & SX1272 & \(c_{6}=28\) mA & \(t_{4}=10\) s \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Nominal consumption of the devices composing the node and their relative running time within \(T_{m}\). (the one shown in Figure 1 where the microcontroller block is substituted with the Arduino UNO), it is possible to appreciate the effectiveness of the proposed solution. Indeed, the absorption of current of the Arduino UNO, that was measured (by means of a digital multimeter) by powering it via a laboratory DC power supplier, is \(c_{Arduino}\simeq 38\) mA.