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.

  • 1
    \$\begingroup\$ Why can't you just AC couple the output? \$\endgroup\$
    – DKNguyen
    Jul 11 '19 at 14:53
  • \$\begingroup\$ @DKNguyen It's possible but you have slightly less control over the sensitivity/selectivity of the circuit. \$\endgroup\$
    – user
    Jul 11 '19 at 15:01
  • \$\begingroup\$ why would you lose control? \$\endgroup\$ Jul 11 '19 at 15:04
  • \$\begingroup\$ @MarcusMüller try simulating it and you will see you have less ability to control the parameters of the circuit. \$\endgroup\$
    – user
    Jul 11 '19 at 15:05
  • \$\begingroup\$ @user you might have chosen an improperly sized capacitor, then. When looking at things like oscilloscopes, or software defined radios, or ADCs for 42 Gbit/s fiber-optical receivers, you'll notice they are generally AC coupled. That might be an indication that AC coupling, you know, works in the cases where you want it (and this is one of them). \$\endgroup\$ Jul 11 '19 at 15:09

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

  • \$\begingroup\$ This only works with edges crossing GND though. Having said that it does present an interesting idea, using a modification of the zero detect part. Essentially it's a window with characteristics determined by the 7402, which may be usable with a suitably conditioned input signal. \$\endgroup\$
    – user
    Jul 11 '19 at 16:08
  • 1
    \$\begingroup\$ It's probably worth mentioning that DS3486 is not an op-amp, but an RS-232 receiver, which has some provision for handling input voltages below the negative supply voltage. \$\endgroup\$
    – The Photon
    Jul 11 '19 at 17:50

The key here is that you’re looking for transitions in light level. This should hint at the approach you want to take (AC coupling.)

I’m wondering if you’ve had a glance at IR receiver modules, like the TSOPxxx family from Vishay. These include the photodiode, gain block, AGC (something you might need) and usually carrier demodulation. An IrDA module includes these things too except for the demod.

Even if you decide you still want to ‘roll your own’ at least you may glean some ideas for your design.

  • \$\begingroup\$ Interesting idea, do you have any links for schematics to such detectors? Unfortunately I can't use an actual IRDA receiver because LCDs don't produce enough IR to trigger them in my experience. \$\endgroup\$
    – user
    Jul 11 '19 at 16:14
  • \$\begingroup\$ The schematic to use a TSOPxxx type is pretty simple: power, GND and signal out with a pull-up resistor. The datasheets will tell you more about the internals. \$\endgroup\$ Jul 11 '19 at 16:33
  • \$\begingroup\$ Have a look. vishay.com/ir-receiver-modules Happy hunting! \$\endgroup\$ Jul 11 '19 at 16:46
  • \$\begingroup\$ Sure but I can't use that part. I thought I meant a schematic of the internals of it. \$\endgroup\$
    – user
    Jul 12 '19 at 7:39
  • \$\begingroup\$ *you meant..... \$\endgroup\$
    – user
    Jul 12 '19 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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