Optocoupler circuit for digital signal - Source vs Drain

Discussion in 'The Projects Forum' started by Steelmesh, Mar 10, 2014.

  1. Steelmesh

    Thread Starter Member

    Aug 25, 2009
    18
    0
    For isolating a PWM signal from one mcu to another (where the left side mcu is generating a PWM, the right side mcu is measuring the width); which one is Right, Wrong, Indifferent, Inverse?

    Assume that opto is capable (I just used a random one)

    [​IMG]

    Thank you
     
  2. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    The first circuit is better.
    If the receiver pin has a high level at there when the power up, that is not a good arrangement, so let the PB0 receive a low level when the power up, and the receive pin and the transmit pin are the same phase.
     
  3. Steelmesh

    Thread Starter Member

    Aug 25, 2009
    18
    0
    Can you help me clarify your response. Did you mean delaying the +5V supply on the photo-transistor side until the receiving controller is running? For example using another output pin to control this delay?
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Not any real difference between them.

    The first has the output in phase with the input, the 2nd one is out of phase.

    That's about the only difference there is. Either should serve you well.
     
  5. Steelmesh

    Thread Starter Member

    Aug 25, 2009
    18
    0
    I appreciate the insight :D
     
  6. ScottWang

    Moderator

    Aug 23, 2012
    4,853
    767
    I didn't add anything at all, it just described what your circuit was, and which one is better for the most applications, why i chose the first circuit, because in many situation that if the receive side has high level, it could be happen some bad when the device is power up.

    Specially in the first circuit has the same phase, so you just need to set the INT and timer on the uC of the photo-transistor side, when the photo-led side is high, then the timer of the photo-transistor side will start to count, and when the photo-led side is became low level then the photo-transistor side will stop the timer, and the uC to calculate the number of timer, that's the program you need to write.
     
Loading...