PiSpy: An Affordable, Accessible, and Flexible Imaging Platform for the Automated Observation of Organismal Biology and Behavior
PiSpy has now been published at PLOS One! Check it out here!
This project is licensed under GNU General Public License v3.0
The hardware is licensed under CERN-OHL-S v2\
PiSpy by Benjamin I. Morris, Marcy J. Kittredge, Bea Casey, Owen Meng, André Maia Chagas, Matt Lamparter, Thomas Thul, Gregory M. Pask is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
This project is Open Source Hardware Association certified OSHWA UID US002095
Contents:
- Summary
- Overview of the PiSpy
- Video and time lapse image recording across various scales
- Custom setup for monitoring ant behavior
A great deal of understanding can be gleaned from direct observation of organismal growth, development, and behavior. However, direct observation can be time consuming and influence the organism through unintentional stimuli. Additionally, video capturing equipment can often be prohibitively expensive, difficult to modify to one's specific needs, and may come with unnecessary features. Here, we describe the PiSpy, a low-cost, automated video acquisition platform that uses a Raspberry Pi computer and camera to record video or images at specified time intervals or when externally triggered. All settings and controls, such as programmable light cycling, are accessible to users with no programming experience through an easy-to-use graphical user. Importantly, the entire PiSpy system can be assembled for less than $100 using laser-cut and 3D-printed components. We demonstrate the broad applications and flexibility of the PiSpy across a range of model and non-model organisms. Designs, instructions, and code can be accessed through an online repository, where a global community of PiSpy users can also contribute their own unique customizations and help grow the community of open-source research solutions.
Shown above is the base model of the PiSpy for simple image or video capture (Fig. 1a). A 3D printable holder mounts both the Raspberry Pi and PiCamera to a laser cut wooden frame, allowing for easy height adjustment (Fig. 1A-B). The stands on the frame are also reversible, and a 3D-printed ball and socket mounts the PiCamera, allowing for free rotation (Fig. 1C). Optionally, the Raspberry Pi computer can connect to input and/or output components, such as a motion sensor or lighting, respectively. This entire setup can be assembled for less than \$100, or cheaper if multiple setups are being bought at once or certain features are omitted (see Bill of Materials in GitHub. A complete user's guide and assembly manual can be found in the Supplementary Materials of the published paper and will also be continually updated on the GitHub repository (https://github.com/gpask/PiSpy). The GUI for the PiSpy, written in Python3 using the TKinter package, controls the functionality of the PiSpy. Features include capture mode, timed or input-triggered capture, light control, and camera resolution (Fig. 1D). For more advanced controls, such as changing the default image/video name and storage location or the specific camera settings, instructions are written in the user's manual for how to edit these in the code itself.Imaging of 10 D. melanogaster larval locomotion on an agar plate provided sufficient resolution for analysis with the ImageJ image processing software, as shown in the above video (sped up to 5x speed):
Video of crayfish behavior when placed in an aquarium allowed for the observation of subtle movements of the swimmerets and legs, even though the animals were underwater and being viewed through a plastic container:
Automated image capture also makes the PiSpy an effective device for capturing and visualizing organismal growth over time. Time-lapse imaging every 5 minutes (and converted to a video at 225 fps) of various beans (Phaseolus vulgaris) growing in clear planters showed detailed root and shoot growth:
At a smaller scale, imaging every 5 minutes (and converted to a video at 90 fps of the soil bacterium Bacillus mycoides captured the growth and expansion process over time:
The flexibility of the PiSpy allows it to be customized for more specific research purposes, as shown above. For example, we have used the PiSpy to monitor the social behaviors in colonies of the Indian jumping ant, Harpegnathos saltator. Because the ants are housed in nestboxes of a fixed size, we have modified the wooden frame and mount to enclose the container to allow for easy overhead recording of the colony, as shown in the image above. To maintain a light-dark cycle for the ants, we used the LED light control capabilities of the PiSpy to be able to record social behaviors throughout the day. Custom LED printed circuit boards (PCBs) can be connected to the general-purpose input output (GPIO) pin of the Raspberry Pi and allow for the cycling of white and red lighting.
The sample videos below show the ability of the PiSpy to record animal behavior in both day and night, with sufficient resolution to capture specific behaviors such as antennal dueling (asseen in the daytime recording). In our experiment, the red light is not detected by the ants but allows for both day and night imaging. Specific camera settings are used to record in each different lighting conditions to ensure the desirable imaging quality. We have programmed in default camera settings for day and night recording, but the user's manual provides instructions for how to modify these within the PiSpy code.
The GPIO pins of the Raspberry Pi can also be used to trigger image or video capture with an external sensor, such as a motion sensor or IR break beam. In our setup (below), an ant disrupts the IR beam as it walks to a foraging arena, and again when it returns to the main colony. The physical setup is shown in the image below, including the LEGO contraption to holding the break beam (right side):
A sample video in which ants return to the main colony carrying crickets is shown below:
As an alternative to automated recordings at fixed time intervals, triggered recordings such as these could be used to monitor specific activities, such as feeding patterns or other behaviors. It is our hope that users will create their own modifications of the PiSpy hardware and/or software and will share these for use by other researchers and inspire further customizations, allowing it to serve as both a general use tool and one that can be applied to highly specific experimental approaches.
Contributors to PiSpy: Benjamin I. Morris, Marcy J. Kittredge, Bea Casey, Owen Meng, André Maia Chagas, Matt Lamparter, Thomas Thul, Gregory M. Pask
For this README, all videos were converted to GIF using ezgif.com