Optocoupler Newbe

Discussion in 'General Electronics Chat' started by Mad Professor, Apr 23, 2009.

  1. Mad Professor

    Thread Starter Active Member

    Apr 15, 2009
    Good Day All.

    I have never used or worked with Optocouplers before so I would like some advice before I go out and buy any.

    I have built my own stepper motor control board that is connected to my laptop printer port, eveything works, but I think I am getting noise on the ground or singal pins so I would like to isolate the printer port from the control board, I have read the best way to do this is to use Optocouplers.

    I have a total of 10 pins I want to isolate with optocouplers.

    All the outputs from the printer port are low unto step signals are sent.

    The IC's on my controller board need to see at least 2.65v before they activate.

    For testing I would like to buy the Optocouplers from maplin as it's local, but that limits me to only the following.

    4N25 £0.79 Each, Datasheet.
    SFH618 £0.89 Each, Datasheet.
    MOC3020 £0.99 Each, Datasheet.
    ILQ74 £1.59 Each, Datasheet.

    Can someone please advice me how I would go about using Optocouplers in my design.

    Thanks for your time.

    Best Regards.
    Last edited: Apr 24, 2009
  2. Darren Holdstock

    Active Member

    Feb 10, 2009
    Shouldn't be too difficult for digital signals. Use a phototransistor (as opposed to photodiode) with the emitter grounded. Use a pullup resistor from the collector to +5V, and for good noise immunity use a pulldown resistor from the base to 0V. The value of the collector resistor will depend on the transistor Ic(max) and the required speed of operation. The base resistor is less critical - 1k is good for most applications.

    Be aware the signal will be inverted. You could try a non-inverting arrangement with the collector at +5V and the output from the emitter, but there's a good chance the output pulse edges will be a bit non-ideal, so it's not recommended.

    Optocouplers have a large current transfer ratio (CTR) tolerance spread, so factor that in when designing.
  3. bertus


    Apr 5, 2008

    Did you think of the 6n138.
    That optocoupler is made for digital signals.

  4. Mad Professor

    Thread Starter Active Member

    Apr 15, 2009
    Thanks for your replys as always.

    As said in my 1st post I want to get the parts local so I can try and do some testing this weekend witch is why I said maplin I know this limits me to what I can get.

    You say to use a phototransistor.

    As my local maplin's only stocks 4N25, SFH618, MOC3020, & ILQ74, I guess the best one would be the IQL74 witch is a quad phototransistor.

    Would this would ok, and what else would I need to buy to start testing.

    Thanks for your time.

    Best Regards.
  5. Bailey45


    Oct 27, 2008
    The ILQ4 will work fine. You might want to add a inverting gate between your PC pin and the opto. This will keep your signal polarity correct as well helping with the opto input current. The limit resistor for the opto transmitter would be 680-820 ohms and a collector resistor of 4700 is good choice.
  6. Mad Professor

    Thread Starter Active Member

    Apr 15, 2009
    Thanks for your reply.

    I will pop down to maplin in the morning and pickup some bit's.

    I can tell the software to invert the signal to stay high and pulse low, so that I get a high pulse on the other side of the optocoupler, in an ideal world I would of likes to have a high pulse from the computer and a high pulse from the otherside of the optocoupler.

    I want to keep this as simple as possible as I don't have alot of PCB room for the final design.

    Thanks for your time.

    Best Regards.
  7. Mad Professor

    Thread Starter Active Member

    Apr 15, 2009
    Is selecting the current limiting resistor for transmitter side of the optocoupler the same as a LED?

    The max output voltage from my computer or laptop printer port should be 5volts, I have tested a output on my laptop and it sits at 4.40volts with no load.

    So using a 5v supply, and a 1.3v @ 20ma led works out to aprox 190ohm current limiting resistor will be needed, thats if I am reading the ILQ74 datasheet right.

    Sorry for all the questions.

    Thanks for your time.

    Best Regards.