Pages: [1]   Go Down
Author Topic: Question about how to physically connect servos to an Arduino  (Read 829 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to purchase an Arduino and use it as a way to power and control a handful of linear servos. I've never added hardware to an Arduino before, but I have programmed an Arduino(-compatible) before. When I look at the connectors for linear servos (e.g., http://www.horizonhobby.com/products/1-9-gram-linear-long-throw-bb-servo-SPMAS2000LBB) they don't seem to be the same as the connector type (I think they use "JST-SHR connector type") on the headers of an Arduino board. How to I solve this hardware issue? Is there some sort of converter cable available or do I have to make my own solution? I see something here called Tinkerkit which apparently would solve my cabling problem but from what I can see there's a hard limit of 6 Tinkerkit servos and I was hoping to go a bit higher than 6. But I can settle for 6 if there's no other solution.
Logged

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

Quote
How to I solve this hardware issue?
With a pair of wire cutters. Cut the connector off. You'll need to do that to connect power to it, anyway. The Arduino won't power it.

Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 181
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your gonna want to power your servos separately from the arduino board.  Duane B has a good write up on how to do that.
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
He also has a write up on controlling up to 12 servos
http://rcarduino.blogspot.com/2012/01/can-i-control-more-than-x-servos-with.html
You can also find servo shields if you want to control more servos.  Here is an example
http://www.renbotics.com/servoshield2.php
Logged

0
Offline Offline
Tesla Member
***
Karma: 116
Posts: 8944
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The advice to cut off your servo wire connector is probably (wrong). I simply use hookup wire stuck in the servo connector pin hole and the arduino pin hole to connect the servo signal wire. Do the same on the servo connector to connect to an external power source.



Moderator edit: Insult removed. (Nick Gammon)
« Last Edit: January 25, 2013, 03:43:00 pm by Nick Gammon » Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all the interesting advice. One question... do I really need to use an external power source if my software will be controlling only a single servo at a time? I didn't mention that, but I will be powering only one servo at any given time. Perhaps the reason people think I need an external power supply is that they assumed I was going to move all the motors at once.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Apparently one of the links does address my last question. Sorry, I'll read the links thoroughly before asking any follow up questions.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Or get a screw terminal breakout shield
Couple of options:
http://www.ruggedcircuits.com/html/quick_shield.html
http://www.ruggedcircuits.com/html/aussie_shield.html

Or a Mega screw shield if you have a bigger board
http://www.crossroadsfencing.com/BobuinoRev17/
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

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

Thanks for all the interesting advice. One question... do I really need to use an external power source if my software will be controlling only a single servo at a time? I didn't mention that, but I will be powering only one servo at any given time. Perhaps the reason people think I need an external power supply is that they assumed I was going to move all the motors at once.

  Well the burden is on you to 'prove' to yourself that even just one of your servos can be powered properly from an arduino board. Current draw will be effected by the mechanical load placed on the servo, the maximum travel movements you issue and of course the current requirements of your specific servos. Servos use motors, motors draw lots of current. The arduino is excellent at controlling servos but very poor at powering them.

 We see so many posts from beginners about their servo based project having their boards go into unpredictably reset conditions and other maladies. So unless you can actually measure the worst case current consumption for all the external stuff you wire to your arduino board and can be sure it all stays below 400 ma or so, you are just delaying the successful completion of your project. Better to plan on adequately power management from the start rather then have to deal with all the rework otherwise bound to be required.

Lefty
Logged

Offline Offline
Faraday Member
**
Karma: 60
Posts: 3242
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

do I really need to use an external power source if my software will be controlling only a single servo at a time?

As Lefty says:

Quote
Better to plan on adequately power management from the start

Engineering is often about a solution being "elegant" not merely functional. To me, separating the plant from the control is "elegant". Engineering's also about "best practices", and there is no doubt from what this forum's gurus say, that powering a motor from the Arduino is not best practice, even if it can provide the current.

Logged

Retired from Arduino.
PMs are set to ignore all.

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's an analogy ...

Some (Windows) computers have a power outlet on the back. The intention is/was that you could plug your monitor into that, and save having to use up two power points on your desk.

Now you might be tempted to think: "ah, power!" and hook up your toaster, room heater, or electric drill to it.

But that exceeds what it is designed for, and the intention of such outlets is not to be a general "power supply".

So, it may work (powering the servos from the Arduino). It may work reliably. But quite possibly not.
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
One question... do I really need to use an external power source if my software will be controlling only a single servo at a time?
How are you going to power your board?

I've not read the links.... so apologies to the author if I'm repeating.... but I'd buy some sockets and make an interface board/loom. Why? Because I can then easily swap devices, which aids testing, speeds repairs etc, and if I have a faulty unit, I can return it under warranty. For testing, there is hook-up wire.


JST = Japan Solderless Terminal

You need to know the pin centres, 1mm, 1.2mm, 1.25mm etc.  - check out the JST site, you will probably find specs & connector part numbers there or you may be directed to a distributor.
Logged

For whom does the clock pulse? It pulses for you!

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23797
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Digikey carries JST connectors.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the awesome information. I hope this helps others besides myself.
Logged

Pages: [1]   Go Up
Jump to: