Electronic – Dual slope edge detection for a phototransistor

analogcomparatorphototransistor

I want to detect sudden changes in light level using a phototransistor. The goal is to transmit information optically using the timing of the transitions, ideally using an LCD screen.

LCD transitions are typically in the range of 5-8ms for black to white, so the slew rate of the signal will be in that region too. Doing some experiments the voltage swing will probably be in the 100mV range.

The ambient light level is not fixed. This is not a controlled environment. So the system needs to automatically calibrate to the ambient level.

Current I have the following system that detects falling edges only:

enter image description here

The red area simulates the phototransistor getting a 60Hz on/off flash. As you can see, the circuit simply compares 98% amplitude version of the signal (1k/50k divider) with a low pass filtered version. On a falling edge the low pass filtered signal is momentarily higher than the 98% version ad the comparator pulls its output low.

I've had success with this method. It tends to be a bit fiddly and require some calibration to work well, but it does work.

I want to instead detect both the falling and rising edges. That will double the data rate. Any improvements to the auto levelling would be welcome too. Minimizing the number of components is important.

Note: I have looked at this question but none of the answers are suitable as they won't work with the small output signal from the phototransistor.

Best Answer

One thing you could do (if I am not mistaken) is swap the inputs of the opamp above, then you get a rising edge detector. Then AND the two outputs togehter. Or use a circuit like the one below. (or if you need a different detection level then modify the input's of the comparators below like your circuit)

Here is a circuit that will do rising, falling or zero detection.

enter image description here
Source: https://www.edaboard.com/showthread.php?270878-i-need-to-detect-rising-edge-of-pulse