Rodent Activity Detector (RAD), an Open Source Device for Measuring Activity in Rodent Home Cages

Visual Abstract


Introduction
Physical activity is an important component of healthy lifestyles and has been linked to reductions in the risk of several major disorders including type 2 diabetes, obesity, and cardiovascular disease (Michigan et al., 2011;Roemmich et al., 2014;Silverman and Deuster, 2014;Benatti and Pedersen, 2015). Despite this link between physical activity and health, relatively little is known about how physical activity exerts its beneficial effects. Several fundamental questions remain unanswered: how much activity is needed to reduce the risk of these diseases? Do different individuals require different amounts of physical activity to experience health benefits? And how does physical activity modulate complex disease states at the circuit or molecular levels?
Rodents provide an excellent model system for gaining insight into these questions (Novak et al., 2012). However, accurately measuring physical activity levels in rodents remains a challenge. Commonly used methods fall broadly into two types: (1) specialized arenas, which track mouse activity with infrared "beam breaks" or video cameras, and (2) home-cage devices that count wheel rotations or sensor activations. The first approach is often low-throughput, as it requires expensive equipment and dedicated laboratory space. Due to these limitations, activity is often measured in short daily sessions, sampling a fraction of daily activity, often in a novel environment. The second class of home-cage methods allow for continuous full-day monitoring, using either wheels or sensors. The presence of a running wheel is not always ideal as the wheel itself alters activity patterns and induces mice to move more , which may confound other factors that affect activity (Copes et al., 2015;de Carvalho et al., 2016;O'Neal et al., 2017). Other groups have used passive infrared (PIR) sensors (Tamborini et al., 1989;Brown et al. (2016), capacitive sensors (Giles et al., 2018;Iannello, 2019;Pernold et al., 2019), and microwave based activity monitors (Pasquali et al., 2006;Genewsky et al., 2017) to measure home-cage activity. Here, we aimed to complement and enhance these existing meth-

Significance Statement
Physical activity is an important determinant of human health, which reduces the risk of cardiovascular, metabolic and neurologic disorders. Better methods for tracking physical activity in research studies may lead to insights that improve physical activity levels in people. To this end, we designed and built an inexpensive device to continuously track home-cage activity levels in rodents. Our device, rodent activity detector (RAD), allows for high-throughput activity monitoring with minimal investigator intervention, presenting an economical and efficient option for investigating physical activity levels in research studies. ods by designing an easy to build, cost-effective, and open-source device. An ideal solution for measuring physical activity would be home-cage compatible, collect activity data continuously with no human intervention, and be scalable to large installations of cages. In line with these requirements, we present a simple PIR-based activity logger, the rodent activity detector (RAD). The low cost and simple design of the RAD renders it ideal for activity monitoring in high-throughput experiments and multi-site studies. We make our device design files and code freely available to the research community to build, use, and improve.

Animals
A total of 47 adult male mice (C57Bl/6 background) were singly housed in murine vivarium caging (Allentown NextGen caging) in a 12/12 h light/dark cycle at room temperature. Mice were given ad libitum access to standard chow (5001 Rodents Diet; LabDiet) and water unless otherwise noted, and cages were changed every two weeks. All animal procedures were performed in accordance with the National Institute of Diabetes and Digestive and Kidney Diseases/National Institutes of Health animal care committee's regulations.

Device design
Our method relies on small, low-cost, PIR sensors, which are battery powered and run for weeks in a home-cage setting. The device cost is significantly less expensive than commercial solutions, costing ϳ$85 to build each device (Table 1). These devices can be built with minimal electronics or coding experience, fit in traditional vivarium caging ( Fig. 1) allowing for high throughput experiments without requiring additional laboratory space, and track home-cage activity levels without the use of a running wheel. PIR sensors have several inherent characteristics that make them ideal for this application. They are very low power, capture data at a low rate that facilitates long-term collection, and they do not detect movement outside of the plastic walls of the cage, so they are not triggered by movement in other cages.
RAD comprises several inexpensive components (Table 2). We modified a PIR sensor (MSP430-PIR, Olimex) to connect the output to a digital input on a microprocessor equipped with a microSD card logger (M0 AdaLogger, Adafruit #2796) and oLED screen for displaying data (Feather-Wing, AdaFruit #2900; Fig. 1B-D; Arduino code for the device is included as a supplement and available online at https://hackaday.io/project/160742homecage-activity-monitoring-with-pirs). We chose this PIR sensor for its low power consumption, but many other PIR sensors will work as drop in replacements in our design. We powered the device with a 6600 mAh battery (Adafruit #353), which was calculated to last 18 d, and empirically tested to last at least 14 d. If sleep modes are used and optimized on the microprocessor, we estimate the battery life could be extended to several weeks or months. Additionally, the RAD can be wall powered with a microUSB cable for uninterrupted use, if the caging is compatible with such a cable. We printed and assembled 40 RAD devices, and mounted them in rodent home cages for continuous, high-throughput activity monitoring (Fig. 1D).

Build instructions
RAD device fabrication, assembly, and programming are outlined at https://hackaday.io/project/160742homecageactivity-monitoring-with-pirs. All design files necessary to complete this build (including electronic layout/soldering instructions, Arduino code, and 3D printing design files) are included as supplementary files and also located at https:// hackaday.io/project/160742homecage-activity-monitoringwith-pirs. In brief, download and install Arduino IDE (https:// www.arduino.cc/en/Main/Software), as well as support for the Adalogger board (https://learn.adafruit.com/adafruitfeather-m0-adalogger?viewϭall). Install the relevant libraries (Adafruit_SSD1306.h, Wire.h, RTCZero.h, SPI.h, SdFat.h, Adafruit_GFX.h). Download the PIR device sketch (PIR-Counter-091218.zip, https://hackaday.io/project/160742 homecage-activity-monitoring-with-pirs). Download and print the PIR housing 3D STL file (PIR monitor housing, https://hackaday.io/project/160742homecage-activitymonitoring-with-pirs). Install male headers on the oLED shield and female headers on the Adalogger M0 board. Solder wires to the PIR sensor signal, ground, and 3V power connections. Solder these wires to the corresponding power and ground connections on the oLED shield, and signal wire to the A1 input on the Adalogger (Fig. 1B). Plug the oLED into the Adalogger, and attach the battery. Flash the RTC setting code and the PIR counter device code to the Adalogger (https://hackaday.io/project/160742homecage-activitymonitoring-with-pirs). Assemble the RAD electronics into the RAD housing (Fig. 1C). Secure the RAD device on top of the food hopper. This specific device housing was designed to be compatible with Allentown NextGen wire racks but can be modified for compatibility with other caging.

Method of sensing
PIR sensors detect when warm moving objects (such as an animal) cross its sensing zone. Importantly, PIR sensors do not detect activity through glass or plastic, making them an ideal sensor for this application as they are not triggered by activity in neighboring cages. By mapping the area of activation using an infrared LED, we determined that in Allentown NextGen wire rack home cages with RAD placed above the wire rack, RAD tracks activity in ϳ30% of the cage surface area (Fig. 1E).

Operation instructions
To start logging activity data, press the "A" button on the oLED shield. To update the time and date, press the "B" button. Once started, RAD will count the number of PIR "active bouts," as well as the total duration the sensor is active each minute. The RAD ends each "activity bout" after 2 s with no activity detected from the sensor. The total active duration, as well as the number of activity bouts, are recorded on an internal microSD card at a frequency of once per minute. These variables and logging frequency can be modified in the Arduino sketch.

Data analysis
RAD logs data in CSV files stored on a microSD card (Table 3). Data are logged once per minute and include a timestamp, time-elapsed timestamp, device name, a cumulative measure of how many active bouts were recorded per minute (PIRCount), a cumulative measure of the duration of those active bouts per minute (PIRDuration), and battery voltage. Example data shown in Table 3. At the end of the study, the SD card can be removed and the CSV files can be opened to view the data. We also provide Python analysis scripts that may be helpful for visualizing data (available as a supplement and at https://hackaday.io/project/ 160742homecage-activity-monitoring-with-pirs). These scripts are not necessary, as any graphing program can be used to visualize and analyze the data.

Statistical analysis
Statistical tests were performed using the StatsModels python module. Two-way ANOVAs were used to compare group means over time (Fig. 4); p Ͼ 0.05 was considered statistically significant.

Code accessibility
The code/software described in the paper is freely available online at https://hackaday.io/project/160742 homecage-activity-monitoring-with-pirs. The code is available as Extended Data 1.

Device validation with video monitoring
To quantify how the RAD output correlated with rodent activity, we recorded simultaneous video and PIR sensor data from four mice using an overhead camera over 24 h (Noldus Phenotyper; Fig. 2A). We processed the video with a commercial motion tracking software (Ethovision XT13, Noldus), and calculated velocity in 1-min bins (Fig.  2B). Coefficient of determination (R 2 ) was calculated for a linear regression between speed in each time bin and length of time the PIR was active in that same bin. The PIR data correlated strongly with speed (R 2 ϭ 0.87, Fig. 2B). We explored changing the bin-width parameter and found that the coefficient of determination dropped off with shorter bin widths (30 s: R 2 ϭ 0.84, 10 s: R 2 ϭ 0.67, 1 s: R 2 ϭ 0.33). Thus, we conclude that the PIR sensor in the RAD is useful for quantifying changes in activity that occur across minutes, but not second-by-second changes. Based on this validation result we set the default data logging frequency of the RAD to once per minute, but this parameter can be adjusted in the code.
To test whether RAD output correlates well with locomotion when used in a smaller home-cage setting, we recorded movement by positioning a video camera below the transparent plastic home cage (Allentown), and placing RAD either above the home-cage food hopper (Fig.  2C) or to the side of the cage wall (Fig. 2E). Recordings were conducted for 45-60 min and data were binned into 1-min bins (n ϭ 3 mice). RAD activity correlated well with velocity moved for both top-mounted (R 2 ϭ 0.66; Fig. 2D) and side-mounted (R 2 ϭ 0.74; Fig 2F) configurations. For both RAD locations, these correlations reveal that activity was only detected by RAD when the mouse was in locomotion above 1 cm/sec. It is important to note that the sensing mechanism of RAD (PIR sensing) requires "line of sight" to the mouse, so for side-mounting RAD must be placed in the cage itself, or the caging modified if attached to the outside. If placed in the cage, the device should be protected with an enclosed housing or barrier to avoid mice chewing on the exposed electronics. To explicitly evaluate which behaviors the RAD detects, we used a behavioral classifier (Ethovision, Noldus) to score the Phenotyper videos for walking, resting, grooming, rearing, sniffing, and digging. In this analysis, "walking" correlated well with how long the PIR was active (R 2 ϭ 0.61), while R 2 for all other behaviors were poorly correlated (R 2 Ͻ 0.2). We conclude that the PIR detects locomotion from place to place, but not slow speed or "in place" actions such as grooming and digging.

High-throughput longitudinal monitoring of rodent physical activity in home cages
To evaluate the use of the RAD in a high-throughput application, we built and positioned 40 RADs in mouse home cages for 8 d of data collection (Fig. 3). We observed the expected circadian rhythms in the activity records, wherein the RAD motion detection increased during the dark cycle and dropped during the light cycle ( Fig. 3A-C). We also calculated a circadian index for each  mouse and noted a large amount of heterogeneity among mice (Fig. 3D). We conclude that the PIR device can detect individual differences among mice and may be useful for studying circadian biology, with the caveat that behavioral detection is limited to periods of active wake and locomotion.

RAD detects high-fat diet (HFD)-induced decreases in activity
To ask whether the data collected using RAD can reveal phenotypic differences between pathologic states, we tracked the activity data of 20 mice fed different diets. Ten mice were given ad libitum HFD, which leads to an increase in body weight and a decrease in activity levels . Over nine weeks of HFD exposure, mice gained weight relative to chow controls (Fig. 4A,B), which corresponded to a ϳ35% reduction in home-cage activity levels as measured by RAD (Fig. 4C,D). This demonstrates that RAD is capable of detecting and quantifying within-mouse changes in activity levels over time.

Discussion
Here, we present a PIR-based device, RAD, which can be used to monitor activity in rodent home cages. To investigate its utility, we completed three sets of validation experiments. In the first dataset, we used simultaneous video monitoring and determined that the PIR is useful for measuring changes in locomotion over minutes, but not on a second-by-second time-scale. In our second dataset, we measured continuous activity data from 40 cages for 8 d without any investigator interference, demonstrating its utility in circadian monitoring. In our third experiment, data collection was completed over nine weeks to track the activity levels of mice fed either a HFD diet or a control diet. Apart from battery replacement every two to three weeks and changing food and water weekly, this experiment was also accomplished with no experimenter intervention. These experiments demonstrate the utility of a simple PIR-based logging device, RAD, in high-throughput studies of rodent activity. We have released this device as open-source, and have made all code and design files available as supplements to this paper, and online.

Comparison with current technologies
Commercial solutions have started emerging for monitoring home-cage activity (Iannello, 2019). While technically excellent, these devices require specialized equipment and caging and thus may not be feasible for many research labs. We aimed to create an open-source, cost-effective activity monitor that could be placed in existing home cages and not require a large equipment expense.
Other open source methods to track rodent activity have also previously been used for arena-based settings (Gibbs and Crosbie-Watson, 2017;Kumbol et al., 2018) and home-cage monitoring (Brown et al., 2016;Ge-newsky et al., 2017). Kumbol et al. (2018) built a device comparable in cost to RAD that can be assembled in a lab and used to monitor rodent movement via an array of infrared beams. Other cost-effective open-source methods have employed video tracking to track activity in an arena (Lopes et al., 2015;Gibbs and Crosbie-Watson, 2017). Home-cage monitoring methods have used microwaves (Genewsky et al., 2017), or PIR sensors (Brown et al., 2016). Brown et al. (2016) used PIR sensors that are similar to those used in RAD to construct a device for tracking mouse movement in home cages. Genewsky et al. (2017) used a different sensing technology, microwave radiation, and published a device that utilizes straightforward circuitry, simple assembly, and inexpensive components to monitor mouse home-cage activity. RAD complements these prior devices and offers a simple battery powered home-cage activity monitor that is optimized for high-throughput experiments with minimal human intervention.

Device limitations
While RAD is useful for tracking rodent activity, it has limitations and may not be ideal for all applications. One limitation of the RAD is the power source. The battery pack must be charged every two to three weeks, which could limit use of the RAD for long-term monitoring. We envision two potential solutions for this issue. First, our design was optimized for ease of construction, and not for low power consumption. In future revisions, we may be able to optimize the hardware and microcontroller code to reduce power usage. Based on the use of PIRs in consumer-grade home security products, we believe that a battery life of one year for such a device is feasible. In addition, RAD can be powered indefinitely by cable, eliminating the need for a battery. While this introduces the additional challenge of cable management, in certain installations this may be preferred over changing batteries.
An additional limitation lies in the use of a PIR sensor instead of a camera, although we have demonstrated here that such sensors reliably report a proxy of ambulatory activity, they cannot provide information about other rodent movements, such as rearing or grooming. Therefore, PIR sensors are not well suited to detecting and monitoring behavior other than locomotion. Small movements of the front or hind limbs, breathing, or changes in posture are unlikely to be recorded by RAD. The smallest movements able to be reliably recorded are short bouts of locomotion where the mouse is moving at Ͼ1 cm/s. A third limitation of the device is the positioning within the cage. As we are only using one PIR sensor, the cage volume may include areas that are outside the field of view of the sensor, for instance, behind the food hopper (Fig. 1E). The PIR sensor position may be moved to reduce this possibility, for instance by positioning the sensor through a hole in the cage, or attached to a side-wall. While RAD measures only a subset of rodent activity, our validation experiments demonstrate that it correlates well with average locomotion speed. In addition, as long as the position is held consistent between devices RAD can be used for quantitative comparisons both within and between mice.
A fourth limitation is the inability of the RAD to monitor group housed animals. As the RAD cannot distinguish between animals, it is best used with singly housed rodents. This limitation also occurs with many other methods for measuring rodent activity, although recent developments in video analysis are starting to track activity of multiple mice in group housed settings (Giancardo et al., 2013;Matsumoto et al., 2013;de Chaumont et al., 2018). While promising, such methods are computationally expensive and difficult to deploy in rodent home cages, making them more suitable for smaller-scale installations in specialized arenas.
A final limitation is that the RAD device was made to be compatible with a specific cage model that is used in our animal facility (Allentown NexGen caging). It is possible that RAD may perform worse in other caging, a possibility that will need to be evaluated by other users of the device. We do not anticipate this being the case if the caging allows for adequate line-of-sight between the RAD and the mouse. While we optimized our design for this caging, we made all design files open-source so that others can modify the design to fit in their caging.

Potential future improvements
Several improvements may be made to future versions of this device. First, the device data-logging platform can be expanded to include additional sensors. For instance, temperature and humidity are vital aspects of rodent living environment, yet current standards of care usually include whole-room (or whole-vivarium) measurements. In-cage measurements of temperature and humidity would provide a far more detailed picture of the variance experienced across individual cages and could easily be added to RAD with an inexpensive (ϳ$10) modification. Similarly, additional PIR sensors could be added to reduce "blind spots" and cover more of the floor area of a cage. The open-source nature of the RAD makes such modifications relatively easy to implement.
Collecting the data with the SD cards used in our 20-cage study (Fig. 4) was time intensive and would likely preclude scalability of RAD to higher numbers of cages. This hurdle might be overcome by modifying RAD to transmit data wirelessly to a cloud server. Wireless data transfer would simplify scaling RADs to higher numbers of cages, enable real-time data viewing, and facilitate multisite studies, where RAD devices could be placed in multiple research facilities. Again, due to the open-source nature of the RAD, adding a wireless radio for data transmission is relatively easy to implement.

Conclusion
This work provides a resource for investigators studying physical activity in rodent models. The open-source availability and scalability attributes of RAD could facilitate reproducibility of studies across research centers. Continued improvement of methods for monitoring physical activity in animal models may ultimately lead to more effective interventions for increasing physical activity and improving health.