servo issues simulating eyebrow movement...

Hi everyone! This ismy first time posting here so be gentle, lol. I’ve be trying to code my ardunio for using 2 servos that simulate eyebrow. When I run it in 2 mirco servos I have no problem its follows my coding exactly. However, when I run it on 2 standard futaba servos. It runs the original sweep code only. Which is just up 2 secs, down 2 secs looping. this is my new coding some I can’t see a problem with:

#include <Servo.h> 

Servo eyebrow1;  // create servo object to control a servo 
               // a maximum of eight servo objects can be created 
               
Servo eyebrow2;

int pos = 0;    // variable to store the servo position 

void setup() 
{ 
 eyebrow1.attach(9);  // attaches the servo on pin 9 to the servo object 
 eyebrow2.attach(8);  // attaches the servo on pin 9 to the servo object
} 


void loop() 
{ 
 eyebrow1.write(100);
 eyebrow2.write(100);
 delay(2000);
 eyebrow1.write(0);
 eyebrow2.write(0);
 delay(20000);
 
 eyebrow1.write(100);
 eyebrow2.write(100);
 delay(2000);
 eyebrow1.write(0);
 eyebrow2.write(0);
 delay(10000);
 

 eyebrow2.write(100);
 delay(2000);
 eyebrow2.write(0);
 delay(10000);
 
 eyebrow1.write(100);
 eyebrow2.write(100);
 delay(2000);
 eyebrow1.write(0);
 eyebrow2.write(0);
 delay(30000);
 
 eyebrow1.write(100);
 eyebrow2.write(100);
 delay(2000);
 eyebrow1.write(0);
 eyebrow2.write(0);
 delay(40000);
 }

It all looks fine to me so I’m kind of at a lose. Any suggestions, anyone? :o

/Thomas

Please use code tags. The forum has turned one of your variables into sunglasses. 8)

MorganS: Please use code tags. The forum has turned one of your variables into sunglasses. 8)

Sorry and fixed

/Thomas

I see nothing in your code that should give different results with different servos so I suspect the problem is that you are powering the servos from the Arduino 5v pin. You may get away with that with micro servos but not with bigger servos that need more current. When the servo draws two much current it causes the Arduino to reset and may damage the Arduino.

Servos shold have their own power supply with the Servo GND connected to the Arduino GND.

...R

Robin2: I see nothing in your code that should give different results with different servos so I suspect the problem is that you are powering the servos from the Arduino 5v pin. You may get away with that with micro servos but not with bigger servos that need more current. When the servo draws two much current it causes the Arduino to reset and may damage the Arduino.

Servos shold have their own power supply with the Servo GND connected to the Arduino GND.

...R

Thanks for this info. I'll try extra (separate) power supply to the servos later today

/T