Let's Make Robots!

servo glitch: oneway selfe going



my servo goes glitching when power goes on it. i made a press butten to control its flow. when i push the pcb button wich is connected to 5v on arduino the flow will go trough my servo and its moves, if u think its ok.. u might wanna know that my arduino has no controlling a servo, but it moves anyway!! how is this possible orange is conntected to pin o/i 9 red to 5v and black to current. help me and ask what u need to know :3

and also my usb goes on and of on and of...... its beebing >.< then servo moves agian a little NO CODE FOR THE SERVO IN IT



void setup() {                

  // initialize the digital pin as an output.

  // Pin 13 has an LED connected on most Arduino boards:

  pinMode(2, OUTPUT);

  pinMode(3, OUTPUT);

  pinMode(4, OUTPUT);

  pinMode(5, OUTPUT);

  pinMode(6, OUTPUT);  




void loop() {

  digitalWrite(2, HIGH);



  digitalWrite(2, LOW);  

  digitalWrite(3, HIGH); 



  digitalWrite(3, LOW);

  digitalWrite(4, HIGH); 



  digitalWrite(4, LOW);

  digitalWrite(5, HIGH); 



  digitalWrite(5, LOW);

  digitalWrite(6, HIGH); 



  digitalWrite(6, LOW);




Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ChuckCrunch's picture

not set this may make the pin float and fead the servo a random signal

robologist's picture

It's possible the servo is resetting the Arduino each time it attempts to move. 

It's usually a good idea to try and isolate servos and other motors from controller power a little. I've used 2 battery packs, one for the controller and one for the servos, joining the ground wires for common reference.. It is also possible to have a single battery pack provide power to a micro through a diode and capacitor set up, with the servos getting power directly from the battery pack (if it is within their reated voltage. 

Try adding a 10uf capacitor across the servo's power leads, this may help.

i think i solved my problem..

i added a diode at the 5v wire to the servo and it seems to work thankss

If you want exact precise control, drop alot more for digital servos.

patrickmccabe's picture

Servos will move a little when you apply voltage. This is normal.