Hi,
I'm trying to control 5 servos (maybe will add more later) with Arduino UNO. The servos are TowerPro SG90, really small 5v servos. They are all connected to the Arduino 5V supply and directly to digital pins of Arduino.
When I run the program, they start twitching in all directions and my computer makes a sound as if the Arduino board has been disconnected. This goes on in a loop. Well, sometimes it works, but it's not reliable. XD
Is 5 servos too much for Arduino UNO? However, I've tried doing it with an external power source and it didn't go much better.
Here's the code:
You cannot power servos from the Uno 5V supply. The servos will pull the power down to the point that the Uno resets, repeatedly. Use a 4 AA cell pack or some other 5-6 volt supply for the servos.
Try starting with just one servo, get this working then move up one servo at a time. Remember that the amount of power required by the servo increases with the load on the servo.
duje:
Is 5 servos too much for Arduino UNO? However, I've tried doing it with an external power source and it didn't go much better.
You certainly cannot power servos - not even one - from the Arduino 5V supply. If you have a sufficiently well regulated 5V supply to power the servos, you could power the Arduino from that via its Vcc terminal.
I think you had better explain just what this "external power source" that you used, was also?
Paul__B:
You certainly cannot power servos - not even one - from the Arduino 5V supply. If you have a sufficiently well regulated 5V supply to power the servos, you could power the Arduino from that via its Vcc terminal.
I think you had better explain just what this "external power source" that you used, was also?
A good rule of thumb is that if more than one servo is to be moving at once, budget 1 ampere of current per straining servo. An AA battery pack with fresh alkaline batteries can supply only about 2 amperes before the voltage begins to drop significantly.
Moral: get a good 5-6 V regulated power supply for your servos.
And this sadly, like many of the "Tutorials" or "Examples" in the Arduino references, is disturbingly incomplete and misleading insofar as it allows beginners to believe that they can or should use the techniques described for more practical purposes.
In the example given, the 5V is supplied (directly) from the USB port whose capability to supply current depends greatly on whether it is a desktop or laptop, hub or powered hub. It may in many cases just be able to power a single unloaded servo for demonstration purposes only. Just.
duje:
The external power supply I used was a simple AC-DC adaptor which gave me around 7V.
If you fed that to the Arduino as Vin, then the regulator in the Arduino is as I recall, less capable of providing current than the USB input. If you powered the servos alone, directly from it then theoretically, you were providing them with too much voltage - though they would likely survive. And - what does "around 7V" mean? Do you mean it was an unregulated power supply? What current was it rated for?
Paul__B:
If you fed that to the Arduino as Vin, then the regulator in the Arduino is as I recall, less capable of providing current than the USB input. If you powered the servos alone, directly from it then theoretically, you were providing them with too much voltage - though they would likely survive. And - what does "around 7V" mean? Do you mean it was an unregulated power supply? What current was it rated for?
I fed the external power directly to the servos, not to Arduinos Vin. I read the voltage on the power supply with a multimeter and it said 7.2V DC. There are no voltage regulators connected to this. As for the current, on the adaptor it is written:
CURRENT 500mA6VA(max) - so whatever that means :~
the adaptor looks like this: helmut-singer.de has been registered
Should I put a voltage regulator somewhere in there? Or is it simply lacking power?