I started a fun project over the break - a mix of basic robotics, networking, and microcontroller programming.

Here's the idea: say you're talking to someone on Skype, the camera is looking right at them, but then they move, or someone else comes into the room. You want to change your view, but you can't: you're stuck looking at the same spot. What I want to do is to be able to move the other person's camera from my couch in Illinois: I press a button, and their camera in Maryland swivels. 

Sounds simple, but there are a lot of issues:

Physical Design: The camera needs to be set up on two swivels, each controlled by a motor - for left/right and up/down movement. It seems servos are way to go, since they can be given a specific angle and don't require additional gears. A normal motor would be hard to control and would spin too fast to be effective. The servos should be powered and controlled through a USB port on the same computer as the camera.

Circuit:  A servo has three inputs: power, ground, and data. The data wire can be either high or low voltage (1 or 0), and the portion of the time it is at 1 determines the angle of the servo. A USB connection consists of four wires: ground, power (+5V) and two data wires. In principle, each data port could control a servo, but this isn't a clean way of doing things, and doesn't scale very well (say I also wanted to add a NERF cannon to my setup - I'd have no way to control it). So, a microcontroller chip is necessary: the computer will occasionally provide it with angle information, and the chip will keep the servos aligned properly. Fortunately, these are pretty easy to get. Cindy's dad had a few AVR ATMEGA8515 chips lying around from a year-old project, so I'll be using one of them for RoboCam.

USB Connection: So, suppose the AVR can control the servos. How do you talk to it? Turns out there are some AVR chips that have built-in USB support, but there's also a project on the web to make most AVRs capable of this: V-USB. There is a basic driver for USB connectivity, as well as lots of sample projects to work with, including USB-Servo. So, I just need to replicate this project for the USB connectivity part, tweaking the firmware a little bit.

Networking: The AVR will be controlled by a program on the host computer that recieves its commands from the guest computer (me). However, there's no knowing where the two computers will be: most likely, each one is behind a router, which makes it hard to initiate a connection. Thus, each computer needs to log into a central server, which will then officiate the "handshake" between them. The Jabber/XMPP protocol was designed to make this possible, and Google has a lib-jingle package that should make writing the guest/host programs possible. I was hoping to run my own Jabber server (I rent some webspace), but with cheap hosting comes the inability to install custom programs... Fortunately, Google also has a public Jabber server (which you use if you log into Google mail, talk, etc.), and I should be able to make use of that.

So, it should be a fun project. Check back or sign up for an RSS feed to read more about it!

Last Updated ( Friday, 15 January 2010 23:17 )