



My 7 year old son helped me put together a framework to hold the Rpi and the tiny camera in a stable position with some dew/weather covering, and to hold the small floodlight in place. Lego bricks work great for such things! Note in the photos below, the Rpi being held vertically, the Lego bricks holding the floppy little camera in place peeking out of a window opening in front, the flat tan shelf piece over the camera opening to help shield from sky glare (we used it in daylight too), and the inverted tupperware held in place by more Lego bricks for weather protection. The Rpi's USB power was supplied from an AC adapter; that and the cord to the floodlight were routed into the house and the setup looked out from a chair on the deck into the back yard.




Here's the backyard scene from the chair as taken on my iphone in daytime, and the comparable scene taken from the Rpi NIR camera later that night:


The Rpi was setup on my home wifi network, so then I logged in and set the cron table to take one picture per minute for the whole night, with hopes that in the morning we'd look through the pictures and see various nocturnal animals scrounging around the yard in the night. In Seattle here at somewhat high latitude, this time of year (summer) it doesn't get dark till 10pm and starts getting light again around 430am, so I had some daylight photos in evening and morning too. (The colors are off in those because there's no IR filter on there, and then the software putting the colors together normalizes the colors all strangely because of it.) Well I looked through every single photo from nighttime, and not a single darn animal came through there! But first thing after dawn, our neighborhood rabbit came wandering through the yard (manually circled in red below). I know we have raccoons and other critters, so next time maybe I'll set this thing up along the edge of the flowerbed which I think is more of a critter thoroughfare.



Anyway, to configure the Rpi to take the pictures with that camera was really quick and easy, using the directions in the "raspicam" online documentation:
https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md
Note the part in there about creating an executable shell script
camera.sh
to take the picture and put it in a timestamped file, and the part inhttps://www.raspberrypi.org/documentation/usage/camera/raspicam/raspitimelapse.md
about calling camera.sh from the crontab file each minute.
My goal with the pictures of critters wandering the backyard was to then use a tool like recurrent neural networks (RNNs) to track the critter(s) from the photos, and compare their paths night to night. Um, looks like I might have to revisit that goal. (I guess I could drop the IR aspect and try tracking Mr. Bunny in the mornings... but the IR capability is sure neat on that cheap tiny camera...)