Go Down

Topic: Servo motor with range of 280 degrees (Read 60 times) previous topic - next topic

levirullezz

I have servo motor which is capable of 280 degrees movement( model sbrs-5314htg). i am trying this simple code below which, as i understand, should move servo from his 0 degree to 280 degree, but instead it is only moving from 0 to 180 degree. tried to even extend the loop in code to be from 0 to 3000 but it does not do anything when between 0 to 1000 and 2000 to 3000(as i expected).
Code: [Select]

#include <Servo.h>

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
 
  Serial.begin(9600);   
  myservo.writeMicroseconds(1500);
  delay(1000);
}


void loop()
{
  for(pos = 0; pos < 3000; pos += 1)
  {                                 
    myservo.writeMicroseconds(pos);       
    delay(10);     
    Serial.println(pos);
  }
  for(pos = 3000; pos>=0; pos-=1)
  {                               
    myservo.writeMicroseconds(pos);         
    delay(10);                       
    Serial.println(pos);

  }
}

the servo is simply connected with 9V battery.

Grumpy_Mike

So have I got this right? You are connecting 9V to a servo who's label says the maximum voltage is 7.5V and you are asking why it is going wrong?

Also you have connected the negative of the battery to the Arduino's ground haven't you?

slipstick

And when you have sorted the power supply out, you might try using the range shown on the label i.e. 900 to 2100. Exceeding stated signal ranges can stall the servo by forcing it against mechanical stops and cause considerable damage.

Steve

Go Up