Let's Make Robots!

Bird box gate

Log access to the bird box

For the last couple of years I have had a bird box mounted on the wall outside my room. All the time I have had a USB webcam inside so I (and a lot of other people including the kid’s school) could monitor the progress of nest building all the way to the new birds leaving.

When watching the parents bringing food to their chick I started wondering just how many times they fly in and out of that box. So now I’m working on a ‘Bird box gate’ that will count when a bird goes in to the box and when it leaves, and logging it on a SD card or live on a SQL server on my main server (haven’t decided on this yet).

But this is what I have got this fare;
An IR gate on each side of the wall of the bird box. One cable that I can run through the wall and hook up to my FEZ Domino inside.

I spent some time on the programming bit. It might seem straight forward but problems arise when a bird just peeks its head in and then flies away. Even the tail feathers might give some sort of false reading on its way in. So what I came up with is this;
Every time the state of the inside IR gate or the outside IR gate changes I add a character to a string. The logic being;
Outside gate goes high add “A”
Outside gate goes low add “B”
Inside gate goes high add “C”
Inside gate goes low add “D”
So if a bird is on its way inn I should get “ACBD” as the first 4 characters of the string. If I get “CADB” it’s on its way out. The rest of the string will be ignored as that’s probably false signals from the tail feathers.
So what if the bird is just peeking in? Then the string would read “AB” and nothing else. The system clears the string every 500ms from last trigger so hopefully this would work.

I’m using a FEZ Domino for this but as you see, there is not much going on.

I’m still not sure if I should just keep the data on a memory card, or go all the way and hook it up to my network. I would be great to see the data in real time.
A well, I have the whole autumn and winter to decide.

Update 19.07.2011
One of the things that has me worried is the loss of power. That would reset the internal clock and I would get the wrong date stamp. Then I remembered that the FEZ Domino has an internal RTC and with a coin battery I will have correct time even if the system restarts.
The other thing is how to communicate with my SQL server. I could buy a Ethernet shield but that’s about $40,-. So I’ll think I will use the USB directly from the Domino and hook it up to my Windows Home server and make a small program on that to take data from the microcontroller and put it into the SQL server.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I would just keep all the data (time on, time off, time on, time off...)

and do the filtering in software...

have you considered the case when the chicks get their tail out to poop?

That might be a solution but why don’t just use the 75Mhz FEZ Domino as it’s just sitting there?
And for the pooping problem, these are small birds and their parents carry it out.

There are many ways to get fail triggers which you can not avoid. But your system might work to lets say 90% accuracy and this should be ok.

I am not sure about the behavior of those birds but what if you put a switch plate to the bottom of the bird house and measure the change of the weight. Every time when mum or dad jumps in the nest to feed their chicks you get a reliable signal that the bird is really inside and not just looking through the door ;-)

The bird that I usually get in my box is the ”Blue Tit” http://en.wikipedia.org/wiki/Blue_Tit and it weighs about 10g so it would be a fairly sensitive load cell.

Yeah, I was afraid of ;-) But to make sure the bird is inside you have to use a second confirmation after the door check in.

Just got an idea. You still have to adjust the weight value according to the growing chicks inside. So if you after triggering the door light barrier just check if the current weight is increased then it would be fine.

How come you will now which bird goes in and out ?

Meaning the case of two or more birds in the box .

Or you only want to count the action ?

When the parents are feeding the chick they both are in and out of the box all day long. But sometimes the female lies on the chick to warm them, then she will stay in the box for a long period of time while the male keeps bringing food. Hopefully this will show up in the data.

So you say that you are enjoying your 3D printer, eh?

I am most impressed by the dual-sensor set-up. The "bird-going-in vs. bird-going-out vs. bird-looking-in" system is simply brilliant. Well done as always.


Thank you Chris.
And yes, the 3D printer is great. The more stuff I print out the more ideas I get for building stuff. By far the greatest present I have ever received :-D