0

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

  • 2
    I'd invest in a better power source first. – Ignacio Vazquez-Abrams Feb 14 '16 at 23:21
  • @IgnacioVazquez-Abrams The 9v is for testing purposes, we have a better battery for the actual power source. Also why would investing in a power source take priority over a proposed faulty system? – Bennett Yeo Feb 14 '16 at 23:22
  • 2
    Because a 9V battery is a terrible power source, especially if you have high-load devices such as servos. – Ignacio Vazquez-Abrams Feb 14 '16 at 23:33
  • @IgnacioVazquez-Abrams in what way is is terrible? Amperage? Would that affect how the servos respond to code? – Bennett Yeo Feb 14 '16 at 23:42
  • 2
    When the servos try to move, they draw current. When the current increases, the voltage drops. When the voltage drops, the Arduino fails. – Ignacio Vazquez-Abrams Feb 14 '16 at 23:48
2

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:

MOSFET driver

| improve this answer | |
  • We built a small battery out of several AA batteries lined in series connected to a bread board. That was our original power source. We were also using a separate 9v battery for ease of testing. The 180 servos are rated "Current Drain (6.0V): 7.7mA/idle and 180mA no load operating", and the 360s rated "Working Current: 0.30~0.35A ". Does this mean we need to have a "driving transistor"? – Bennett Yeo Feb 15 '16 at 1:36
  • 1
    Your working current of 300 mA far exceeds the 20 mA continuous output of the processor (by over 10 times!). See amended reply. – Nick Gammon Feb 15 '16 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.