Loading...
Pages: [1]   Go Down
Author Topic: Arduino Uno - which pin can control servos?  (Read 666 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there, been away for a while but started pikcing up a project that I left off for over a year. I haven't worked on this for a while so please forgive me if I am a bit rusty. I'm at a point where I would like to have my Arduino UNO control a servo. I've been reading a lot of posts out there, but there seems to be a couple of libraries out there to choose from (Arduino Servo library included in the IDE, and a Software Servo library, etc.).

Most people seem to recommend to use pin 9 and 10 to control the servo. However, I already had these two pins controlling two motor drivers so they are not an option. I've seeon other examples that seem to suggest that any output pin (PWM or not) can be used to control a servo, but I'm not sure if that's specific to just a particular servo library or not. I've also seen comments on Arduino 1.0.17 or newer having different capabilitites than the older boards when it comes to servo control. I'm also interested in finding out whether using a pin to control a servo will change the PWM characteristics of other pins.

I guess I am hoping to find out the pros and cons of the different servo librarys, and which other pins I can use to control the servo. Currently, digital pins 0-2 and 9-13 are all assigned to specific functions, but the rest of the digital pins and all the analog pins are still open to assignment.

Any help will be greatly appreciated!

Thanks,
- K.
Logged

Seattle, WA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh by the way, is there a library that provides better resolution than 0-180 degrees? I'm trying a control a servo that has 6 turns lock-to-lock (i.e. 2160 degrees of travel from one end to the other) so a higher resolution than 180 positions would be quite useful.

Thanks again!
- K.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 316
Posts: 35535
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've seeon other examples that seem to suggest that any output pin (PWM or not) can be used to control a servo
Any pin can be used to command a servo.

Quote
Oh by the way, is there a library that provides better resolution than 0-180 degrees?
Can you direct this servo to any spot between 0 and 2,160 degrees?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 279
Posts: 15314
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I've seeon other examples that seem to suggest that any output pin (PWM or not) can be used to control a servo
Any pin can be used to command a servo.

Quote
Oh by the way, is there a library that provides better resolution than 0-180 degrees?
Can you direct this servo to any spot between 0 and 2,160 degrees?

Don't know about the OP's servo as he didn't post a link to it, but yes, using servo.writeMicroseconds() one can command a servo directly to anywhere within it's control range. There are servos that can turn some full or multiple turns (not to be confused with ex-servos that have been modified for continuous rotation service) over there command range.

Lefty
Logged

Seattle, WA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks both, this is very helpful. I am using a GWS S125 6TD "Sail winch" servo. I read some documentation that claims it has a resolution of 4,096 positions (12-bit ADC?) across a motion range of 6 full turns, but I can't find that link anymore. Honestly I don't need that kind of precision. In fact, 0-180 (approx 12 degrees per step) is probably more than enough for my application, but I'm always interested in the boundary conditions of maximum control just in case the need comes up.
Logged

Seattle, WA
Offline Offline
Newbie
*
Karma: 0
Posts: 36
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Folks, just hooked up my servo on pin 16 (Analog pin 3 on my UNO), hooked up the servo library with a few lines of code and it just worked! Thanks for the advice.
Logged

Pages: [1]   Go Up
Print
 
Jump to: