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.
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.
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.
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
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)
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!