Raspberry Pi nest cameras: An affordable tool for remote behavioral and conservation monitoring of bird nests

Abstract Bespoke (custom‐built) Raspberry Pi cameras are increasingly popular research tools in the fields of behavioral ecology and conservation, because of their comparative flexibility in programmable settings, ability to be paired with other sensors, and because they are typically cheaper than commercially built models. Here, we describe a novel, Raspberry Pi‐based camera system that is fully portable and yet weatherproof—especially to humidity and salt spray. The camera was paired with a passive infrared sensor, to create a movement‐triggered camera capable of recording videos over a 24‐hr period. We describe an example deployment involving “retro‐fitting” these cameras into artificial nest boxes on Praia Islet, Azores archipelago, Portugal, to monitor the behaviors and interspecific interactions of two sympatric species of storm‐petrel (Monteiro's storm‐petrel Hydrobates monteiroi and Madeiran storm‐petrel Hydrobates castro) during their respective breeding seasons. Of the 138 deployments, 70% of all deployments were deemed to be “Successful” (Successful was defined as continuous footage being recorded for more than one hour without an interruption), which equated to 87% of the individual 30‐s videos. The bespoke cameras proved to be easily portable between 54 different nests and reasonably weatherproof (~14% of deployments classed as “Partial” or “Failure” deployments were specifically due to the weather/humidity), and we make further trouble‐shooting suggestions to mitigate additional weather‐related failures. Here, we have shown that this system is fully portable and capable of coping with salt spray and humidity, and consequently, the camera‐build methods and scripts could be applied easily to many different species that also utilize cavities, burrows, and artificial nests, and can potentially be adapted for other wildlife monitoring situations to provide novel insights into species‐specific daily cycles of behaviors and interspecies interactions.


| INTRODUC TI ON
The use of photography and video systems to remotely monitor wildlife has become increasingly popular (see reviews : Cutler & Swann, 1999;Edney & Wood, 2020;Hereward et al., Under review;Swann et al., 2004;Trolliet et al., 2014). This is because remote-monitoring cameras can greatly reduce the time and effort required to collect observational field data and are typically less invasive than direct observation by researchers in the field (Cutler & Swann, 1999;Trolliet et al., 2014). However, designing, implementing, and maintaining camera systems can require technical expertise; the presence of the camera can potentially affect an animal's behavior; and the type of data collected can be limited (Caravaggi et al., 2020;Cutler & Swann, 1999;Reif & Tornberg, 2006;Trolliet et al., 2014). Nevertheless, infrared-sensitive, movement-triggered video cameras now enable greater flexibility than earlier designs in remote surveillance of wildlife (Scheibe et al., 2008), and videomonitoring has increasingly been used to aid population monitoring and to examine behavioral and ecological interactions (Meek et al., 2014;Trolliet et al., 2014).
Commercially built systems are typically easier to use, with little setup time or knowledge of the system required (Cox et al., 2012;Hereward et al., Under review;Meek & Pittet, 2012). However, their deployment settings are typically less flexible, specifically in the length of time cameras can be left during deployments due to limited battery life and image/footage storage capabilities, and due to the limited programmable settings available (Cox et al., 2012;Prinz et al., 2016;Reif & Tornberg, 2006). By contrast, simple programmable computers, or circuit boards, such as Raspberry Pi (www.raspb errypi.org) or Arduino (www.ardui no.cc), have been increasingly used by researchers (Hereward et al., Under review). These technologies have allowed greater scope for the development of purposebuilt cameras and for addressing specific research questions (Allan et al., 2018;Greenville & Emery, 2016;Johnston & Cox, 2017;Jolles, 2021). The increasing popularity of these bespoke units is not only driven by their comparative flexibility in programmable settings, but also by the reduced costs and by the cameras being combined with other sensors, for example, temperature loggers (McBride & Courter, 2019). Do-it-yourself, self-assembly cameras can be produced more cheaply than commercially available models; for example, Cox et al. (2012) calculated that their bespoke system ("System One") costs ~33% less than a comparable prebuilt unit. However, it is important to note that these bespoke cameras require additional expertise and time to design, setup, and troubleshoot (Cox et al., 2012;Hereward et al., Under review).
Some of these papers specifically describe the building methods of the camera setup, where the costs ranged from ~$85 USD (Youngblood, 2020) to ~1,000€ (Zárybnická et al., 2016). A range of different power sources were used: (a) mains power or large batteries (60 Ah 12 V battery), occasionally attached to solar panels, providing power lasting 6.5-7 days (Nazir, Newey, et al., 2017;Prinz et al., 2016;Zárybnická et al., 2016); (b) smaller powerpacks of 10,000-20,000 mAh often attached to solar panels lasting 4-7 days (McBride & Courter, 2019;Youngblood, 2020); and (c) D-cell batteries in series, creating 70,000 mAh, which lasted at least 14 days (Mouy et al., 2020). For storing the recorded image/video files, various designs coded the Raspberry Pi to upload the files from the SD card to "the cloud", thus avoiding the need to remove the SD card periodically and reducing the likelihood of the SD card becoming full (Alarcón-Nieto et al., 2018;McBride & Courter, 2019;Prinz et al., 2016;Youngblood, 2020;Zárybnická et al., 2016). However, Mouy et al. (2020) were not able to connect their system to a network during deployment and so found that their SD card capacity (200 GB) became the limiting factor for storage over the 8-14 days that their devices were deployed, recording a maximum of 212 hr.
However, Mouy et al. (2020) found that during trials, using USB storage rather than SD storage used more energy, therefore reducing battery life. USB storage was also less reliable, due to having a more fragile connection, for example, vibrations from the boat disrupting the connection prior to deployment (Mouy et al., 2020). In comparison, Kallmyer et al. (2019) successfully used a 32 GB USB for data storage. Regarding cameras, only Youngblood (2020) did not use a camera, but instead paired passive integrated transponders on the birds, with a radiofrequency identification reader at the feeders.
There are a few published papers that detail the build of cameras to monitor cavity-nesting species, using Raspberry Pi (Kalhor et al., 2019;Kallmyer et al., 2019;Prinz et al., 2016) or using a Linux FTP server control board (Zárybnická et al., 2016), including specifically for birds (Prinz et al., 2016;Zárybnická et al., 2016). All of these are designed so that the camera(s) (and additional modules) are embedded within-and become a part of-the nest box design. This is useful because the same nest box can be monitored over a long period. However, this is also restrictive in cases where the focal animals do not end up using the specific nest box, as happened for Prinz et al. (2016) due to changes in group composition. It also reduces the number of different nests monitored, compared to having the possibility of moving a camera system between nest boxes, which would allow greater insight into a wider number of nests/individuals across each breeding season.
Deploying cameras in extreme environments is technologically challenging due to the impact these conditions have on the perfor- where not only does the case need to be watertight but also needs to cope with salt water and high water pressure (Greene et al., 2020;Mouy et al., 2020;Phillips et al., 2019).
For terrestrial systems, some camera systems would be completely exposed to rain, humidity and salt spray (if near the coast), and so mitigation has typically taken the form of water-resistant/ waterproof casings, for example, using a Peli case (pelip roduc ts.co. uk) (Youngblood, 2020) or similar casing (e.g., Camacho et al., 2017; McBride & Courter, 2019), or a double box with drainage holes in the outer box . However, other systems have been partially enclosed (e.g., a waterproof junction box; Prinz et al., 2016) due to being within a cavity/box and so less mitigation was deemed necessary, or not encased due to being fully enclosed within the nest box (e.g., Kalhor et al., 2019;Zárybnická et al., 2016). Nevertheless, despite the weather proofing of these terrestrial systems, humidity leading to condensation or frost on the camera lens still occurred with little additional mitigation suggested, other than removing or replacing the equipment (Camacho et al., 2017;Kalhor et al., 2019;Kallmyer et al., 2019), and including silica gel packets within the weatherproof casing during deployment (Youngblood, 2020).
Here, we describe a novel camera system that is fully portable and yet weatherproof, which was developed to study the behavior of two sibling species of sympatric, nocturnal, cavity-nesting stormpetrels (Hydrobatidae) that breed on Praia Islet, an isolated, uninhabited, volcanic islet (~12 ha) in the Azores archipelago, Portugal (Bolton et al., 2004;Long et al., in press). While there are now various bespoke camera models described in the scientific literature, few combine mitigation strategies for both salt spray and humidity alongside the need for easy access and full portability between nests throughout a single breeding season. Consequently, these unique circumstances presented by our study system required the development of a novel method of deployment. This included a bespoke camera and housing design to be fully portable between the 150 previously deployed artificial nest boxes on Praia Islet. These nest boxes were initially deployed in 2000, to provide additional breeding sites for two storm-petrel species: the Monteiro's storm-petrel Hydrobates monteiroi breeding in the "hot" season (April-September), and the Madeiran storm-petrel Hydrobates castro breeding in the "cool" season (September-March) (Bolton et al., 2004(Bolton et al., , 2008Bried et al., 2009). The camera system was required to record behaviors and interspecific interactions in these artificial nests over successive 24-hr periods, on an isolated islet with no mains power supply, where it is difficult to bring in bulky equipment, and where the equipment would frequently be exposed to conditions of salt-laden spray and high humidity. Here, we detail how this system can be deployed effectively in these circumstances (see appendices materials for full build details).

| MATERIAL S AND ME THODS
We used a Raspberry Pi Zero circuit board, programmed using  Table A1; deployment data and Python scripts archived with Dryad; Hereward et al., 2022). of the nest box, and (c) whether the lid of the box was at an appropriate height above the nest (so that the footage captured would be in focus at a vertical distance of ≥15 cm). One camera per nest was deployed opportunistically across the subset of appropriate nests (n = 54) for 24 hr at a time, across the successive breeding seasons. During each 24-hr deployment, at least two cameras were deployed in different nests. Each camera was removed after the 24-hr period, the footage downloaded, and then, each camera was opportunistically re-deployed at another nest of suitable breeding stage. The frequency of redeployments was dependent on the available (solar) power to charge the powerpacks.

| Field deployment example
In this paper, we present the technical outcomes, using a table of definitions, to define whether each of the deployments was a Failure, Partial failure (nonusable), Partial failure (usable), or a Success (Table A2), and we detail causes of-and solutions to-any failures.
Alongside these technical outcomes, we were able to successfully record and classify behaviors on the nest during the chick-rearing period, alongside interspecific interactions, where it was possible to identify other species entering the nest cavity. Details of these behaviors and interspecific interaction observations will be available elsewhere (H. F. R. Hereward, unpublished). Solutions to Failures and Partial failures are detailed in Table 2.

| RE SULTS
F I G U R E 1 Pictures illustrating the building of the Raspberry Pi camera described in this study. (a) Passive infrared (PIR) sensor, showing the suggested positions of the sensor settings (sensors labeled with gray arrows, minimum ("min") labeled with black arrows), the left setting =time (set at "min") and the right setting = sensitivity (set at 90° to min); (b) PIR sensor without the sensor cover, showing the pin connections: white cable = VCC, gray = OUT, black = GND (labeled with respective arrows); (c) Real Time Clock (RTC) (red board, labeled with gray arrow) already connected to the Raspberry Pi board (GPIO pins 1-10), PIR sensor cables connecting onto the Real Time Clock 5V = white cable and GND = black and on the Raspberry Pi zero board, GPIO17 (pin 11) = gray (labeled with respective arrows); (d) completely connected Real Time Clock and PIR sensor, labeling the HDMI and USB connector ports; (e-g) to connect the switch to the Raspberry Pi board using two female-female cables, first remove the black covers on the switch end of the female-female cables by lifting the black tabs (e), then remove the black covers (f), finally attach to the switch by connecting the exposed ends of the female-female cable to two of the switch ends (g); and h) final built camera ready to be deployed labeled with each part

| D ISCUSS I ON
Here, we have described and demonstrated the successful building and deployment of a bespoke camera that is small, portable, weatherproof, battery-run, and with PIR motion-trigger capabilities.
This bespoke camera, based on a Raspberry Pi microcomputer, is cheaper or similarly priced to other bespoke cameras of similar build (Prinz et al., 2016;Zárybnická et al., 2016). The poweradd Pilot X7 20,000 mAh powerpack proved to have enough capacity for a 24-to 48-hr deployment if needed (Youngblood, 2020 In comparison with previous nest box/cavity system designs (e.g., Kalhor et al., 2019;Kallmyer et al., 2019;Prinz et al., 2016;Zárybnická et al., 2016), our camera housing was independent of the nest box design and so completely portable, allowing easy transfer between nests throughout the breeding season, thus allowing us to gain insight into a wider number of individual nesting behaviors as well as avoiding missing out on recordings because individuals did not use an initially targeted nest box (as has occurred previously, e.g., Prinz et al., 2016;Zárybnická et al., 2016).
Despite the increased portability and easy access to download the data, the need to frequently open up the camera housing in-  (Youngblood, 2020). Consequently, some additional waterproofing is suggested alongside the further housing adjustments summarized in Table 2, to aid in reducing these specific failures in future. These mitigations include placing the camera in a box of silica gel between deployments, to reduce the humidity around the components, prior to re-deployment. The calculated percentage success rates based on the Successful, Partial (usable), Partial (nonusable), and Failure definitions could be used by researchers to estimate how many total successful deployments will be needed to achieve a target sample size.
The present study provides a template for building and program- Company.

CO N FLI C T O F I NTE R E S T
We declare we have no conflict of interests.

This article has been awarded Open Data and Open Materials
Badges. All materials and data are publicly accessible via the Open Science Framework at https://doi.org/10.5061/dryad.9w0vt 4bfb. Cork board -25 cm diameter round, 1 cm thick 1 £7.00

DATA AVA I L A B I L I T Y S TAT E M E N T
Cork board -22 cm diameter round, 0.6 cm thick 1 £2.00 Garden wire diameter ~1.2 mm (small amount needed from large reel) 1 £6.00 Silica gel (1 g packet) 1 £0.08 Total for housing £22.58 Total for the camera + housing £109.27 Overall total £218.59 Note: Prices given in GBP £.

List of parts required to build each camera
The following parts are required to build each camera. Each camera cost a total of ~£86 GBP (~$115 USD) to build. Each numbered part is referred to within the build instructions below: • Part 1: Dual USB flash drive, Mini USB to USB-3.0. We used a SANDISK Ultra (64 GB), which has a mini-USB connector on one end of the USB and a USB-3.0 connector on the other end. This is where the recorded video files were stored. In this study, we used a USB to store video files and found this to be highly successful

Failure
Where only 0-2 videos recorded Partial failure (nonusable) When more than two videos were recorded but in total less than 1 hr was recorded Partial failure (usable) When there was an unexpected interruption in the footage but there was more than 1 hr of footage recorded (e.g., caused by loss of battery power, technical faults, or a break in footage despite movement still occurring in the nest due to an adult or chick being present)

Success
Continuous footage with no known interruptions (allowing for anticipated breaks between footage when no movement was detected)  (Figure 2a-d). This method assumed that a change in infrared detection would indicate that motion of an animal had occurred within the field of view.

TA B L E A 3
• Part 7: Off clicker + 2 female-female cables. To allow for correct shutting down of the Pi Zero board in the field, a "shutdown" script was written (see "shutdown.py"). On the switch end of the female-female cables, the black covers were removed for easier attachment of the switch (Figure 1e-g).
• Part 8: Heat sink. One heat sink was added to each Raspberry Pi Zero board, to reduce the risk of overheating.
• Blue tac (Bostik) and glue (such as PVC pipe adhesive) were used to seal the gaps in the drilled holes where necessary, reducing the likelihood of water entry, and at least one 1-g silica gel sachet was also placed inside each of the sealed boxes to help reduce humidity around the equipment.

Camera mounts
To mount the cameras on top of the nest rim, but underneath the lid, we cut a hole from the center of a round cork board (25 cm diameter, 1 cm thick) into which the waterproof camera box base slotted. We then attached (using thin garden wire) an additional thinner cork board square (cut from a 22-cm-diameter, 0.6-cm-thick cork board) with camera, IR LED and PIR sensor holes to support these ( Figure 2a-d). The equipment housing and camera mounts cost an additional ~£23 GBP (~$31 USD) per camera.

Program scripts and associated files
Five python files can be found in the archived data repository (Hereward et al., 2022). Two are python scripts that were used to run the camera and shutdown option ("nestcam.py" and "shutdown.py").
The other three files are details of the command lines to be used in the Raspberry Pi "terminal," which assist in the camera setup described below ("script for RaspPi terminal_RTC.py,""script for RaspPi terminal_runonboot.py," "script for RaspPi terminal_usb.py").
Step-by-step instructions for building the camera Using the parts described above, and each of the scripts provided, we suggest setting up the camera in this order: 1. Before beginning to build the camera, plug the uniquely labeled USB (Part 1) into a computer and copy the five python files (see archived data repository) onto the USB. Note that in any future connections of the USB to the computer it will suggest "fixing a bug problem"-do not select this option as it will reformat the USB.

Install onto the microSD card (Part 2) the Raspberry Pi Operating
System, which is downloadable (with installation instructions) from: www.raspb errypi.org/downl oads/raspb ian/ (if you have bought a NOOBS microSD then the system is pre-installed so you can skip this step).
3. Insert the microSD card (Part 2) into the Pi Zero board (Part 3) and connect the Pimoroni Three Port USB Hub to the Pi Zero "USB" port. Connected to this three-port hub should be the USB (Part 1), keyboard and mouse. Then connect the screen using the HDMI cable with mini-HDMI adapter.
4. Once the above items have been connected, only then connect the power source for the screen and Pi Zero board, using USB cables to mains power or USB cables to powerpacks.
5. Configure the SD card by following these dropdown menus: pi → Preferences → Rasp.pi configuration -interfaces -en-able…. Enable: "camera," "SSH," and "I2C." 6. In the folder window, find the Pi folder (home → Pi) and create two folders, "scripts" and "usb" (this creates folders on the microSD card-note the use of all lowercase letters in folder names).
7. From the USB, copy over the scripts into the new "scripts" folder.
8. At this point, the USB is recognized in the folder: home → media → USB, but the next step is to "mount" the USB so that the USB is always given the same name/location and so that the data can be written to this location (each USB has a unique code hence the importance of labeling each USB so it remains with the same Pi Zero board after "mounting" it). Here, we set the new USB folder in: home → Pi → usb -this is the folder where the USB will then always open. To do this, follow the stepby-step guide in the "script for RaspPi terminal_usb.py." 9. Once these steps are completed, the rest of the camera can be built up on the Raspberry Pi board following these steps: a. Turn off the board (Pi → shutdown).
b. Add the camera (Part 4) to the Camera Serial Interface port on the Raspberry Pi board.
c. The Real Time Clock (RTC; Part 5) is then placed on the GPIO pins 1-10 (GPIO pins are numbered starting from pin 1 at the SD card end).
d. The pre-assembled PIR sensor (Part 6) is then added to the additional pins on the Real Time Clock using three female-female cables. The PIR sensor "VCC" pin is connected to the Real Time Clock "5V" pin and then the two "GND" pins are connected together. Finally, "OUT" on the PIR sensor is connected to GPIO17 (pin 11) on the Pi Zero board (Figure 1a-d). The sensor settings (time and sensitivity) are then altered using the settings; Time = min, sensitivity = 90° to min (Figure 1a). e. The "Off" switch (Part 7) is added to pins 39 (GND) & 40 (GPIO 21) (i.e., the end GPIO pins) using two female-female cables (Figure 1e-g).
f. Add the Heat sink (Part 8); remove the peel-offsticker and place onto the chip on the Raspberry Pi board (Part 3).
g. Then reconnect the power via the USB connector cable.
10. Next, configure the Real Time Clock to run on the correct time and date. To do this, follow the step-by-step guide in the "script for RaspPi terminal_RTC.py." 11. Before configuring the terminal so that the scripts run on boot (i.e., run automatically when power is connected), it is useful to check that the camera script is working. Open Pi → Programming → Python 3 (IDLE) → file → open → scripts → "nestcam.py" and press F5 to run the script. Pressing "shift and F6" stops the script running. You will notice that the "nestcam.py" is scripted to print the word "idle" when the camera is off and "recording" when the camera is recording. This is displayed on the python shell output screen, and aids in testing the camera before deployment.
12. Once you have checked that the camera is working correctly, add the "nestcam.py" and "shutdown.py" scripts to the "bootup" so that they will run when it is connected to power; see the stepby-step guide in the "script for RaspPi terminal_runonboot.py." 13. When all of the components are assembled ( Figure 1h) and configured, the camera is ready to deploy in the field. Disconnect the HDMI cable + mini-HDMI adapter, Pimoroni Three Port USB Hub (with keyboard and mouse) and connect the USB (Part 1) directly to the "USB" port on the Raspberry Pi board (Part 3).
14. Prior to deployment the camera needs to be fitted into the weatherproof housing as described above.
15. Finally, when ready to turn the camera on, connect a Mini USB 3.0 USB connector cable (Part 9) to the "power in" port on the Raspberry Pi board (Part 3) and the powerpack (Part 9).