Control of the servo using the 12F683 PIC microcontroller
Design Nature Fall 2007
The PIC 12F683 is a 8-pin microcontroller. The detailed instructions are included in its datasheet. The PIC has been programmed to send pulses of different width (specify details) for different periods of time (specify details). The wiring of the microcontroller is shown below,
where GND is ground, VDD is the applied voltage (2-5.5 Volts according to the specs, but the circuit has worked with as much as 6 Volts using four AA batteries). Servo Out is the signal that should be connected to the signal wire of the servo (white or yellow wire). The voltage at Endpoint 1 controls one of the end positions of the oscillation, and Endpoint 2 controls the other. The voltage at Period 1 specifies the time that the servo stays at Endpoint 1, and Period 2 specifies the time at Endpoint 2.
The voltage must be between ground and VDD, but other than that, it can be specified in several ways. One way of manually controlling the voltage is using a potentiomenter as shown below.

For example, the circuit shown below implements oscillations from one extreme of the servo to the other (since one endpoint is attached to ground and the other to VDD), where the amount of time at each endpoint is the same (since they are tied together), but controlled by the potentiometer.

In order to facilitate the construction of a circuit that takes advantage of the microcontroller, two printed circuit boards can be provided. The larger board ([length]" X [width]"), shown below, is designed to include four potentiometers, the chip and two headers for power and connection to the servo.

The smaller board ([length]" X [width]"), shown below, is designed to include four voltage dividers specified by pairs of resistors, the chip and two headers for power and connection to the servo.

Both boards have mounting holes that use 2-56 screws. The behavior of the chip is programmed in assembly code, which is then compiled. The code is uploaded into a PIC 12F683 using a PICKIT 2 from Microchip.