Diode to power port if one of two pins has power

Hello everyone,

hope you can help me out with this one.
Lets start with the main question and afterwards I am going to give more details what I am actually trying to do. I am glad for any hint you can give me:

Main question:
I have a motor driver (TB6612FNG) with a standby pin STDBY. I only want this pin to have power if PWMA and/or PWMB has power.
Board

Is it possible to use one diode from PWMA to STDBY and one diode from PWMB to STDBY? Or will this destroy anything?

More details:
I am actually really new to all of this, but I can say that I have been pretty much searching and learning so much over the recent days.

I want to control a total of 16 DC motors (reversible, 350ma, 12V).
The motors can only turn into the same direction at once and PWM is not important.
For example:

  • motor 1,3,5 turn left
  • motor 10,13,5 turn right
  • NOT: motor 1 turn left, motor 2 turn right

As chip I am using an ESP8266 that has an 16-IO port extension (MCP23017).
Each of these 16 ports should control a single motor. 2 Pins of the ESP8266 controll the direction of all motors at the same time.

I started with a single relais for each port. That worked, but the motors were not reversible.
Then I switched to MOSFETs, which were way smaller, but were not able to reverse as well.
Ordered 8 L293D and thought they might be too weak, so I ordered 8 L298D and then I found out they probably do not work with 12V as the voltage drop is too high.
So finally I settled on the 8 TB6612FNG chips.

In the schematic you can see the way I would like to hook it up.
For example I only connected a single motor driver that is connected to 2 motors.
So I would add another 7 driver motors to this.

Each of the 16 ESP ports is connected to one PWMx and if this is high, the motor should move.
As I do not want to power all the motors at the same time, I only want to power the STDBY if the motor should actually move. So if PWMA and/or PWMB is HIGH.

Is this possible with diodes?

Another way would be to add another 8 pins that control each STDBY of the motor drivers, but that does not sound too clever for me.

Am I missing any capacitors/resistors?

Any suggestion is welcome.

Thank you very much!

you have created an OR gate. STBY goes high if PWMA or PWMB goes high. it should work.

What is the reason for putting the driver on standby?

I feel like I don't have to go into standby.
If it is a DC motor, the driver will not power the motor until you input a signal to the PWM and rotate the motor.

you have created an OR gate. STBY goes high if PWMA or PWMB goes high. it should work.

So there should be no problem, even if BOTH are high? Sorry, really new to diodes (or overall general electronics).

What is the reason for putting the driver on standby?

Mainly to save power. Most of the times only 1-2 motors are being used at the same time, sometimes there might be 4-5 but probably not more. So I did not want to power ~10 motors all the time without using them.

According to the datasheet (page 4), it looks to me like the output is only "off", if the standby is actually off.
Is this only for stepper motors? If it would be no problem and the 8 drivers do not pull too much power, I would love to just leave them on all the time (in case the actual motors are not powered)

Take a closer look at the "L" in that table.
In the this H-bridge, "L" means to connect the motor terminal to GND, and "H" means to connect the motor terminal to VM.
When the PWM signal is LOW, both terminals of the motor are always "L".
This means connecting both terminals of the motor to GND, and since it is not connected to the power supply at all, the motor doesn't consume power ...
In the first place, don't you think that it is basically impossible to stop a DC motor while consuming power?

1 Like

The data sheet shows that when the signal on the PWM pin is LOW (that is, that motor is not selected to drive by the your ESP8266), both are "L" regardless of the AIN and BIN states.
image

The fact that both are "L" means the following conditions.
image

If you say this motor wasting power, so I will throw up my hands.

1 Like

When the PWM signal is LOW, both terminals of the motor are always "L".

Now that you say it, it makes a little more sense to me.

In the first place, don't you think that it is basically impossible to stop a DC motor while consuming power?

I was actually not sure if there was a way like putting both outputs to HIGH or something (which would probably fry the electronics) that could actively make the dc motor stop instead of letting it "run out".

Guess I still need to learn faster how to read those datasheets correctly.
Thank you very much!

BUT:
Just in theory, so I could learn a little bit more:
Would it be possible to use the diodes like the way I showed it?
Or would this be considered "dangerous"?

Yes it can.
It's called "wired-OR"

But, depending on the another IC, the delay time from activate to the actual signal input may be specified.
(In many cases, on the order of nanoseconds...)
So if that case it may not be preferable to input the operation signal and activate from standby at the same time.

Thank you very much for your help.
This really helped me a lot!

I tried to google so much, but pretty much having "OR" as a word makes it really hard :smiley:

The motor IS wasting power when both outputs are Low. Not power from the battery directly but it is braking - turning a stored kinetic energy into heat. There should be some mode where one or both outputs are High-Z (disconnected).

@Smajdalf
OP is a beginner and cares about the power supplied by the power supply, so I have omitted the detailed explanation.
(The driver doesn't support controll regenerative battery charging.)
Also, there is a non-Brake mode (it's basically called "Coast") in this driver, but both IN pins that control the direction of rotation is must be set to HIGH.
Since OP shares the IN pin of all motors, it is not possible to put only a specific motor in the Coast state.
Therefore, this is also omitted from the my explanation.

try "logical or" or "logical or gate"

I think the difference between braking and coasting is quite important for a beginner.

A H-bridge does regenerative braking automatically: https://electronics.stackexchange.com/questions/56186/how-can-i-implement-regenerative-braking-of-a-dc-motor

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.