Guest post #7: Bird table webcam by Francis Agius

You can know the name of that bird in all the languages of the world, but when you’re finished, you’ll know absolutely nothing whatever about the bird … So let’s look at the bird and see what it’s doing — that’s what counts.
Richard Feynman (well, his dad Melville really)

And how do you see what the bird is doing? With a Raspberry Pi of course. Francis Agius tells us how:

A robin visits the table: click for video

Inspired by other web cam posts I wanted to set up a web cam that I could use to record my garden bird table. New to this sort of thing there were several hurdles to overcome! The main two were getting a reliable wireless set up and also being able to run the Raspberry Pi off a battery so I could leave it running free standing outdoors. I also wanted if possible to use Arch Linux as it is a very lean OS, less than 10 seconds to boot up! For wireless network I have used a Tplink WN722N USB stick, this is supported by Arch Linux without any extra difficult setup.

The innards

For power I already had a spare 12 volt car battery and found a fantastic DC to DC converter at Maplin which has two outputs, USB 5v at 0.6 amps good for the the RPi and a second 5 volt output at up to 3 amps perfect for a powered USB hub which runs the camera and the WiFi stick, making it possible to run the whole setup from a single 12 volt car battery power supply. There are probably cheaper ways to get 5 volts from a 12 volt car battery but the Maplin product is very tidy and easy to use. My Raspberry Pi is running Arch Linux with additional packages motion and ffmpeg installed, there are lots of post on how to set these up. I can forward info on my setup if this this will help anyone.

Sealed up and ready for action

So to summarize I am using Arch Linux running motion and ffmpeg, I use ssh connect to my Rpi and start motion running, pictures are captured to the Rpi sd card. On my windows machine Winscp is installed which is great for moving the captured files from the Raspberry Pi to windows.

Software

Raspberry Pi

  • Arch Linux
  • Motion
  • Ffmpeg

Windows

  • putty for ssh connection
  • Winscp to transfer files

Hardware

  • Tplink WN722N USB wifi adapter
  • Sweex Blackberry Black Usb Hd camera
  • Advent powered USB hub
  • Maplin A79 GW DC to DC converter
  • Old 12 volt car battery
  • Food storage container

31 comments

Avatar

I would suggest running sshfs on the rpi, connected to a *nix machine. That would make it possible to save images directly to the *nix machine over the network (particularly handy if you happen to use Linux as your main OS).

Avatar

Excellent project, this is one of the reasons I bought my raspberry pi, although I’ve not progressed with it yet. I current have a windows setup connected to some security cameras, one inside a birdbox that used software to record video when movement was detected. Also wrote a perl script that would tweet a screenshot from the birdbox when movement was detected.

It works great but abit bulky having a desktop in the garden shed, so aiming to miniaturise to a raspberry pi – the world of linux is new to me so I taking it slowly – still at first base, managing to install a VNC ;)

Link below gives some details on my setup, start from the bottom of the page:-

http://lakeuk.blogspot.co.uk/search/label/birdbox

Avatar

Dave,
Just checked out your link and your setup looks to be much more capable than mine, looks really good! Getting an Rpi setup with similar performance will definitely be a challenge but then that’s half the fun.

Avatar

That’s a great bit of work. I love the video of the Robin too. You can see he thinks the Camera is up to no good and so keeps checking it every few seconds =)

Avatar

Very nice. How long does the battery last?

Avatar

I have had the camera running all day, at least 12 hours. To be honest using a car battery may be a bit over the top I just happened to have one and wanted something portable. A half amp Rpi and a 50 amp/hr battery in theory should run for a few days. A tidier solution may be a smaller 12v lead acid motorcycle or house alarm battery.

Avatar

I got my son who is 14 a Raspberry which arrived a few weeks ago and so far he has managed to install the XBMC media softaware but now seems a bit lost as what next to do.

Your Webcam setup has hit the spot but as we are complete novices at this side of computing I would appreciate any help in installing the Arch Linux software and the additional packages you used to get up and running.

I really enjoy your projects and has got me fired up with several ideas, I now have the hard task of convincing number one son.

Thanks

Mark

Avatar

The process for the ARM version of Arch may be slightly different, but there’s a very useful Beginner’s Guide on the Arch wiki – it’s over 20 pages worth of printout, but very useful! I used it the other week when setting it up on my Desktop box to replace another distro (after backing everything up first, just in case!)

https://wiki.archlinux.org/index.php/Beginners%27_Guide

Avatar

Thanks for the links.

Avatar

Mark,
I have used the Arch image “archlinux-hf-2012-09-18” from the Raspberry pi downloads page, and set it up to use ssh to access the Rpi remotely from a laptop. To capture images from the webcam I added two packages, motion and ffmpeg, they can be installed using:
pacman -S motion
pacman -S ffmpeg
The Rasberrypi.org forum is a great place to go to get detailed information on how to configure motion and your Rpi. I found it much easier to first use a wired network setup until the webcam was working and then added wifi later. There were several failed attempts and Arch ‘re-images’ before I had wifi working!
For wifi setup two package were added, initscripts and netcfg, installed using:
pacman -Syu initscripts
pacman -S netcfg
A wifi configuration file needs to be created to hold your wifi settings you can use file wireless-wpa as a template.
Navigate to /etc/network.d
copy file wireless-wpa to a new file, ‘mywifi’
cp wireless-wpa mywifi
Then move it to the network.d directory.
mv /etc/network.d/examples/mywifi /etc/network.d/mywifi
Edit file ‘mywifi’ to add your home wireless settings add these lines.
ESSID=’your wireless sid’
KEY=’your wireless password’
Next edit file /etc/rf.conf so that the wifi network is started when the Rpi boots up.
Add a line at the end of rf.conf:
netcfg -c mywifi
This is just an overview of what has worked for me but I am sure there are lots of alternative ways to capture images and configure wifi. Hope you can make use of this and have fun with your project!

Avatar

Yeah, this is exactly what I’m gonna do when I’ll have money for second Pi. The one I have is now rabbit surveillance (with nightvision webcam) and PPTP server.

Avatar

Neat project but it’s basically re-inventing the wheel. Wi-Fi or IP cameras have been available for years now. These cameras can wait for a minor or major change in the viewing area then can be set up to automatically record, Email or even send you a SMS text message. They are completely configurable in a web browser. Plus most Wi-Fi cameras are designed to handle an outdoor environment. Basically your 12V battery and a Wi-Fi camera could take the place of the Pi, Hub, USB Camera & DC to DC converter and a Wi-Fi camera might even cost less too!

Avatar

“it’s basically re-inventing the wheel”

More like building your own wheel from scratch because you fancied learning something about geometry, spokeshaves, working steel etc; or just because you enjoy carpentry. Of course, you could have just gone out and bought a nice shiny wheel ;)

Avatar

Very well said! The raspberry pi project really is all about learning, not buying an off the shelf solution. Those have their place, but there is not much learning involved and not much customization available.

Avatar

Thanks, I totally agree, it may have been done before but you can get a huge amount of pleasure from doing it for the first time yourself! I think there are two aspects to an Rpi project, there is the end result which may or may not be put to good use and then there is the bit before this where you get a few hours enjoyment learning something new.
Cheers!

Avatar

Nothing wrong with reinventing the wheel when your goal is understanding how they’re made…

A similar project would be a wildlife camera triggered by motion or breaking a light beam. Or to take the bird camera further, playing with pattern recognition.

Avatar

That is absolutely great! Could you tell me from where you’ve got the dc/dc-convertor?

I’ve got a similar setup running in a birdhouse but with an alix board, i’m on to migrate it to raspberry pi for next spring and add some temperature sensors and infrared lights. mine is solar powered and with two webcams. check it out if you want to have a look: http://goo.gl/15UtK

keep up those great projects!
best regards from switzerland

Avatar

From maplin.co.uk

Avatar

Christian,
I have had a look at your link, the pictures are really impressive! Maplin.co.uk stock the dc to dc converter, just search for part number a79gw. It is very versatile and I am sure it will be useful in other projects. Please keep your link updated hopefully there will be some Rpi footage next spring!
All the best.

Avatar

Great job! Can you comment on the quality/resolution of the video?

Avatar

The picture size and frame rate are not as high as I had hoped, the video at the top of this article is the best quality I could get, and after several changes to the motion config file. There is an option for motion to use an ‘mpeg’ input straight from the webcam which I suspect would give better results but couldn’t get this to work with my webcam and arch install. I would be interested to know if anyone has been more successful with this.

Avatar

Very Nice! If you are using systemd in Arch linux and are are starting ‘motion’ automatically on booting, I would be thankful if you could describe your startup configuration. I am new to systemd

Avatar

Fantastic segment on bird box cameras. Has anyone tried an analog camera like the bird box cameras? We have one would like to connect PI up. The camera uses phono connectors and need a way to convert phono to digital, then process the image. Thanks all in advance R Williams

Avatar

im looking to do a similar with a window bird feeder and pi+camera. just a question about the battery, how many amps is it and how long does it last between charges?

Avatar

Its an old 50amp/hr battery, never tested it until flat but my guess is that it should be good for a few days, assuming the Rpi and kit is using 0.5 of an amp.

Avatar

Why can’t you plug the webcam and the wifi dongle directly into the Pi? Is there not enough power?

Avatar

I have 512MB RAM Raspberry Pi with the Raspian distribution + motion installed.
What kind of top frame rates and resolutions combination have you come out with ?

I have Logitech B910 USB-webcam and I get something like 1 fps with resolution 864 x 480.
Additionally I am saving still picture every 60 seconds and running Apache2 server with 4-5 instances (probably 2 too much in that number). 1 fps is quite good for RasPi, since the jpegs are quite big. The stills are like 100kB in size…motion jpegs are probably 50..70kB each.

According to my findings, the outcome was poor and not usable with 256MB RAM Rasperry Pis. Yes, I am a major consumer of RasPis, I have about 6 of them in various tasks, from UPS monitoring to home automation to video surveillance :)

Avatar

The author of the article, so I learned a lot, thank you.

Avatar

Hmm.. I had the idea for combining this project with a solar power Rpi project …wonder if that would work?

I’d like to set it up to capture images of our Hummingbird feeder and tweet shots of when the birds fly in!

Any thoughts?

Avatar

Please explain me the steps how did you do this..?
I have done a similar setup, but motion is streaming very slow even aflter overclocking.
I want to setup teamviewer kind of app, suggest me if anything is available other than VNC..
Thanks.

Avatar

Hi, just a question. I saw your DC to DC converter, but could not find it anywhere.. can you tell me exactly what brand it is? please send me a email as i’m afraid i’m not be able to find this topic back!

Leave a Comment

Comments are closed