Apologies if these questions have already been answered but I haven't come across them. I am using an Arduino Uno powered from my computer's USB. I use pin 9 to send the signal to the servo and an external power supply to power the servo.
Using a servo motor (SG90) with Arduino Uno - in the introductory material, it recommends using pin 9 for the signal to the servo as it is PWM but if I switch to pin 12 (not PWM) the servo still works. Can I assume that the servo.h library is performing the PWM?
I understand that the maximum current output of the pins is 40mA and the total combined current to be 200mA. I want to run 4 servos plus a soft latch power switch circuit (uses 1 arduino output to keep power on) and potentially a serial input, however I am concerned that I might go over the combined current limit. I have tried to measure the current of the signal wire to the servo but I cannot obtain a value with my multimeter. I also tried to measure the voltage drop across a resistor (10 Ohms) but this gave 9.5mV -> Voltage drop / Resistance = (5 - 9.5m) / 10 = 499 mA (which seems far too high for the output of a digital pin). I cannot work out what IC is inside the servo but I am inclined to think that actually the signal input's current draw is negligible as the servo is powered externally and the signal input is just used to activate the servo through its IC. Is this correct or have I missed anything?
Any help with either is much appreciated!
Thanks for your reply.
With regard to your reply to the second question: The resistor is in series with the signal wire to the servo and the multimeter placed across the resistor, this meant that I had 5V entering the resistor (output from pin 9) and 9.5mV leaving the resistor and so my voltage drop would be 5V - 9.5mV.
However, after measuring the voltage from pin 9, I discovered that it was actually 200mV, not 5V as I expected. This would mean that the Current = (200mV - 9.5mV) / 10 Ohms = 19.05mA.
I also tried measuring the current again with a multimeter that has a micro amp setting, putting this multimeter in series with the signal wire (no resistor), I obtained a current of 1.4uA.
These results seem to contradict eachother, as I can't see how adding a resistor results in more current being drawn than without. But if the current draw is actually roughly 19mA then at least this is in the safe zone for my application.
To know the current through a resistor, measure the voltage drop, with DMM, across the resistor (only) and calculate current through resistor = measured voltage drop / resistor value.
Thanks for your reply groundFungus. I have already done this, please see my posts above for results.
With multimeter you're measuring the average voltage. The servo signal is a PWM signal that is high for 1-2ms and low for around 20ms. But you're still missing the main point. There are two things in the circuit. If 9.5mV is dropped across the resistor then the rest of the voltage is dropped across the SERVO!
So 200mV-9.5mV is the drop across the SERVO (of unknown effective resistance). The voltage drop across the 10 Ohm resistor is still the 9.5mV that you measured. So the current through the resistor and the servo is still a bit less than 1mA.
I'm sorry but this is really very basic circuit theory. If you're going to do much more of this stuff you really need to read up on some of this. Ohm's Law and Kirchhoff's circuit laws are good places to start.
"I have tried to measure the current of the signal wire to the servo but I cannot obtain a value with my multimeter."
I just measured the resistance of a 9g servo from the servo signal input to the servo ground and it measured ~10.4k, which should put the signal current at about .5ma at 5v.
The Servo library on the Uno uses timer1, meaning that pins 9 and 10 stop being usable by
analogWrite(). This is why its suggested to use them first for driving servos, because they are less
useful for other purposes...
This incompatibility between Servo library and analogWrite on pins 9 and 10 (For ATmega328 based
Arduinos) is somewhat of a trap for the unwary.
Thanks everyone for your replies.
Steve: My apologies you are correct, I can’t explain how, but I was mixing up the voltage drop across the resistor with the servo. So when I obtained the voltage measurement across the resistor, I was viewing it as the voltage leaving the resistor…
Zoomkat: Thanks for the idea, I tried this on a couple of servos and I obtained values from 120k - 122k Ohms which fit with the rest of my results for currrent/voltage.
Welcome to the forum.
Please read the post at the start of any forum , entitled "How to use this Forum".
Is a good guide to multiple servo operation.