Recommended changes to Servo reference page

Recommended changes to: http://arduino.cc/en/Reference/Servo

I suggest changing the first sentence of the servo reference page from: “This library allows an Arduino board to control one or two RC (hobby) servo motors.” To: “This library allows an Arduino board to control RC (hobby) servo motors.”

Also, the text in the Circuit section should mention that servo motors can draw considerable current and an external power supply may be required to drive more than one or two servos. When using external power, the ground of the supply must be connected to Arduino and servo grounds. The fritzing example diagram can be used to illustrate connection for a single servo. Something like this would be useful to show how to connect external power.

Updated the text. Great diagram, but I'm too tired to add it now. Maybe we should give you permission to edit the pages directly?

I would be happy to do that.

Also the reference page should note that analogWrite on pins 9 an 10 are disabled when using the servo library. The second paragraph of the reference should contain something like this:

As of Arduino 0017, the Servo library supports up to 12 servo motors on most Arduino boards and 48 on the Arduino Mega. In Arduino 0016 and earlier, this library uses functionality built in to the hardware, and works only on pins 9 and 10 (and does not work on the Arduino Mega). In this case, if only one servo is used, the other pin cannot be used for normal PWM output with analogWrite(). For example, in Arduino 0016 and earlier, you can't have a servo on pin 9 and analogWrite output on pin 10.

From version 0017, any free digital pin can be used for a servo. On all boards except the Mega, analogWrite on pins 9 and 10 are disabled (even if those pins are not used by the servos). On the Mega board, all analogWrite pins are available for up to 12 servos, PWM on pins 11 and 12 are disabled when using between 13 and 24 servos.

PM me if you would like to enable me to make the changes

Fixed, more or less. I’m going to try to work on a set of recommendations for contributors that should make it easier to add more people to the documentation team.

Maybe change the pic to 4 AA's? I haven't tested any servos at three volts but would bet at least some would be sluggish or inoperative.

pb

The picture uses Fritzing's generic image for a battery pack (the other two cells are underneath ;)

The text block in that picture does say four AA cells, but if the font was bigger it would be easier to read.

edit: here is an updated picture with larger text:

Any chance the information about power and ground (and the picture) can get added to the reference?

See this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1251825966/0

Absolutely seconded, wish I had seen this information earlier :slight_smile:

Sorry for the newbie question lol, how would you wire this up without the potentiometer?

I'm not sure where to put the wires from the arduino, gnd & 5v on the breadboard without frying my poor arduino :o

I'm also guessing some resistors might be involved in place of the potentiometer?

how would you wire this up without the potentiometer?

Without a potentiometer. As in, "not there", "omitted".

I'm also guessing some resistors might be involved in place of the potentiometer?

Guessing wildly, and wrong. No resistors needed.

As Groove says, if you don’t need a potentiometer then you can ignore it. Its in the tutorial picture because that tutorial is for the knob example sketch which uses a pot to set the servo position.

Wire the servos as shown in the picture but leave out the red, blue and black wires connecting to the potentiometer.

The black wire connecting the servo grounds to the Arduino ground (and the power source ground) is still required.

Cant you just power the arduino from usb or mains & attach the pwm wire on the arduino to the breadboard?

I'm hoping to use a bench power supply & dont like the idea of powering the arduino from the same power supply as the servos.

Cant you just power the arduino from usb or mains

You are powering the Arduino from USB - in the diagram above it explicitly states that the +ve wire from the battery should not be connected to the Arduino.

& attach the pwm wire on the arduino to the breadboard?

sp. “PPM”

Thnx, im guessing the ground from the arduino is to prevent the arduino from frying a current through the servo pin on the arduino?

The grounds are needed to provide a common reference level for the control signal from Arduino output pins. Without the common ground, the servo would have difficulty interpreting the Arduino pulses. But only a very small control current flows through the ground connected to Arduino, the servo motor current goes through the ground connecting the servos to the power source.