Serial controlled servo


I am planning a homebrew project which will require a single servo to be controlled by a (linux) PC via a serial port, and had a few questions.

Will the Pololu Serial 8-Servo Controller interface directly with my PC serial port, say, using a C program; or do I have to purchase some sort of master controller for the setup?

Also, how can I power the controller/servo from an AC outlet? Are there any recommended AC adapters to use?

You can hook either the Serial 8-servo controller or the micro serial servo controller directly to an RS-232 serial port (or the Serial 16-servo controller for that matter, but why pay more when you only need the one servo).

The serial 8 servo controller even has a built-in DB9 port, so you can plug a serial extension cable right into it (straight-through, not null-modem):

The micro serial servo controller is a little cheaper, and you can still hook one up directly to a serial port, you’ll just need to cut up the end of a cable and connect the ground and TX lines (and make sure to connect it to the RS-232 input pins, NOT the logic-level serial pins). If you’d rather work over USB, the USB-to-Serial adapter and micro serial servo controller is a killer combination, and a whole lot cheaper than the USB 16 servo controller. Some people have had difficulty to get these running under Linux, but mine works fine with Kubuntu, and I’m still running Feisty Fawn!

As for power, a 5-6V “wall-wart” style adapter might do for just one servo, depending on the quality and current capacity (I’d say at least an amp), but you’d have to try it to find out, and some are pretty lame. The other end of the spectrum would be a nice regulated benchtop power supply, but those can cost hundreds of dollars, and they’re way more power than you need.

If you can’t find a nice reliable wall-wart, or if you might want to add more servos later, a switching power supply would be a good compromise (like the kind that laptops use, with the box along the cord, not against the wall). Most laptop supplies are higher voltage than you would want, but some have separate 5V lines you could use. You might also find a switching supply from some other piece of hardware, like an external drive enclosure. You could also use the switching supply from an old desktop PC, like an ATX supply, or MicroATX, or even smaller. You would only need ~50 watts to drive all eight servos against a heavy load.

What I like to do is scavenge the old switching power supply boards that used to be included in bulky device enclosures for things like external tape drives. You can get them cheap or free from junk electronics stores, since they usually only try to sell the drives and not the enclosures. Big universities also tend to have lots of old electronics to dispose of. I’m running a six-servo robot arm off of a power supply board I found in a SCSI drive enclosure between two dumpsters outside my school’s property disposition building.

Of course it should go without saying to be super-careful if you do hack up a 120V adapter board, and you should definitely either leave it in the enclosure you got it in, or house it in some other well insulated and ventilated casing.

So, whats your plan for this servo anyway?


Hey, thanks for all the info! It’ll be very helpful (I’m more of a CS than an EE).

I was planning on making a pan (maybe add tilt) mechanism for a webcam I recently bought.
If I can get it working, I’d eventually like to do some motion detection and focusing on moving objects.
I’ve seen a lot of sites that people do such things, so I figured I’d give it a shot.

Thanks again!

Sounds very cool. If you’re interested in buying some pan/tilt hardware for your servos, ServoCity has a variety of models for Hitec or Futaba servos. Most of their stuff is meant for way higher loads (and higher prices) than you would need, but the SPT100 is only $20, and would be plenty for something light like a webcam.

Also, for homebrew computer vision, you should take a look at OpenCV on SourceForge. It’s a really nice set of computer vision libraries that Intel originally developed, then released under a BSD license. You can do something like motion tracking entirely with their filters, or you can just use their basic functions to get over the initial hurdles of displaying the webcam video in a window while having access to arrays of RGB integer values for each frame at the same time. I’m more of an ME than a CS, but that’s the fun part to me, not trying to pick apart the drivers for a particular webcam!