RaspberryPi birdfeeder webcam

Posted on May 31, 2012

8


This isn’t so much a Howto (as other people have already written that up very nicely) but a post on what I am using one of my Pi’s for.

The first gotcha is that for some unknown reason, the default, recommended, reference debian image is built without support for USB webcams… Nuts, but there you have it. [UPDATE – the latest, tippety-top kernel does now have camera support – be sure to update your debian image to the latest version from the github repository]

Arch linux is built with a more sensible set of defaults and works out of the box. I pushed the arch image onto a fresh SD, did a swap, ssh’d in and set up a simple ffmpeg webcam server, very similar too the guide I linked to above, but I was only interested in getting an asf stream out.

It means that I can keep an eye on my birdfeeder very simply 🙂

My next step is to make a kernel with USB cam support and bootc’s i2c/SPI driver support in so I can use an accelerometer to log comings and goings to the feeder 🙂

UPDATE
======

I have connected my D90 camera to the Pi as well, via one of the GPIO pins.

I used the helpful information and cable pin-out for the shutter release from http://www.doc-diy.net/photo/remote_pinout to work out what to do.

I wasn’t going to pay £20+ for an attachment that I was only going to butcher anyway, so I printed a small insert (x=5.2mm, y=2.8mm z=10mm with a 0.5mm perimeter) to fit in the socket.

Close-up of the insert, showing the notch cut into it. The wire is threaded through the centre and out and the end folded over to pass through the notch – aiming to connect to the correct pin for the shutter control. A thin layer of tape is wrapped round the outside, to stop the wire end touching the grounded socket case.

Plug it in and see if it will take a photo when this wire is connected to the socket casing!

Judicious use of tape to hold things in place…

Connecting to the Raspberry Pi:

Using the Slice of Pi breakout board, I connected GPIO pin 0 and Gnd to power a relay switch, connecting the shutter wires to the switch itself.

Then, to fire the shutter, all you have to do is put the GPIO pin to high: (other ways to do so shown here)

(Set up the GPIO 0 pin for output. (GPIO 0 pin on the header is actually 
GPIO17 in the system. The low-level peripherals wiki page linked to
just above has more info)

[root@alarmpi ~]# echo "17" > /sys/class/gpio/export
[root@alarmpi ~]# echo "out" > /sys/class/gpio/gpio17/direction

(Now to take a picture:)

[root@alarmpi ~]# echo "1" > /sys/class/gpio/gpio17/value 
[root@alarmpi ~]# echo "0" > /sys/class/gpio/gpio17/value 
[root@alarmpi ~]# 

And that’s it really. Next step is to set up a pressure sensor on the feeder and capture pictures of the various visitors 🙂

Advertisements
Posted in: development, event, fun, idea, play