Servo connect

Hey,

I'm waiting to get my first Arduino (uno) controller and reading some informations...

Now I see a lot of different info on how to connect a servo!
Red wire to 5V, black to ground, ok that's fine. But what about the signal wire?

I thought servo's are controlled by PWM, but a lot of tuts connect the signal wire to a normal digital output, or even a analog input? :o
Digital output (without PWM): http://communityofrobots.com/node/169
Analog INPUT: http://www.arduino.cc/playground/Learning/SingleServoExample
And other resources say digital output with PWM.

So what is actually allowed, or do all inputs/outputs work? :o

Thanks in advance, Pidgey

The signal wire must be connected to a pin that can act as a digital out. These include

  1. the digital PWM pins
  2. the other digital pins
  3. the analogpins ==> by calling pinMode(A0, OUTPUT); it becomes a digital out (IIRC the servo lib takes care of that )

JUst give it a try,

Power supply:
Be aware not to drive to many servo's from the Arduino board as the board cannot provide that much current.
A separate power supply for servo's is good engineering!
==> do connect the GND of Arduino with the GND of the servo power supply so they share the same reference

succes,
Rob

Ok thanks a lot!
I thought servo's needed PWM in order to work, but I've read some information now and know I know this isnt true :slight_smile:
And I think the Software Servo library is better than the Servo library, am I right?

And I think the Software Servo library is better than the Servo library, am I right?

No. Software implementations are never as good as hardware implementations. Otherwise, where would the incentive be to handle events in hardware?

Otherwise, where would the incentive be to handle events in hardware?

Memory consumption :wink:

Paul is right, hardware implementations are faster, more reliable, no (or less) RAM usage but they can be less flexible e.g. only work for certain pins. Software implementations are slower, use flash and RAM, but they might be fast enough and are often (a bit) more flexible.

Tip of the day is: use hardware version if possible

Aight I understand!

But is it in the 'hardware implementation' also allowed to use the analog input pins for driving the servo?