Do I have a faulty arduino uno, or have I found an Arduino bug? Lately, we got an old arduino uno donated from a friend and have been trying to get it to work with servos. We have been having very perplexing results. We have tried many different "stock" code and servo combinations with our servos, but here is the behavior:


180 Servos automatically move to right max as soon as power is applied.
Sail Winch servo moves a tiny amount and then stops. If power wire is removed and then reapplied, the servo moves another tiny amount.


The code is very simple. First we call the servo.attach(pin), and confirm the pin. We have also tried doing the manual uSec definition: servo.attach(pin, 600, 2400). In our loop() we have tried servo.write(*value from 0-180*) and servo.writeMicroseconds(*value in PWM range*)

Power is being supplied by a 9v battery, the sensor (yellow) is directly in digital pwm pin, while red (power) is in + and black (ground) is in -.

I'm trying to decide whether I should invest in another arduino system.

servos:

180 servos

Sail Winch servo
If the Arduino "fails" the moment you apply power to a motor, you can bet that it is a power issue. 

Or possibly you are exceeding the output rating of the output pin. You should not draw more than 20 mA from each output pin continuously.


  I'm trying to decide whether I should invest in another arduino system.


Power the motor independently of the Arduino. This is normal advice for all but very small motors. Also make sure that you have a suitable driving transistor / MOSFET if the motor draws more than 20 mA. Take into account any surge startup current.



See Driving motors, lights, etc. from an Arduino output pin for some design ideas.

For example: