Getting the status of a photodiode using LM311 comparator

Hello,

I am new to Arduino, and I am not a electronics engineer by trade, so please forgive my silly questions :blush: I am designing a system to detect an interruption of a laser beam which falls on a photodiode. The laser and the photodiode needs to be of visible range, since the intermediate region is filled with water, which absorbs infrared.

The photodiode I have selected is BPW-21 (OSRAM or Vishay), and I also intend to use an LM311 comparator. The circuit diagram is attached. Please tell me if this is feasible. The logic I followed is given as below:

(1) I intend to use a 5 mW laser module, and the spectral sensitivity of BPW-21 is 0.34 A/W. Hence, the current through the photodiode would be: 0.34*0.005 = 1.7 mA. Hence, the voltage at the non-inverting input of LM311 would be: 5V - 1.2 kOhms * 1.7 mA ~ 3 V. The inverting voltage is at 2.5 V, so the output would be high.

(2) Total current load from +5V pin of Arduino:
(a) Current through photodiode: 1.7 mA (As above)
(b) Current through R2 and R3: 5V/( 2 kOhms + 2 kOhms) = 1.25 mA
(c) Current through LM311: 3.5 mA (for a supply voltage of 5V)
(d) Current through R4 pull-up resistor: 5/10 = 0.5 mA
Hence total current load: 1.7 + 1.25 + 3.5 + 0.5 = 6.95 mA < 40 mA

(3) Resistor R5 is set to prevent damage to the Arduino board if the digital i/p pin is by-mistake set to o/p.

Any comments?

Abhishek

Your principle is OK, however I'm questioning whether you're going to get the 1.7mA you expect. The short-circuit current for the BPW-21 is listed as about 10uA at 1000 lux. So while 0.34 A/W may be true, there is no suggestion that you would get 0.34A if you provide 1W -- there is simply a maximum current limit.

--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

RuggedCircuits:
Your principle is OK, however I'm questioning whether you're going to get the 1.7mA you expect. The short-circuit current for the BPW-21 is listed as about 10uA at 1000 lux. So while 0.34 A/W may be true, there is no suggestion that you would get 0.34A if you provide 1W -- there is simply a maximum current limit.

--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

Yes, this is one point I am not too sure about. Taking 1000 lx as "standard" illumination and a minimum spectral sensitivity of 5.5 nA/lx (as mentioned in Page-2 of OSRAM datasheet), the current will be at 5.5 * 1000 = 5.5 micro-A, hence the R1 resistor would need to be 200 kOHM: 5 - 200e3*5.5e-6 = 4 V.

I guess I will have to use a potentiometer.

One another thing I forgot to add ... the interruption in the laser beam would be about 15 ms in duration. Since I am using a 5V voltage, the minimum allowable rate for the comparator to drop from high to low is: 5V/15 ms = 333 V/s. I read somewhere that the slew rate for LM311 is ~1.25e7 V/s, so I guess its okay to use am LM311 isn't it?

Abhishek

I don't think the response rate of the LM311 is nearly as much a concern as the capacitance of the photodiode and your choice of resistor. With 200k resistance and 580pF of capacitance (from the datasheet), you have a time constant of 116 microseconds. Five of those is roughly 0.6ms compared to your 15ms duration, and you should be OK.

--
The MegaRAM shield: add 128 kilobytes of external RAM to your Arduino Mega/Mega2560

RuggedCircuits:
I don't think the response rate of the LM311 is nearly as much a concern as the capacitance of the photodiode and your choice of resistor. With 200k resistance and 580pF of capacitance (from the datasheet), you have a time constant of 116 microseconds. Five of those is roughly 0.6ms compared to your 15ms duration, and you should be OK.

--
The MegaRAM shield: add 128 kilobytes of external RAM to your Arduino Mega/Mega2560

Ah! I hadn't thought of that! So I guess I will use a 500K pot and adjust it to balance between response time and getting enough voltage to get the high signal..thanks!