Building a Swallow Cam using a Raspberry Pi

by Sarah - Craft Invaders

We have built our own Swallow Cam using a Raspberry Pi so that we can watch the swallows in our shed raise and fledge their young. I should be honest and point out that although I say we, it was my brother who put this together for us, and he has kindly agreed to outline what he used, and did below…

We have built our own Swallow Cam using a Raspberry Pi so that we can watch the swallows in our shed raise and fledge their young. Check out how we did it, and what you'll need to make your own.

Equipment

Raspberry Pi:

For this project we used an old version 1 Raspberry Pi. Any model will do apart from the early PiZero models which do not have a camera connection.

Raspberry PiNOIR Camera:

This is the ‘night vision’ version of the Raspberry Pi camera. You can use the regular one for better colour images, but as we wanted to also shoot in total darkness we went for the infra red version.

Long Range USB WiFi Adaptor:

This was needed as the shed with the nest was outside normal WiFi range of our internet hub. The best test to do is that if your smartphone has a WiFi connection in the location you are placing the Pi then you you can use a regular USB WiFi connector. If you are using the latest Pi3 or Pi ZeroW they have WiFi built in

Prototype Board, 6 x IR LEDs & 2 x 47ohm resistors:

These are only needed if you are using the PiNOIR camera and want to do night vision filming. Below is a screen shot of the wiring diagram and the power is just supplied from the 5v and Ground pins on the Raspberry Pi.

We have built our own Swallow Cam using a Raspberry Pi so that we can watch the swallows in our shed raise and fledge their young. Check out how we did it, and what you'll need to make your own.

Method

The first thing to do is to install a new version of Raspian on your Raspberry Pi and get the camera set up. If you are new to the Raspberry Pi then all the information can be found on their website at:

Raspberry Pi Help

and

Getting Started with a Picamera

Once you have your Raspberry Pi and Camera set up then you will want to make sure you have PuTTY and VNC activated on your Pi so you can access it remotely using your PC without a monitor, keyboard and mouse connected to the Pi. There are plenty of tutorials on this available and so I will not repeat them all here.

We have built our own Swallow Cam using a Raspberry Pi so that we can watch the swallows in our shed raise and fledge their young. Check out how we did it, and what you'll need to make your own.

Installation

We installed our camera overlooking a nest that our visiting swallows return to every year. The piece of insulation that you can see in the photo below is something that we put in place a couple of years ago to protect the lawnmower that sits underneath the nest. Since our swallows have never seemed bothered by this adaptation to their nesting site we were hopeful that the presence of Swallow Cam wouldn’t disturb them.

We have built our own Swallow Cam using a Raspberry Pi so that we can watch the swallows in our shed raise and fledge their young. Check out how we did it, and what you'll need to make your own.

Streaming your live feed to Youtube

Now you need to install the software on the Pi to stream to YouTube. Type in these commands in order through a command line on the Pi:

cd /usr/src

git clone git://git.videolan.org/x264

cd x264

sudo ./configure –host=arm-unknown-linux-gnueabi –enable-static –disable-opencl

sudo make

sudo make install

This will install X264 on the Raspberry Pi. These steps will only take a minute or so. Once this has finished you will need to install FFMPEG with the following commands (the ‘sudo make’ stage will take hours so you may as well get on with other stuff, but don’t forget to do the ‘sudo make install’ when it has finally finished):

cd /usr/src

git clone git://source.ffmpeg.org/ffmpeg.git

cd ffmpeg

sudo ./configure –arch=armel –target-os=linux –enable-gpl –enable-libx264 –enable-nonfree

sudo make

sudo make install

You now need to set up your YouTube account for streaming. Click on the upload button in your Youtube account and follow the instructions to set up a live feed. When you apply for live streaming YouTube will verify your account and then issue you with the key that you need to add to the code below

Once this is set up then enter the following command on the Raspberry Pi:

raspivid -o – -t 0 -vf -hf -w 720 -h 480 -fps 12 -b 480000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i – -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/<Stream name/key from YouTube>

It works!

On the 30th of April our Swallows started to return, and we are delighted to see that they are visiting our Swallow Cam nest and appear to be making repairs ready to nest. You can see them and Swallow Cam in action below

 

This has been such a fun project, and the kids are totally enthralled with the live stream of our nest. We already had most of the bits and bobs to put Swallow Cam together, but if you are starting from scratch and buying everything in, we would expect to be able to build it for less than £50. We are now working on a camera trap version to see if we can capture some images of the nocturnal visitors to our garden.

We have built our own Swallow Cam using a Raspberry Pi so that we can watch the swallows in our shed raise and fledge their young. Check out how we did it, and what you'll need to make your own.

related articles

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

10 comments

Laura Ryland April 4, 2019 - 10:20 pm

I wonder if she ever gets the feeling that someone is watching her. LOL

Thank You so much for putting this up! I am obsessed with all birds! I’m actually decorating my office using a bird “theme” but I am ‘challenged’ shall we say when it comes to decorating anything! So if you have any suggestions, I’m all ears! Thank You again for posting this video! It’s amazing!

Reply
Sarah - Craft Invaders April 11, 2019 - 1:14 pm

Thank you for your kind comment Laura and I’ll get my thinking cap on re. your bird theme (which sounds fab!)

Reply
Lol May 8, 2017 - 6:38 pm

I love this! I’ve been itching to try a raspberry pi project as I love fun techie things – I do think it would be all consuming if I got one though!

Reply
Sarah - Craft Invaders May 8, 2017 - 9:55 pm

I have to admit I have spent a ridiculous amount of time watching it already Lol, and they haven’t even laid any eggs yet. It’ll be 24/7 if we get babies 🙂

Reply
nikki May 5, 2017 - 2:29 pm

Sarah, I love coming here and learning new things. This is absolutely cool! We have swallows that make nests in the trumpet vine above our porch. We don’t mind if they do it off to the side, but last year they made one right above the walk into the house. This year we are discouraging them from doing that. You should have heard the ruckus every time we entered or left! Can’t wait to see more video on this, so awesome! I can see why the kids are enthralled.

Reply
Sarah - Craft Invaders May 8, 2017 - 9:33 pm

I can imagine the noise Nikki, ours dive bomb anything they don’t like the look of (namely the cat and dog) but they are such graceful birds. Here’s hoping they do go ahead and use the swallow cam nest 🙂

Reply
Linda at Mixed Kreations May 2, 2017 - 9:52 pm

Oh Wow, this is so cool! I would love to have one of these, but this is way to techy for me. I have thought about buying a out side cam to see the wild life that comes in our yard after we’ve gone to bed though. That would be so cool!

Reply
Sarah - Craft Invaders May 8, 2017 - 9:31 pm

You get such cool wildlife over in the States Linda, I bet you’d see some amazing creatures if you did get one. My brother is working on a camera trap for me now so hopefully we’ll get that set up soon 🙂

Reply
Michelle May 2, 2017 - 4:13 pm

Loved the video, love the instructions, love everything about it Sarah. Our swallows just left about 2 weeks ago to fly to your side of the world. Give them my love if you see them please.

Reply
Sarah - Craft Invaders May 8, 2017 - 9:28 pm

Wouldn’t it be amazing if they were the same swallows Michelle! It’s been such fun setting up the camera and will be amazing if they do go ahead and raise young in that nest. We’re keeping everything crossed 🙂

Reply