Wednesday, 30 April 2014

BirdBoxPiCam2014: for the love of Graphs

As my RaspberryPi powered bird box collects data, I feel obliged to harvest it, compile it, try to make sense of it, and present it.

But sometimes data can raise more questions than it answers.

Something a little strange happened on Monday, but we were not at home to witness it.

Both the bird box system and the great tit family have been reasonably well behaved over the last week or so.

Taking the bird box counts (which are triggered each time a bird enters of leaves the nest) and dividing this figure by 2 gives me a rough idea of the number of visits made by the parents.

Just show me the graphs man!

The daily graph so far looks like this:

As to be expected, there was a sharp rise in visits following the arrival of the first chick.

The counts are stored in a CSV file on an hourly basis. So I can also plot the numbers for a given day like this:

This is a fairly typical hourly visit graph. For whatever reasons, the hourly totals vary throughout the day, but the dip mid-afternoon was almost certainly due to a very heavy storm.

The female also still sits on the chicks from time to time, probably to keep them warm. This means that only the male is providing food during these periods.

However, from Mondays data we get a graph like this:

With my admittedly limited experience, I'd say this is unusual. Assuming there was not a technical hitch, neither of the adults visited (or left) the nest from 10:58am until about 12:20.

Unfortunately we were out of the house for most of that day, only returning from work shortly before 8pm. But one thing was clear; there were now only 7 chicks in the nest.

Even more unfortunate was a lack of video. I hadn't bothered to switch on motion capture, which at least would have shown us 3 chicks exiting stage left.


All I really know is that we are 3 chicks down and the adults stopped going in and out for approx 1 hour 20 minutes. There are no signs of damage to the box.

There are no signs of damage to the vegetation on the pergola where the box is mounted (i.e. it doesn't look like a cat has been up there).


We did see some unusual behaviour a few years ago by a female great tit. She was nesting with her chicks in a box on the blind-side of the garage. On the video she seemed reluctant to leave the nest from time to time and we could hear her called (yes, we had sound in those days!). When I eventually walked around the garage to investigate, I found a cat standing on the oil tank, trying to see into the nest.

So there could have been a predator preventing the adults from returning to the nest. I don't think a predator took any chicks, but the box has a 32mm entrance hole, larger than the 28mm required for great tits.

When the chicks hatched, there were 3 that arrived later than the rest, which may still have been smaller and weaker than the other 7.

The chicks have to be able to survive overnight (say 10 hours) without food. So lack of food for 1 hour 20 minutes should not have been a problem. But maybe lack of food and warmth together could cause problems.

When small chick die in the nest the adults will remove them. They don't just chuck them out of the nest, they are carried away so as to avoid giving away the location of the nest. So the 3 missing chicks may just have died overnight and been disposed of in the morning, with no connection to the lost 80 minutes!


  1. That's really interesting. I'm also a sucker for a good graph and info-graphic (see David McCandless' book: 'Information is Beautiful'). It would be cool to have a way to overlay other measures such as temperature, ?rainfall, wind and stuff like that. So much cool stuff out there, so little time ;)

    Disposing of moribund offspring away from the nest makes good evolutionary sense as far as I can see. For your motion capture, why cant it run all the time? When I did some time lapse stuff I got around the SD card space issue my mounting a shared folder on a networked PC onto the Pi. The issue I found then was relying on the 'file creation' program to save directly across a network. A better way would be to periodically copy video files over network using rsync on a cron job, then delete the source on the SD card...

    1. Weather data: yes, I guess you could take the data from a Maplin weather system ( and merge/plot the data with your bird box data.

      Run Motion all the time: my original plan was to stream video from the Pi and run motion on my garage server. However, my wifi is the weak link. If I run 2 remote VLC clients, I get significantly more image breakup, so would get false motion capture and lots of useless video clips.
      Video & still images using Raspi are great. Video runs at 30fps, whereas running motion I only get 4fps at best. (I'm not using Kenneth Larvsens standard version, as you are. I'm using the version patched by dozencrows).
      I don't know how to pipe video into both motion and RaspiVid/RaspiStill at the same time. Maybe I could simply use RaspiVid + VLC to produce an HTTP stream (instead of RTSP) and run standard motion on the Pi pointing to the loopback address (e.g. My Pi has a 16GB sd card, so storing the motion video clips for a week or so is not a problem.
      By the end of this year there may be some useful developments (see So there may be a more integrated approach to streaming and capture ready for the 2015 season. But for the moment, there just isn't enough time to investigate all this stuff.

      Disposal: it's not only dead chicks that are carried away. Faecal sacs (if not swallowed by an adult) are transported to the far side of the garden, and sometimes dropped near the blue tit box!

      BTW, I'm glad to see a blue tit is taking an interest in your angled box.