Problem Interfacing Digital Output to Optocoupler

Discussion in 'The Projects Forum' started by moocrow, Oct 24, 2013.

  1. moocrow

    Thread Starter New Member

    Apr 3, 2011
    21
    0
    Hi,

    I have two sensors, a 5V IR detector and a 5V photo-interrupter, which I want to use to driver an optocoupler. The purpose is to translate the high/low state of the output to 3.3V. As it happens, it also inverts the state but that is not essential to my project. Both sides of the circuit have a common earth and are ultimately powered from the same source.

    I have connected the 5V output of the IR sensor to the optocoupler anode via a 680Ω resistor, with the cathode connected to ground. The collector is connected to the output pin and to 3.3V via a 10K pull-up resistor. The emitter is connected to ground.

    So, when the IR sensor output goes high, current flows to the optocoupler which connects the output pin on the other side to ground. It drops from 3.3V to 0V.

    With exactly the same setup, using a photo-interrupter instead of the IR sensor, I get a different result. When the output goes high, it goes to only approx. 1.2V. The voltage on the other side of the resistor, at the anode, is almost the same. When I disconnect the output from the circuit, it goes to 5V when high as expected. Changing the resistor doesn't seem to matter much. E.g. a 680Ω resistor results in only a change of 0.1V.

    So I have two 5V digital outputs which behave very differently under the same conditions. Clearly the optocoupler is not getting enough current at the anode but I don't know how to calculate the correct size resistor.

    Thanks,

    Jim.

    Optocoupler, ACPL 8x:

    https://www.google.co.uk/url?sa=t&r...=xHO8DFeXE0oJN4DS-WHicg&bvm=bv.55123115,d.d2k

    Photo-interrupter:

    https://www.google.co.uk/url?sa=t&r...=sZ6u9BWSyo5KCgZqAStfyA&bvm=bv.55123115,d.d2k

    IR Sensor:
    http://www.pololu.com/catalog/product/1134
     
    Last edited: Oct 24, 2013
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,791
    1,103
    Not surprising. The interrupter has an internal 15k pull-up resistor which is limiting the diode current. Try connecting the 680 Ohm resistor between the +5V rail and the diode anode, and connect the interrupter output pin to the diode anode too.

    Edit: Like this
     
    Last edited: Oct 24, 2013
  3. moocrow

    Thread Starter New Member

    Apr 3, 2011
    21
    0
    Thank you! Having a schematic to work to is really helpful. I'll try this and post the results.
     
Loading...