A Proposed Low-cost Data-logging System to Monitor Migratory Bird Activity Anastasios Bounas 1, Konstantinos Sotiripoulos 1, Artemis Talioura 1, Dimitrios Kiromitis 2, Charikleia Kommata 2 and Sotirios Kontogiannis 2 1 Department of Biological Applications and Technology, University of Ioannina, University campus, Ioannina, 45110, Greece 2 Laboratory Team of Distributed MicroComputer Systems, Dept. of Mathematics, University of Ioannina, University campus, Ioannina, 45110, Greece Abstract This paper presents a novel, low-power, low-cost autonomous bird monitoring system for the process of capturing migratory bird activity. The proposed system includes an end-node device with PIR sensors and a mobile phone application for data acquisition and visualization. The authors have experimented with their implementation using birds in captivity. The authors' preliminary results have shown that their implementation can operate flawlessly with no interventions, especially at night. The authors present their prototype implementation, capabilities, preliminary experimentation, and future directions. Keywords 1 IoT, embedded systems, Birds Monitoring system, IoT autonomous systems, bird migration 1. Introduction Twice every year, a vast number of birds move between the western Palearctic and Africa, connecting the two continents and their different biomes [1]. Birds travel between geographically distinct locations to take advantage of seasonally predictable resources, thus supporting their reproduction and overall survival. Migration, therefore, is a fundamental stage in the life history of birds. Migratory songbirds have experienced massive declines in the last decades, and climate change has already been proven to affect their behavior [2]. Unraveling the adaptive response mechanisms of phenotypic traits to novel or changing environments has one major precondition: the accurate characterization and quantification of the migratory phenotype. The beginning of bird migration in spring and autumn occurs at specific periods determined by the endogenous circadian and circannual rhythms [3]. Many long-distance migrating songbirds show diurnal activity before and after the migratory seasons but have evolved the ability to migrate exclusively at night. As a result, they develop intense nocturnal activity during the spring and autumn migratory periods, known as migratory restlessness, when kept in cages. This behavior typically consists of wing fluttering while the bird is perched and is expressed as the amount of activity within a given time period. Therefore, research on bird migration has been based on measuring migratory restlessness in captive individuals as it can also be used as a direct indicator of a bird's internal migratory drive. In contrast, its occurrence and intensity in captive birds mirror the migration patterns of birds in the wild [4, 5]. This paper presents an activity monitoring system based on commercially available Passive InfraRed sensors (PIRs). The authors describe hardware configuration, necessary programming code, and developed android application capabilities, which researchers can use to make their system record animal activity. The authors also provide a sample of Proceedings of HAICTA 2022, September 22–25, 2022, Athens, Greece EMAIL: tasosbounas@gmail.com (A. 1); ksotirop@uoi.gr (A. 2); taliouraart@gmail.com (A. 3); jkiromitis@gmail.com (A. 4); chara.kommata7@gmail.com (A. 5); skontog@uoi.gr (A. 6) ORCID: 0000-0002-6724-0151 (A. 1); 0000-0002-4534-6158 (A. 4); 0000-0002-1360-3367 (A. 6) ©️ 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) 388 activity data for House sparrows (Passer domesticus), collected for three days, and validate the functionality of their implemented measuring prototypes. 2. Related Work Several data logging systems exist that monitor animal activity. Nevertheless, they are mainly designed for laboratory environments and are costly and energy-consuming [6, 7, 8, 9, 10]. Those solutions are robust and easy to deploy in laboratory conditions as a trade-off. Additionally, those systems cannot operate autonomously in an open environment. When working with natural populations of non-model species, data collection may be performed under field conditions, making it challenging to use for the previously mentioned solutions. Therefore, developing an inexpensive and easily assembled activity monitoring system would be of major importance for researchers working in remote locations where field stations are established to collect activity data to be used in bird migration physiology studies. Furthermore, the recording and storage of data through the mobile application makes the process easier and user-friendly, including for scientists working in the field [11]. Also, the users can benefit from the performance of research projects such as those that study the quality of habitats, population dynamics in migratory birds, and how past events affect animal life-history traits within a season [12]. 3. Proposed Monitoring and Data-logging System The following subsections present the authors' implementation and proof of concept experimentation. In brief, the authors' MCSL-Birds end-node device implementation and functionality are presented in detail in section 3.1. Sections 3.2 and 3.3 focus on the implemented data-logging device parts and data management mobile phone application capabilities. Finally, in section 3.4, the authors illustrate their experimentation setup and preliminary data results taken from the MCSL-birds system. 3.1. MCSL-Birds System Functionality MCSL-Birds system functionality is illustrated in Figure 1. The MCSL-Birds detection process includes four stages. The PIR sensors in Figure 1 (1), are interrupt-triggered whenever they detect any movement activity inside the cage (see Figure 2, (2)). Furthermore, when a PIR sensor detects motion, it switches its data input pin from LOW to HIGH until the movement is over. In order to filter the short- time intervals of movement activity close to the repeating trigger mode delay of the PIR sensors, a filtering process is used that deletes the movements triggered in short-range intervals between 1500- 3000 ms (see Figure 1, (1),(2)). Figure 1: MCSL-Birds system data-logging and data-management functionality The detected movement intervals are periodically stored in a CSV file every five minutes (see Figure 1, (3)). In addition, these records also include the CPU's time interval (CPU up-time) or the current 389 absolute measurements time. If taken from the Wi-Fi transceiver via Network Time Protocol (NTP), that is. The latter requires Wi-Fi Internet connectivity or a nearby Point-to-Point Wi-Fi Network Time Protocol concentrator device (Figure 1, (3)). Finally, the user can access the stored data using a mobile application (Figure 1, (4)) implemented over Bluetooth Low Energy [13]. 3.2. Data-logging End-node Device The proposed MCSL-Birds system end-node device consists of a dual-core 32bit mini-ARM board that includes onboard Wi-Fi b/g/m and Bluetooth Low Energy (BL3 4.2) transceivers. It also has an embedded MicroSD card slot capable of storing up to 32GB of sensory data and four Passive InfraRed sensors – PIRs, connected to the board's GPIO digital input pins. The MCSL-Birds end-node device prototype is illustrated in the following Figure 2. Figure 2: MCSL-Birds system end-node device and device packaging The end-node device transceivers and interfaces used are as follows: 1. 32bit ARM CPU and BLE 4.2 transceiver: The CPU calculates asynchronous movements using interrupt service routines when the PIR sensors detect birds' motion. The BLE transceiver communicates and passes the real-time data per PIR sensor to the mobile phone application. 2. GPIO input Pins: The input pins are connected to the four PIR sensors, operating in repeating mode (each sensor appropriately attached to a bird's cage), triggering HIGH input when movement is detected every PIR sensor interrupt interval of TINT=1500ms. 3. MicroSD Card: It periodically stores movement data (in ms) and measurements timestamps per PIR sensor in CSV format. 4. Micro-USB power cable: It is used for powering up and debugging end-node device output via the Serial interface. The Type-A end of the USB cable can be connected either directly to a 12V voltage regulator with USB output attached to a 12V-10W PV panel that is charging a Pb 12V/24Ah battery for autonomous operation or to a 1500mAh LiPo battery pack for 24h continuous operation. 5. Wi-Fi transceiver: It is used for the acquisition of time for long-term experiments if an appropriate Network Time Protocol concentrator device with Internet connectivity is nearby. The CPU GPIO input pins are connected to each PIR sensor in order to sense trigger input pulses per interrupt interval TINT from each cage when movement is detected, as shown in Figure 3. 390 Figure 3: PIR sensors attached to the end-node device Each PIR sensor includes two rheostats that adjust the sensor sensitivity and the triggering time delay. For the MSCL-Birds system operation, both rheostats are adjusted to their minimum value placement, corresponding to 3 meters of movement detection range. The PIR sensors are also capable of two trigger options setup modes: (1) repeatable mode and (2) non-repeatable mode. The difference is that in a non-repeatable mode, in which the MCSL-Birds system is working, the output of PIR sensors is switched to LOW when no motion is detected, and the PIR interrupt time interval TINTis elapsed. MCSL-Birds end-node device is a low-cost and low-power device. Its total cost is less than 60€, without calculating PV panel and battery costs. End-node device power consumption is 80-90 mA while running and storing the data to the SD card and 110-120 mA when the user receives the data, via the BLE transceiver, from the mobile application. Preliminary end-node device measurements have shown that the end-node device can operate continuously for ten hours using a 1Ah-12V battery. It can also operate as an autonomous device for at least three months using a 10W-12V PV panel and 24Ah-12V deep depletion Pb battery. Unfortunately, comparing with other measuring devices is not possible since energy consumption is not their target, and cost information for other devices is unavailable. 3.3. Mobile Phone Application The MCSL-Birds system includes a mobile application that is capable of data acquisition and visualization from the end-node devices over BLE. The mobile phone application Users Interface (UI) is illustrated in Figure 4. The application can acquire and show real-time PIR data or fetch all the data stored in the end-device SD card during the end-device operation. It is also capable of clearing the stored SD card data. Additional parameters such as setting the data-logging time interval or the Wi-Fi NTP concentrator Access Point Network (APN) can be set via the end-device Serial port, using appropriate AT commands. Specifically, the mobile application's main activity contains six push buttons, as shown in Figure 4 (left activity screenshot). The push-button functionalities include: 1) Connecting/disconnecting via Bluetooth Low Energy (BLE) to the MCSL-Birds BLE SSID of the end-node device, 2) recorded data clean up (Clear push button), 3) real-time data visualization to a separate activity UI and 3) Entire data- logged acquisition and storage to the mobile phone external SD card using a separate activity. The Figure (activity on the right) shows how the recorded data are presented as the cumulative duration of the motion detected in the 5 minutes detection period for each of the four connected PIR sensors (in ms) and the total data-logging time (in secs). 391 Figure 4: MCSL-Birds mobile phone application User Interface 3.4. Experimental Setup and Data Analysis The authors' preliminary experimentation with the MCSL-birds implementation has been performed as follows: Two House Sparrows (one male and one female) were captured using mist-nets near the University of Ioannina campus (39°37'N, 20°50'E). Both birds were kept on a natural photoperiod with food (a mix of seeds and dried insects) and water provided ad libitum for three consecutive days. Sensors were mounted on the top of 50 x 30 x 30 cm cages lined with a cotton cloth to avoid visual contact between individuals (Fig. 5). Activity data were collected for three days, stored in an SD card, and downloaded as comma delimited text files (.csv). Data were then imported in R 4.0.5 (R Core Team 2022) for subsequent analysis. Figure 5: Birds cages lined with cotton cloth 392 An actogram (see Figure 6) was produced to visualize each individual's activity within a 24-hour cycle. Mean hourly activity data for each sparrow during the course of three days were also produced (see Figure 6). Activity patterns were consistent with the avian circadian clock. Both individuals showed high activity levels during the early morning, followed by a midday drop-in activity and a subsequent peak during the evening hours. These results confirm that the monitoring system collected movement data accurately and can subsequently be used for full-scale data collection in research projects. By acquiring high-quality data regarding migratory disposition, we could associate the duration of migration stopovers with gene expression levels regarding metabolic, physiological, and behavioral processes. Such data could be further used to model the migratory birds' response to climate change scenarios regarding fuel deposition, flight range, and the possible mismatch of important stopover sites in the Mediterranean [14]. Figure 6: MCSL-Birds system validation. Actogram for the visualization of birds' activity 4. Conclusions and Future Work This paper presents a new low-cost and low-power system for the process of data-logging migration birds' activity during the seasonal migration periods. The proposed system includes a data-logging end- node device and a mobile phone data management application. It is an autonomous, low-power, low- cost system that can continuously track birds' activity. The authors' preliminary experimentation of their proposition has shown that the system can accurately capture bird activity time in cages. As part of their proof-of-concept quality assurance, the authors set as future work further testing of their proposition as well as the inclusion of the system setting of end-device parameters to a separate activity in their mobile phone implementation rather than over the serial interface. The authors also set as an important future work the ability and experimentation with their end-node device to detect bird activity close to the birds' nests and in their natural environment gathering points. 393 5. Acknowledgements This work is part of ROUTES research project, supported by the Hellenic Foundation for Research and Innovation (H.F.R.I.) under the "2nd Call for H.F.R.I. Research Projects to support Post-Doctoral Researchers" (Project Number: 805). 6. References [1] P. Berthold, Bird migration: a general survey, Oxford University Press on Demand, 2001. [2] K. V. Rosenberg, A. M. Dokter, P. J. Blancher, J. R. Sauer, A. C. Smith, P. A. Smith, J. C. Stanton, A. Panjabi, L. Helft, M. Parr, Decline of the North American avifauna, Science, 366(6461), pp. 120–124, 2019. [3] V. M. Cassone. Avian circadian organization: a chorus of clocks, Frontiers in neuroendocrinology, 35(1), pp. 76–88, 2014. [4] P. Berthold, Control of bird migration, Springer Science & Business Media, 1996, ISBN: 0412363801. [5] E. Gwinner, Circadian and circannual programmes in avian migration, The Journal of Experimental Biology, 199(1), pp. 39–48, 1996. [6] L. A. Brown, G. T. Banks, N. Horner, S. L. Wilcox, P. M. Nolan, and Stuart N Peirson, Simultaneous assessment of circadian rhythms and sleep in mice using passive infrared sensors: A user's guide, Current Protocols in Mouse Biology, 10(3), pp. 81-87, 2020. [7] B. A. Matikainen-Ankney, M. Garmendia-Cedillos, M. Ali, J. Krynitsky, G. Salem, N. L. Miyazaki, T. Pohida, A. V. Kravitz, Rodent activity detector (RAD), an open-source device for measuring activity in rodent home cages, Eneuro, 6(4), 2019. doi: https://doi.org/10.1523/ENEURO.0160-19.2019. A. Pogány, J. Heszberger, Z. Szurovecz, E. Vincze, T. Szekely, An infrared motion detector system for lossless real-time monitoring of animal preference tests, Acta Biologica Hungarica, 65(4), pp. 385–395, 2014. [8] P. G. Story and B. Walker, A low-cost, do-it-yourself data-logging system to record animal activity in laboratory and small-enclosure experiments, Australian Mammalogy, 39(2), pp. 152–160, 2016. [9] R. Terry, L. E. Ramirez, C. Carrera, A. Kimmitt, K. Delmore, A. Goulart, A Zugunruhe data collection system using passive infrared sensors, Pursue: Undergraduate Research Journal, 4(1), 2021. [10] P. S. Beri, P. A. Dawande, R. A. Eksambekar, R. A. Gokhale, S. S. Sonawani, Migratory birds tracking system using RF as communication medium and android mobile base station, International Journal on Recent and Innovation Trends in Computing and Communication, 4(5), pp. 543–545, 2016. [11] D. R. Norris, P. P. Marra, Seasonal interactions, habitat quality, and population dynamics in migratory birds, The Condor, 109(3), pp. 535–547, 2007. [12] E. Mackensen, M. Lai, T. M. Wendt, Bluetooth Low Energy (BLE) based wireless sensors, SENSORS, pp. 1–4, IEEE, 2012. doi:10.1109/ICSENS.2012.6411303. [13] R Core Team et al., R: A language and environment for statistical computing, 2013, https://www.r- project.org/. [14] C. Barboutis, E. Navarrete, G. Karris, S. Xirouchakis, T. Fransson, A. Bounas, Arriving depleted after crossing of the Mediterranean: obligatory stopover patterns underline the importance of Mediterranean islands for migrating birds, Animal Migration, 9(1), pp. 27-37, 2022. doi: https://doi.org/10.1515/ami-2022-0117. 394