0

I am new to Arduino and trying to do some basic tasks. I want a micro servo to rotate but it's not working, only slightly virbating when I launch a sketch. Below on the photos is how it is all assembled: I have a jumpwires connected to GND, 5V and #8 ports just as in the tutorial. I use micro servo SG-90 and Funduino UNO. Does anybody have any ideas what might the problem be? Here is also the sketch.

#include <Servo.h>

Servo servo;

void setup() {
  // put your setup code here, to run once:
servo.attach(8);
}

void loop() {
   // put your main code here, to run repeatedly:
servo.write(0);
delay(2000);
servo.write(90);
delay(2000);
}

enter image description here

  • USB power is usually way too weak for driving servos or motors – KIIV Jul 1 '17 at 15:11
  • Hm, I didn't think about it. So, should I use batteries or charger instead? – NecroSith Jul 1 '17 at 15:17
2

You should not power a servo from a USB port.

However, your most glaring problem is that you have entirely mis-wired the connections, such that no wire is going to the correct place.

Servo connections are in the order of Ground - Power - Signal, usually with a dark color for ground and a redder one for power. Connector shells aren't standardized between brands, but within one there may be keying to prevent reverse installation.

It would appear that on your servo, ground is brown, power red, and signal orange.

Pull out all three wires and start over; also you'd do well to use a dark color for the ground, as you appear to have mixed up the power and ground as well as the signal.

  • Yes, I totally messed up with all the wire connections. Now when all of them are in the right places everything is working excellent! Thank you for the explanation, I'm gonna keep it in mind. – NecroSith Jul 1 '17 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.