Pages: [1]   Go Down
Author Topic: Newbie advice needed on servo power and control  (Read 763 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
God Member
*****
Karma: 7
Posts: 647
"In this house, we obey the Laws of Thermodynamics" Homer J. Simpson
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have used a very small servo powering it directly from my uno (which is getting its power via USB) and controlling it using the servo library - all went well. Now I am considering using a larger servo but there are some gaps in my understanding.

The servo I am thinking of using is a Hitec HS-645MG http://www.servocity.com/html/hs-645mg_ultra_torque.html

Power Supply
The operating voltage of the servo is 4.8 - 6.0V .
What is the best way to power this unit ( I may wish to run similar sized stepper motors in future as well ) ?
Servos have 3 wires, two for power and one for control. If my servo is getting its power from a separate power supply how is the control from the uno wired up, do the uno and the power supply somehow need to share a ground ?

Control
This servo appears to be controlled as follows;
 600us pulse = -90deg position
1500us pulse =   0deg position
2400us pulse = +90deg position

I am not really sure why the control is described in that way.
I am just assuming that I can treat 600us as being 0deg, 1500us as 90deg and 2400us as 180deg, is that correct?
My main question is the servo compatible with the servo library?
Finally where can I find the source for the libraries?
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 65
Posts: 3643
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What is the best way to power this unit
Batteries if you need mobility (not the PP9 - it's useless for this purpose) or a Wallwart or other tethered power supply if you don't. When I first got some servos, I searched around the house and found an old wallwart that had sufficient power - looks like you should allow at least 500mA@6V for that particular servo.

Quote
Servos have 3 wires, two for power and one for control. If my servo is getting its power from a separate power supply how is the control from the uno wired up, do the uno and the power supply somehow need to share a ground ?
Uno and power supply grounds must be connected.

Your servo should work with the servo library. You may need to experiment to see how it reacts - the range of movement may not correspond to what you're expecting in the code, but you can just adjust for that in your sketch.

Code is already on your machine somewhere under your Arduino installation directory. For me:
/Applications/Arduino.app/Contents/Resources/Java/libraries/Servo
Logged

Offline Offline
God Member
*****
Karma: 7
Posts: 647
"In this house, we obey the Laws of Thermodynamics" Homer J. Simpson
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll take Wildbill's advice and start by using a wallwart.
Connecting the uno and the power supply grounds is the bit I am still unsure about though.

The wallwart will be 6V DC with two wires to attach to the servo.
One will be +Ve and one will be -Ve.

Do I attach the walwart -Ve to both the servo and to the gnd on the uno?
Does it make any difference that the uno is 5V and the servo 6V?
Does it make any difference where on the uno I attach the walwart wire?

I am sorry for asking what I am sure are very basic questions but I don't want to fry my uno or the USB on my laptop.

Looking ahead are there any recommendations for a more general purpose power supply for a beginner wanting to experiment with small scale servos and steppers. I doubt I would want to power more than four at a time.
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 65
Posts: 3643
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do I attach the walwart -Ve to both the servo and to the gnd on the uno?
Does it make any difference that the uno is 5V and the servo 6V?
Does it make any difference where on the uno I attach the walwart wire?
Yes. Or at least, servo ground, Uno ground and wallwart ground need to be connected.
No.
No. Ground on the Uno is what you need. Any of them will do, or something that's attached to them

Make sure you get + and - from the wallwart the right way round - it's important - I have a dead servo to prove it.
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 65
Posts: 3643
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a picture of the setup. Wallwart power comes from the black & green connector at the bottom. Arduino power (unplugged) comes from the USB.Common ground is established on the breadboard. Arduino pin 9 is used via the servo library to move the servo.


* servo.jpg (907.09 KB, 3072x2304 - viewed 17 times.)
Logged

Offline Offline
God Member
*****
Karma: 7
Posts: 647
"In this house, we obey the Laws of Thermodynamics" Homer J. Simpson
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Brilliant, thanks for taking the time to post that WildBill. For some reason I have trouble reading the jpg you posted, if I save it to file then try opening it Microsoft Photo Editor says "Error reading file". I have noticed that with a couple of images posted on the forum recently, so the problem must be with me or the site, not with your post.

Anyway I can see your picture in my browser and make out how things are connected. It gives me a lot more confidence to proceed - thanks.
Logged

Pages: [1]   Go Up
Jump to: