Saturday, 4 February 2017

BirdBox2017: double Zero deployed!

I attached the new bird box & external camera to our pergola late yesterday afternoon, and by 8:30 this morning we had our first visitors.


Blue tits are very inquisitive, and certainly do not require a couple of months to get used to a new box (as some tv experts would have you believe).


So the 2017 season appears to have got off to a good start!

Actually, its not just blue tits that are inquisitive. While standing on a plastic patio chair yesterday, putting up the box, three long-tailed tits arrived. They sat on a shrub watching me, while chattering to one another, for quite a while. They were so close I could have reached out and touched them.

It is a pity they are not interested in nesting in my box. But who knows? Another 50 years of evolution and they might change their minds!

two Zeroes are better than one


In the 2 or 3 weeks since my last birdbox post, there have been a few changes.



First of all, the external camera is now remote. The aluminium bracket I'd tried to manufacture and fix directly above the box, turned out to be too springy. And for the pergola location there wasn't really any benefit in having it over-head. However, if I want to add a second camera to the maple tree box, it will need to be attached so that I can install it as one assembly.

Rather than retain the Pi 2B that I was using to test the main box computer, I switched to a second Pi Zero (so both the internal and external cameras are using Zeroes). This was mainly due to the need to reduce current drain on the 12V battery. I understand that the ethernet port is responsible for a few 10's mA, and this is a valuable saving on my system.

This change (from 2B to Zero) also meant I could put the camera back to its original position in the box, exactly where it was when designed for a Pi A+. While not in the centre, it is much closer to the middle.

I also decided to run the same software on the external camera as the internal. This involved replacing motionEyeOS with Raspbian + motionEye. So now I have the same capture capabilities on both cameras.

the Gambas bit


There are a few changes to my Gambas controller program. As the internal box Pi is linked to the Picaxe controller, this Pi acts like a master. When it is time for the system to shutdown due to lack of [bird] activity, the master Pi sends a message to the external Pi. This is accomplished via sockets as described in this earlier post: Using Sockets with Gambas

I have also extended this idea of master/slave control so that when I change streaming/recording options on the master, the slave is also updated.

Since 2014, using Gambas on my Pi birdboxes has certainly made it easier to write, maintain and modify my code as each season progresses (e.g. while the box is actually running). However, there is no doubt that there is also a heavy price to pay.

Running my Gambas application means I need to run a GUI desktop and run VNC to access it. It would be quite easy to provide control and feedback via a web page, making it unnecessary to boot into a desktop. This would equate to faster startup times and lower power consumption.

So I think that should be one of my aims for the 2018 season; re-write my software, probably using Python.

battery monitor


Although I was monitoring the battery voltage via a Picaxe in 2015 & 2016, I was still relying on a battery state indication based upon a fixed Ampere-hour rate divided by an average current consumption (i.e. 12Ahr, 160mA load and therefore approx 60 hours life between re-charge).

But now I have two Pi camera systems running from the same battery, and the batteries have aged somewhat, so I am going to use the battery voltage.


I decided to keep it simple with a basic straight line fit to the Lucas battery graph, where 13V is 100% and 11.5V is 0%. So I simply remove and recharge the battery when it drops below about 30%.

The part of the controller circuit responsible for measuring the battery has also changed. Originally the Picaxe ADC input was connected to the polarity protection diode in series with the battery supply. However, the diode forward voltage drop varies with current and temperature. The modified circuit looks like this;

Part of Picaxe-Pi controller circuit


If the battery is accidentally connected the wrong way around, I'm hoping that the second 1N4000 series diode (connected between Picaxe Pin 3 and 0V) will save the Picaxe.

The voltage drop due to the 3A cable used between the battery and the box was surprisingly high at just over 100mV. When calibrating the voltage measured by the Picaxe, I decided to half the difference between the actual voltage at the battery and the actual voltage at the box.

monitoring with motionEye


One of the benefits with motionEye is that you can adjust camera parameters from the motionEye interface. But I've been unable to get it to work the way I would like on the remote (monitoring) Linux laptop. It should be possible to connect the two motionEye cameras as 'motionEye cameras'. But when I do this I can't see the video.

No matter. I can still connect them to the laptop motionEye as network cameras. And I discovered that I can use RecordMyDesktop to capture side-by-side video like this;



I need to decide what to do with the 2014 design box which is destined for the maple tree location. I could keep the NE555 timer based controller but still upgrade its Pi model A to a Pi Zero. But this would lack a means of measuring the battery voltage.

No comments:

Post a Comment