# How to Compute bias Resistor for phototransistor Value?

I want to use this phototransistor in an Arduino project: https://www.kingbrightusa.com/images/catalog/spec/WP3DP3BT.pdf I calculated the value of the phototransistor bias Resistor (R1) by the following computation:

R1 = (Vs - Ev) / If

where: Vs = supply voltage, which is 5V on Arduino board Ev = emitter forward voltage, which the data sheet states as 0.8V If = emitter continuous forward current in Amperes, which the data sheet states as 100nA Applying the formula, we get the following:

R1 = (5V - 0.8V) / 0.0001A R1 = 42K ohm then I used R1 =10K ohm to use the phototransistor as switch (either saturate or cut state). I am not shure from my choose.

So, my question is:

1. Did I compute R1 and choose it correctly?
• Sorry for a super late comment, but isn't 100nA = 0.0000001A? so calculation then is (5-0.8)/0.0000001=42M ohm? – user152879 Nov 16 '17 at 23:50

100 nA is the dark current. That is, with no light falling on the detector, it will put out about 100 nA.

0.8 volts is the saturation voltage. That is, if you shine a light on the transistor when it is connected like simulate this circuit – Schematic created using CircuitLab

when the light is dim, VOUT will be nearly Vcc. As the intensity increases, VOUT will drop, but it will never get lower than 0.8 volts.

Now you need to estimate what light level you expect to detect. Let's say you want the transistor to reach saturation with a power level of 1 mw/$cm^2$. From the first table you can typically expect 0.2 mA, but it might be 0.1 mA. So $$R = \frac{V}{i} = \frac{5-0.8}{.0001} = 42k$$ as your calculation showed. However, this means your pot should be either 50k or 100k, depending on what's available. If you use a 10k pot, the most voltage across the resistor you can hope for is $$V = iR = .0001 \times 10,000 = 1 volt$$ This would mean that, for 1 mW/$cm^2$ illumination, your output voltage would not get below 4 volts.

For greater sensitivity you need more resistance, not less.

• I want to detect a black line on white surface, so What the value of current I should choose to calculate this resistance, in fact I saw the value 10K ohm in some circuit in the intern, but I don't now how it calculated. – Ali AL-Assad Sep 26 '15 at 18:59
• First, you need to know how much power per unit area the image of the white background will provide. I expect you'll need a lens for that. Basically, you'll just need to experiment. But you'll need to produce an image of the black line which is bigger than the sensitive area of the phototransistor. – WhatRoughBeast Sep 26 '15 at 19:03

(I know the question is old, but here is my answer for reference)

To detect a black line on the surface I would say that you need a reflex sensor (IR transmitter and receiver in one). If you only use a phototransistor, you will shadow yourself (My guess is that you want some sort of robot to follow/detect the line).

We use GP2S700HCP to detect black marks in our printers. simulate this circuit – Schematic created using CircuitLab

As pointed out, make sure the blackmark/line is thicker than the sensor's view area. Also note that it is sending/receiving IR light, not visible light. So depending on material/paint, a black surface might reflect a lot of IR...