Cat Cam Setup & Info

I wanted to talk a bit about the webcam that I set up, since it’s far from typical.

These days, I imagine most people experience webcams through cameras physically installed into the computer, monitor or phone they’re sitting in front of (if you can consider a phone camera a “webcam”). I’ve owned a few external USB webcams in years gone by, but today I just have built-ins like most people.

So, when Corinne brought home some kittens to foster and a friend suggested I set up a webcam (because who doesn’t want to look at adorable kittens all day long?), I thought it was a good idea but wasn’t sure how I’d accomplish it.

Turns out, I have a very capable tool for the job: a Raspberry Pi.

If you’re unfamiliar with what a Raspberry Pi is, the short version is that it’s a small-but-powerful computer that’s about the size of a credit card. You can power it via a USB port or external power supply and you can attach all manner of peripherals to it via either standard USB cables or a few other ports.

What you see below is a picture of my Raspberry Pi in a third party case with the official camera module attached to a small servo product called Pi-Pan. Pi-Pan lets me programmatically change the pan and tilt of the camera from the Pi directly (which is really cool!). The “crazy wires all over the place” look is connecting the Pi-Pan servos to the Raspberry Pi. The white ribbon cable connects the camera itself to the Raspberry Pi.

Raspberry Pi + Camera Module + Pi-Pan

After deciding that I was going to use this as a webcam, I needed to decide the best way to implement it. Since the Raspberry Pi runs a version of linux, I have a lot of options. I figured the easiest way would just be to write a short python script to:

  • set the Pi-Pan to the correct pan and tilt
  • take a picture with the camera
  • FTP the picture to the webserver
  • tweak the files so that the new image shows up to viewers

As far as programming goes, it’s very basic. It doesn’t have much (if any) error handling and doesn’t have much optimization. There’s a lot that can be done to make the script faster and be more error resistant. It just requires time that I don’t have right now.

Another nice thing about the Raspberry Pi is that I can just pop a small USB wifi adapter into one of the open USB ports and that’s all that’s needed to get it online. It’s currently running in the other room and I have a console open with the output of the webcam script scrolling past the screen.

If you’re looking for a really small and rather cheap development platform that has a lot of versatility and doesn’t require an advanced computer science or engineering degree to get started with, I highly recommend the Raspberry Pi. There are a ton of third party attachments, modules and peripherals that you can get.

Apr 25th, 2014 | Posted in IT, Nerd, Programming
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>