Servo commander

Fichier attachéTaille
Icône paquet servosource.zip16.4 Ko

The original article is in the archives :

But wait, if you want the sources (zip file) they are attached bellow.

I would suggest anyone trying to do this kind of project to recreate the soft I made using a cross plateform / open source langage like java or python. You just need a langage that has support for low level input/output and high resolution timer.

Here is a quick copy :

How to control 8 servo motors with a PC ?

This document is intended to provide basic yet complete informations to the guy who wants to control up to eight servo motors with one LPT (printer) port. Soldering ability is needed, and some programming skills are needed, although full exe and source is provided for free.

This little project could be used by teachers, as it is quite simple and cheap. With this, you can control 8 independent axis (!) and so build a good robot.

You should use a PC running win95 with Delphi 3.0. But any other computer with precise timer should do the job.

The programming tool used here is Delphi 3.0 (turbo Pascal + windows + object oriented programming) because it's easy and quite as powerful as C.

The cost of this project is max 1$ (wires...) without any servo...

Introduction, remarks.

It is in fact very easy to control a servo motor with a computer. Those motors are used in RC (radio command) for airplanes, car and boats. Those motors have built in the whole electronics to control them. All you need is power (5v) and a special signal to adjust there main arm position. They generally have 3 wires : a positive alimentation (5V) often RED

  • A ground (0V) often black or white :>(

  • a data line often brown or violet or...

You need to give them permanent power. Is so, they will stay in one position. To unlock them, turn the power off. To control the arm's position, you need to send , every 20Msec (no critical) a pulse of 1.5 -> 2 Msec length. The length of the signal gives the position of the arm. Sending this signal is exactly what a computer can do. But the most complicated task is to set up a high-res timer (1/100 Msec). Windows provides all the API needed to do so. We'll use the // port of the PC to control up to 8 motors (1 motor for 1 data line)

The electronic

No components, just wires !

What you need :

  • Soldering iron

  • 3m of wire

  • DB 25 connector

  • Some connectors for your servo. They normally have 3 pins with 2.54 mm space. Obviously, if you are using 1963 servo's...

  • Some bread board (3*5 cm)

  • A power of 5 V (or get some from the PC. Take care !

  • Some servo motors. those are not really cheap, at least 10$ each ...

You simply have to connect all the grounds and +5V together, and each motor's data line to the LPT port data output. The LPT data lines are pins 2 to 10.

There are no buffer or transistors. You can safely omit them if you are using standard servo. Keep in mind that the computer needs only to control the servo's, through the data line, and that he doesn't need to power them.

The "software"

A basic soft (with Delphi 3.0)

No need to break your head against the walls, we only have to make a good delay routine, and a good LPT control routine. Some assembly needed, as win32 doesn't allow direct outputs controls.

We simply create a timer which sends a signal every 20 Msec of a length between 1.5 and 2 Msec.

This soft is not available for downloading because it's not very useful and because I've lost it. You'd better download the full version...

The full version (also with Delphi)

This one can control up to 4 servo's (upgradable to 8) with the mouse or a joystick. You can program difference steps and save them in a text file.

It's not very useful to add a lot of comments, see the source for details...

  • (17k) : the Delphi 3.0 sources

  • : the compiled version (win32 .exe)


Connect everything : it should work...
If nothing happens, you are not very lucky, verify the lpt port, check the servo, check your brain...

If some smoke get trough, remember : 1. allways try this at a friend. 2. I'm not responsible of wathever could happen to you, your house or your dog.

Further developements?

I don't think I will ever expand this project further, but feel free to use the ideas found here.


  • If it breaks something, it's not my fault,....

  • the code is gpl if you really care