| Servo motors turn through a precise angle. They are controlled by a series of pulses. The width of the pulses to the servo motor controls the angle through which it turns. It is easy to use them with PICs (if suitable programming software is used). |
 |
How does it operate?
|

|
These notes refer to the Sanwa type SW102Z servo motor (Rapid Order code 43-1044) but the operation of all servo motors is similar.
Servo motors need to receive a steady stream of pulses. The width of the pulses to the servo motor controls the angle through which it turns. Servo motors can only turn to fixed angles – limited within a range of about 180o. They cannot rotate continuously. |
|

Click on the circuit diagram to download a Livewire file of the circuit that you can investigate and add to your own circuit. Note that there is no symbol for a servo motor in Livewire, so the operation of the subsystem cannot be simulated. |
Servo motors consume quite a lot of current and generate considerable electrical noise, so they need a separate power supply.
The width of the pulse needs to be between 0.75ms and 2.25ms.
To connect the servo motor to the input signal and the power supply:
- Connect the red lead of the servo motor to the positive voltage on the separate 5V power supply
- Connect the black lead of the servo motor to 0V on both the power supply for the electronics and the separate power supply
- Connect the blue lead of the servo motor to the input signal (providing the stream of pulses).
|
|

|
To operate, a servo motor needs to receive a pulse every 20ms, and the pulse needs to be between 0.75ms and 2.25ms long. The length of the pulse controls the angle that the servo motor turns to.
PIC Logicator and PICAXE Program Editor have a special command called ‘Servo’ that produces suitable pulses.
The number in the ‘Pulse’ box needs to be between 75 and 225 to produce a pulse of length between 0.75ms and 2.25ms. The ‘Pulse’ number can be a variable. |
Possible applications
- Moving a barrier or the arm of a robot to different controlled positions
- Moving an item on a point-of-sale display through various angles
- Servo motors are widely used in radio control
Making
|
 A three pin PCB-mounting terminal block
|
 How part of the PCB might look
|
The three wires to the servo motor can be connected to the PCB using a three pin PCB-mounting terminal block.
|
Build and test the unit that will provide the input signal before adding the servo motor. |
Testing
Before connecting the servo motor, use a multimeter to check that the terminal on the connector that will be connected to the:
- red lead to the servo motor is at +5V;
- black lead to the servo motor is at 0V.
Connect the servo motor. Write a short program that will:
- produce 0.75ms pulses
- delay for a few seconds
- produce 2.25ms pulses
- delay for a few seconds
- repeat this sequence
Fault finding
If there is a fault, check the three wires to the servo motor are connected correctly and are at the correct voltage.
Check that a suitable stream of pulses is being fed to the servo motor by using an oscilloscope.
Alternatives
- A stepper motor moves through a fixed angle. Stepper motors are less expensive than servo motors, but they cannot be moved as precisely and the PIC programming involved is more complicated.
- A solenoid can be used to move an object between two fixed positions. Solenoids are less expensive than servo motors, but they can only move to two positions and they are not as powerful.
- A d.c. motor can be used to move an object between two fixed positions, provided two microswitches are used to stop the motor when it gets to the required position. d.c. motors are less expensive than servo motors, but they can only move to two positions and the programming (or electronic hardware) involved is more complicated.
Web links
Return to list of datasheets