Adding optocoupler between Arduino and h-bridge

Discussion in 'General Electronics Chat' started by TerraViper-5, Dec 11, 2013.

  1. TerraViper-5

    Thread Starter New Member

    Jul 28, 2012
    8
    0
    Hi!

    I will be using Arduino to control a h-bridge like this:

    h-bridge: Yet another MOSFET based h-bridge

    [​IMG]

    Without any protection, the wiring is easy:

    [​IMG]

    But I don't want to leave it like this, I want to be on the safe side and add some safety, primarily for the MCU.
    First, I would like to ask for some suggestions for type of protection, if I know that PWM wont exceed 31 kHz and A and B wont change faster than once in a few tens of milliseconds.

    One thing I found to protect my MCU was optocoupler. But I bumped against a problem when I tried using it. That problem was that A and B can change their roles, being low at one time or high at other. That means electricity has to flow in both directions. Optocoupler cant do that, so I would probably have to add a pulldown resistor somewhere. But, here I become concerned that this will affect the amount of current coming to the BJTs. If this happens, it might change the way author predicted this circuit to work. The BJTs might not get saturated enough, causing too small current to flow to the FETs and thus charging the gate capacitors too slow. It might be just me being paranoid though, but I already burned one of these h-bridges on 31 kHz, so I had to lower the resistors leading to FET gates to 1k.
    For example: when that A acts as high, the current goes from it to ground, but it has to pass through that 10k resistor. But since it already passed through one 10k resistor that is part of h-bridge design, the current diminishes more than it should have. On the other hand I need that 10k resistor there for the case when A acts as low.

    [​IMG]

    Please help!
     
    Last edited: Dec 11, 2013
  2. TerraViper-5

    Thread Starter New Member

    Jul 28, 2012
    8
    0
    Come on, nobody can help? :(
     
  3. eeabe

    Member

    Nov 30, 2013
    59
    9
    In my opinion, it doesn't look like you really need to protect your MCU as I don't see any potentially damaging energy able to get to it (barring a catastrophic failure of some sort).

    The fact that you burned up I'm guessing one or more of the power mosfets, probably has to do with the slow gate rise time due to the combination of the gate capacitance and the pull-up resistors. That lets the mosfet spend too much time in linear mode where it dissipates a lot of energy.

    I'd recommend a high current mosfet driver -- I've used a MIC4452 before in a switching power supply circuit and it works really well. It will drive a mosfet gate high and low very quickly rather than only driving low and having a resistor to pull it back up slowly like the current circuit.
     
  4. TerraViper-5

    Thread Starter New Member

    Jul 28, 2012
    8
    0
    Thank you for response!

    I read somewhere that its a good practice to separate the logic and power parts of the circuit in case some unexpected spike comes back to the mcu. But I probably overreacted since this is a low power circuit. I was concerned with damage-over-time, small spikes that slowly destroy a mcu's pin.

    One of the reasons I wanted to add an optocoupler was to be able to lower the resistors that limit power coming to the mosfet gates. If I lower it down from 10k to 1k it solves the problem of overheating at 31kHz, but the more I lower that resistor value, the more power a MCU will have to sink when A or B are low. At 1k it will have to sink 12mA coming from VBAT, which is 12V. I dont know how damaging is that?

    Thank you for suggestion, but the main reason I did not use gate drivers is because they are expensive. I plan to make at least 4 h-bridges like this, each MOSFET will need one of these gate drivers, and this gets close to 50€ besides of having to order them from abroad. Later, I might make even more. This is a circuit to swing some home decorative bells and if I put coolers on MOSFETs, salvaged from printers'n'stuff it might do the trick (the coolers are just a safety precaution). The current draw shouldn't be over few amps.
     
  5. eeabe

    Member

    Nov 30, 2013
    59
    9
    At 12V, each 1k resistor is using less than 1/4 Watt, even at 100% duty. It sounds like that is a very minor fraction of your overall power usage, so if you are happy with the operation at 31kHz with 1k resistors, I'd recommend leaving it as is. You could even try some 500 ohm, 1/2 Watt resistors to see if the faster switching time keeps the mosfets even cooler, or allows you to run at a higher frequency if that is your goal.

    I agree that an MCU should be protected, but I just don't see much possibility of damage with your circuit.
     
  6. TerraViper-5

    Thread Starter New Member

    Jul 28, 2012
    8
    0
    But those 12V wont be killing the MCU, will they? Actually, I could live with 21 kHz, as long as its out of hearing range, 31 kHz is just a value that most MCUs support without a problem. If I wanted 21 kHz it would be much more complicated to achieve.
    Yes, that thought has crossed my mind, in the event if I decide to use a little stronger motors with more current draw, cooler MOSFETs would be very handy. Thank you for confirming that it can work :) 24 mA wont be too much for a MCU pin, will it (in case if I use 500 Ohm resistors)?

    Thanks for your advices! Much appreciated!

    Have a nice day!
     
  7. eeabe

    Member

    Nov 30, 2013
    59
    9
    That's a good point, and I wasn't thinking about the MCU pins being on the emitters. Your MCU datasheet should show the maximum sinking current of a single pin. If you need more current than the MCU can handle, you could consider adding another layer of transistors for the "shoot-through prevention" part of the circuit so the MCU pins are not directly involved in the relatively high gate currents. I'm thinking some transistor logic similar to how the enable signals are used on the lower half of the bridge.
     
  8. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    The real reason for using opto-isolators between the MCU and the motor driver is that you can use two totally isolated AC- powered supplies; one to run the MCU and the other to run the motor driver and motor. To achieve this isolation, the supplies must each be transformer-isolated from the AC line side. There will be no Ohmic (Galvanic) connection between the 0V terminal of the MCU supply and the 0V terminal of the motor supply.

    Maintaining this isolation keeps any transient motor currents from flowing along any of the MCU's wiring, especially in the MCU's "ground plane". This is 95% of what it takes to prevent to keep the inductive transients in a high-current inductive load from disturbing the MCU. The other 5% comes from "bypass capacitors", shielding, and physically routing the MCU wiring away from the motor wiring...

    I know of which I speak; I used to do this for a living.
     
    Last edited: Dec 17, 2013
Loading...