How to Compute Resistor Value?

I want to use this phototransistor in an Arduino project: http://www.sparkfun.com/datasheets/BOT/QRD1114.pdf

Based on the data sheet, I believe pins 2 and 4 go to ground. Pin 3 connects to +5 with a 66 ohms resistor in between. I got this value 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 1.7V
If = emitter continuous forward current in Amperes, which the data sheet states as 50mA (so that converts to 0.05A)

Applying the formula, we get the following:

R1 = (5V - 1.7V) / 0.05A
R1 = 3.3V / 0.05A
R1 = 66 ohms

I think I need a "bias resistor", but do not know how to compute that.

So, my questions are:

1. Did I compute R1 correctly?

2. How do I compute bias resistor?

Comment viewing options

Yes, that is correct for an absolute maximum forward current of 50 mA, but it might be better to shoot for the 20 mA operating current shown on the next page that gives the max Vf forward voltage of 1.7 volts.

Another thing to note is the max output current of an Arduino IO pin, which is 40 mA. Trying to get more is likely to burn out your Arduino.

So, recalculating, Vs  = 5 v, Vf = 1.7 v, If = 20 mA => R1 = (5-1.7)/0.02 = 165 ohm, use 180 ohm standard value. This 20 mA is below the Arduino pin max, so should be ok.

There is a graph later of different Vf for If values but to be safe the max value Vf is best used.

A "bias" resistor is needed to produce an output from the phototransistor side of the device. It shows the Ic collector currentfor the QRD1114 to be 1 mA when coupled with the LED. So to make the max voltage swing for the output (a connection between the collector and the resistor, other end of resistor to 5 volts) you need a resistor value that drops all of the Vs supply voltage minus the Vce-sat collector emitter saturation voltage with that 1 mA of current. So this time the bias resistor calc is (5-0.4)/-0.001 = 4600 ohm, use 4.7k or greater. I've seen 10k used to greater effectiveness, so the phototransistor can be more sensitive to reflected light.

robologist,

I think I fully understand how R1 was calculated and why the max output current of the Arduino IO pin is important.

I'm still a bit confused with the bias resistor:

1. When computing the bias resistor for a phototransistor, I should look at the "COUPLED" collector current in the data sheet, right? (I thought I needed to look under "SENSOR.")

2. Why did you look at the QRD1114 instead of the QRD1113? Both are listed on the data sheet.

3. Where did the 0.4 value come from in your bias resistor calculation?

And just to verify the connections:

4. Pins 2 and 4 connect directly to ground, right?

5. Pin 3 connects to +5v with a 180 ohm resistor in between.

6. Pin 1 connects to +5v with a 4.7K ohm resistor or higher in between.

Thanks for all the help so far.

SparkFun only sells the QRD1114.
If you connect your emitter to an Arduino digital output instead of the +5V line you can often reduce the power consumption of the sensor by several times. You can also connect the sensor to the same digital output, although the current draw of the sensor is only ~1/40th of the emitter requirement.