# A Low Power IoT Sensor Node Architecture for Waste Management Within Smart Cities Context
## 5 Energy-Saving Policy and Consumption Estimation
### Energy-Saving Policy  
In order to facilitate the explanation of the energy-saving policy, let us refer to the flow chart in Figure 6. First of all, the chart qualitatively reports throughout a single measurement sampling period, which approximately is 57 m due to the oscillator circuit of the HEF4060B as explained before, the activation time spans of the main components of the node: the counter (i.e., the HEF4060B (Nexperia, Nijmegen, The Netherlands)) as a green bar, the ATmega328 (i.e., the microcontroller) as a yellow bar, the level sensor (i.e., the HC-SR04 (Elecfreaks, Shenzhen, China)) as a pink bar and the LoRa module (i.e., the SX1272 (Semtech, Camarillo, CA, USA)) as a blue bar. For the sake of clarity, note that the time axis is not linear: the overall time in which the ATmega328 is on, is no more than few tens of seconds. Finally, the arrows represent the events driving the activation as well as the deactivation of the single devices. Their actual meaning will be clearer as soon as the policy will be described. This policy is cyclically actuated by means of both the firmware installed on the microcontroller and some hardware component like the MOSFETs and the counter as well. Such a procedure could be summarized in the following points and, with the purpose of getting better the dynamics of this energy-efficient strategy, it is advisable to refer to Figures 1, 4 and 5 along with Figure 6.  
1. The HEF4060B starts to count as soon as the four AA lithium batteries are installed in their slot since it is directly connected to them. Then, after 57 m, the MSB of the counter is at a high logic level implying the activation of the MOSFET within Block A. As a result, the Pololu D24V22F5 is switched on entailing the supplying of the microcontroller within Block B. The firmware installed on the chip ensures that none of the other components within Block B are activated during this phase of the policy. Indeed, the Switching and powering system for LoRa block as well as the level sensor are connected to digital output pins of the ATmega328 that provide a low logic level according to the executed firmware instruction so far. 2. At this stage the ATmega328 takes control of the node while the HEF4060B still continues to count. These two phenomena take place in parallel since they are not in conflict. Indeed, the only trouble would arise only if the MSB will lower its logic level due to the counting process: this event would cause an unwanted deactivation of the ATmega328. Fortunately, this episode will never occur since it naturally would after 57 m while the time needed for the measurement and the transmission of the data is by far shorter. 3. The level sensor is directly connected to the microcontroller which manages its activation and the acquisition of the sensed filling level too. Indeed, the supply voltage of 5 V for the sensor is provided by a digital output of the ATmega328. When such output is kept to a high logic level, due to the relative firmware instruction, then the sensor is activated. Furthermore, the firmware commands the sensor via the Sensor trigger and Sensor echo pins: the former receives the request by the ATmega328 for the measurement while the latter returns such data to the microcontroller. Once this process ends, the ATmega328 switches the sensor off by lowering the digital output devoted to the sensor powering. 4. A similar plan is implemented for the LoRa module even though it presents some slight dissimilarities. The microcontroller drives the MOSFET within the Switching and powering system for LoRa block through a digital output: raising its logical level implies the activation of the transmission module (by the way, here it is highlighted the importance of the Switching and powering system for LoRa: a feeding method specular to the one exploited for the sensor is no longer viable since the ATmega328 high logic level coincides with 5 V which will damage the LoRa module. Moreover, the microcontroller would not be able to provide the power requested for the transmission on its own).