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.

Nice job, Geir!

As always well done and effective :)

Love the idea and the used domino! :)

Ok, I was dreaming last night (not really about this topic) but what about a RFID tag for the Blue Tit parents ;-)

I see not that the solution is not that simple. But I got another idea.

A micro switch in the hole where they land to go in the house. Combined with the in/out code it should be possible to determine whether the bird is just peeking in or going in.

Thank you for taking even you’re sleeping hours to think about my problem :-D, but I think my dual IR gate and the text combination will be sufficient.
What I could use some help with is the power supply. Even though a power outage where I live is rare, they do occur. The power is usually back within the hour but it would be great to have a battery backup if it should happen. My coin battery only powers the RTC.
Any suggestions?


There is no magic Geir, I am 7 hours ahead of time here in Shanghai :-)

Yeah, you might be right that your double IR gate will do it just fine.

Power supply...I would use a combination of battery pack and a power adapter if you really want to get uninterupted counts.The battery supply the electronics and by a certain drop of capacity the power adapter jumps in to charge. (perhaps a solar charger instead of a power adapter)

If you dont have space problems then a ups and a transformer will do the job .

While reading your post, what I really enjoyed was the "hi tech" implementation for something so... organic, so... down to earth, so... natural. Simply beatiful inspiration! Great job!


that was great