Shop OBEX P1 Docs P2 Docs Learn Events
Two-wire remote photointerrupter circuit — Parallax Forums

Two-wire remote photointerrupter circuit

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
edited 2013-06-23 20:11 in Accessories
I needed a photointerrupter circuit that would work over a two-wire cable. This is what I came up with:

attachment.php?attachmentid=102263&d=1371244520

The circuit is basically a current loop, and the current in my test circuit varies between 1.84 mA and 2.95 mA, depending upon whether the sensor is obscured or not. This results in a 2.05V to 3.16V output range, which could be detected either by an ADC or a by comparator. The downside, of course, is that Darlingtons are slow, so it probably would not be a good circuit to use in a remote encoder, for example.

Any and all suggestions for improvements to this basic concept are welcome -- especially those which shorten the response time and/or provide a wider, or more logic-compatible, output range.

-Phil
520 x 267 - 2K

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-06-15 18:48
    Okay,when obscured you have 2k in series with the IRled, Vf= 1.3V say, so (5-1.3)/2k = 1.85mA, and when not obscured it is reaching a feedback equilibrium at about two volts on the twisted pair, 3mA; any lower and the LED goes out, higher and the xistor turns on harder. Have you experimented with the values? A highly naive analysis would put the ratio of voltages at
    V1 / V2 = (3.7 / 3) * (R1 / (R1+R2) where R1 is the loop termination resistor and R2 is the one at the end of the loop. That suggests that a lower value for R2 would increase the ratio.

    For speed, maybe something could be done with a cascode. It might take a bit more Vf from the led (or two diodes in series) to give it enough overhead. Does it need to be a photo-Darlington?

    cascode.png
    184 x 199 - 4K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-15 22:01
    Tracy,

    I did fiddle with the R values a little bit -- just shotgunning it, not much analysis -- and the 1K/1K combo gave me the biggest current spread among the values I tried. I did consider a cascode conneciton for speed -- haven't tried it yet -- but I was not sure if it would help a Darlington, which I need for the sensitivity. I like your idea of using Vf of the IRED to set the base voltage, BTW!

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-06-15 22:23
    Using these...

    receiver:
    http://www.ebay.com/itm/100pcs-5mm-940nm-IR-detector-sensor-Infrared-Phototransistor/370609015183?_trksid=p2047675.m1850

    transmitter:
    http://www.ebay.com/itm/390221393754?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1423.l2649

    ...A slight modification of your circuit provides an output of 1.36V to 2.72V configured as a standard "slot detector" with similar currents on the IR led.

    Circuit modification below....
    2-wire_photointerurpter_v2.gif
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-15 22:28
    That's clever, Beau, and is totally usable with the Prop's logic threshold. I was using some obsolete Motorola side-looker devices. With a brighter IRED like yours, it looks like I can ditch the Darlington.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-06-15 22:39
    Thanks Phil!

    I just did a quick check using the same circuit powered from 3.3V instead of 5V. .... The output voltage ranges from 1.3V to 2.2V.

    Note: The gap distance between the RX and the TX in my test setup was about 1/4 inch.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-06-15 23:21
    That's great Beau. The series connection looks like positive feedback that could give it some speed-up, snap action. Good deals on the parts too! Gosh, the IRleds even come with free resistors!

    For the cascode connection, there is something like this:
    cascode.png


    Both the photodiode and the amplifier transistor benefit from low voltage swing.
    184 x 200 - 6K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-15 23:34
    Tracy,

    I like the idea of a photodiode due to its inherent speed -- assuming it can be amplified adequately.
    __________

    Thanks, guys! I'm glad I posted this here and was able to attract my two favorite analog gurus!

    My app has one additional criterion: either the IRED or the sensor has to have a very small aperture; its complement, a large one. Lensing might work, but it adds one more level of complication.

    -Phil
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-06-15 23:50
    Another funny thing about the receiver in Beau's link:
    Applications:
    940nm ( 840nm~1100nm ) Infrared applied system
    Camera
    Cockroach catcher


    Phil, surely the ultimate, if not the penultimate?
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2013-06-15 23:53
    Tracy Allen !!! lol - that's what I was going for don't you know. :-)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-15 23:53
    That's assuming that cockroaches are oblivious to IR. 'Could require some additional research -- but not in my kitchen!

    -Phil
  • ercoerco Posts: 20,256
    edited 2013-06-16 21:51
    Cascode: thanks to you fine fellows for lernin' me somrhing new today! From http://en.wikipedia.org/wiki/Cascode :

    The cascode is a two-stage amplifier composed of a transconductance amplifier followed by a current buffer. Compared to a single amplifier stage, this combination may have one or more of the following characteristics: higher input-output isolation, higher input impedance, high output impedance, higher gain or higher bandwidth. In modern circuits, the cascode is often constructed from two transistors (BJTs or FETs), with one operating as a common emitter or common source and the other as a common base or common gate. The cascode improves input-output isolation (or reverse transmission) as there is no direct coupling from the output to input. This eliminates the Miller effect and thus contributes to a much higher bandwidth.

    I was so confused. I thought eliminating the Miller effect had to do with me sobering up from that tall boy MGD I enjoyed before reading this post...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-16 22:07
    erco wrote:
    I thought eliminating the Miller effect had to do with me sobering up from that tall boy MGD I enjoyed before reading this post...
    Well, that's not far off if the Miller effect slows your response time. "Excuse me, officer, before I recite the alphabet backwards, may I grab a cascode from the glovebox?"

    -Phil
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-06-17 08:27
    But Miller Lite, takes more than one tall one to achieve that effect. Now introducing, Miller Cascode, two in one for the best of both.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-06-17 08:34
    Phil, to get a narrow beam from the emitter, take a look at the Osram sfh4550. The half-power angle is only 3 degrees and the radiant intensity at beam center at 100mA drive is nearly 1W/sr. They warn of danger to eyes, so be careful unless you want a bunch of blind cockroaches running around. A frightening thought.
  • ercoerco Posts: 20,256
    edited 2013-06-17 08:57
    Well, that's not far off if the Miller effect slows your response time. "Excuse me, officer, before I recite the alphabet backwards, may I grab a cascode from the glovebox?"

    I'm not as think as you drunk I am, Pister Molice Occifer!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-17 09:21
    Tracy,

    Thanks for the Osram recommendation. What I really need, though, is a near point source with a fairly wide beam angle, and a sensor with a fairly wide sensitive area. I could do it with lensing but would prefer not to.

    -Phil
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-06-17 12:39
    The near point source with wide spread is easy... how wide? How about a solar cell for the receiver?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-17 12:47
    ... how wide?
    Maybe 60-90 degrees.
    How about a solar cell for the receiver?
    'Might work if the response is fast enough. Since it's a voltage-output device, instead of current-sinking, I might have to rethink the two-wire topology. The cable could be quite long, though.

    -Phil
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-06-17 13:09
    A single solar cell can be used in current-sinking mode. It is basically the big, leaky, high capacitance photodiode. Fast enough? How fast can a cockroach run? Erco had posted a link to some long narrow ones from goldmine-elec a couple of days ago.
  • W9GFOW9GFO Posts: 4,010
    edited 2013-06-17 13:24
    A couple years ago at UPEW Peter demonstrated a communicator where he transmitted audio via laser to a solar cell receiver. I would not have guessed that a solar cell could respond that fast. It worked quite well.
  • LawsonLawson Posts: 870
    edited 2013-06-18 19:41
    This is an interesting challenge. So I'll contribute something that uses one of the modern micro-amp op-amps. (I.e. the MCP604x and friends)

    While I haven't tested this circuit yet, it should look like a resistor who's value is inversely proportional to the coupling between the IR LED and IR photo-diode. The basic idea is that the IR led starts with full current as long as the photo-diode is blocked. This should result in an output voltage around 1.4 volts because the MCP604x starts loosing drive current capability. As soon as light couples with the photo-diode it's photo current is turned into a large voltage that subtracts from the LED's drive voltage. This negative feedback should stabilize the output at something like 3 volts. Using an MCP6041 op-amp I'd expect this circuit to have about 1KHz bandwidth. Using a faster op-amp or reducing Z1 will speed it up.

    Lawson
    672 x 268 - 5K
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-06-20 08:44
    Clever! I looks to me like it should work. For those following, it is important to point out that the MCP604x is specified to operate down to Vdd=1.4 volt power supply at a mere Idd=0.6 microamp. (1.4V to 6V Vdd allowed) Rail to rail input and output. At Vdd=1.4V the bandwidth is 9kHz and it can sink 2 milliamps at the output.

    The circuit is reminiscent of LM10, the first and foremost low voltage op-amp. See figure 4 in the app-note, AN-211a, "Two Terminal Light-Level Detector with Hysteresis". It operates the photodiode in voltaic mode with the op-amp as a comparator and the 0.2V reference as threshold. The LM10 was (and still is) fully specified for operation down to Vdd=1.1V and even less at low current, and up to Vdd=40V, quiescent current 270µA. Many of the example circuits involve using the LM10 in floating mode to transmit values as current on a pair of wires.

    I went to TI to find the above link and was surprised to find that the app-note there is a revised version dated May, 2013. The original material is almost all there, but it is kind of a travesty in my opinion that it does not mention the original authors, Robert Widlar, Robert Dobkin, and Mineo Yamatake, or that the note dates from 1978. One can still find Robert Widlar's original tech note, R. J. Widlar, “Low Voltage Techniques,” IEEE J. Solid-State Circuits, Dec. 1978, as TP-14.
  • LawsonLawson Posts: 870
    edited 2013-06-23 20:11
    Was looking for low voltage Op-amps and found a few from Touchstone Semi that say the work below a volt. TS1003 and TS1002. Data sheets say they work down to 0.8 and 0.65 volts, but the data sheets only show short circuit current vs temperature at two supply voltages. I wish the data sheets showed short circuit current versus supply voltage at room temperature. Then I'd get a better idea of how these op-amps work below 1 volt.

    Anyway, the TS1003 would let my photo-interrupter circuit have an low voltage output about 1 volt. That would let the circuit work more comfortably with the Prop's inputs. (which have a threshold at ~43% of the supply voltage, 1.42 volts with a 3.3 volt supply)

    Lawson
Sign In or Register to comment.