Buzzing Servo Will Not Turn

Hi,

I have been having an issue with my project. I am trying to make something simple, that allows me to turn the servo a small amount in one direction when the potentiometer is turned to that side, and turn it the other way, when the potentiometer is on the other side. It was working before, only occasionally, like right now, it just doesn't move and just buzzes.

I've researched it a bit and no, it is not an inadequate power source, I am using the power from my macbook pro via a USB 2.0 cable. In the future I would plan to power it with something like on of these:

I have been using Tinkercad's circuit simulation to simulate it, and with the exact same circuitry as in this design, it has not been working:

Everything is exaclty the same as in this diagram only the potentiometer's cables are actually a 3-core 4m long cable.

In case you're wondering, here is my code:

#include <Servo.h>
#define knob 0

Servo zoomServo;

int zoomServoPos = 0;

void setup()
{
  pinMode(13, OUTPUT);
  
  zoomServo.attach(9);
  
  digitalWrite(13, HIGH);
}

void loop()
{
  int zoomVal = analogRead(knob);
    zoomVal = map(zoomVal, 0, 1040, 70, 110);
    zoomServo.write(zoomVal);
    delay(15);
}

If there is anything that I have missed, please just let me know.

Thanks so much,

Ben

Your servo cannot be powered from a digital output pin.

image

That wiring could not ever be working in reality.

I didn't know this. Why not?

Also if I can't power the servo from a pin, can I power the potentiometer from it?

An Arduino output pin can safely supply 20mA ( .02A ) to a load.

You servo needs greater than 1A to start turning.

Can you start you vehicle with a 9 volt smoke detector battery, why not ?

I see. Thanks for letting me know. I'll change this now.

How can I have 1A of current when the max output for the 5v pin is 0.8A? I have never encountered this before, sorry for so many questions.

You should make a direct connection from the PSU to the servo, so that the current does not flow though the Arduino board at all.

What voltage does your servo require? It looks like you are (trying to) run it at 5V at the moment. If 5V is sufficient (provided current is also sufficient) then get an external 5V PSU. This can then power the servo and the Arduino (through the Arduino's 5V pin).

A couple servo power supplies (for the 4.8V-6V servos) are a 4 AA cell battery pack or an old 5V cell phone charger. Connect as below.

This is really helpful, thanks. Would there be a way to perhaps from the 9V adapter draw just 5V? So that I wouldn't have to have two power sources.

The Arduino is not suitable for converting 9V to 5V for anything but itself, so you'll need a 5V supply for the servo regardless. Just use that to power the whole project. Connect the ps ground to the Arduino ground and the servo ground, connect the ps +5 to the Arduino + 5 and the servo +5, and the signal from the Arduino to the servo. Connect the LED and the pot as you had done previously.
C

Isn't an arduino supposed to have 7-12v

It needs 7 - 12V at the Vin and power jack inputs for the onboard 5V regulator to work properly. Unfortunately the on board 5V regulator is not heat sinked so will handle limited current before it overheats and shuts down. If one wishes to power anything more than a few LEDs one should power the Arduino through the 5V pin with a power supply that outputs a well regulated 5V and enough current capability to power the Arduino and all peripherals that connect to the 5V. The external power supply bypasses the weak 5V regulator.

Although I agree with @groundfungus that you should power the Arduino via the 5V pin, bypassing the regulator, I understand your comment given that Arduino.cc still has this advice on their website:

* Vin. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
* 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.

I can think of no damage mechanism, but it's their advice, so be aware. Thing is, on this forum, we constantly advise people to power their Arduino via the 5V pin, and no one has, as far as I know, come to grief.
C

An alternative is to provide 7-12 via the barrel jack just for the Arduino, and power the rest with an external 5V source. If you do this, make sure you tie the ground of the external supply to the ground of the Uno.
C

Disconnect the USB cable when powering your Arduino with the 5V pin.

On some boards, you do not need to follow this; however, if you are not confident in what you are doing, just disconnect the USB cable.

So could I power this all via an AC to DC power converter like this one:

And then just strip a section of the cable and connect the ground and power to the servo? Or would I need one with a higher current to power both the board and the servo?

Also on several sites it says that the servo needs much less than 1A to work, but for some reason when connected to the 5V which supposedly has a 0.8A max.

Edit: Nevermind. I realised that the USB cable method of powering can only have a current of 550mA.

Also on several sites it says that the servo needs much less than 1A to work

What confuses many with servos is that there are many different current ratings for servos. Read on, for a brief summary. You need to find the spec for your particular servo, as the available devices are all over the map.

A Typical hobby servo

Specifications of interest from that page:
Running current (at no load): 400±30mA (4.8V ) 500±30mA(6V)
Stall current (at locked): 1300±40mA (4.8V ) 1600±50mA(6v)
Idle current (at stopped): 6±1mA (4.8V ) 6±1mA(6v)

Commentary:

  1. Idle current - when your servo reaches the end of travel by achieving it's setpoint, you will then draw the 'idle' current. It's more or less irrelevant, as other worst-case numbers are much larger.

  2. Operating current - usually, stated operating current is "no load" - literally, with no plastic horns even, but certainly with no coupling to any mechanical/physical process. That's the 450 mA (ish) above, once the servo is moving at the "Operating speed"; any resistance to movement increases this value.

  3. Stall current - if your servo perchance doesn't achieve it's setpoint, then you've got a servo in 'stall' until the next time you move it.

  4. Starting current (not listed) - When a servo starts moving, the current surge is very large; it's the same as stall, because it hasn't overcome inertia and friction to start the move. Starting current decays away as the device starts moving; but, if you try to move too slowly, for example in 1 degree steps with too much delay between steps(see the 'sweep' example in the Arduino IDE, change it's delays to 100 or more ms per step), you can actually have that starting surge repeatedly during a move, as the servo 'jitters' from A to B. So, 1350 mA more or less for this servo to start from rest.

So you need to find the specification for your particular servo.

Ok. Thank you so much!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.