Optocoupler Connection

Discussion in 'The Projects Forum' started by poxkix, Feb 24, 2012.

  1. poxkix

    Thread Starter Member

    Nov 28, 2011
    42
    0
    Will my circuit connection work?
    At default state, the MCU pin is at state 0. If the MCU pin changes state to 1 it activates the 12v solenoid.
    Does the Optocoupler make any difference if it is there or not?
     
  2. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    As shown, the optocoupler does nothing. The optocoupler is an open collector transistor to ground and is either on or off. Either way there is no voltage to turn on the 2N2222A.

    To configure it to operate properly, connect pin 16 to the 12V supply and pin 15 to the base resistor of the 2N2222A.
     
  3. poxkix

    Thread Starter Member

    Nov 28, 2011
    42
    0
    Oh. Good thing I asked first before trying this circuit.
    Can the emitter handle the 12v input? I can't seem to find it in the datasheet or I don't know how to look for it.
    Like this sir?
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    The Absolute Maximum Rating collector-emitter voltage (on the data sheet) of that optocoupler output is 70V so it well readily tolerate 70V. It's the collector-emitter voltage you are concerned about, not the emitter voltage. The optocoupler output is highly isolated and will tolerate a potential 2500 volts above the input ground (DC isolation test voltage).
     
    Rbeckett likes this.
  5. poxkix

    Thread Starter Member

    Nov 28, 2011
    42
    0
    Okay. I got it. Thanks sir.
    Will this circuit do?
     
  6. #12

    Expert

    Nov 30, 2010
    16,355
    6,852
    The design is good but it looks like you are trying to put 1 volt into pin one of the optocoupler. That's not enough to fire the internal LED. If that's just an oversight on the drawing, ignore this message.
     
  7. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    That circuit reverses the polarity so that an input low turns on the relay. Is that what you intended?:confused:

    Edit: Also R2 is not needed.
     
  8. poxkix

    Thread Starter Member

    Nov 28, 2011
    42
    0
    That 1/0 there is a digital state. If that is what you mean

    What is the correct and exact circuit to serve my purpose? It only should activate if the MCU pin gives a digital signal og 1, if not then nothing happens.
     
  9. #12

    Expert

    Nov 30, 2010
    16,355
    6,852
    You need an invert.
     
  10. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    Your circuit in post #3 would work as you want. Why did you change it?:confused:
     
  11. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Are your input and output side grounds common? If so, I don't see any need for the optoisolator.
     
  12. poxkix

    Thread Starter Member

    Nov 28, 2011
    42
    0
    No sir, the grounds are different. I'm using 2 sources 5v and 12v for the relay
     
  13. poxkix

    Thread Starter Member

    Nov 28, 2011
    42
    0
    I got it to work. Thanks for helping sir.
     
Loading...