Weasel Cam

What do you do when you find a dead rabbit outside of your office after the Christmas break? My suggestion was to build a camera trap to see if we could spot the culprit. From reports by colleagues we were looking for an opportunistic weasel that had been seen darting through the office garden.

A quick trip home for the parts and a bit of bashing together some code and I had a very simple setup ready to go. My solution was almost a direct copy of several tutorials already out there for the same application, but as this needed to be done quickly I recycled some code from existing projects to get to my end result a bit faster.

Having a Raspberry Pi preconfigured to work with a camera helped.

My complete rig was a Raspberry Pi with a camera and an IR sensor wired to the GPIO pins running python, all powered by a USB power bank. Every time the IR sensor triggered the PI would capture a single jpg. I was worried about filling up the memory too quickly, or I would have tried some video capture, as it was it worked well enough to be worth setting it outside and seeing what we got.

I set the camera up in a bush nearby, not entirely convinced that it would survive the cold, or be able to see anything once it began to get darker. I know there are a lot of settings that I could have taken advantage of with the camera to get better results, but as I already noted, time was a factor as I had work to be doing.

The rig was only outside for a couple of hours before it managed to capture the weasel making off with the rabbit. It was hard not to keep checking, but when I realised the rabbit had gone I recovered the camera trap and checked through the captured images. It was almost completely dark and the camera  trap was just a fraction too slow to respond, but thanks to some post processing you can see a dark blur off to one side in these pictures, where the weasel is making off with his prey.





Comments