I have a laser sensor that randomly triggers on sunlight.

Oscilloscope Print

The signal is fed to an opti-coupler to a FTDI chip.

I am looking for advice for the easiest solution to take out these false positives which can be up to 250 ms.

The problem appears to be the opto-coupler which is switching at less than 1 V DC and simple resistor / capacitor circuits take to long to discharge. :(

I'm guessing it's going to be some sort of logic circuit.

Any guidance given would be appreciated.

Edit Currently under the winter sun where - worst case is 250ms / Second

  • \$\begingroup\$ Can you add an optical filter to the sensor? \$\endgroup\$
    – Colin
    Nov 2, 2018 at 16:12
  • 1
    \$\begingroup\$ You might want to describe the wanted signal to be able to distinguish it. Certain sensors work around the problem by modulating the light. \$\endgroup\$
    – PlasmaHH
    Nov 2, 2018 at 16:14
  • \$\begingroup\$ Why not just use a low-pass filter + comparator? \$\endgroup\$
    – Felix S
    Nov 2, 2018 at 16:15
  • \$\begingroup\$ No! We've been there, tried all sorts of filters and shading. Basically the frequency of the laser operates at a range of sunlight. When the sun emits a solar flare and when we get "the glint of sun light" at the frequency of the laser, it trips it. Filter it out and the laser doesn't work :) - we made the same mistake :) \$\endgroup\$ Nov 2, 2018 at 16:18
  • \$\begingroup\$ How long is an actual pulse ? If the actual pulse is longer than the glitch, measure the time of the pulse rather than look only at it one edge? \$\endgroup\$
    – efox29
    Nov 2, 2018 at 16:22

1 Answer 1


You can solve this with two op-amps.

The first is configured as an integrator. Its output rails low most of the time. When a high signal is present, it starts ramping up linearly.

The second op amp is configured as a comparator. Once the output of the integrator reaches a specified voltage, the comparator triggers.

For a short pulse, the integrator begins ramping up, but doesn't reach the comparator threshold before the input goes low again and the integrator starts ramping back down.

By adjusting the integrator gain and comparator threshold, this circuit gives you fine control over the minimum pulse width required to trigger. You should have enough precision to, say, trigger after 300mS, but ignore a 250mS pulse. You didn't state how long the "desired" signal pulses are expected to be.

However, be aware that multiple short pulses may trigger the comparator if the integrator doesn't have time to fully return to zero before the next pulse hits. If this is a concern, please add a comment and I'll discuss some ideas to solve it.

  • \$\begingroup\$ Thanks Selvek - just those two words "integrator" "comparator" have opened up a Pandoras box. will spend the weekend chasing Google \$\endgroup\$ Nov 2, 2018 at 16:34
  • \$\begingroup\$ Haha have fun! I wasn't sure what your electronics background was - let us know if you get stuck somewhere! \$\endgroup\$
    – Selvek
    Nov 2, 2018 at 16:54

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.