Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Microcontroller/optoisolator interface

  1. Nov 17, 2016 #1
    I have to connect a micro controller to an optoisolator, but I'm told to do this, I can't directly connect the micro controller to the optoisolator, I need an interface device in between (for example an open collector). Why is this, what is the reason for the interface device and why can I not directly connect the micro controller to the optoisolator?
     
    Last edited by a moderator: Nov 17, 2016
  2. jcsd
  3. Nov 17, 2016 #2

    berkeman

    User Avatar

    Staff: Mentor

    That depends on the optoisolator. Some can be connected directly, others need at least a pullup resistor on the output transistor side, and some need a current-limiting resistor on the input photodiode side. Can you post a link to the datasheet of the opto? Is your uC running off of 3.3V or 5V?
     
  4. Nov 17, 2016 #3
    I have a drawing similar to that picture given to me to help me out. I've only just started this project so I've not got anything specific. Can you explain to me what's happening in that circuit?
     

    Attached Files:

  5. Nov 17, 2016 #4

    berkeman

    User Avatar

    Staff: Mentor

    That circuit shows an input LED that is driven by an external digital gate (with a current-limiting resistor), and a photodiode that will convert the light from the LED into a photocurrent.

    Unless you need a really fast optocoupler, that's not the easiest way to go. It requires a current-to-voltage converter at the output. A much more practical version uses a phototransistor at the output, which only requires a pullup resistor to make a digital output signal. More like this...

    http://www.eblogbd.com/wp-content/uploads/2013/01/opto-coupler-or-opto-isolator3.jpg
    opto-coupler-or-opto-isolator3.jpg
     
  6. Nov 17, 2016 #5

    berkeman

    User Avatar

    Staff: Mentor

  7. Nov 17, 2016 #6
    I know for pretty much certain, I definitely need an open collector, an optocoupler and a microcontroller.

    When you explained that circuit, you said it had an input LED... is that not the open collector or am I just confused?
     
  8. Nov 17, 2016 #7

    berkeman

    User Avatar

    Staff: Mentor

    If you look at the circuit in my Post #4 above, you see an input LED on the left side of the optocoupler, and a phototransistor on the right side. You drive the input LED with some signal, and limit the LED current with a series resistor. On the output phototransistor, you usually ground the emitter and put a pullup resistor from the collector to 3.3V or 5V (whatever your uC uses), and also connect that collector to the input of your uC. Does that make sense?

    An alternate output connection is to connect the collector to the power supply rail (3.3V or 5V), and connect a resistor from the emitter to ground. The emitter is also connected to the input line of your uC. Can you see how the two types of output connections result in a signal inversion when compared to each other? :smile:
     
  9. Nov 17, 2016 #8
    I do understand what you're saying but I'm kinda confused.

    What I'm doing is building a switching device for a switched reluctance motor. I've just started so I'm not too sure what I'm doing but I know the basic devices I NEED.

    upload_2016-11-17_20-36-38.png

    That picture shows the basic way it'll be connected up. I know for sure I need all these devices, but put VERY SIMPLY, why do I need that open collector there? Why can't I just remove the open collector altogether?
     
  10. Nov 17, 2016 #9

    berkeman

    User Avatar

    Staff: Mentor

    I don't know of any reason for an open collector stage before the optocoupler. In fact, it would appear to be bad design practice on the face of it. It will slow down the interface -- a simple digital buffer gate can be used if the uC does not have enough drive capability for the LED side of the optocoupler.

    Is there a more complete problem statement that you can share with us?
     
  11. Nov 17, 2016 #10

    berkeman

    User Avatar

    Staff: Mentor

    Actually, which direction is the signal propagating in that diagram? I'd assumed left-to-right to drive the IGBT. But if the signal is propagating right-to-left as a monitoring signal fed back to the uC, then the diagram may only be saying that the output of the optocoupler on the left needs to be treated as an open collector signal going to the uC on the left, and hence you need the resistor pullup to 3.3V or 5V. Could that be what they are trying to show?
     
  12. Nov 17, 2016 #11

    rbelli1

    User Avatar
    Gold Member

    Some micro-controllers have outputs that can drive an opto isolator with nothing more than a resistor. Check the recommended maximum output current on all of the available outputs. Look for both source and sink as you can wire the opto up for either current direction. If you find something that is higher than the minimum current of the opto (taking into consideration the current transfer ratio) you are good.

    The easiest course of action is to find a device that has logic input and is designed to drive an IGBT. You have gate charge to contend with and that will give you slow switching using just a transistor output isolator.

    This all assumes you are using the micro to control the IGBT.

    BoB
     
  13. Nov 18, 2016 #12
    Hello Nothing -

    Since you are using an IGBT and Not a MOSFET you are probably not dealing with a 1-2 Amp / low voltage switching case correct? In power electronics - it is very common to add a buffer between the controller and the opto; the general reason is noise immunity but there are few others. The controller may be mounted separate from the power electronics ( Switching devices and drivers - etc) -- and the buffer, opto (IGBT driver) and IGBTs are all assembled close to one another. Since the IGBT switching generates a lot of EMI, you want the signal from the controller to the power electronics to stay "clean".

    Did they also say to use a separate power supply for the controller and the Buffer/ Opto? This can also allow a level shift between the two. Or the link from the uC to the Buffer may be at a higher voltage - also for noise immunity- requiring a level shift to the opto - by always putting (or expecting to put) a buffer there, you will be more successful and have fewer problems.

    Is it possible you are being told to do this as a "best practice"?

    As such - from a pure electrical circuit standpoint, yes the uC can run the opto, but in practice this is not ideal for this case.
     
  14. Nov 18, 2016 #13

    Baluncore

    User Avatar
    Science Advisor

    An open collector driver might be used where the microcontroller runs on a low-power regulator, or where a low supply voltage is used, the opto-isolator is then run on a higher voltage or on the unregulated supply.

    What make / model is your microcontroller ?
    What voltage power supply does it use ?
     
  15. Nov 19, 2016 #14
    You can find push-pull optocouplers that can directly drive an input pin for an MCU. I'm actually using one with a project I'm working on right now; link.

    Another consideration with optocouplers is you need to drive a diode so you need a signal source with fairly low impedance. In my case I'm using a driver since the signal comes from a source with fairly high impedance; link.
     
  16. Nov 19, 2016 #15

    rbelli1

    User Avatar
    Gold Member

    FAN3100T is a rather meaty driver. If your grounds are common you should be able to get away with driving the IGBT directly with that.

    BoB

    PS: There is an error on Fig 6 of the FAN3100T datasheet.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Microcontroller/optoisolator interface
  1. Why do you optoisolate (Replies: 1)

  2. Linear optoisolator (Replies: 13)

Loading...