The Raspberry Pi Foundation just released an update to the Pi zero W from v1 to v2, see here for full details
I had one of the bird boxes down for some TLC and swopped the v1 for a v2 and did some before / after benchmarks. I'm most interested in its improved wifi as well as likely faster compute time since it's moved from single core to quad core CPU. Bear in mind that that these pi zeros are in bird boxes up a tree and rely on nearby wifi signal to operate, so I'm interested in upload speed, the time taken for compute-based tasks and how much heat they generate. I used benchmark scripts here
Temperature: It gets hotter! there's a +12 degrees Celsius for the v2 under load. These units are enclosed in the top portion of a wooden nest box so that extra heat needs to go somewhere. In a near copy of this box I've installed a vent in the camera section with aluminium grill for ventilation which this one does not have so it'll be interesting to see how much of a difference this makes.
Internet speed test: Download is much faster, however this will be streaming a video signal out, so any download speed bump isn't going to do much. There is minimal difference upload speed so I'm not expecting increased streaming bandwidth. Testing is on the workbench so I cant say if the wifi throughput is different whilst its up a tree.
CPU test: CPU tasks complete much faster. This matters in my use case since the regular v1 pi zero W suffers from drop in video stream signal when undergoing video encoding, so if there's a bird in the box and the unit is encoding a video the streaming signal may drop leading to temporary loss of signal.
You can see some droppings in this box, so something's been roosting in it. Once its back up in the next few days and a few repairs are done then hopefully the'll be some more things to report.
For interest, this box came down as non-functional and was found to have a corrupted micro SD card, and a load of the entrance hole sensor connections had corroded away, so its now had some rough and ready emergency soldering, a new SD card and is back working again. The front piece is missing from this 'behind the scenes' pic showing my bodgy fixes...
Here is an roosting Great tit who is resting in the #2 version of this box as I write this, but with v1 pi zero w, it'll make for an interesting comparison when #1 goes back up.
Live birdbox camera web streaming is a great way to
involve others in the development of your nesting birds. I've attempted to collect together the
various options to do this, together with how I streamed my 2017 Robins
Yes dear, I know digital cameras can be expensive, but you can DIY for a lot less...
This post aims to touch on the following...
1) Review of analogue versus digital cameras for nest boxes: Commercial and home-brew
2) How to convert your analogue camera to digital
3) Putting your birdbox on online
You can potentially spend a lot on this, or alternatively go with my approach using a low cost, home brew setup using a Raspberry Pi + webcam combo, or use the Raspberry pi foundation camera module.
Getting started
The first thing you'll need to get your bird box camera
online is a digital video source.
Many commercial birdbox cameras use analogue cameras and are
designed to connect via a wired or wireless connection (2.4Ghz radio) to a SCART/composite
video in your TV or via BNC type-connector to a video recording system (capture
card to PC), or digital video recorders (DVRs) sold for CCTV. As-is, analogue cameras won't let you
do live streaming, you'll need to convert your analogue video to digital, or
start off with a digital camera in the first place.
Analogue camera kits are available from a variety of sources, e.g. HandyKam, UK wildlifecameras and others (I've borrowed their images, so its only polite to link out to them...). These are mainly described as connecting to a TV (or DVR).
Examples of analogue cameras, and what to expect in a kit.
How to convert
analogue video to digital video...
To get your analogue camera online, there are a couple of options to convert it to a digital form.
Analogue capture to
PC: There are lots of bits of kit that can convert an analogue video signal
to digital. Some sit outside your PC. Alternatively use a dedicated video capture card in
your PC. I picked up a
couple of Picolo Pro 2 PC
capture cards on ebay a few years ago and have used one to for a few seasons to
capture an analogue camera using iCatcher PC software in a tawny owl-come-squirrel nest box (replaced a
few yrs ago with a home-brew digital setup).
Standalone IP converter. Directly connect an analogue video source to the internet.
There are some scenarios where these may be more appropriate e.g. Inaccessible sites e.g. Norwich Cathederal Peregrines (note this does not work in chrome) or in schools where there may not be much in the way of IT support, or the person setting it up does not want to bother with a PC component. These are expensive,
and for this reason I've not tried one (would like to...). This Axis IP converter is one example available from HandyKam, and once purchased, the per camera cost drops since several analogue cameras can be converted the same time (depending on your kit that is).
Alternatively you can just generate a digital source in
the first place...
IP (IP='Internet
Protocol') cameras. The cheapest ones are generally more expensive than analogue cameras, however as the camera itself generates the digital feed, you don't need as much intermediary 'stuff' to get your video stream online, offsetting the higher camera cost. Video
quality is often better and does not degrade like you may get with a long
CCTV-analogue cable, particularly if used with analogue radio transmitters, especially if like me the local 2.4Gz spectrum is already pretty much full (neighbour's chicken cams!).
IP camera
options
Commercial IP
cameras: There are lots of examples at the 'cheaper' end of the professional spectrum
(however still in the several £100's range). Kate MacRae 'WildlifeKate' uses a Vivotek IP8152 in her Tawny owlbox:
This example is approx £240 - It wont fit into a typical small bird next box however!
Hobbyist IP camera
kits: 'Birdbox IP' camera kits: e.g. this kit from HandyKam: 'DigiNestCam HD camera kit - Bird box, 2MP IP camera with IR.' This would be a good place to start if you're after an a commercial kit (£179.95). The advantage of this kit is that the PoE (power over ethernet) and cabling is sorted out for you. This alternative is similar with additional work needed by the user for powering it. For the DIY-er, the new Raspberry Pi camera board is 8MP, so likely improving on the resolution of these.
Domestic IP
cameras: ?May be worth looking at but these offer a range of options not really required (e.g. facial recognition, subscription monitoring), some of which are still expensive so are probably best avoided.
MAKE YOUR OWN<-
this is what I've done using a Raspberry pi (credit card-sized PC) + camera
comes in at approx £50 -ish to make a live-streaming capable device. This is the
cheapest & most flexible option, but relies on a bit of technical know-how and setup time (but not a lot...). Note there is additional cost to sort out PoE and any cabling.
Analogue vs IP cameras for wildlife nest monitoring
Analogue camera
IP camera
Cost
Cheaper (under £100),
More expensive (several
£100)
Alternatively go the
home-brew Raspberry pi route = much cheaper (under £50)
Limited kits for domestic nature watching use, only a few kits available, this one does the PoE thinking for you...
Small=beautiful
May be easier to fit into
a nest box
Commercial cameras are usually
bulky, may be more appropriate for larger nesting sites, BUT Raspberry pi solution = small.
Wired Connection options
Via CCTV cable (often
comes with kit). I've had mine work over
50+ meters extending with (variable) success to 200m over wireless 2.4Ghz.
Usually power over
ethernet (PoE), quite cheap to do .. will need to learn how to wire a cat5 ethernet
cable if going the home-brew Raspberry pi route (not difficult).
Wireless options
Greater signal range via
2.4Ghz transmitter/receiver pairs.
Limited by number of channels available. Prone to interference (e.g. microwave)
Transmit over wifi. Transmission framerate may drop over
increasing distance, no drop in video quality.
Signal strength (wired)
May degrade considerably
over distance.
Does not degrade over
distance (within domestic context...)
Viewing video
Direct connect to TV
SCART/ composite video or via analogue video capture to PC
Via router to PC connected to same
network, or direct to internet.
Recording video
Without digital
conversion, using commercial CCTV digital video recorders (DVRs). If using digital conversion, all recording options under 'IP camera' are also valid
On PC using dedicated
CCTV software e.g. iCatcher console, (£139 for 2 camera licence), or Zoneminder (FREE, runs on linux PC/Raspberry pi, more fiddly to setup).
Online streaming
Needs convertor if you
want to get this online (+££)
Can stream via PC or
direct from camera (if supported)
So, the point of this is was to describe/document how I got my Robins online.
I used a Raspberry pi + webcam combo setup as described here to generate a video stream (motion jpeg in this case). I then used a program called ffmpeg on a second Raspberry pi to convert this to something that YouTube could use and stream to its live events facility. You could do all this on the same Raspberry Pi but I had a second, more recent version handy (more oomph).
I'll cover this in more detail in a subsequent post...
My 2017 Bird Nest Box should hopefully be up and running later this week, hopefully not too late for this season. This version has two camera: A 'from the side' camera which is a webcam (as described in previous posts), and a 'view from above' camera that uses as raspberry pi InfraRed (IR) camera with Infrared-cut to allow night and daytime viewing, I've added dimmable IR and non-IR led illumination. The RPi camera does video capture via the marvelous program PikrellCam.
Test screen shots below (Microsoft LifeCam above, Raspberry Pi v2 IR cam below)
Daytime
Daytime previews
Night-time
Night time previews
I've also included an entrance hole counter and facility to measure ambient temperature and outside light levels.
The bird box has been recently used as an overnight roost for a blue tit. On a couple of occasions we've had two in there. Today was a little different since tit 1 didn't appreciate tit 2 in the same space, as can be seen in the following clip:
It's interesting that in addition to feet and beaks being used as offensive weapons, there are a couple of hooks using a wing...
Right hook
The posturing at the beginning is also interesting:
I recently acquired a new oven that is described as 'Self-cleaning'. Looks like my bird box is too (sort of). I've seen a lot of flies in the nest box recently. Looks like someone else has noticed that too.....
Pay attention to the fly at the top right corner of the box....
The 2014 bird box has a Raspberry Pi + Microsoft lifecam cinema usb webcam in
it that has been faultlessly streaming video since being setup. I had to switch all cameras off over the Summer & Autumn for building work, and on reactivating them... I have discovered a design flaw.
My design has a glass partition between camera / electronics and area for the birds. Over the Summer this has got filthy - I blame my builders! The dirt means that the camera now 'sees' the window and focuses on it rather than any in-box activity. An example from last week (Jan 6 2016), shows the problem:
While I don't resent the odd insect, I don't want this sort of thing:
There is an obvious solution - CLEAN THE GLASS!
...which would be great if I could locate the keys for my securely locked ladder :(
Plan B is to turn the auto focus OFF and fix the focus to a specific focal distance
Introducing uvcdynctrl
This is a handy application that gives control over your webcam's settings. Apparently the one I'm using (Microsoft Lifecam cinema) is notorious for a skittish auto focus.
Since I'm running this on a Raspberry pi, to install do:
sudo apt-get install uvcdynctrl
To list the controls available to you do:
uvcdynctrl -c
I get the following (output depends on webcam model): xx@xx ~ $ uvcdynctrl -c
Listing available controls for device video0: Brightness Contrast Saturation White Balance Temperature, Auto Power Line Frequency White Balance Temperature Sharpness Backlight Compensation Exposure, Auto Exposure (Absolute) Pan (Absolute) Tilt (Absolute) Focus (absolute) Focus, Auto Zoom, Absolute
Now, obviously I cant control all of these, there's no pan and tilt controls available to me, however I can change the autofocus behaviour.
To turn OFF that pesky autofocus:
uvcdynctrl -v -d video0 --set='Focus, Auto' 0
Auto focus is OFF... just need to manually set the auto focus until it's in the correct place:
The number at the end is the focal distance - just needs playing with to hit the correct focal point
You can 'get' i.e., query what the focus setting is at as follows:
uvcdynctrl -d video0 -g "Focus (absolute)"
So auto focus is off for now... just need to find my keys /access ladder, clean/remove the separating glass and I can sort it properly, then switch auto focus back on with:
UPDATE Sept 2019: I wrote an updated version of this here (v3)
Activity counter v1
I've been working on getting the activity counter working on my side-view bird box.
This works on the basis of 2 infra-red beams built into the entrance hole. The front panel of the box is constructed of several layers of plywood with channels cut for cable inclusion.
The IR beams interface with a PiFace add-on board on a Raspberry Pi. The principle is that by breaking outer and/or inner beam its theoretically possible to distinguish between entrance, exit, head bob in/out.
My design is based on that described in chapter 17: "The Techno-BirdBox: A Wildlife Monitor" of Andrew Robinson and Mike Cook's book: Raspberry Pi Projects.
Parts
2x IR LEDs: SFH484-2
2x IR photodetectos QSE113
2x 1k ohm resistors
2x 330 ohm resistors
RaspberryPi + PiFace in-situ
For full description on wiring guide and setup, please go buy the book!
Activity counter scripts
I did feel slightly aggrieved that the included python scripts for recording and processing the beam breaks has quite a few printing errors in the book,and does not work as-is. I have made corrections such that I think it now all works fine. You can find my versions of these scripts in a GitHub project page together with some sample activity log data, which I've used to create the graph below.
One cool thing about Andrew's scripts is that he describes a way of programatically generating graphs of activity. The following is generated from my version of these scripts:
Activity graph generated from sample activity data
The plus side of having had to tweak these scripts is that I have learned some python and I now have some idea of what a state machine is. All I need now are some bird box visitors!
Well, I am usually genuinely surprised when things actually work, so it was with great excitement that we spotted this fella poking his head into our new bird box to take a look.
Blue tit inspecting potential home
We're pretty sure its a blue tit. My first thought was to check the activity log that is generated via the two infra-red beams at the entrance hole. There are two IR beams, an inner and an outer one, so theoretically one should be able to distinguish between entrance / exit / head-in / head-out. Why you might ask...? ;)
Nest box in situ, and activity log. Yellow activity is this blue tit.
The log shows the activity to date, where the two numbers represent the beam, then the beam state:
1=Outer, 0=Inner and 1=Whole, 0=Broken, for example 1,0=outer beam broken.
On closer inspection of the log, I seem to have mis-coded that...
I originally thought Mr Blue tit was the first look-in I'd had, as it was the first caught on camera, however the log showed otherwise, with some interest five days ago. A quick re-visit of recorded footage showed a shadow briefly obscuring the entrance hole at the exact time of the logged event on the 24 April. There's no way I would have spotted this so it shows the IR beams are doing their jobs.
I'm considering putting up a miniature gallery along the lines of 'Birds & insects that have made brief appearances in our nesting boxes'. Fascinating viewing I'm sure !
?Coal Tit making brief appearance into owl squirrel box
Apparently the path to camera upgrades in nest boxes isn't really smooth. When it works, it works really well. It would appear that my squirrel pair are no longer in residence, however I did get a brief visitor earlier today which shows some strengths and weaknesses of this particular webcam
I need to deactivate the wobbly autofocus. This can easily be done with the following command in a linux terminal:
uvcdynctrl -v -d video0 --set='Focus, Auto' 0
I also seem to have run into a problem where it runs for approx 18 hrs then drops off the network. Since at this point I cant SSH into it I cant tell if its still streaming and its a network problem, or whether the Pi has seized up. I'm going to try reducing the resolution and fps and see if that makes it any more stable. I have had this same webcam streaming in HD across my home network with a different Raspberry Pi solidly for several weeks, so I hope I haven't got a dodgy Pi one stuck up a tree now :(
So, as I
mentioned in a previous
post, my Tawny Owl nesting box has/had some squirrels in it who have done a loft conversion so we now have a squirrel drey - complete with branches sticking out of the entrance hole.
View from below
The camera in
there was really limited in terms of the picture quality, as the a
2.4GHz radio transmission transmitter had very poor performance (read
as mostly non-functional). Today I took
advantage of the lack of wind, and did a
quick and dirty mod, and replaced the existing camera with a webcam-raspberry
pi combo.
I've been
working for a while on a pi-cam nesting box for smaller birds (full post later),
and Iused the same methodology to rig up a webcam in the Owl box. For power, I've used power-over-ethernet
(PoE), so I've only one cable running to it.
The box is
approx 150ft from the house. Last year, I
ran exterior ethernet cable underground most of the way, to a shed which is
approx 30ft from the tree. From the shed
I've run a ethernet cable which takes a power injection using a TPlinkPoE kit, which steps down from 48 to 5v in the nest box. Webcam is a microsoft lifecam cinema. I created all the
network cables from a box stock of exterior cat5e network cable. There's
no artificial lighting in the box as I had to make these changes 20ft up a tree
so had no room for finesse, and plenty of room for falling out of the tree. The old camera had several IR leds (too
many), so unfortunately night vision is
out for now.
Kit in-situ (again no finesse here - mostly chucked in)
In a later
post I'll detail how motion jpeg stream is setup from the Pi, but its cool to
SSH into a linux box
250ft from my desk and 20ft up a tree.
The improvement in quality is immediately obvious. I'll need
to do some repositioning later in the week.
At 800x600
resolution I get approx 20 fps, and at 1280x720 I get 7-10 fps which isnt bad
for full HD. The video signal is a
motion jpeg stream, which is fed to a pc running iCatcher console
software. This sees it as an IP camera
and does the motion capture side of things.
Audio: I haven't investigated this yet, but this webcam has an inbuilt
microphone from which I think it should be possible to grab an audio feed.
Stay tuned for some (hopefully interesting) footage...
I'm interested
in how technology can be applied so that aspects of the environment around us
can be measured, or seen in ways not normally possible. This project is an alternative take on the basic bird-box camera concept.
I've always
had an interest in ornithology, starting from when as a youngster I went out
with Dad and watched sea ducks through a telescope approx 1km away in a force 4
gale. While this might put off some
kids, I think this sort of experience drove a need to get things a bit more
'close up'.
As a
grown-up I've built some basic bird boxes which have invariably been occupied
at one time or another by blue tits & great tits.
Owl box
Last year I started tinkering with camera-enabled bird boxes, and built what I optimistically called my 'owl' nesting box, which was occupied
by a family of great tits - nobody told the local Tawny Owls. This was my first camera-equipped box, which
used acolor 540 line CCD camera, from Handykam. This was linked to a PC video capture card
and video captured using iCatcher software from iCode Systems.
Here is
some footage of a few early interested visitors:
In March
2013, we had great fun as a family watching a family of great tits raise a
brood.
The above video shows some male female courting behaviour. You can tell which one the male is as he has a thicker belly stripe (not evident from this top-down approach!)
9 Great tit eggs
Hungry chicks...
While the video quality started off good, it gradually degraded and is now only works intermittently. While this is a colour camera, I never got colour video. I think this is because I used a very long cable run (30m) combined with a 200 ft wireless transmission distance.
Limitations of this approach
1) Relies
on radio-frequency transmission, with distance transmission issues
2) Is
therefore distance and line-of-site limited
3) Has
problems with interference in poor weather - which as I write (Feb 2014) is
very poor indeed !
4) Interferes
with nearby similar systems - we're a mini-Spring-watch street!
5) No audio
My camera-enabled bird box wishlist
1) Higher
resolution, colour video + audio
2) Not
reliant on "analogue" radio transmission.
3) Single
wire run
4) Compact
5) Preferably
internet-protocol (IP) based
6) Low cost
If cost wasn't an issue, there are various ways to achieve this for example, you could theoretically use a dedicated IP-camera & mic option to monitor nesting activity.
There are many examples out there of internet-enabled wildlife feeds, such as that available for the Peregrines on Norwich Cathedral
Unfortunately,
my budget wont stretch to this! Raspberry-Pi powered birdbox...
I recently
discovered the brilliant low-cost computing system that is the Raspberry Pi. The Pi is a small,
bare-board computer that allows you to do a load of cool stuff for minimal cost.
In this context, by attaching a simple USB webcam to the Pi, and getting creative with some power-over ethernet it is possible to setup a live video stream with one cat5 network cable connected to it.
The following image is a screen capture of a video captured from a high definition USB webcam attached to a Raspberry Pi, powered by power over ethernet, streaming across my home network and motion-captured using iCatcher software.
Squirrel-selfie
Bird box camera plus+ I recently found this video from the University of Manchester School of Computer Science which (amongst other things) shows a Raspberry Pi-powered bird box.
The really neat thing they've done here is that you can count nest box activity, which opens up the option to create plots such as these, and lets be honest, we all like a good graph (well, I do anyway!)
The Raspberry Pi can be theoretically put to other uses in this context, for example adding a temperature sensor, and visualising bird activity with the weather. Anyway, over the next few weeks I'll blog my progress and with luck I'll end up with a high-definition, video streamed video bird box at an affordable cost and have a bit of fun in the process.
Cheers
Chris Update 10/05/14: My take on this design is described in this post Update 10/05/14: Description of entrance hole counter in this post