Servo Motors

Background

servo3 (2).jpg  servo2.png

A servo motor is a special type of motor with internal electronics for control. It can rotate 180 degrees and is controlled using a single wire to tell it the position it should be in. A 50 Hz pulse signal is sent on the line with a varying on-time between 1 and 2 milliseconds corresponding to specific positions of the motor. The motors provided in your kit can move at a rate of 60 degrees in 0.1 seconds. They are typically powered from an external source (not the Arduino's 5V power supply).

 

Hardware Description

servo_no_ps_bb.png

Pinout

Note: If you are using more than one servo or a larger servo, you must use an external power supply to provide 5V to the motor. Make sure to connect the ground between the Arduino board and the power supply, so they have a common reference.

 

Software Description

This library allows an Arduino board to control hobby servo motors. The Servo library supports up to 12 motors on most Arduino boards. On the Arduino Uno, the library disables analogWrite() PWM functionality on pins 9 and 10, whether or not there is a Servo on those pins.

https://create.arduino.cc/editor/mjdargen_ncsu/141a1d00-9c5f-45e9-9924-3b218bf70ade/preview

 

More Advanced Control

If you want to better control the speed that your servo moves, you can use a function I wrote entitled my_servo_write.

https://create.arduino.cc/editor/mjdargen_ncsu/2f2d095b-9fb3-4f3b-8ee2-45dd15c3914c/preview

 

Resources