Connect with us

Using optoisolator as a switch

Discussion in 'General Electronics Discussion' started by windinmysails, Sep 18, 2012.

  1. windinmysails

    windinmysails

    26
    0
    Mar 12, 2012
    Hi everyone,

    I'm struggling with a circuit I'm trying to build to isolate two circuits from one another. I thought this would be easy, but I'm obviously doing something wrong!

    Basically, I've got an EDAM 5000 DAQ board that has an isolated input circuit with various digital inputs. When I short from the Input Ground on the DAQ to a particular channel in I get a reading otherwise it's open circuit. This has worked fine for me whilst I've been testing, but I want to be careful with this unit as it's about £150 and I don't want to blow it up, so I thought I'd isolate the input circuit from some other higher power circuitry using an optoisolator, and in particular with a photodiode rather than a transistor as I really only need to close a switch effectively, plus I've got no Vcc on the input side.

    So I ordered a 6N136 from Rapid, (http://www.rapidonline.com/pdf/58-0596.PDF) and I wired it up as shown in the attachment.

    I expected to be able to put a multimeter between pins 7 and 8 and see open circuit when there was no power applied across 2 and 3, and closed circuit when there was power applied. But this isn't the case - I don't get anything. It just stays at open circuit.

    I've Googled and found lots of people using this chip for the transistor bit, but I can't do that as I don't have a Vcc on that side - which is why I was trying to use it as a switch in the first place!

    Can someone tell me what I'm doing wrong please!?

    Many thanks,

    Neil
     

    Attached Files:

  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,174
    2,690
    Jan 21, 2010
    I suspect you may be able to connect pin 8 and 6 together, then to your input, and connect pin 5 to ground.

    A normal optocoupler with a transistor output would have done just fine here, and would be my next step if this doesn't work
     
  3. windinmysails

    windinmysails

    26
    0
    Mar 12, 2012
    Hi Steve,

    Thanks for the reply. I did this and it still doesn't work - I can't see why not. It looks from the circuit diagram with this device that it should work like that!

    When you say a normal optocoupler, what would you recommend?

    Many thanks,

    Neil
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    9,136
    1,844
    Nov 17, 2011
    Not quite, Steve.

    This one works a bit different from "normal" photocouplers:
    The photodiode drives a base current into the base of the transistor, thus controlling the current flow between collector and emitter of the transistor.
    The datasheet states pin 8 = Vcc. Look at Test Circuit 1 on page 5 of the datasheet. That is how to connect this photocoupler.
     
  5. windinmysails

    windinmysails

    26
    0
    Mar 12, 2012
    Hi Harald,

    Thanks - I saw the diagram, but I don't have a 5V source to complete this circuit - all I have is an ground and an input pin... so I can't make this circuit. Any ideas would be much appreciated!

    Thanks both!

    Neil
     
  6. Harald Kapp

    Harald Kapp Moderator Moderator

    9,136
    1,844
    Nov 17, 2011
    You might use any of these.
    What is the switching frequency and what is the input power available? Could a reed relay (e.g. here) be a suitable isolating component?
     
  7. gorgon

    gorgon

    603
    23
    Jun 6, 2011
    If you measure between the input and the ground, you must have some form of voltage? The polarity of this voltage define how you connect a 'normal' optocoupler.
    The one you have described need Vcc on the output side to work properly, so you need to change the optocoupler selected, to a standard emitter, collector only, output type.

    Connecting the new optocoupler is simple, emitter to the most negative side, and collector to the positive side of the input. To be on the secure side, try to measure the current going through the transistor when activating the input, in addition to the open circuit voltage.
    You need these measurements to select an optocoupler.

    TOK ;)
     
  8. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,174
    2,690
    Jan 21, 2010
    Yeah, I read the datasheet. It was a bit of a "hail mary".

    It would be interesting to know what voltage appears on the input when open circuit, and what current when it is shorted to ground. I suspect there is a pull-up resistor.

    I'm not sure a photo darlington is required, I would first try a normal photo transistor output in case the additional voltage across the photo darlington causes problems.
     
  9. Harald Kapp

    Harald Kapp Moderator Moderator

    9,136
    1,844
    Nov 17, 2011
    Right, a photodarlington is probably overshooting the mark. "Normal" photocouplers are here.
     
  10. windinmysails

    windinmysails

    26
    0
    Mar 12, 2012
    Thanks chaps,

    Out of interest, if I wanted three optocouplers on one device (as I'm planning on using three of those digital inputs for three different things I'm trying to sense), I should be able to go for the ILQ30 (see: http://www.vishay.com/docs/83621/ild55.pdf ) which I can get at Farnell at a reasonable price.

    I should then be able to connect my switch contacts such that the input ground goes to pins 9, 12 and 13, my channel inputs connect to pins 10, 11 and 14, and with my 24V switched source, I'll stick something like a 10K resistor to get the voltage down to drive the emitter... anything I'm missing?

    Thanks again!

    Neil
     
  11. Harald Kapp

    Harald Kapp Moderator Moderator

    9,136
    1,844
    Nov 17, 2011
    What do you mean by that? The Emitters are pins 9, 11 and 13.
    Do you mean the LED? In that case 10k is way too large. The specs are for a LED current of 10mA - 20mA. The LED voltage is then approx. 1.3 V. SO the resistor should be R=(24V-1.3V)/10mA= 2270 Ohm (2.2kOhm is a good standard value for that.

    But as Steve mentioned, a photodarlingtin has a higher saturation voltage than a simple phototransistor. You should check the input characteristics of the DAQ board. Will it recognize the darlington's on voltage of up to 1V as closed contact?
     
    Last edited: Sep 19, 2012
  12. windinmysails

    windinmysails

    26
    0
    Mar 12, 2012
    Hi Harald,

    Yes, sorry, I did mean the LEDs. OK - so 10k is too big - 2.2k I can do!

    What I know about the DAQ is that between the contacts there is about 14.2V. When I measure current flow through from the input ground to the sensing pin it's about 2ma.

    Having been through a range of resistors floating around (no variable resistor to hand!) I can say that an 18k resistor counts causes the digital input to read "on" and the 21k causes it to read "off". Lower than 18k is on, above 21k is off. The voltage reading if I put the multimeter in the circuit like this:

    IGND --- Resister --- Multimeter --- Input Pin.

    gives me readings of 14.1V with the 18k resistor, and 13.8 with the 21k resistor, so it sounds as though the threshold is about 14v.

    Does this answer your question (or rather, does this help you to answer mine!) Sorry, as you can tell, I'm not experienced in this!

    Many thanks,

    Neil
     
  13. Harald Kapp

    Harald Kapp Moderator Moderator

    9,136
    1,844
    Nov 17, 2011
    In that case the photodarlington should work.
     
  14. windinmysails

    windinmysails

    26
    0
    Mar 12, 2012
    Hi Harald,

    I'm please to say that it all works wonderfully! :)

    Thank you and everyone else for your help!

    Have a good weekend,

    Neil
     
  15. Harald Kapp

    Harald Kapp Moderator Moderator

    9,136
    1,844
    Nov 17, 2011
    Thanks for the feedback. I'm glad it works.

    Harald
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-