Do you have a remote control (R/C) system just lying around collecting dust, since you invested in a computer? This article will show you how to give mechanical 'life' to your MicroBee by using the servos from your R/C system. Using a transistor, few resistors and power supply, you can obtain another dimension from your computer system, other than sight and sound.
Most servos have three connection pins, two for supply and a control pin. The type of signal used for controlling, is a pulse width modulated (PWM) type. In using PWM, the length of the pulse applied to the control pin is directly proportional to the angular position of the servo. The servo experimented on (Futaba FP-S23) had a full left pulse of ~2 msec and a full right pulse of ~0.05 ms. For effective use the servo must be continously fed this control pulse.
The two supply pins are the ones which are close together, the outside one is GND and inside Vdd. Powering Vdd from an external (not the 'Bee) 5v supply would be advisable as the servo can draw up to 400mA if it is heavily loaded. Using a NPN transistor (548,549), the following connections were made: i) 'Bee Gnd to external Gnd; ii) Emitter to Gnd; iii) 5V external to Collector, via a 10k resistor; iv) Collector to final pin of servo; v) A data bit (from the parallel port) to Base, via another 10k resistor. Thats all the hardware required, all that is needed now is the driving software.
The controlling software needs to be written in EDASM, to cope with the short output pulses which are so critical. The software listing below will allow you to control the position of the servo from the keyboard, it will also allow you to store a sequence of positions and replay them. The program is messy (havn't had time to re-write it), it can be greatly improved and/or simplfied.
There's no reason why you can't control up to eight servo's from the parallel port, it's only a matter of writing a program which outputs a pulse on one data line, then another pulse on the next line and so on. Even more could be controlled if a decoder IC (eg. 74LS138 3->8) is used.