Isolated comms (circuit review)

Hi all,

I have a requirement to have two uCs talk to each other serially with the following conditions

  • uC1 and uC2 must be totally isolated from each other

  • uC1 must be able to cut the power from uC2

  • half-duplex comms on one wire

  • Distances not large 1-2 metres

  • Low speed, probably 4800bps

NOTES:
PS1 is a DIP isolated PSU
uC1 will control PS1's VIN+ (and therefore uC2's power) with a MosFET
No hardware provision for bus clashes however with a simple master/slave protocol there shouldn't be any and R1/2 will limit current
uC1 probably Arduino or similar
uC2 ATtiny85

The general idea is that uC1 powers up uC2 by applying power to PS1, the two engage in a short dialogue, then uC2 is shut down until the next time.

Somehow it doesn't seem right to have two inverting devices (the opto couplers) back to back but I can't see how this would oscillate.

All comments appreciated.

Rob

I'm thinking you will have a problem because you basically have a LED shorting the output of the transistor. I don't think you can rely on the forward bias voltage of the LED being read as a high.

I don't pretend to have any expertise in isolated communication, but I can't see any problems with the circuit.

I'm not sure what Tim Williams is trying to say, but then again, perhaps I just don't know enough about this kind of thing :P.

Well, lets see if I can expand on my earlier post.

All diodes (including LEDs) have a property that above a certain voltage they conduct very strongly, so resistance decreases as voltage increases (it is not linear like a resistor), so that regardless of voltage input, the voltage across the diode is (nearly) constant.

For LEDs this Forward Bias Voltage perhaps 1.5V. Since the LED portion (pins 1&2) is across the output portion (3&4) of the optocoupler, the highest voltage you will ever see across 3&4 is 1.5V. So, the input to the micro is going to be 0V when 'low' and 1.5 when 'high.'

I checked after I posted and the ATMega only needs 0.6 for a high so it might work, but it is poor design practice to use a 1.5V signal when the circuit is running off 5V. Many logic ICs are not guaranteed to work with a 1.5V signal.

Bi-directional optoisolation is non-trival. I would ask the OP if he really needs one-wire communications instead of merely wants it. I would need to have some real justification to use only one-wire, instead of implementing a two-wire solution, using the same parts.

Ah, now I understand what you're saying.

Regardless, I'd say give it a try and see if it works. It's not an ideal solution, but that's not to say it shouldn't work.

Tim is right I hadn't spotted it, I've redrawn the circuit and it's more obvious (isolated PSU not shown as I don't think it's relevant to the problem).

However I think the other side is OK because of the resistor location. So if I move R2 it should work.

There are of course software issues with clashing, if both uCs drive high at the same time their OPs will be shorted almost to GND by the transistors, but as I said a very simple protocol should deal with that, and maybe resistors in series with the uC's IO pins to at at least limit the current if this happens.

Maybe 4 wires is the way to go, in all currently designed widgets (at the uC2 end) I have a spare pin and and at the other end I may have room to make the connectors 4-way instead of 3, AND there are no clash issues.

I'll do some deep thought about that, meanwhile am I correct with the above circuit Tim?

Well, the first redrawn schematic is not the same as the original. R1 is not in series with both optocouplers.

In any case, moving the resistors as shown in the second redrawn schematic will not make a significant difference. You would have to increase the value and add an external pull-up, but when you do that the voltage for a low level increases.

I hate to be a naysayer, but that is what engineering is all about--figuring out what can possibly go wrong and then not doing that.

Even if we find the right value of resistors to get reliable signal levels, how were you going about handling the signal inversion?

I hate to be a naysayer

That's alright, I was looking for informed opinion.

The signal inversion doesn't matter because the comms is bit-banged serial so I can invert. However having a digital system that relies on picking the correct resistors is not good when for the sake of adding another wire all these problems go away.

So that's probably what I will do.

That's alright, I was looking for informed opinion.

You definately got the wrong person then. :stuck_out_tongue:

I did stumble upon an app note from Freescale, that purports to show a successful opto-isolation scheme. It uses 2 optos, 2 transisistors, 2 caps, and 6 resistors. It adds some more hardware, but if you want to make one-wire work....

I've being playing with Dallas Semi one-wire temp sensors, so I will have to file this idea away as there really isn't an option to go to two-wire with those.

Thanks Tim, very interesting circuit, I'll study it for a while.