Offline
Newbie
Karma: 0
Posts: 17
Iam just biginer
|
 |
« on: October 04, 2012, 05:50:58 pm » |
Hello guys. excuse me for the bad english but I really need your help for my servo
the servo type is SM-S4303R, but when I used the example code and the standerd wiring connection it doesn't work.
it just make 'zzzzzz' sound so I don't understand what happend
can any one explane why this sound come from the servo ??? is it the power issue or the servo it self was broken from the bingeing???
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6553
Arduino rocks
|
 |
« Reply #1 on: October 04, 2012, 07:30:23 pm » |
Some test code you can try. Powering a servo from the arduino can cause problems. Also, the servo power supply ground and the arduino ground must be connected. // 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
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
Iam just biginer
|
 |
« Reply #2 on: October 05, 2012, 01:41:11 pm » |
Hello. thanks for your feedback but the problem still on.
I have try to connect the servo on external power supply(battery) and the zzzz sound still come from the servo although the both Arduino and servo on the common ground.
any other options ??? because I think that the servo need to be change, so I will go tomorrow to the store for change it.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
Iam just biginer
|
 |
« Reply #4 on: October 09, 2012, 12:52:04 pm » |
Hello, thank you Shredder but I did the same thing and it didn't work. so I think maybe the usb can't power the Arduino enough, is it Possible that if I power it with 9v battery will work???
Because if didn't thats mean that the Arduino have problem and need to be changed.
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
God Member
Karma: 14
Posts: 644
|
 |
« Reply #5 on: October 09, 2012, 01:33:31 pm » |
Hello, thank you Shredder but I did the same thing and it didn't work. so I think maybe the usb can't power the Arduino enough, is it Possible that if I power it with 9v battery will work???
The USB is fine for powering the Arduino board, but not the servo because it can't provide enough current for both. You will need either a separate AC adaptor or a battery dedicated to powering the servo just as zoomkat suggested earlier. A 9V battery is not a good idea for two reasons. First, and most importantly, servos aren't just electrical motors they have integrated electronic controls that are built to tolerate a certain voltage level. Exceeding that voltage level by too much can damage the electronics. Second, 9V don't have a lot of charge capacity, even when compared to other common sizes like AA and AAA. All the "Latin letter" sized alkaline batteries (AAA, AA, C, & D) are nominally 1.5 V DC so you can connect them serially to get higher voltages. In fact you should be able to find cases for 4 AAA or AA batteries wired this way fairly easily. Because if didn't thats mean that the Arduino have problem and need to be changed.
I truly doubt it's a problem with your Arduino.
|
|
|
|
|
Logged
|
|
|
|
|
Ayer, Massachusetts, USA
Offline
Edison Member
Karma: 27
Posts: 1105
|
 |
« Reply #6 on: October 09, 2012, 01:43:47 pm » |
All the "Latin letter" sized alkaline batteries (AAA, AA, C, & D) are nominally 1.5 VDC so you can connect them serially to get higher voltages. In fact you should be able to find cases for 4 AAA or AA batteries wired this way fairly easily.
Note, rechargeable Nimh batteries are 1.2 volts, not 1.5 volts. Also alkalines start out at 1.5 volts, but they do drop voltage as the battery gets depleted.
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
God Member
Karma: 14
Posts: 644
|
 |
« Reply #7 on: October 09, 2012, 01:47:53 pm » |
Also alkalines start out at 1.5 volts, but they do drop voltage as the battery gets depleted.
Well that was implied by the term "nominally", but I probably should have explained that...
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
Iam just biginer
|
 |
« Reply #8 on: October 09, 2012, 02:43:34 pm » |
I did what zoomkat said and I used 4*AA Batteries and I connect the signal to pin9 and the batteries to red wire (servo) and the both servo ground and Arduino ground are connected to the batteries ground (common ground), But it keeps making the sound zzzz.
Note: if I remove the signal wire the sound stops.
So, Does the Arduino have issue ???
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
God Member
Karma: 14
Posts: 644
|
 |
« Reply #9 on: October 09, 2012, 02:49:10 pm » |
Do you currently have a load, other than the servo horn, that the servo is trying to move, or is the servo unloaded?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
Iam just biginer
|
 |
« Reply #10 on: October 09, 2012, 03:02:24 pm » |
No its not loaded and not moving just make the zzzz sound
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
Iam just biginer
|
 |
« Reply #11 on: October 09, 2012, 03:27:03 pm » |
Ok, whats the deferent between the ground next to pin13 and the ground next to 5v???
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
God Member
Karma: 14
Posts: 644
|
 |
« Reply #12 on: October 09, 2012, 04:37:33 pm » |
Ok, whats the deferent between the ground next to pin13 and the ground next to 5v???
Why, did it work correctly on one and not on the other?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 17
Iam just biginer
|
 |
« Reply #13 on: October 11, 2012, 06:21:59 pm » |
No, Iam just asking  . Ok, did any one now why did the servo didn't move although the code and connection are correct and the servo is unloaded?? I was doubtful that the Arduino it self has a problem in the input / Output. So, I can't prof that until I can go back to the store and check the both with the engineer their. See you
|
|
|
|
|
Logged
|
|
|
|
|
USA
Offline
God Member
Karma: 14
Posts: 644
|
 |
« Reply #14 on: October 12, 2012, 11:50:54 am » |
No, Iam just asking  . Good, because if everything was functional correctly there really shouldn't be a difference. There's more than one GND pin for two reasons, first to increase the total current that can be sunk through the board's power supply and second to make bundling wires easier (because there are grounds on both sides that have rows of pins).
|
|
|
|
|
Logged
|
|
|
|
|
|