Robin2:
Make a pencil drawing showing how you have everything connected and post a photo of the drawing.
Also post the code you are using.
As far as I can see those servos use the usual 4.8v to 6v power supply. Why are you using 12v?
I do hope you are not trying to power the servos from the Arduino 5v pin.
...R
Thanks.
I'm using the adapter for supplying the board, not the servos.
My code is like below:
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
You hit the nail on the Head! I'm using 5v pin to power the servos. But why not?!
Why not is because you are limited to the current in the regulator on the Arduino so if your external supply can give you 2A or 5A it does not matter because you can get less than 1A through the Arduino.
Next there needs to be decoupling between the motor's supply lines to cut down on interference from the motors.
Your servos should be powered separately from the Arduino and the Servo GND should be connected to the Arduino GND.
If you try to power a servo from the Arduino 5v pin you risk damaging the Arduino and, even if it is not damaged, it may cause the Arduino to reset thus preventing the code from working properly.
Robin2:
Your servos should be powered separately from the Arduino and the Servo GND should be connected to the Arduino GND.
If you try to power a servo from the Arduino 5v pin you risk damaging the Arduino and, even if it is not damaged, it may cause the Arduino to reset thus preventing the code from working properly.