Pages: [1]   Go Down
Author Topic: Servo broken? help a newbie  (Read 610 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

setup is the simplest possible http://imgur.com/wLezu

The code is servo example from Arduino.cc


Im getting only sound from my servo. In intervalls according to what i set in my code.


Could it be a voltage problem? if i mesaure voltage on the servo its between 3.8-4 v. How would i set up if i want it to run on 6v from 4 1.5v AA batterys? (guessing red-black to battery and leave only pin wire from the arduino board) tnx!
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26627
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Connect the black wire to your Arduino's ground (gnd) and to the battery's -
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Same thing with extra power. Now pins on servo shows 5v

How could i change the code to try different update rates? like 50hz
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 310
Posts: 26627
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
How could i change the code to try different update rates? like 50hz
Servo update is 50Hz, IIRC.

Quote
Same thing with extra power. Now pins on servo shows 5v
I don't understand that

Can you confirm that the servo, the battery, and the Arduino share a common ground, and that you have your Arduino's signal pin connected to the servo's signal wire.

Please post your code and your schematic.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes i think so.

http://imgur.com/RIeaG

is this ok? battery ground (black) and servo ground (black)  -> arduino ground (black)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just the standar examle code

#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(smiley-cool;  // attaches the servo on pin 9 to the servo object
}
 
 
void loop()
{
 
  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(25);                       // waits 15ms for the servo to reach the position
  }
 
  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(25);                       // waits 15ms for the servo to reach the position
  }

 
}
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Can't see your wires to well in the picture, but just to confirm, servo ground, battery ground and Arduino ground all need to be connected together - can't tell from the pic.

Also do the batteries have a good charge ?

Duane B

rcarduino.blogspot.com
Logged


0
Offline Offline
Tesla Member
***
Karma: 148
Posts: 9750
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Basic servo/arduino wiring setup and servo test code.



Code:
// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

String readString;
#include <Servo.h>
Servo myservo;  // create servo object to control a servo

void setup() {
  Serial.begin(9600);
  myservo.writeMicroseconds(1500); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control
  Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}

void loop() {
  while (Serial.available()) {
    char c = Serial.read();  //gets one byte from serial buffer
    readString += c; //makes the string readString
    delay(2);  //slow looping to allow buffer to fill with next character
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string
    int n = readString.toInt();  //convert readString into a number

    // auto select appropriate value, copied from someone elses code.
    if(n >= 500)
    {
      Serial.print("writing Microseconds: ");
      Serial.println(n);
      myservo.writeMicroseconds(n);
    }
    else
    {   
      Serial.print("writing Angle: ");
      Serial.println(n);
      myservo.write(n);
    }

    readString=""; //empty for next input
  }
}
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes the batteries are new. They measure up to 6v

as far as i can see i have connected like you draw zoomkat.

"common ground" as in: my 3 black ground wires wires are all connected together:

-from battery -
-from servo ground


and

-to arduino ground


Trying that code i get nothing, only sound from servo when i plug power in.
« Last Edit: August 03, 2012, 11:34:01 am by demer8008 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How is a servo supposed to feel, not plugged in? should yu be able to turn it around manually with light force?


mine wont budge unconnected
nothing happends at startup of arduino
when code starts running i have faint sounds in the interval, but no movement
« Last Edit: August 03, 2012, 12:27:57 pm by demer8008 » Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you can't turn it by hand, when it has no power going to it, then there is something wrong with it.
Logged

0
Offline Offline
Tesla Member
***
Karma: 148
Posts: 9750
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What type of servo do you have? Note that hand turning smaller servos might damage the gears if not careful. Also the small servos like the 9g ones may strip gears if run against the internal hard stop when at near max voltage.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

its called "HS-55" micro servo
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
   I seem to be the only person on the planet that this happens to, but I often need to connect a 1K or 10K resistor in the signal line to the Servo or my projects hang.

Like I say no one else seems to have this problem but maybe I just use a wider variety of servos.

Duane B

Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now i have tried 9v in to the arduino dc.
And 6v into the servo.

Also 10k resistor on signal line.

Must be something broken with the servo
Logged

Pages: [1]   Go Up
Jump to: