## 4 LOKA: LOw Power Consumption Algorithm
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Platforms**} & \multicolumn{3}{c}{**CPU**} & \multicolumn{3}{c}{**Radio**} \\ \cline{2-7}  & \multirow{2}{*}{**Model**} & \multicolumn{2}{c}{**Current Drain**} & \multirow{2}{*}{**Model**} & \multicolumn{3}{c}{**Current Drain**} \\ \cline{3-3} \cline{5-7}  & & **Sleep** & **Active** & & **Sleep** & **Active** & **Using TX/RX** \\ \hline Mica2 & ATmega128L & 15 \(\mu\)A & 8 mA & TI CC100 & \textless{1} \textless{}1 \textless{} \textless{} \textless{}1



By comparing the energy consumption estimations of _Mica2_ and _TinyNode_ with our prototype, it can be seen that LOKA is more efficient that the TinyOs duty-cycling mechanism. The reason of less energy consumption applying LOKA than in the other platforms is because LOKA only uses interruption handles while TinyOs uses a computational abstraction layer. This layer wakes up the microcontroller CPU more frequently than applying only LOKA, and therefore, consumes more energy:

Figure 5.2

Figure 5.3

Figure 5.4

Figure 5.5

## 6 Conclusions

The Wireless Sensor Networks are useful in multiple scenarios where gathering data along a wide area is required. Often, this implies an electrical grid independence and wireless communications as the area to cover does not have the required infrastructure. Thus, WSNs are composed of several motes equipped with batteries and wireless transmission devices. The operation time of the WSN is dependent of the battery capacity and the logic implemented in the motes. In this regard, there are different studies about how to minimize the energy consumption: assessing the best transmission way, processing the data before transmit it or using wakeup-protocols with duty-cycling mechanism. Following the last approach, this paper presents LOKA, a duty-cycling algorithm that reduces the energy consumption of each mote in the WSN by exploiting the power modes of the mote's devices. To demonstrate the efficiency gain using LOKA, we have deployed a prototype sensor mote with different sensors (presence, temperature, humidity and light) controlled by a Cortex M0+ microcontroller and equipped with a XB24 ZigBee communication module and a battery. Managing the power modes of the microcontroller and the XB24 module, in our experiments LOKA can reduce over 55% the energy consumption of the sensor motes. In future works, we want to study the impact of the combination of LOKA and adaptive algorithms in the context of energy harvesting systems and to compare our deployed prototype sensor with other new FRAM microcontrollers like MSP430 FR5969. ###### Acknowledgements. [PERSON] is supported by the UAH grant 30400M000.541A.640.17. The work is supported by the Universidad de Alcala project 2016/00351/001 and MINECO project Epheme-CH TIN2014-56494-C4-P.

**Author Contributions:** [PERSON] and [PERSON] conceived and designed the experiments; [PERSON] and [PERSON] performed the experiments; [PERSON] and [PERSON]. [PERSON] analyzed the data; [PERSON] and [PERSON] contributed reagents, materials, analysis tools; all autors equaly wrote the paper. **Conflicts of Interest:** The authors declare no conflict of interest. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Operation Time [s]** & \multicolumn{4}{c}{**Consumption [J]**} \\ \cline{2-4}  & **Mica2** & **TinyNode** & **LOKA Prototype** \\ \hline
60 & 0.810 & 0.809 & 0.614 \\
300 & 4.053 & 4.047 & 3.073 \\
600 & 8.105 & 8.094 & 6.146 \\
900 & 12.158 & 12.140 & 9.220 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Average consumption estimation in Mica2, TinyNode and LOKA’s prototype using 1% duty-cycling mechanism. ## References

* (1) [PERSON] Wireless sensor networks. _Smart Environ. Technol. Protoc. Appl._**2004**, 11-46. * (2) [PERSON]; [PERSON] Secure user authentication scheme for wireless healthcare sensor networks. _Comput. Electr. Eng._**2016**, _59_, 250-261.