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:
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.