Isolating arduino from H-bridge motor driver

I am planning to use Arduino + SparkFun Monster Moto Shield to drive two 12v (>10amps) motors. My wiring would look something like this:

But, even when the monster moto has built in protections, I'd still like to isolate the boards to add an extra layer of protection, since they are not so cheap and easy to get where I live.

My electronic skills are very basic, but I remember having used an opto isolator for a project in school, so I did some googling and found the 6N137, which I think may be suitable for this. After some more googling and watching circuit examples I drew this:

My idea is to isolate the connections between pins 4 to 9 on the boards, so here are my questions:

1) Would this circuit work? If so, are the component values correct?

2) Would I need 6 of these circuits to isolate all the connections or can one opto isolator be used to isolate more than one connection?

That chip is a little more complex than a plain optoisolator. It looks like you don't need the 470 resistor on the output side as the output is a digital logic gate.

470 on the input side will give just the minimum current across the LED, assuming 5V input. This would be a problem in a normal optoisolator as the output is a multiple of the input and you should not go near the minimum. It may be OK for this one, but just to be safe, I'd substitute 330 ohms, to get the current up to 10mA.

You can get optoisolators in array packages, to get 2 or 4 in one chip.

By isolating the thing, you lose the current feedback ability of that motor driver. I think it's more important to be able to measure current instead of isolation. Those driver chips are extremely good at their job. They are almost impossible to destroy and extremely unlikely to let dangerous voltages into your Arduino.

(PWM current feedback does require a bigger capacitor than the normal one fitted to those boards.)

If you share a common 5V and ground then your opto isolator in effect does nothing useful.

To get isolation requires you to have a separate power and ground on both sides of the opto.
You do not common the grounds between the two systems.

Yes, do not share GND and Vcc. And there are lots of 6 pin opto chips or chips that have multiple opto-couplers in one housing.

MorganS:
By isolating the thing, you lose the current feedback ability of that motor driver...

Are you talking about pins 2 & 3 + 13 of the monster moto? I am not using those on my code/wiring, because I couldn't find how they work on the documentation.

Grumpy_Mike:
If you share a common 5V and ground then your opto isolator in effect does nothing useful.

To get isolation requires you to have a separate power and ground on both sides of the opto.
You do not common the grounds between the two systems.

Oh yes, I forgot to fix the image (fixed it now), I would be using a different power supply for the h bridge if I use this type of isolation.

arduinoaleman:
Yes, do not share GND and Vcc. And there are lots of 6 pin opto chips or chips that have multiple opto-couplers in one housing.

Do you know the name of some of those chips so I can check them out?

Thanks for your replies, I guess I will get some of the needed components and start running some tests.

The ILQ2 from Vishay might be an appropriate device to use as it has 4 per package. It's not as smart as the 6N137, so it will need more circuitry around it.

The 'fix' in the image is wrong. Pin 3 should connect to the Arduino ground and nothing else.

I hope you're building your own circuit board. If this is on proto board or breadboard then the isolation is unlikely to be sufficient to protect anything from anything. You can hand-solder these parts, if you don't mind not connecting the heatsink pads underneath. This should be OK for 12V/10A. Solder paste through a solder stencil plus oven or skillet soldering will let you solder those pads properly.

If you aren't planning to build a PCB, then just use the damn shield like it's supposed to be used. The most likely source of damage is wiring it up incorrectly, which is pretty much solved by using the shield as intended.

MorganS:
The ILQ2 from Vishay might be an appropriate device to use as it has 4 per package. It's not as smart as the 6N137, so it will need more circuitry around it.

The 'fix' in the image is wrong. Pin 3 should connect to the Arduino ground and nothing else.

I hope you're building your own circuit board. If this is on proto board or breadboard then the isolation is unlikely to be sufficient to protect anything from anything. You can hand-solder these parts, if you don't mind not connecting the heatsink pads underneath. This should be OK for 12V/10A. Solder paste through a solder stencil plus oven or skillet soldering will let you solder those pads properly.

If you aren't planning to build a PCB, then just use the damn shield like it's supposed to be used. The most likely source of damage is wiring it up incorrectly, which is pretty much solved by using the shield as intended.

I see, thanks for the clarification. I would be building my own PCB for this, and I want to use opto isolators because for the application I would be using it (driving 2 motors like those used for car wipers), I read that some people have fried both the h bridge and the arduino, maybe because inductive kickback idk).

I went to buy the opto isolators but they didn't have any of those I was looking for, they only had a PC817, some people told me it should still work so I drew this:

Click to enlarge

But I get a little confused when having to connect multiple opto isolators, it just seems like im bridging all the h bridge pins by connecting them to all to the same Vin.

I calculated R1 to R6 by looking at the "Collector Current vs. Collector emitter Voltage" chart on the datasheet (HTTP 301 This page has been moved). It looks like 680 or maybe 1k should keep it operational using 5V. But I have no idea how to calculate the pull up resistors.

But, even when the monster moto has built in protections, I'd still like to isolate the boards to add an extra layer of protection, since they are not so cheap and easy to get where I live.

Well, considering that the isolation requirement is is just backup protection for the arduino and the cost and availability of the isolation components might also pose a problem, you might want to see if you can obtain some of the below arduinos as backups instead of the all the isolation components.

http://www.ebay.com/itm/NEW-ATmega328P-CH340G-UNO-R3-Board-USB-Cable-7-Gilded-Pin-for-Arduino-DIY-FO-/291352666431?pt=LH_DefaultDomain_2&hash=item43d5f8e13f

zoomkat:
Well, considering that the isolation requirement is is just backup protection for the arduino and the cost and availability of the isolation components might also pose a problem, you might want to see if you can obtain some of the below arduinos as backups instead of the all the isolation components.

http://www.ebay.com/itm/NEW-ATmega328P-CH340G-UNO-R3-Board-USB-Cable-7-Gilded-Pin-for-Arduino-DIY-FO-/291352666431?pt=LH_DefaultDomain_2&hash=item43d5f8e13f

Would love to be able to buy stuff on ebay, or some of those sites that sell almost any component in existence, but in my country everything is held in customs, i'd have to drive >500km, fill legal and tax forms, and pay more than 50% extra just to receive the product.

Anyway, I was told the circuit should work but that opto isolators invert the signal, and to look into an inverter like the 74ls14. Will have to do some more reading.

but that opto isolators invert the signal,

That is why you have software so the signal can be any way up you want.

Grumpy_Mike:
That is why you have software so the signal can be any way up you want.

So i would just use HIGH instead of where I now use LOW and viceversa? But how would I invert the PWM signal output?

Yes that is right.
PWM is inverted by feeding an analogWrite with 255-value in place of just value.

can i integrate the Monster Moto Shield with an APM 2.6??

I'm sure it can be done by somebody. Maybe that somebody is you.

Report your own post to the moderator. Ask that it be split into a separate thread. This doesn't continue the discussion of the previous thread.