Skip to main content

Reducing the Power Consumption of IoT with Task-Oriented Programming

  • Conference paper
  • First Online:
Trends in Functional Programming (TFP 2022)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://statinvestor.com/data/33967/iot-number-of-connected-devices-worldwide/.

  2. 2.

    https://www.bp.com/en/global/corporate/energy-economics/statistical-review-of-world-energy/electricity.html.

  3. 3.

    https://nl.wikipedia.org/wiki/Kerncentrale_Borssele.

  4. 4.

    https://www.bp.com/content/dam/bp/business-sites/en/global/corporate/pdfs/energy-economics/statistical-review/bp-stats-review-2021-electricity.pdf.

  5. 5.

    https://www.wemos.cc/en/latest/d1/d1_mini.html.

  6. 6.

    https://www.adafruit.com/product/3010.

  7. 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. 8.

    See https://www.adafruit.com/product/904 for the sensor and https://github.com/adafruit/Adafruit_INA219 for the associated library.

  9. 9.

    See https://www.wemos.cc/en/latest/d1_mini_shield/sht30.html.

References

  1. Barry, R.: Using the FreeRTOS Real Time Kernel - A Practical Guide (2009)

    Google Scholar 

  2. 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

  3. 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

    Article  Google Scholar 

  4. 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

    Chapter  Google Scholar 

  5. 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

    Article  MathSciNet  MATH  Google Scholar 

  6. Clean team: Clean 3.0 language report (2020). https://cloogle.org/doc. Accessed 05 Apr 2022

  7. 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

  8. 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

  9. 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

    Chapter  Google Scholar 

  10. 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

  11. Lubbers, M., Koopman, P., Plasmeijer, R.: Writing Internet of Things applications with task oriented programming. arXiv preprint arXiv:2212.04193 (2022)

  12. 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

  13. 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

    Article  Google Scholar 

  14. 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)

    Google Scholar 

  15. 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

  16. 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

    Chapter  Google Scholar 

  17. 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

  18. 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

  19. 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

    Chapter  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Mart Lubbers .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics