Go Down

Topic: Servo motor just hums rather than writing the angle. (Read 331 times) previous topic - next topic

tdTedPaul

Code: [Select]
#include <Servo.h>
Servo servo;

void setup() {
    servo.attach(2);
    servo.write(90);
   
}

void loop() {
     
}


This is the code that I'm trying to use. I'm not exactly sure if my issue is a code error or the servo itself. If you use servos then you can probably tell that I'm just trying to write my servo to 90 degrees so I can use it as a kind of baseline for another project. When I upload the code though, the servo makes a humming sound and when I touch it I can feel it vibrating slightly. No actual turning. If I give the arm that I attached to it a push in the direction that I want it to go, it will usually end up going on it's own the rest of the way.

What can I do to fix this?

Here's the amazon link to the servo's that I have
https://www.amazon.com/MakerDoIt-Micro-Arduino-Walking-Control/dp/B07C5PGD3Q/ref=sr_1_1_sspa?ie=UTF8&qid=1550672399&sr=8-1-spons&keywords=9g+micro+servo&psc=1

Thank you, everyone.

AWOL

What happens if you turn off the power, gently turn the servo, and then reapply the signal and power?

Did you remember to connect the ground?

tdTedPaul

Same thing is happening, and yes I connected all the wires.

AWOL

Did you connect the servo power supply ground to the Arduino's ground?
You do have a separate power supply for the servo, don't you?

outsider

The servo library sets the servo to 90° by default. Where does the servo power come from? Try this:
Code: [Select]
#include <Servo.h>
Servo servo;

void setup() {
  servo.write(30);    
  servo.attach(2);
    
  
}

  void loop() {
    
}

vinceherman

Quote
If I give the arm that I attached to it a push in the direction that I want it to go, it will usually end up going on it's own the rest of the way.
This reads like it is a power problem.
Can you get a pen and paper, draw how you have everything wired up, take a picture of that drawing and post the picture here?

Go Up