Analog servo doesn't work

Hi Everyone!

I try to control an analog servo, which i bought yesterday. At the shop they tried it and i saw it worked.
I use the Servo library to control the servo.
I tried to control a tiny Micro SG90 servo and it worked with my code, and it is working well.
Than I tried to control the analog servo (which is a Feetec FS5106M, Operating Voltage :4.8V~6V), but it didn't move. If I give it a push than it moves to the position which I specify. In this case the power supply was the arduino for both servos, and the arduino is connected to the USB port of my computer.

I try other power supplies, for example batteries and the 5 V output of an ESC, but in these cases the analog servo doesn't move too.

Do you have any idea what is the problem?

Thanks! :slight_smile:

And my code is here:

#include <SoftwareSerial.h>
#include <Servo.h>

String be;
int szog=90;
Servo myservo;



#define _ServoPin  6
void setup()   
  
   Serial.begin(9600); 
   myservo.attach(_ServoPin,900,2100);
   myservo.write(90);
   
}

void loop() {
  // put your main code here, to run repeatedly:
    if(Serial.available())
    {
      be=Serial.readString();
    }
    szog=be.toInt();
    Serial.print("szog: ");
    Serial.println(szog);
    myservo.write(szog);
}

The problem is you underestimate the current needed for a servo - for small servos budget 1A, but that
Feetec one is high torque and probably needs more like 2A. What kind of batteries did you try? Did
you monitor their voltage under load?

You should never be powering a servo or motor from the Arduino 5V rail, that's a logic supply rail and
you risk dropouts or overvoltage spikes on your logic chips if you put a motor load on that. Besides
USB cannot provide the 1A minimum you should be expected a small servo to require.

I tried just 4 AA batteries, which sum is 6 V, but no sing how much current they can give.The datasheet says its capacity is 2600 mAh.
Refered to the link:

I didn't monitored the voltage, should I do it?

So which power supply can you suggest to me for the bigger servo?

Thanks!

Can you draw out your wiring and post it here?
There is some question about how you have the power going to the servos.

My wiring is on the picture. 1. is with just the arduino
2. with external power soource

Awesome! After you post a picture like that, right click on the attachment and choose 'Copy link location'
Then modify your post, click the insert image button and past in the location.
It comes out looking like this:

Now on to the content. Both of your pictures show a problem.
In the first picture, you are powering a servo form the arduino. This is bad. Potentially damage to the arduino bad.
You are closer with the second picture. But that picture does not show a common ground. You need to tie the battery ground to the arduino ground. Failure to have a common ground leads to all sorts of poor behaviors. It catches out many people. Tie the grounds together.

Conic:
I tried just 4 AA batteries, which sum is 6 V, but no sing how much current they can give.The datasheet says its capacity is 2600 mAh.
Refered to the link:
http://www.varta-microbattery.com/applications/mb_data/documents/data_sheets/DS4106.pdf

I didn't monitored the voltage, should I do it?

So which power supply can you suggest to me for the bigger servo?

Thanks!

Charge capacity is not the same as current sourcing ability. mAh measures charge capacity only.
For RC use servos are powered from a decent rechargable NiMH or LiFePO4 battery pack, designed for the job.

The supply I'd use is a bench power supply to find out what it actually needs, then I'd be looking at
datasheets, or testing the rechargables I already have some of...