photointerrupter with photocoupler not working

Discussion in 'The Projects Forum' started by courtens, Mar 29, 2013.

  1. courtens

    Thread Starter New Member

    Mar 28, 2013
    6
    0
    I have been struggling with this photointerrupter/coupler combination in my project, and somehow just can't get it to work the way I think it should work.

    As interrupter I am using RPI-246 (link to PDF)
    and for the coupler it is TLP117 (link to PDF)

    Do I need a transistor after the interrupter's detector, in order to create a darlington pair? ... would that fix it?

    It somehow looks like I just can't get the emitter on the coupler to light up bright enough in order to drive the gate on it.

    Or, is there a flaw in my schematic?

    Thank you for helping me out.
     
  2. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    Take a look at the coupled characteristics for the RPI-246. At 20ma Iforward, you get a max of 1.2ma collector current out to drive the LED of the TLP117. The TLP117 requires 10ma min to operate. So.. no go. You'll need a some current gain between the two optos.

    I am curious as to why you have to have two optos. A comparator with hysteresis on the output of the interrupter would provide the Schmidt trigger.

    If you need the 2ed isolator, you could use a PNP stage to drive the TLP117. Alternately, the open collector output of the aforementioned comparator would drive the 2ed LED and give you some level discrimination to sharpen the output of the interrupter.
     
  3. courtens

    Thread Starter New Member

    Mar 28, 2013
    6
    0
    John Thank you for your help. I just got it do work; but probably still need some adjustments on the R values for R0 and R2. (see new schematic) do you have a suggestions on these?

    The reason why I need two optos is that the photointerrupter is too close to a lot of noise producing electronics. It is monitoring moving parts of a motor and could pickup too much noise. So in order to isolate and get a cleaner signal I am using the photocoupler before entering my PCB.
     
  4. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    Its a clever approach, setting a continuous current below the current threshold of the TLP117 and then adding enough to be above it.

    My concern is that calling the 117's 10ma min current to operate a threshold implies that its somehow a controlled parameter i.e. 9.5ma is guaranteed OFF and 10.5ma is guaranteed ON. That is not what the spec is saying. Instead, it says that at 10ma in, ALL 117's that are produced will be ON so if your design supplies at least 10ma, you can be sure that all of your production boards will work. Your approach assumes that anything less than the specified current will also result in it being OFF, but that's not what the spec is saying.

    Your current resistor values confirm this. You say the 117 is now working but Iforward is still way less than 10ma. Imin for your specific device is less than 10ma. You are operating in the grey area. Even if you tinkered with the values to make it work, variances in the individual devices, ambient temperature etc. would conspire against you.

    I still vote for a current-gain stage between the devices. The overall gain must be so that worst case, the min current out of the first opto * gain >= min current requirement of the second one. I would make sure to add some to that for tolerances etc. A PNP stage would do the trick.

    Have fun!
     
  5. courtens

    Thread Starter New Member

    Mar 28, 2013
    6
    0
    Thank you John! Please excuse myself for sounding stupid for a second; but I am not sure if I am understand the datasheet for the RPI-246 photointerrupter properly. The sheet states under absolute maximum rating "Output phototransistor" collector current (Ic) = 30mA. Now somehow I was wrong thinking that this is what it can draw -- NOT SO! In the graph (Figure 10) I see the "Collector Current Ic (mA)" in relationship to the "Collector to Emitter Voltage Vce (V)". So if I understand this right - if the emitter is ON I will only "pull" 0.7mA --- no wonder this did not work!?! Is this assumption right ... or am I still missing something?

    In the meantime I found myself in the process of replacing the RPI-246 photointerrupter. They are too small. I am now replacing it with this EE-SX1041 (link to PDF) interrupter. It looks like the electrical date is about the same.

    I went ahead and draw-up two schematics. Now I have two different ways to get this to work. Which one would you choose? I assume both would work ... Darlington Transistor (link to PDF) or Schitt-Trigger Inverter (link to PDF)
     
  6. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    I don't like the top one because the typ source current from the inverter is only 4ma. You need 10ma min. You can get more out of them but the voltage out will drop...

    The bottom one is fine if you don't mind buying the ULN2003. If you go that way, R24 should be something kind of big 47K-68K. All you want it to do is handle any leakage current from the opto's transistor. When ON, you want the opto current to drive the 2003 hard. Also, R23 should be 180 or so. Don't forget that you have Vce on the opto to add to the Vf on the LED to get the voltage across the R (and from there the current in the leg).

    If you don't want to use the 2003, I've attached a PNP driver that should work. The base pullup R (shown 33K-68K) should be 68K or more. It too is just there to swamp out any leakage current from the opto transistor and speed shutoff.

    The 30ma is the absolute max rating. If you had a particularly hot pair that could deliver more than the typical current you could toast the transistor. Your later realization is correct, you might find some that could deliver lots of current but the mfr. is telling you what minimums are guaranteed. Usually, an individual device will be much better than the quoted min specs but if you design to typical values you may be disappointed when you get one that is lower than you expected.

    The new one has a better typ current but look at the minimum. 0.5ma at 20ma in the LED (under Combination in the characteristics table). So, I would design the gain stage to expect no more than .5ma and make sure it had a current gain of at least 20 (to get the 10ma that you need for the 2ed opto). The stage I drew should be OK but if you decide to use it, better check it with .5ma base current (less the current through the base pullup R - that's why its big).
    Good Luck!
     
    Last edited: Mar 30, 2013
  7. courtens

    Thread Starter New Member

    Mar 28, 2013
    6
    0
    So I was looking around for a PNP stage and soon gave up on it. I need 4 of them but have only one in-house.

    So I went ahead and came up with this (see image) using a NPN stage. Somehow it works on paper ... but not in reality. Am I missing something ... :confused:
     
    Last edited: Apr 5, 2013
  8. courtens

    Thread Starter New Member

    Mar 28, 2013
    6
    0
  9. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    First, the NPN as wired will give you a net inversion i.e. when opto 1 is conducting, opto 2 is OFF. Is that OK?

    Second, your calculations are marginal and don't take into account the voltage drops across LED2 and Q2. Your current through the 2ed opto is
    5V - VfLED - Vce sat of Q2/390ohms. On a good day this is 5 - 1.2 - .4 = 3.4V. 3.4V/390ohm = 8.7ma, not the 10 you want. Note that just because you calculate a collector current does not mean that you will get it if you have other things in the circuit. Drop the 390 to 180 or less.

    To remove the inversion, move the 68K from the collector to the emitter of the opto and connect the base of Q2 through a smallish resistor to that emitter-resistor node. (check the max base current of the 2222 and push it to ensure saturation).
     
    courtens likes this.
  10. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    courtens likes this.
  11. courtens

    Thread Starter New Member

    Mar 28, 2013
    6
    0
    JohnInTX -- thank you so very much for all your help!

    I got it working nicely with the ULN2003A. Ended up using a 12K resistor to 5V and connected to the node of Q1 emitter and ULN2003A base. The voltage is jumping between 80mV and 1.9V. I do not have a way to measure the current under 0mA; but it is under 0mA; so assuming under 600uA.
     
Loading...