Go Down

Topic: Servo Help (Read 702 times) previous topic - next topic

omsisteve

Hi,
As you may of seen I have started a OMSI dashboard.

My problem at the moment is I cannot even get a server to sweep.
I wire up the servo correctly and it just makes a little vibratey noise and
nothing happens.

Please help,
Steve

JimboZA

Quote
I wire up the servo correctly and it just makes a little vibratey noise and
nothing happens.


C'mon Steve.... you'll have to do better than that  8)

Circuit.... code....
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

omsisteve

I dont get you????.

I think it may be my servo, I have checked the whole system, The whole code,
Nothing seems to work.

Is it me being dumb and not working something out?

JimboZA

Quote
Is it me being dumb and not working something out?


Well nobody can tell unless you post the code and the circuit.....
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

omsisteve




// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.


#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
}


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
  }
}

JimboZA

Ok, well assuming it is actually connected correctly  8), it might be that your servo is unable to get enough current through the Arduino.

I'd hook the servo up to its own power, not through the Arduino, like in my Fritzing pic below. Check the servo maker's details though, to check what voltage it needs.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0

Go Up