Electronic – Simple IR pulse detector with IR phototransistor

phototransistorresistorssensor

I understand the basic circuits used with phototransistors: Basic phototransistor circuits

I believe that this is essentially a voltage divider, commonly used for all sorts of analog sensors. In the left circuit, in the dark, the phototransistor is very high impedance, making Vout close to Vcc, and dropping as more light is detected. In the right circuit, Vout is close to GND, going up as more light is detected.

I would like to use an IR phototransistor to detect IR pulses (low frequency, of unknown duration), and I'm not sure how to choose a value for the resistor. Ideally, I would like to avoid using an ADC, and just detect a logic high/low with a microcontroller. If I need to use an ADC and detect voltage at a certain threshold, then that is possible, as well.

How do I choose an appropriate resistor given datasheet values for the phototransistor? I know that dark current is 100nA (Vce = 15V) and light current is 20mA (Vce = 5 V, H = 20 mW/cm), and collector current is 25mA, but I'm not sure how to turn those values into a suitable resistor. An application note I found says that "the load resistor (RL)
should be set in relation with the collector current (IC) as Vcc < RL × IC." That gives me a resistor of 132 ohms or less using 3.3V, however, and that seems pretty small, given what I've found recommended elsewhere (up into the tens of kOhms).

How do I chose this resistor value appropriately?

Best Answer

The voltage accross the resistor is the current thru it times its resistance. That's basic Ohm's law. The values you give are a bit conflicting and misleading, but let's say the maximum light current is 20 mA. If the power supply is 5 V and you want 500 mV on the transistor so it doesn't saturate, then that leaves 4.5 V on the resistor. 4.5V/20mA = 225 Ω.

However, things are not that simple. The ambient light level can vary by a large margin, so the DC dynamic range has to be high. To be safe, you make sure that the resulting voltage stays linear with light up to the maximum light the transistor is rated for or you know will ever be encountered. That's what I did in the example above. The problem with that is that gain will be very low. The signal you want may only be a millivolt or possibly less.

This is why light sensors like this are almost always AC coupled. Use the largest resistor that still allows about 500 mV accross the transistor with maximum light, then AC couple that into a amplifier. The ambient light level is DC or slowly changing, so will get blocked. Now you can amplify the AC signal in the frequency range you are looking for. This may require a voltage gain of 100s to 1000 or more. Anything you can do mechanically to eliminate ambient light pickup and strengthen the intended received beam will help. With lower maximum ambient light, you can make the resistor larger, which increases gain.

Related Topic