Saturday, 26 November 2016

Completed Bird Box Camera

Last time I set-up a Raspberry Pi running from Power over Ethernet. So now I knew I could connect to the machine remotely, I could proceed with setting up the camera.

As I was going to install the camera in the bird box, there was not going to be much light available. Setting up a visible LED would likely be a big deterrent for birds, given that the box would be glowing brightly! So I decided to use a NoIR camera with an IR LED for illumination. The camera was installed as per normal and I set-up the live stream previously used for the remote robot arm

I bought some 850nm IR LEDs. You can't just wire these up directly to the 5v pin on the GPIO port otherwise they will burn out. To prevent this happening you need to add a resistor.

To calculate the value of resistor use the formula, R = V/I

V is the source voltage minus the forward voltage, or voltage drop over the resistor, and I is the forward current of the LED. The resistor should limit current to at or below this current.

For these, the forward voltage was quoted as 1.5V and current as 100mA so R is:


R = ( 5V – 1.5V ) / ( 100mA x 1000 )
 R = 35 Ohm

We multiply by 1000 because the LED current is quoted in units of milliamps.

The nearest resistor I had to this was 39 Ohms, so this was put in place. A larger resistor would result in smaller current across the LED so this was OK.

Because I was happy for the LED to be powered 24 x 7, I connected this to the 5v and ground pins on the Raspberry Pi GPI.


(As an aside, I practised setting up the LEDs first with an Arduino, it turns out mobile phone cameras have some sensitivity to IR light so looking at the LED in preview mode on the camera was a quick way of telling if it was working or not.)

Focussing the camera proved to be difficult. The camera is a fixed focus and so the distances involved here (10-20 cm inside the box) are too small for a sharp focus.
The lens however can be unscrewed with great care and there are some pages on the web that describe how to do this. I can only say this is an incredibly fiddly operation, so fiddly in fact that the first time I tried I ended up scratching the lens and I had to buy a new camera.

Fortunately, the new one came with a very handy widget that allows you to change the focus very easily:



Of course, setting up components in a nice an clean desktop setting is one thing, squeezing the Pi and POE into a small tupperware box and ensuring the cables were not catching was quite another especially when space was at a premium.

The last tricky bit was positioning the camera at an angle to the underside of the box roof so that it would point straight down. I succeeded with a piece of cardboard shaped into a wedge.

Here is the completed bird box, without full waterproofing:


The view of the inside is pretty good:



The box is now waterproofed and out in the garden, on the end of a 30m cable. I don't really expect to see much activity given it's winter but it'll be good to run for a few days or weeks to check out how well it's been put together and make repairs if necessary.

No comments:

Post a Comment