Using a phototransistor as input into comparator

Thread Starter

connellyw

Joined Aug 2, 2016
6
We've been tasked to find a creative use for a phototransistor at uni.

I was wondering if this would work, and if there's any flaws to my workings:


The NPN phototransistor is used as an emitter circuit, which means that in its idle state without light the output is high going in to the LM339 +ve. If the source voltage is +5v, the voltage drop across the resistor is 4.3v, because there's a 0.7v drop across the phototransistor because its turned on.

So at idle state, LM339 +ve is 0.7v, -ve is 5v, and LM339 output is high

image1_connellyw.jpg
 

Thread Starter

connellyw

Joined Aug 2, 2016
6
So does that mean that the resistor between the voltage source and the phototransistor actually needs to be between the phototransistor and ground, or can I just switch the +ve and -ve terminals?
 

SLK001

Joined Nov 29, 2011
1,549
Put a voltage divider (from +5 to gnd) as an input to the "+" terminal. That way, you can adjust the switching point if needed.
 

Sensacell

Joined Jun 19, 2012
3,451
Consider that the inputs must reverse (- higher than + to change state) so you must bias the '+' to a voltage lower than the power supply to accomplish this.

Try connecting a potentiometer across the power supply, connect the wiper to the '+' input and play with it.
This will allow you to adjust the switching threshold.
 

Thread Starter

connellyw

Joined Aug 2, 2016
6
Put a voltage divider (from +5 to gnd) as an input to the "+" terminal. That way, you can adjust the switching point if needed.
So this gives the +ive terminal a voltage input of 2.5v if R1 and R2 are the same, If the transistor is saturated, does the -ve terminal voltage = 0.7v? What happens if the transistor is not on?
 

Thread Starter

connellyw

Joined Aug 2, 2016
6
Consider that the inputs must reverse (- higher than + to change state) so you must bias the '+' to a voltage lower than the power supply to accomplish this.

Try connecting a potentiometer across the power supply, connect the wiper to the '+' input and play with it.
This will allow you to adjust the switching threshold.
So I need the +ve terminal voltage to be constantly less than 0.7v right?
 

hp1729

Joined Nov 23, 2015
2,304
Design 803 photo and vc.PNG
We've been tasked to find a creative use for a phototransistor at uni.

I was wondering if this would work, and if there's any flaws to my workings:


The NPN phototransistor is used as an emitter circuit, which means that in its idle state without light the output is high going in to the LM339 +ve. If the source voltage is +5v, the voltage drop across the resistor is 4.3v, because there's a 0.7v drop across the phototransistor because its turned on.

So at idle state, LM339 +ve is 0.7v, -ve is 5v, and LM339 output is high
What is the ACTUAL output of the phototransistor with and without light? Set the voltage divider appropriately. As an example one setup I did the phototransistor had an output voltage of about 2.7V at 1/4" away and 4.6 V at 1.5". It never got down to 0.7 V.
So I would have set the voltage divider to about 3.5 V.
 
Last edited:

Sensacell

Joined Jun 19, 2012
3,451
Don't expect to be able to calculate the voltage- it depends on the light energy falling on the photo transistor, which you have no numbers for. The light emulates base current and that will cause current flow from C to E, the magnitude of which you cannot predict without photo-metric instruments. Even if you had said instruments, the value would still have a large range of variation.

So don't bother. Measure it!

The only number you vaguely know is the "dark current" which you can get from the data sheet for the transistor, even there, you will not know it with any precision as it's listed as a maximum value.

Opto-electronic circuits are tricky, you usually have to design around parameters that vary by orders of magnitude.

Look at the attached data sheet- the collector current performance is said to vary 4:1 for a given value of light.
This should give you an idea of how variable these things are.
 

Attachments

GopherT

Joined Nov 23, 2012
8,009
I may be wrong but don't transistors have a very small CE voltage drop (a few 0.1 volts)?
Only when saturated. How much light does it take to saturate this photo-transistor, who knows. I don't know what it illuminating it, the distance, the angle, the wavelength vs. sensitivity of the phototransistor the emission spectrum of the illuminating source, ...
 

ScottWang

Joined Aug 23, 2012
7,409
View attachment 110166

What is the ACTUAL output of the phototransistor with and without light? Set the voltage divider appropriately. As an example one setup I did the phototransistor had an output voltage of about 2.7V at 1/4" away and 4.6 V at 1.5". It never got down to 0.7 V.
So I would have set the voltage divider to about 3.5 V.
The outputs of LM339 are all open collectors, so the output needs a pull high resistor as 4.7K or 10K, unless the output is sink the current from external.

Please check the internal structure on page 10 of LM339.
 

hp1729

Joined Nov 23, 2015
2,304
I may be wrong but don't transistors have a very small CE voltage drop (a few 0.1 volts)?
If they are driven to saturation, yes. They don't have to be driven that hard all the time. Phototransistors usually don't get that much light. Measure the one you are going to use under the conditions you will use it. We can discuss it for days but a few minutes with a breadboard and parts will be really enlightening.
 
Last edited:
Top