servo not working in basic setup

hi all

i'm new to the forum!

i have a problem and cant get it to work. hope you guys can help me out.

Its about a Tower Pro MG995 servo

wired everything up as seen in the picture, servo has external power (5V 2A)
both servo and arduino share ground

i uploaded the following code: (at the moment this code, i tryed multiple codes like sweep)

#include <Servo.h>

Servo myservo;

void setup() {
myservo.attach(9);
Serial.begin(9600);
}

void loop() {
myservo.writeMicroseconds (1500);
Serial.print("center");
delay (1000);

myservo.writeMicroseconds (1000);
Serial.print("left");
delay (1000);

myservo.writeMicroseconds (2000);
Serial.print("right");
delay (1000);
}

When i apply power.
all i get is the servo rotates to the right.
doesnt move left and right.
at max angle its softly buzzing and vibrating. but doest rotate.
when i turn off the power, gently hand crank the servo to the left.... then power it again. the servo rotates to the right and stays there

Hope you guys can help me out!

With kind regards
robbert loos

wired everything up as seen in the picture, servo has external power (12V 2A)

Tower Pro MG995R Digital Metal Gear Servo

MG995R Servo

MG995R RoHS Standard weight- 55.0g

Standard weight- 55.0g

Dimension 40.719.742.9mm

Stall torque 8.5kg/cm(4.8V),10kg/cm(6V)

Operating speed 0.20sec/60degree(4.8v), 0.16sec/60degree(6v)

Operating voltage 4.8-7.2V <================WHAT DOES THIS SAY IS THE MAXIMUM OPERATING VOLTAGE ? !!!

Temperature range - 55

Dead band width 5us

WHAT'S WRONG WITH THIS PICTURE ?

sorry my mistake haha, i meant 5v 2 amps.
to much brainstorming today haha, its powered by a samsung usb phone charger
rated @ 5v 2 amps

OK.

Have you run the same code with an ordinary rc servo (any size) ?

no this is my first time working with a servo.
used to to build simple systems to power relais, neopixels. stuff like that

the rx led is blinking and the serial monitor reads "left center right" so i can see the program is running. tryed to use another pin but no difference

Is the servo just sitting oo a table or bench with nothing connected to the horn ?

thats right, just a simple mount on the rotor, no load at all
if the picture is opened in a separate windows its visible

a lesson for the future , schrink the picture so its fully visable

if the picture is opened in a separate windows its visible

The best way to post a photo is as an attachment using "Additional Options" instead of copy & paste. I saw the photo and I didn't see anything wrong. Have you measured the 5V that you are using to power the servo ? Have you tried powering the servo from the arduino ? (It won't damage it. The worst that could happen is the arduino would reset if the servo pulled the Vcc below 4.5 V.

yes the power supply is a good 5v. use it all the time to power setup before i solder it to a pcb.
tryed to power direct from the arduino board, when hand cranked the lever the left and put power on the servo it rotates back to the right (slower as external psu) noticed the pwr led on the arduino is dimming.
its like the servo draws to much current from the board.
yesterday i noticed when the servo is powered from the arduino. im unable to upload sketches even reset wont do the trick.i have to reboot my pc. then its working again

The USB port on the PC has an overcurrent detect that shuts it down until the PC is reset.

I'm suspecting a few things here (ideally, you'd want to try a second, known-good servo first, though):

  1. Check that your signal wire has continuity - sometimes those cheap jumpers break.

  2. Check that you have a solid connection (and continuity) between the signal wire and the connector (sometimes the connector can be broken).

  3. Check that the signal wire of the servo has continuity.

  4. Verify the position of the servo potentiometer.

Items 1 & 2 can be done using a multimeter; you might also write code to send regular PWM down pin 9, and hook the signal wire up to a resistor and LED to verify things - although checking the signal with an oscilloscope would be the best way (you'll see continuity, be able to verify the frequency, and the voltage level).

Items 3 & 4 will be difficult to do, because you will need to open the servo to access the signal wire solder point (for item 3) - and to take apart the servo far enough to center the potentiometer.

Basically, to center the potentiometer (once you have it all the way apart, and have verified the signal wires) - you will see a motor, and the final output gear will be connected to the potentiometer (the output shaft is generally the shaft of the potentiometer or coupled tightly to it). Send the "middle" signal (1500 uS) and watch the motor - if it rotates (however fast or slow), rotate the potentiometer until it stops - that's "middle position". Remove the power, reassemble the servo, then try your test program again.

If it still doesn't work, then your servo is bad most likely.

cables and wiring are all oke.
i took the servo appart and found the potentiometer.
i send the middle signal, powered the servo, the motor starts spinning, i try to find the middle but it wont stop.
there is a position where the rpm goes very low but it wil not stop, if i twist about 1 degree further it spins on max speed again

Generally servos that uncontrollably turn in a single direction and lodge against the internal hard stop have either a bad control signal, or the servo and arduino grounds are not properly tied together.

I can't see the picture so can't comment on it.
Cr0sh has already asked but I'll ask again; do you have access to an oscilloscope? Seeing what is coming out of the arduino pin will tell you a lot.
My guess is that there is a hardware issue here, but something else you could try if nothing else works to use a different servo library file, i.e: ServoTimer2

I had the same experience as you. But now I found out the reason, that you should also consider the ampere. Output of the most mobile charger is less than 0.7A. this servo needs more than 2 Amp. I just connected 4 AA sized batteries in series. and worked fine.