Abstract
Limiting the energy consumption of IoT nodes is a hot topic in green computing. For battery-powered devices this necessity is obvious, but the enormous growth of the number of IoT nodes makes energy efficiency important for every node in the IoT. In this paper, we show how we can automatically compute execution intervals for our task-oriented programs for the IoT. These intervals offer the possibility to save energy by bringing the microprocessor driving the IoT node into a low-power sleep mode until the task need to be executed. Furthermore, they offer an elegant way to add interrupts to the system. We do allow an arbitrary number of tasks on the IoT nodes and achieve significant reductions of the energy consumption by bringing the microprocessor in sleep mode as much as possible. We have seen energy reductions of an order of magnitude without imposing any constraints on the tasks to be executed on the IoT nodes.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
In the implementation a delay d is replaced by a waitUntil (now + d) that compares the clock time of the system with the given start time.
- 8.
See https://www.adafruit.com/product/904 for the sensor and https://github.com/adafruit/Adafruit_INA219 for the associated library.
- 9.
References
Barry, R.: Using the FreeRTOS Real Time Kernel - A Practical Guide (2009)
Belwal, C., Cheng, A.M.K., Ras, J., Wen, Y.: Variable voltage scheduling with the priority-based functional reactive programming language. In: Proceedings of the 2013 Research in Adaptive and Convergent Systems, pp. 440–445 (2013). https://doi.org/10.1145/2513228.2513271
Bhatti, S., et al.: Mantis OS: an embedded multithreaded operating system for wireless micro sensor platforms. Mob. Netw. Appl. 10(4), 563–579 (2005). https://doi.org/10.1007/s11036-005-1567-8
Brus, T.H., van Eekelen, M.C.J.D., van Leer, M.O., Plasmeijer, M.J.: Clean—a language for functional graph rewriting. In: Kahn, G. (ed.) FPCA 1987. LNCS, vol. 274, pp. 364–384. Springer, Heidelberg (1987). https://doi.org/10.1007/3-540-18317-5_20
Carette, J., Kiselyov, O., Shan, C.: Finally tagless, partially evaluated: tagless staged interpreters for simpler typed languages. J. Funct. Program. 19(5), 509–543 (2009). https://doi.org/10.1017/S0956796809007205
Clean team: Clean 3.0 language report (2020). https://cloogle.org/doc. Accessed 05 Apr 2022
Elliott, C., Hudak, P.: Functional reactive animation. In: Proceedings of the Second ACM SIGPLAN International Conference on Functional Programming, pp. 263–273 (1997). https://doi.org/10.1145/258948.258973
Eswaran, A., Rowe, A., Rajkumar, R.: Nano-RK: an energy-aware resource-centric RTOS for sensor networks. In: 26th IEEE International Real-Time Systems Symposium, pp. 256–265 (2005). https://doi.org/10.1109/RTSS.2005.30
Grebe, M., Gill, A.: Threading the Arduino with Haskell. In: Van Horn, D., Hughes, J. (eds.) TFP 2016. LNCS, vol. 10447, pp. 135–154. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-14805-8_8
Koopman, P., Lubbers, M., Plasmeijer, R.: A task-based DSL for microcomputers. In: Proceedings of the Real World Domain Specific Languages Workshop 2018 on - RWDSL 2018, Vienna, Austria, pp. 1–11. ACM Press (2018). https://doi.org/10.1145/3183895.3183902
Lubbers, M., Koopman, P., Plasmeijer, R.: Writing Internet of Things applications with task oriented programming. arXiv preprint arXiv:2212.04193 (2022)
Lubbers, M., Koopman, P., Ramsingh, A., Singer, J., Trinder, P.: Tiered versus tierless IoT stacks: comparing smart campus software architectures. In: Proceedings of the 10th International Conference on the Internet of Things, IoT 2020. ACM, New York (2020). https://doi.org/10.1145/3410992.3411002
Nižetić, S., Šolić, P., López-de-Ipiña González-de-Artaza, D., Patrono, L.: Internet of things (IoT): opportunities, issues and challenges towards a smart and sustainable future. J. Clean. Prod. 274, 122877 (2020). https://doi.org/10.1016/j.jclepro.2020.122877
Plasmeijer, R., Achten, P., Koopman, P.: iTasks: executable specifications of interactive work flow systems for the web. In: Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming (ICFP 2007), Freiburg, Germany, pp. 141–152. ACM (2007)
Plasmeijer, R., Lijnse, B., Michels, S., Achten, P., Koopman, P.: Task-oriented programming in a pure functional language. In: Proceedings of the 14th Symposium on Principles and Practice of Declarative Programming, PPDP 2012, pp. 195–206. ACM, New York (2012). https://doi.org/10.1145/2370776.2370801
Stutterheim, J., Achten, P., Plasmeijer, R.: Maintaining separation of concerns through task oriented software development. In: Wang, M., Owens, S. (eds.) TFP 2017. LNCS, vol. 10788, pp. 19–38. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89719-6_2
Tratt, L.: Domain specific language implementation via compile-time meta-programming. ACM Trans. Program. Lang. Syst. 30(6) (2008). https://doi.org/10.1145/1391956.1391958
Valliappan, N., Krook, R., Russo, A., Claessen, K.: Towards secure IoT programming in Haskell. In: Proceedings of the 13th ACM SIGPLAN International Symposium on Haskell, Haskell 2020, pp. 136–150. Association for Computing Machinery, New York (2020). https://doi.org/10.1145/3406088.3409027
Wang, S., Watanabe, T.: Functional reactive EDSL with asynchronous execution for resource-constrained embedded systems. In: Lee, R. (ed.) SNPD 2019. SCI, vol. 850, pp. 171–190. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-26428-4_12
Acknowledgements
This research is partly funded by the Royal Netherlands Navy. Furthermore, we would like to thank the anonymous reviewers for their invaluable comments.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 Springer Nature Switzerland AG
About this paper
Cite this paper
Crooijmans, S., Lubbers, M., Koopman, P. (2022). Reducing the Power Consumption of IoT with Task-Oriented Programming. In: Swierstra, W., Wu, N. (eds) Trends in Functional Programming. TFP 2022. Lecture Notes in Computer Science, vol 13401. Springer, Cham. https://doi.org/10.1007/978-3-031-21314-4_5
Download citation
DOI: https://doi.org/10.1007/978-3-031-21314-4_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-21313-7
Online ISBN: 978-3-031-21314-4
eBook Packages: Computer ScienceComputer Science (R0)