Go Down

Topic: Voltage/current interaction between Arduino and motor driver shield (Read 1 time) previous topic - next topic

rwiens

I bought a shield based on the L298N dual H-bridge chip (full disclosure...it was NOT from a well-known source and was poorly documented).  It has several switches that allow you to change configuration in terms of where the motor is getting power and where the L298N is getting +5v logic voltage from (the shield has an on board regulator).  I was testing the shield/Arduino combination with a 9V supply to the shield, and the voltage regulator turned on (so that +5v was going to the L298N).  When I threw a different switch to get +5V from the Arduino (remember it had no supply attached to it), the Arduino powered up.  After thinking about it for awhile, this makes sense as I was basically completing the circuit from the +5v pin of the L298N, which had +5v on it from the regulator, back to the +5v pin of the Arduino, although this was backwards from what was intended by having the switch there, and a clear no-no (but it worked).

After playing around with that setup for a few minutes, I added a 9V supply to the Arduino.  So now the Arduino has +5v from two different supplies (one via its own regulator and one via the shield regulator), and so does the L298N.  The shield went up in smoke (OK maybe that's overly dramatic, but there was smoke).  Arduino was fine.  Why?  I should point out that there was no load even connected to the shield at the time, never mind drawing current.

My understanding of electricity leads me to believe that from a voltage perspecitve you could add any number of +5v supplies in parallel and you would still get +5v (the grounds are tied).  Clearly there was (too much) current flowing somewhere, but I can't figure out where.




MarkT

Does the shield use the Vin pin?  That gets the input voltage to the Arduino regulator.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Docedison

I would suggest that the wiring is much more involved more than you are aware of. When Paralleling Linear (assumed) regulators the one with the highest voltage will supply the brunt of the load... until it's voltage drops slightly due to load and then the next closest regulator (in output voltage as they are Never exactly the same voltage) woll take up what it can supply until all are sharing current according to the separate voltages of each regulator. In this respect Linear and Switchers are the same and NOT the same as batteries. Unless it is a very special type of linear or switcher it cannot sink current so there is no interaction where one is trying to "charge" the other to it's output voltage as a linear or switcher can only source current it cannot sink current... unlike batteries which Can cause major damage if of unlike terminal (output) voltage. Paralleling regulators isn't the greatest of ideas AT ALL (better to split the source voltages and keep the grounds all returning to ONE common point) by using a star ground layout and separate sources. The reason is that there is no way of insuring that all are created "Equal" and if one fails or is really low in current capacity it will be masked by the "Better" regulator and you might well find "Weird" behavior. There is also there is the thought that the higher "input" voltages will suffer proportionally less "I-R" drop than trying to supply each board from a common supply.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

rwiens

Thanks for the reply...I suspected the answer was not simple.

It was never my intent to parallel the regulators.  In my opinion, the shield was poorly designed (and even more poorly documented) to allow this to happen accidentally.  I just didn't understand why the Arduino and L298N, both faced with the same 'dual source', reacted differently ("ho hum" vs. "KABOOM" respectively).  Suffice it to say that when I receive my replacement shield I will not make the same mistake, regardless of whether I understand or not why it is a mistake!

Go Up