2
\$\begingroup\$

I have an IR LED and photodiode separated by 3.5 cm.

In practice, these devices get damaged very soon. (Some people that use this circuit report this problem).

IR LED and photodiode

An engineer proposed to make them blink, switching on/off, and reading the signal in active half cycle.

Are there other ways to expand the life of this kind of circuit?

\$\endgroup\$
7
  • \$\begingroup\$ You show only four electrical components in this circuit. Some components of the complete circuit are not shown (cut off to the right). Are you certain that the components not shown are free from failure? Those shown should have long life. \$\endgroup\$
    – glen_geek
    Commented Jul 30, 2022 at 20:43
  • \$\begingroup\$ How much is VCC? What is current through LED? Are the parts shown damaged or some other part? \$\endgroup\$
    – Justme
    Commented Jul 30, 2022 at 22:32
  • \$\begingroup\$ glen_geek . The other part is a microcontroler input. \$\endgroup\$
    – Ando
    Commented Jul 30, 2022 at 23:38
  • \$\begingroup\$ Justme vcc is 5 V. Through the photodiode 0.4 mA. Through the led 15.6 mA . That's my case. Maybe other people have differences in their connections. \$\endgroup\$
    – Ando
    Commented Jul 30, 2022 at 23:53
  • 3
    \$\begingroup\$ I have an array of several hundred LEDs being driven at 50mA each that just passed 26,000 hours run time. Zero failures and light output is still very uniform. If you're having rapid failures with just a single diode you're doing something very wrong. Double check your current, operating temperature and if that fails consider a better supplier. Both the photodiode and LED should be able to run for many years continuously. \$\endgroup\$ Commented Jul 31, 2022 at 13:36

3 Answers 3

7
\$\begingroup\$

First you should isolate the cause of the problem. If it is due to dirt, contamination then the answer will be somewhat different than if it is due to the obvious potential problem of LED aging or marginal IR light falling on the phototransistor. Or perhaps there are situations where sunlight is falling on the phototransistor.

Assuming it's a coupling problem that is unrelated to contamination (dirt or light), you want a brighter LED or higher load resistor on the phototransistor (the latter will exacerbate external light issues). If it's LED aging (if your supply is 5V you're putting 25mA through the LED) you'd want to use better quality LEDs and run them at lower current, and make sure you have a good safety margin on the brightness (perhaps 2:1 or more under typical conditions). If external light contamination you can shield it better, and use a phototransistor with built-in optical filter that blocks some of unwanted light (if you are not doing so already).

Using an AC-coupled transmitter/receiver is a time-honoured approach to getting improved rejection of ambient light and higher signal to noise ratio, but it's not as straightforward to design as what you have. It's perhaps possible (depending on your actual use case) to employ the inexpensive modules designed for IR remote receivers if you pulse the LED with a 38kHz signal, but they don't respond very quickly and they don't respond in a straightforward manner to a continuous 38kHz modulated light signal, you have to do a bit more.

\$\endgroup\$
6
\$\begingroup\$

In practice, these devices get damaged very soon. (Some people that use this circuit report this problem).

If by "get damaged" you mean "they age" rather than "they get mechanically damaged", then you're just pushing the LED too hard. It may also be a crappy led, since 25mA through a 5mm LED is not a big deal normally.

Drive the LED at average current below 50% of the recommended operating current and it will last "very long" - definitely much longer than the current design. You can always make the detector more sensitive. 3.5cm is nothing for a LED-photodiode combo used as an optical interrupter. You can be driving that LED with a 100uA 1-10kHz square-wave and detect the output from 3.5cm away no problem using any 4x4mm photodiode, a transconductance amplifier and synchronous detector. With such low drive, the LED will last longer than your and my lifetime added together. I.e., for practical purposes, the LED lifetime is infinite at such low drive currents. Even for crappy LEDs.

The photodiode+resistor detector is a very crude circuit and not very sensitive. This relative insensitivity of the detector is the big part of your problem. Making the circuit use synchronous detection will not only let you detect smaller signal, but also improve the noise rejection.

The whole thing can be made using a 555, a quad op-amp, and a DPDT analog switch. The parts cost a couple of dollars in very small quantities.

A tested design is shown below. I'm using a RED led of the same type for the transmitter and receiver, but it can also be an IR LED of course. No need for a specific photodiode, although a photodiode would improve the sensitivity.

The circuit is not particularly sensitive to low frequency ambient light. It rejects DC light, so it works in full sunlight. It can tolerate partial illumination with a bright PWM pencil flashlight, and works under all reasonable indoor lighting conditions. With visible light you can at least visually confirm that the beam source works.

The schematic of a tested circuit

The chip lineup is all-TI:

  • U1: CD4053BE
  • U2: TLC555CP
  • U3: TL974IN

U2 is a simple oscillator with rail-to-rail output. The rail-to-rail output is important, as it controls the CMOS switch. R4 reduces the slew rate of the control signal reaching the switch, and minimizes electrical feedthrough from the transmitter to the receiver.

U3A is a transimpedance amplifier. It biases the receiver photodiode at VCC/2. U3B is a 100x AC amplifier. U1A/B are the demodulator switch and filter. C8 is the flying capacitor. C9 is the integrating capacitor. C9 is fairly large, and can be made smaller - say 1uF - to speed up the response. U3D is a buffer for the reference voltage needed by the demodulator to output centered at VCC/2 and not at VCC, outside of the op-amp's common mode range. U3C is the final DC amplifier. It could be followed by a CMOS schmitt buffer, like CD40106. The output is rail-to-rail and compatible with either TTL or CMOS inputs. For TTL, the fanout is 1.

A legacy 5mm LED is not a particularly sensitive detector, due to its small area, so a lot of gain is necessary. For a larger photodiode, the gain of the 2nd preamp stage can be lowered, as well as the transimpedance of the 1st stage.

VR1 should be adjusted for 0.5V output voltage with the transmitter or receiver diode covered. The output is active high.

The PCB layout should have a separate ground plane for the transmitter and the receiver, connected at a single point. This circuit is hard to get to work without shielding on a breadboard - the copper shield on the bottom of the breadboard is a must. The overall voltage gain of the 2nd and 3rd stage combined is about 5,000. The transimpedance is about \$5{\,\rm V}/{\rm nA} = 1{\,\rm V}/{\rm\mu A} \cdot 5000{\,\rm V}/{\rm V}\$.

There are several high-impedance, sensitive current summing nodes. The clock connection between the transmitter and the receiver is a 1ft shielded cable. R4 is split into two halves, one in series with the shield, the other in series with the center conductor, on the transmitter side. The shielded cable connects directly between GND and control inputs of the switch U1.

The supply range is 4.5V to 12V. The voltage should be regulated, as large changes require adjustments to VR1.

Closeup of the circuit on the breadboard View of the entire setup

I've also assembled it more permanently on a single breadboard. Note the shielding needed to make the receiver insensitive to interference from other nearby circuits/devices that may be in the enclosure:

enter image description here enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for your suggest. The whole machine needs 15 sensors at time. Is necessary to build something small and cheaper. I am thinking on a attiny45 microcontroller + amp op comparator for the signal. The microcontroller can drive the optoelectronics an be connected by i2c. I have a question about how the microcontroler can switch the diode and photodiode at time. \$\endgroup\$
    – Ando
    Commented Aug 10, 2022 at 3:12
  • \$\begingroup\$ "Small and cheaper" I didn't use the tiny packages, obviously enough :) The exact op-amp and comparator used aren't too big of a deal. Cheap CMOS ones will do fine. Of course a microprocessor can do a part of the job. But it can be an extra hassle. I'm just pointing out that this circuit, when implemented properly, takes very little room (<<1cm^2), has highly available parts (you're not competing with automotive suppliers for the parts), and may well cost less than something with a micro. EMC testing and mitigation aren't free either. At 1kHz this is exempt from EMC testing :) \$\endgroup\$ Commented Aug 30 at 11:03
4
\$\begingroup\$

As far as I can tell from your limited description, you are using some homebrew optocoupler to defect some opaque object passing between the LED and the photodiode.

What are the usual failure modes here:

  1. Optics lose alignment. I.e. the brightest spot of the LED is not on the photodiode anymore.

    Reasons: Mechanical stress, substandard build quality.

    Mitigation 1: There are factory-made air-gapped optocouplers that could perform better in this regard. They have a rigid package containing both elements aligned against each other.

    Mitigation 2: Use a visible light LED. They still can lose alignment, but one would be in a better position to diagnose what happened.

  2. The LED ages and dims.

    Reason: Mediocre quality LED driven at high current.

    Mitigation 1: Use better LED, drive it 50% of the rated current (or lower). Be aware that this will lower the signal/noise at the receiver side.

    Mitigation 2: Use AC-driven LED, detect AC signal at the receiver side. Complex. On the other hand, you may find an "optical sensor" element that does everything this in a single package.

  3. The LED and/or the photodiode are accumulating dust.

    Reason: It simply happens, especially when something moves.

    Mitigation 1: Air the dust once in a while.

    Mitigation 2: Use another kind of sensor (e.g. magnetic, acoustic, capacitive) if applicable.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.