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?

Yes, that is correct for an

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.

Starting to make sense, but …

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.

Answers : Yes,

Answers :

  1. Yes, "coupled" values should be used as that is indicating the phototransistor is picking up the LED light (or similar light).
  2. Because it is linked as a QRD1114, not 1113, so that is the device it appears Sparkfun is selling. If you have the 1113 then use those numbers.
  3. 0.4 is the max Collector Emitter Saturation Voltage in the "coupled" section describing how the phototransistor operates. This is the voltage drop on the phototrans when it is fully "on".
  4. Correct
  5. Mostly correct or could have pin 3 connect through a 180 ohm resistor to an Arduino output so that you can turn on and off the sensor in program.That was why I mentioned the max current of 40 mA for an Arduino output.
  6. Mostly correct, but thinking more, a 10k might be the best minimum to start with, to ensure good sensitivity.
You measure the response (5 volts to near 0 volts) at the collector of the phototransistor, pin 1. This connects to an Arduino input.

SparkFun only sells the

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.