Hi, i need help with my servos that can't move. I am currently working on a robotic arm that has two servo motors, and prior to this it was still functioning when I tried moving it with a potentiometer. The next day when I plugged in a new code, none of the servos will move, even with the original code I used previously. The same goes to a new servo motor that wasn't previously tested.
Here's the circuit schematic and respective code I've used to test the S996R servo motor. I used the default USB connection as a power source.
#include <Servo.h>
Servo myservo;
int pos = 0;
void setup() {
myservo.attach(9);
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) // change here in the place 0 and 180 , into any two degrees you wish the servo to sweep.
{
myservo.write(pos);
delay(15);
}
for (pos = 180; pos >= 0; pos -= 1) // change here also in the place 0 and 180 , into any two degrees you wish the servo to sweep.
{
myservo.write(pos);
delay(15);
}
}
type or paste code here
Although you should not power any servo from an arduino 5V output, it's strange that it worked one day and not the next. You may have damaged the Arduino.
Does your arduino still work?
Can you run the blink example ino?
Power the servo from a separate 5V supply and use a different Arduino pin.
Don't run the 5V power through the breadboard, connect directly to the servo.
Does it work now?
What you saw was not "functioning" that was electricity applied incorrectly which had 5vdc 12vdc on PWM giving the servo a 100% duty cycle 200% its rated sinking capability.