Curious power issue through a voltage regulator

i have previously been fiddling about with micro servos (SG90s) but finally "graduated" to "standard" size ones - ie. those MG995s, to be accurate, a pre-modified MG996R (continuous rotation) - cheap "TowardPro" (!!) from eBay/China.

i am now finding out i need to upgrade my inventory of various power supplies, but in the meantime am trying to understand "things at the limits".

what i have managed to get working, is a simple sketch running the servo slowly using a 5V DC adaptor rated at (only!) 500mA - that is the 'benchmark' for this topic.

i then tried (in the name of experimenting, not expecting it to work) connecting a second servo - and (of course) the Arduino kept resetting.

i also have a 9V DC adaptor with 600mA (hardly an improvement) but continued nonetheless on this experimental track.

i ran it through a 7805 voltage regulator to power the setup to see if it was (marginally) better - it was not.

NOW, the issue is - i tried the 9V + 7805 with just ONE servo, and it didn't work either! (ie. the Arduino resets)

what is happening here ?

my understanding is that the voltage regulator passes on the input current to the output (less a bit due to non-ideal efficiency) - so i would think it should at least be able to match the 500mA from the 5V adaptor - what am i missing in my understanding of the scenario ?

for additional information :
i had initially used the 7805 'bare' (meaning, sans capacitors) - and later added them as suggested in the datasheet, ie. 0.1uF on the output pins, and 0.33uF on the input pins (albeit, using 3x0.1uF in parallel)

this resulted in the servo turning for a bit longer before the Arduino reset - giving me the indication that i am dealing with insufficient power on the voltage regulator setup.

can anyone explain why a 9V DC 600mA adaptor through a 7805 cannot match a 5V DC 500mA adaptor ?

Thanks.

EDIT:
i had also tried using an 8xAA(NiMh-eneloops) (=9.6V) pack through the 7805 and that failed too.

could the 7805 be faulty ?

Is the 7805 in a standard TO-220 package? Does it get hot or does it not stay on long enough for that?
My first thought was that you're dissipating about 2-2.5W through it at 500-600mA but I guess that package should be able to handle that.

Where are you plugging the 5V into? Presumably the 5V pin and not the Vin pin?

saximus:
Is the 7805 in a standard TO-220 package? Does it get hot or does it not stay on long enough for that?
My first thought was that you're dissipating about 2-2.5W through it at 500-600mA but I guess that package should be able to handle that.

yes, it's a TO-220 package, and i've used this for powering other circuits with less current demand.
since the Arduino resets, i do not leave the circuit running long enough for the 7805 to get hot.

ahh... could the shutdown function of the 7805 be kicking in then ?
(i have a buck converter on the way - that would certainly shed more light on this circuit....)

saximus:
Where are you plugging the 5V into? Presumably the 5V pin and not the Vin pin?

yes, the 5V pin - the 7805 is needed because the 'cheapo' ProMini VIN pin got fried !

I assume you do not have a multimeter to measure voltage and current. I think one would help here. It needn't be a terribly expensive one as you are not looking for precision here.

Possibilities are:

The 9V adapter has a lot of ripple on the output especially when loaded. The valleys of the ripple are causing the 7805 to be unstable.

There is some interaction and the PWM you think is driving the servo is corrupted.

JohnRob:
I assume you do not have a multimeter to measure voltage and current. I think one would help here. It needn't be a terribly expensive one as you are not looking for precision here.

i've been stumbling along with a cheap analog multimeter, but i have an INA219 (current sensor) module otw because i'm really feeling blind as to 'current situations' in an increasing number of scenarios that seem like surges beyond my power supplies.

JohnRob:
Possibilities are:

The 9V adapter has a lot of ripple on the output especially when loaded. The valleys of the ripple are causing the 7805 to be unstable.

but would that happen with the battery pack - i understand that DC adaptors are generally quite wimpy in providing enough juice, but the batt.pack seems to fail as well ?

JohnRob:
There is some interaction and the PWM you think is driving the servo is corrupted.

is this related to the ripple issue above, or possibly something new ?

I have a vague memory somewhere of 78xx chips not being suitable to drive motors and i have had issues with it myself. I would anyway not really want to power an Arduino from the same source as Servo. 4x AA shouldbe able to drive the servo without a 7805 i think.

Deva_Rishi:
I have a vague memory somewhere of 78xx chips not being suitable to drive motors and i have had issues with it myself.

i see.

Deva_Rishi:
I would anyway not really want to power an Arduino from the same source as Servo. 4x AA shouldbe able to drive the servo without a 7805 i think.

yes, that's really what i should do actually.
i have to admit i was a bit lazy in unplugging wires from another circuit which is still an ongoing project.
i have to make a note of never combining the Arduino and servos on the same power line.

Is the servo power coming from the 5V supply or the Arduino's 5V pin?
How about a schematic?

outsider:
Is the servo power coming from the 5V supply or the Arduino's 5V pin?
How about a schematic?

oh, i know at least to NEVER supply power to ANY motor from an Arduino pin.

the servo and Arduino share same supply which is ALSO "bad".

i finally connected them separately (with common ground ofc) and they then run without resetting the Arduino.

can anyone explain what 'phenomenon' (the exact detail of the power electronics) is happening to the Arduino ?

if we use water flow analogy, then my thinking is like this;

     servo (BIG current = big pipe)
          =======\
                  }------- (inadequate supply = small pipe also)
          _______/
     Arduino (small current = small pipe)

when the servo draws a large current, and the supply is unable to meet the demand, the servo ends up "drawing from the Arduino (pipe)" ?

ie. servo sucks water from the tap(aka adaptor) but needs more and 'disturbs' the Arduino "water flow".

what is happening at that junction, electronically, in this case, if i am understanding it correctly ?

A DC motor, like the one in your servo, when standing still, looks like a short circuit to the power supply, so might draw 1 Amp or more while accelerating it's load up to speed, if the PS can't supply that current the voltage will sag, maybe enough to drop below the Arduino's minimum and causing it to reset. I believe a 7805 is only rated 1 Amp with a heat sink, your PS should be able to hold up at least 1.5 Amps continously.

Hi,
Can you post a circuit diagram of how you setup the LM7805 and 9V powersupply?

Did you use bypass capacitors around the regulator as suggested in the LM7805 datasheet?

Even though a servo is not moving, if there is ANY torque on the shaft, it will consume current.

Tom.. :slight_smile:

outsider:
A DC motor, like the one in your servo, when standing still, looks like a short circuit to the power supply,...

thanks, this makes things clearer.

outsider:
so might draw 1 Amp or more while accelerating it's load up to speed, if the PS can't supply that current the voltage will sag, ...

yes, it's this sagging that i now would like to comprehend fully.

outsider:
maybe enough to drop below the Arduino's minimum and causing it to reset. I believe a 7805 is only rated 1 Amp with a heat sink, your PS should be able to hold up at least 1.5 Amps continously.

i am now setting the circuit up with separate power supplies - the 5V adaptor 500mA can now run BOTH servos ! (the Arduino has it's own supply)

so, it would seem the PS can supply the current (at managed slow acceleration) - except when sharing with the Arduino, which is what my 'diagram of the junction' is trying to clarify above - so, what is happening at that junction, electronically/electrically speaking ?

TomGeorge:
Can you post a circuit diagram of how you setup the LM7805 and 9V powersupply?

hi, it really is as simple as in the datasheet.
short of an actual photograph, it is a DC female jack (for the adaptor) wired to a pair of dupont sockets and long header pins which stick into the breadboard (for the In and Common of the 7805), and then a pair of very short single-core jumper wires connecting Out and Common, to the breadboard power rail.

TomGeorge:
Did you use bypass capacitors around the regulator as suggested in the LM7805 datasheet?

i didn't at first - i mentioned it above as being 'bare' , but then added them, which resulted in noticeable "improvement", but not enough.

TomGeorge:
Even though a servo is not moving, if there is ANY torque on the shaft, it will consume current.

yes, i am starting to get this is how a servo is different from a plain DC motor, but for a balancing robot, my thinking is it would be much preferable than a DC motor trying to "stay still" with infinitessimal back and forward motions.

If you don't have at least 2A power supply for your two servos, you will probably get grief. If the power
source drops out on the stall current of the servo, it will likely reset the servo's control processor
immediately on power up. Expect a working servo to demand full stall current spikes, arrange that
the power supply is adequate.

BabyGeezer:
so, it would seem the PS can supply the current (at managed slow acceleration) - except when sharing with the Arduino, which is what my 'diagram of the junction' is trying to clarify above - so, what is happening at that junction, electronically/electrically speaking ?

I don't know what you mean with "junction" but explanation for this behaviour is likely BOD (brownout detection) of Arduino. When both servos try to draw current the supply voltage drops - so much Arduino resets. But it stays high enough for servo controller to keep working.

MarkT:
If you don't have at least 2A power supply for your two servos, you will probably get grief.
...

yes, thanks - this is no longer the issue (at hand), while i await a proper power supply, i am using the existing supply (the 5V one, no more 9V nor 7805) and coding the servos with gradual acceleration;

eg:
servo.write(92);
delay(200);
servo.write(102);
delay(200);
servo.write(112);
delay(200);

NOTE: increment of 20 will fail !

amazingly this now actually works (with the 500mA adaptor), for TWO servos - as long as the supply is separated (from the Arduino).

which is now my query - what is happening at the "junction" when the supply for servo and Arduino is shared ?

Smajdalf:
I don't know what you mean with "junction" but explanation for this behaviour is likely BOD (brownout detection) of Arduino. When both servos try to draw current the supply voltage drops - so much Arduino resets. But it stays high enough for servo controller to keep working.

okay - i now get that BOD/power source dropout/voltage sag issue, but could someone explain it from first principles, please ?

what i meant by junction is the shared power supply; i'll try the diagram again with more annotation.

     servo (BIG current)
          =======\
                  }------- sharing inadequate PS (5V 500mA)
          _______/
     Arduino (small current)

in the above, a BOD/voltage sag/power dropout occurs, and the Arduino resets.

as opposed to separate power supplies.

   servo (BIG current)
       ========= dedicated power supply
  • STILL the 500mA 5V DC adaptor
       _________ separate PS

(3xAlkaline AAs plus DC-DC boost converter)

   Arduino (small current)

(* with common ground)

the question now is; does my water-flow analogy explain the BOD/voltage sag occurrence accurately, i would appreciate if i were corrected in my simplistic understanding, Thanks.

i am also guessing that in BOTH scenarios ('shared' and 'separate'), the current draw DOES exceed 500mA but the servo seems to cope with the temporary lack of supply, whereas if shared, this temporary lack of supply affects the Arduino circuit.

In a parallel circuit (which is what the servo and Arduino are creating), voltage (water pressure) is the same between each "branch". The thing that changes is the current down each path (water volume), which you identified.
The thing with a motor and its stall current is that its pipe diameter isn't fixed and gets wider or thinner depending on the load. When it gets too wide - i.e. wants to draw too much current - the supply isn't capable of providing enough volume, so its pressure drops. I guess, if I try to put it in terms of your water pipes, the Arduino's pipe has a valve which requires a certain amount of pressure or it will close entirely. So when the pressure drops too much, the Arduino turns off.
Does that help?

BabyGeezer:
yes, i am starting to get this is how a servo is different from a plain DC motor, but for a balancing robot, my thinking is it would be much preferable than a DC motor trying to "stay still" with infinitessimal back and forward motions.

It doesn't make any difference, servo or DC motor, a servo is just a DC motor with built in feedback control.
In both cases the motors will be making infinitesimal back and forward motions in a balancing robot.
Separate power supplies will make a big difference.
Tom.... :slight_smile:

The thing with a motor and its stall current is that its pipe diameter isn't fixed and gets wider or thinner depending on the load.

No, the diameter doesn’t change. Is the wire in his circuit a fixed diameter? Of course it is. The pipe is the wire so it’s a fixed diameter. With the water analogy, the properties are:

Voltage = pressure
Current = flow rate
Resistance = the diameter of the pipe

A power supply has a maximum current it can supply (flow rate). When the flow rate exceeds its rating, the pressure (voltage) drops. When the pressure drops below the brown out detection (BOD) level, the Arduino resets.

Analogies applied incorrectly is just another layer of confusion. As Einstein once said, “you truly understand something when you can explain it to your grandmother”.

WattsThat:
No, the diameter doesn’t change. Is the wire in his circuit a fixed diameter? Of course it is. The pipe is the wire so it’s a fixed diameter. With the water analogy, the properties are:

Voltage = pressure
Current = flow rate
Resistance = the diameter of the pipe

A power supply has a maximum current it can supply (flow rate). When the flow rate exceeds its rating, the pressure (voltage) drops. When the pressure drops below the brown out detection (BOD) level, the Arduino resets.

Analogies applied incorrectly is just another layer of confusion. As Einstein once said, “you truly understand something when you can explain it to your grandmother”.

I think you contradicted yourself. The wire is fixed diameter but the resistance is the diameter of the pipe in the water comparison. So the diameter of the pipe does change as the resistance changes. Which is exactly what I was trying to explain. Your explanation is also almost exactly the same as mine.

Perhaps another quote is relevant here - "Blowing out someone else's candle doesn't make yours shine any brighter."

TomGeorge:
It doesn't make any difference, servo or DC motor, a servo is just a DC motor with built in feedback control.
In both cases the motors will be making infinitesimal back and forward motions in a balancing robot.

ah yes, that's true !
i guess, for me, it's the "built-in feedback control" that helps (compared to doing it oneself on a DC motor with "standard drivers"(like a L298) , and the fact(?) that servos are better designed for those "infinitesimal back and forward motions".

TomGeorge:
Separate power supplies will make a big difference.
Tom.... :slight_smile:

indeed - it's this difference that i'm now trying to learn more about.

WattsThat:
...
A power supply has a maximum current it can supply (flow rate). When the flow rate exceeds its rating, the pressure (voltage) drops. When the pressure drops below the brown out detection (BOD) level, the Arduino resets.

my question is, what is happening (at that junction) when the Arduino resets.

which way is the water flowing ?

OUT of the Arduino INTO the servo ??

WattsThat:
Analogies applied incorrectly is just another layer of confusion. As Einstein once said, “you truly understand something when you can explain it to your grandmother”.

so, would you mind enlightening me with your true understanding then ?