Do I need to place resistors between Arduino output and H-bridge? + theory

Hello to All.
I’m currently building a motor driver circuit based on the L293B. I have a few questions regarding this circuit. While all these questions stem from a practical application, I’m also trying to understand the underlying theory. I am a hobbyst/beginner, so please be patient if some of my questions seem very basic/stupid to you. I’ve been googling for a week about this stuff, but could not find clear answers for my questions. Here is my circuit:


image hosting sites

1. Is it a good idea to place resistors between a microcontroller and some other IC?

I can understand simple circuits consisting of a single voltage source and a few resistors/transistors connected in series and parallel. What puzzles me is how these things work when you add a microcontroller and another IC. What are the levels of current involved in communication between an Arduino and my motor driver IC? I’ve looked into CMOS and TTL, searched the datasheet, but could not find specific information about current sink/source levels, only about voltage levels and the corresponding logic. I know that the Arduino’s limit is 40mA per output pin, and resistor’s of 470 or 1K Ohms are recommended to protect the outputs, that’s why I’m using R1, R2, R8 and R9 in this circuit. Do I really need these? What happens to the inputs if a motor driver IC fails due to overcurrent? Does it fail short or does it fail open? Would these resistors add to the power consumption of my circuit, and if yes, is their impact significant?

2. What happens if the current through a resistor is lower than the calculated value for a given voltage? Can this happen?

In a simple battery+resistor circuit with a fixed voltage, the resistance determines the current. But what happens if the current is lower than this calculated value for the resistor (can this happen)? (Example: a 1K resistor would allow through 5mA of current in a simple 5V circuit, but what happens if it is placed between two ICs which use a lower level of current for communication, like 1mA or less?) Does the resistor have any effect on currents lower than the current calculated for the given voltage level? Is there any power dissipation (wasted energy) when a resistor is in the path of a current lower than the resistor’s current calculated from voltage? Using the hydraulic analogy, this would be the equivalent of a valve and a small amount of water passing through it below the full capacity of the valve. Does this analogy work here?

3. How can I (do I need to) calculate the correct resistor values for R3 and R4 (for the transistor which is used as a NOT gate)?

I’ve chosen 1K for R3 as a general value that limits the current through T1 to a safe level of 5mA. The base resistor is again picked as a very general approximation. Minimum Hfe for T1 is 110, so theoretically I do not need more base current than 0.05 mA. The calculated R for the base resistor is 100K, but it seemed a very high value, so I’m using 10K. Are these values OK? Do these values have an impact on the input of the motor driver IC, or if I give enough base current for the transistor to saturate, the base/collector resistors do not really matter?

4. Adding a capacitor between the motor terminals.

I’ve omitted a small (100 nF) capacitor usually placed between the motor terminals, because if I understand correctly, it should be placed as close to the motor as possible. However, I have some motors which are inside a mechanism I cannot open without breaking, so I do not know, if they have a capacitor between their terminals, or not. Does it make sense to add a capacitor on the motor output pins of this circuit, even if it is about 10 inches from the motor? What happens, if later I connect this circuit to a motor which already has a parallel capacitor on it? Could this cause problems, or an extra capacitor does not matter?

Thank you all for your patience, I know this is a long post. Your input is much appreciated.

As far as I know, there's no need for any of that circuitry external to the 298, since the 298 takes care of stuff itself.

The attached circuit is how it's usually done, far as I know. Dead simple: all the complexity's in the 298.

2 motors L298 small.png

Could be the case for the 298, but I'm using an L293 B. According to the datasheet it needs flyback diodes. But that part is Ok, I was wondering if it is a good idea to put series resistors between their Arduinos output and other Integrated Circuits, or you can get away without it. (Unless driving some low-impedance load, such as LEDs).
Is there a chance, that the motor driver fails short and zonks the Arduino? Would a series resistor prevent that?

I was wondering if it is a good idea to put series resistors between their Arduinos output and other Integrated Circuits, or you can get away without it.

It is not a matter of getting away with it you simply do not need one.

Is there a chance, that the motor driver fails short and zonks the Arduino?

Yes, not a very big one though.

Would a series resistor prevent that?

Probably not.

The only reason why some people suggest using a series resistor is in case you connect the output of a chip to an input pin, and then your are stupid enough to program that pin as an output, and then you are unlucky enough to set that output to the opposite logic level. So three things go wrong, this is most unlikely.

Myself I think this is a rubbish thing to do and I have never had an accident like this even when I was learning, and in those days there was no noe to tell you what to do you had to work it out from first principals.

What happens if the current through a resistor is lower than the calculated value for a given voltage?

Then you have broken ohms law.

Can this happen?

No.

because if I understand correctly, it should be placed as close to the motor as possible.

For maximum effect it should be, but it still has a big effect where ever you put it and it should not be missed out.

or an extra capacitor does not matter?

An extra capacitor is even better than one capacitor.

he calculated R for the base resistor is 100K, but it seemed a very high value, so I'm using 10K. Are these values OK?

Yes

Do these values have an impact on the input of the motor driver IC, or if I give enough base current for the transistor to saturate, the base/collector resistors do not really matter?

Basically it does not matter. It might take longer for the transistor to turn off but you need an oscilloscope to see it and it will not affect a motor circuit because that is so slow in electronic terms.

Grumpy_Mike:
Then you have broken ohms law

It's too restrictive and nobody should be forced to have a current they don't want, just because they have a resistance and a voltage already imposed upon them

  1. <<<<< smiley, just in case.

alchemistanonymous:
Could be the case for the 298, but I'm using an L293 B.

Sorry, I missed that bit....

Repeal Ohm's Law

There is too much vested interest and a huge lobby from the electronics industry world wide for that to ever happen.

It is a bit like the gun lobby in the U.S. only not quite as powerful.

alchemistanonymous:
According to the datasheet it needs flyback diodes.

OK, so you have the datasheet. Where in the datasheet does it tell you to use series resistors?

Grumpy_Mike:
It is a bit like the gun lobby in the U.S. only not quite as powerful.

:grinning: :grinning: :grinning: :grinning: :grinning: :grinning: :grinning: :grinning: :grinning: :grinning: :grinning: :grinning:

Grumpy_Mike:
Myself I think this is a rubbish thing to do and I have never had an accident like this even when I was learning, and in those days there was no one to tell you what to do you had to work it out from first principles.

And you had to trudge fifteen miles to school (because they did not have fifteen kilometres then, which would have been easier) dragging your lunch on a sled over a field of thistles and if you were lucky it snowed.

Myself I think this is a rubbish thing to do and I have never had an accident like this even when I was learning, and in those days there was no one to tell you what to do you had to work it out from first principles.

Do you mean before the internet or before books ? (like the pre-history era )

raschemmel:
Do you mean before the internet or before books ? (like the pre-history era )

Both.

There were books but they did not tell you things you wanted to know about micro processors.

So basically, Don Lancaster's TTL-COOKBOOK ERA, right ?