Hardware Reference
In-Depth Information
more than the Arduino can supply). Although you can sometimes run one or
two servos directly from the Arduino's 5V supply, you learn here how to use a
separate power supply for the servos so that you have the option to add more
if you need to.
Figure 4-9: Servo motors
Servos have a dedicated control pin, unlike DC motors, that instructs them
what position to turn to. The power and ground lines of a servo should always
be connected to a steady power source.
Servos are controlled using adjustable pulse widths on the signal line. For
a standard servo, sending a 1ms 5V pulse turns the motor to 0 degrees, and
sending a 2ms 5V pulse turns the motor to 180 degrees, with pulse lengths in
the middle scaling linearly. A 1.5ms pulse, for example, turns the motor to 90
degrees. Once a pulse has been sent, the servo turns to that position and stays
there until another pulse instruction is received. However, if you want a servo to
“hold” its position (resist being pushed on and try to maintain the exact position),
you just resend the command once every 20ms. The Arduino servo commands
that you will later employ take care of this for you. To better understand how
servo control works, study the timing diagram shown in Figure 4-10.
Search WWH ::




Custom Search