Using a phototransistor as input into comparator

Discussion in 'General Electronics Chat' started by connellyw, Aug 7, 2016.

1. connellyw Thread Starter New Member

Aug 2, 2016
6
0
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

2. Sensacell Moderator

Jun 19, 2012
2,029
642
The comparator '+' input will always be at a higher voltage than the "-" it will never switch.

3. connellyw Thread Starter New Member

Aug 2, 2016
6
0
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?

4. SLK001 Senior Member

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

5. Sensacell Moderator

Jun 19, 2012
2,029
642
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.

6. connellyw Thread Starter New Member

Aug 2, 2016
6
0
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?

7. connellyw Thread Starter New Member

Aug 2, 2016
6
0
So I need the +ve terminal voltage to be constantly less than 0.7v right?

8. Sensacell Moderator

Jun 19, 2012
2,029
642
Test and see.

Build the circuit and play with it- you will learn 1000 X faster.

atferrari, absf and Alec_t like this.
9. hp1729 Well-Known Member

Nov 23, 2015
2,306
284

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: Aug 8, 2016
Robin Mitchell likes this.
10. Robin Mitchell Distinguished Member

Oct 25, 2009
880
302
I may be wrong but don't transistors have a very small CE voltage drop (a few 0.1 volts)?

11. blocco a spirale AAC Fanatic!

Jun 18, 2008
1,535
411
I'm not convinced that this circuit meets the "creative use for a phototransistor" criteria... unless it is just part of a bigger plan.

GopherT likes this.
12. Sensacell Moderator

Jun 19, 2012
2,029
642
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.

File size:
148.2 KB
Views:
0
13. GopherT AAC Fanatic!

Nov 23, 2012
8,025
6,786
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, ...

Robin Mitchell likes this.
14. ScottWang Moderator

Aug 23, 2012
6,427
995
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.

15. hp1729 Well-Known Member

Nov 23, 2015
2,306
284
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: Aug 10, 2016
Robin Mitchell likes this.