This works on the basis of 2 infra-red beams built into the entrance hole. The front panel of the box is constructed of several layers of plywood with channels cut for cable inclusion.
The IR beams interface with a PiFace add-on board on a Raspberry Pi. The principle is that by breaking outer and/or inner beam its theoretically possible to distinguish between entrance, exit, head bob in/out.
My design is based on that described in chapter 17: "The Techno-BirdBox: A Wildlife Monitor" of Andrew Robinson and Mike Cook's book: Raspberry Pi Projects.
2x IR LEDs: SFH484-2
2x IR photodetectos QSE113
2x 1k ohm resistors
2x 330 ohm resistors
|RaspberryPi + PiFace in-situ|
Activity counter scripts
I did feel slightly aggrieved that the included python scripts for recording and processing the beam breaks has quite a few printing errors in the book,and does not work as-is. I have made corrections such that I think it now all works fine. You can find my versions of these scripts in a GitHub project page together with some sample activity log data, which I've used to create the graph below.
One cool thing about Andrew's scripts is that he describes a way of programatically generating graphs of activity. The following is generated from my version of these scripts:
|Activity graph generated from sample activity data|
The plus side of having had to tweak these scripts is that I have learned some python and I now have some idea of what a state machine is. All I need now are some bird box visitors!