DOI QR코드

DOI QR Code

Analysis of Arduino Timer Callback for IoT Devices

IoT 디바이스를 위한 아두이노 타이머 콜백 분석

  • 공동환 (한양사이버대학 기계자동차공학부) ;
  • 신승중 (한세대학교 ICT디바이스학과)
  • Received : 2018.09.07
  • Accepted : 2018.12.07
  • Published : 2018.12.31

Abstract

Arduino, based on open source hardware, is used in many IoT devices, and IoT devices require multitasking for various inputs and outputs. Among the several methods used for multitasking based on Arduino, we compare three methods: Timing Call by using millis(), Simple Timer library method, and Timer library method. In order to measure the execution error caused by measurement and time delay of each method, two situations are created and analyzed. In the first case, 10 random tasks of a certain size are generated to measure the time delay of each method. In the second situation, 10 random tasks of a certain size are generated to compare execution errors caused by the time lag of the Timer library. In the first case, the millis() timing call method and the Simple Timer library method have a similar time delay and the Timer library method has more time delay. In the second situation, an execution error occurred in which small-size tasks were not called back at the correct timing due to the time delay.

오픈 소스 하드웨어 기반의 아두이노는 많은 IoT 디바이스로 사용되고 있으며 IoT 디바이스들은 다양한 입출력을 위한 멀티태스킹을 필요로 한다. 아두이노 기반의 멀티태스킹을 위해 많이 사용되는 몇 가지 방법 중 세 가지 방법인 millis()를 사용한 타이밍 호출 방법, SimpleTimer 라이브러리 사용 방법, Timer 라이브러리 사용 방법을 비교 분석한다. 각 방법의 측정과 시간지연으로 발생되는 실행 오류를 측정하기 위해 두 가지 상황을 생성하여 분석한다. 첫 번째 상황은 일정한 크기의 임의 작업을 10개 생성하여 각 방법의 시간지연을 측정하고 두 번째 상황은 일정하지 않는 크기의 임의 작업을 10개 생성하여 Timer 라이브러리의 시간지연으로 발생되는 실행 오류를 비교 분석하였다. 첫 번째 상황에서 millis() 타이밍 호출 방법과 Simple Timer 라이브러리 사용 방법은 비슷한 시간지연이 발생하였고 Timer 라리브러리 사용 방법은 더 많은 시간지연이 발생하였다. 두 번째 상황에서는 크기가 작은 작업들이 시간지연으로 정확한 타이밍에 콜백되지 않는 실행 오류가 발생되었다.

Keywords

OTNBBE_2018_v18n6_139_f0001.png 이미지

그림 1. 2초의 콜백 이벤트 발생에 따른 모든 함수 실행 시간 비교(ms) Fig. 1. Comparison of all function execution times according to 2 seconds callback event

OTNBBE_2018_v18n6_139_f0002.png 이미지

그림 2. 콜백 함수 8번의 실행 지연을 확인하기 위한 시리얼 모니터링(ms) Fig. 2. Serial monitoring to check the time delay of callback function 8

OTNBBE_2018_v18n6_139_f0003.png 이미지

그림 3. 콜백 함수 6, 7, 8번의 실행 오류 측정(ms) Fig. 3. Measuring Execution Errors in Callback Functions 6, 7, and 8

표 1. 실험 환경 Table 1. Experiment Environment

OTNBBE_2018_v18n6_139_t0001.png 이미지

표 2. 2초의 콜백 이벤트 발생에 따른 모든 함수 실행 시간 비교(ms) Table 2. Comparison of all function execution times according to 2 seconds callback even

OTNBBE_2018_v18n6_139_t0002.png 이미지

References

  1. Ho-Tae Lee, "Analysis of Security Technology for Internet of things", The Journal of The Institute of Internet, Broadcasting and Communication(IIBC) Vol. 17, No. 4, pp. 43-48, Aug 2017. https://doi.org/10.7236/JIIBC.2017.17.4.43
  2. Chang-Gyu Seong, Keel-Soo Rhyu, "Internet of things application service system with open source hardware", Journal of the Korean Society of Marine Engineering 40(6), pp. 542-547, Jul 2016. https://doi.org/10.5916/jkosme.2016.40.6.542
  3. Yangja Jang, "IoT Platform Technology Review", Communications of the Korean Institute of Information Scientists and Engineers 32(6), pp. 19-24, Jun 2014.
  4. Internet of Things: Wireless Sensor Networks White Paper(IEC, 2014).
  5. Sung-Yoon Chae, Jinhee Park, "A Design and Implementation of Testing and Management System for IoT Sensors", The Journal of The Institute of Internet, Broadcasting and Communication(IIBC), Vol. 16, No. 5, pp. 151-156, Oct 2016. https://doi.org/10.7236/JIIBC.2016.16.5.151
  6. Galadima and A. Adamu, "Arduino as a learning tool", 2014 11th International Conf. on Electronics, Computer and Computation, pp. 1-4, Sep. 2014.
  7. Y. Chemin, N. Sanjaya, P. K. N. C. Liyanage, "An Open Source Hardware & Software online raingauge for real-time monitoring of rainwater harvesting in Sri Lanka." Symposium on Mainstreaming Rainwater Harvesting as a Water Supply Option, 2014.
  8. Yumi Oh, Sungwon Lee, "IoT and Open Source Development Platform" Communications of the Korean Institute of Information Scientists and Engineers 32(6), pp. 25-30, Jun 2014.
  9. S. H. Kim, "Internet Of Things Technology", The Institute of Electronics and Information Engineers, Vol. 43, No. 3, pp. 67-71, 2016.
  10. OSHA(Open Source Hardware Association), https://www.oshwa.org/
  11. Arduino Playground. http://playground.arduino.cc/
  12. Wikipedia, https://www.wikipedia.org/