6n137 optopcoupler wired wrong?

Discussion in 'The Projects Forum' started by basline, Jan 3, 2016.

  1. basline

    Thread Starter New Member

    Aug 16, 2012
    20
    0
    Hi all,

    I'm having trouble with the attached circuit, and as a newbie who has forgotten much of what I learned along the way I'm at a loss as to how I can trouble shoot the problem. I've stuck the multi-meter on the circuit, and while there is 5 volts across pin 6 and pin 8 this voltage never changes even when apply voltage across pin 2 and 3.

    I've been working on a project to control fans and pumps with a micro-controller. I designed the attached circuit, which uses 6n137 optocouplers (because I had them) and n-channel mosfets along with some sizable diodes to deal with the flyback from switching the motors. I've been working a few weeks here, a few weeks there for over a year now. I'm having a a hard time making heads from tails on the 6n137 datasheet as I've for gotten so much now.

    To test this circuit I have connected my microcontroller's 5V to pin 2 of connector JP8. I then use the digital output of my controller to toggle pin 1 and pin 3 for each optopcoupler. I see the voltage across pin 2 and pin 3 of the 6n137 go from 0 to 1.4 volts, which I think is what it is supposed to do. However the voltage across pin 6 and pin 8 never changes from 5V, and my mosfets never turn on.

    [​IMG]

    Are there problems with my schematic?

    Thanks in advance
     
    Last edited: Jan 4, 2016
  2. basline

    Thread Starter New Member

    Aug 16, 2012
    20
    0
    Last edited: Jan 4, 2016
  3. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    You need a pull up resistor on the output (pin 6). Look at the data sheet. Put a 470 ohm resistor between +5 and pin 6 and it will work.
     
    Last edited: Jan 3, 2016
  4. hp1729

    Well-Known Member

    Nov 23, 2015
    1,950
    219
    Pin 7 is an Enable input. It should be high. I can't tell if it is on your schematic.
    (edited to add ....)
    I had to sit down and play with one to confirm it. Yes the enable floats high. Yes letting it float should work.
    You are back to the output being your only problem.
     
    Last edited: Jan 4, 2016
  5. DickCappels

    Moderator

    Aug 21, 2008
    2,651
    632
    When posting images here that are hosted by postimage.org, use the link labeled "direct link" instead of the one simply labeled "link".
     
  6. basline

    Thread Starter New Member

    Aug 16, 2012
    20
    0
    Thanks for the feedback everyone. I realized I had my pin numbering off in my original post (incorrectly referred to pin 7 when I meant pin 8, also referred to pin 5 when I meant pin 6). I apologize for any confusion this may have caused, I've edited my original post to reflect this. Apologies overall for the edits, I'm flustered and frustrated that I messed this up. I really appreciate the help.

    I've edited the link.

    hp1729, pin 7 is not connected. I was confused about this in the datasheet, and it seemed like it would change the behavior of the optocoupler.I went with NC as it seemed like it wasn't needed.
    Here's the datasheet:
    http://optoelectronics.liteon.com/upload/download/DS70-2008-0035/S_110_6N137 20140411.pdf

    Lestraveled, I have a pull down resistors on pin 6 because they are controlling logic level n-channel mosfets, but I may also just be confused about this as well. I did a pull down resistor as I thought a pull resistor will mean the n-channel mosfet is always on. Is this incorrect? I think a resistor between pin 5 and pin 6 would be a pull down resistor rather than a pull-up resistor, or is this incorrect? Should I remove R1 and add a 470ohm pull-up resistor instead?
    I've been looking at the lite-on datasheet linked to above, and it's example circuits have just confused me. I'll try looking at other manufacturers to see if they have better examples.

    Thanks again
     
    Last edited: Jan 4, 2016
  7. Lestraveled

    Well-Known Member

    May 19, 2014
    1,957
    1,215
    @basline
    By itself, the 6N137 can only "pull down". Just add a 470 ohm resistor between +5 and the output pin and it will work.
     
  8. hp1729

    Well-Known Member

    Nov 23, 2015
    1,950
    219
    Pin 7 looks like an Enable input to me and must be high. I don't know if floating qualifies. ... and yes, the output can only pull low.
    (edited to add ...)
    No, pin 7 is not your problem. I had to play with one to confirm it. Leave it to float.
     
    Last edited: Jan 4, 2016
  9. basline

    Thread Starter New Member

    Aug 16, 2012
    20
    0
    Thanks for the help from everyone. I ended up simplifying the circuit somewhat since I had to start over an order new parts. In case it will help future novices out there, this circuit is working on my breadboard. There are two jumpers so I can control the mosfets either separately with 2 pins from the microcontroller, or together with a single pin from the microcontroller.
     
Loading...