phototransistor sensor

hey there!

i want to build a very basic light sensor, as sort of a substitute for real distance sensing with ultrasonic
i want to put my hand above it and have higher (or lower) values if my hands covering it than if its more far away from it, so why not use a simple light sensor first... i'll try out using the data for audio control then, let's see...

i have a photoresistor here (which is quite easy to use, of course) and phototransistors, and i'm using a phototransistor now because the resistor reacts too slow
my phototransistors came in a light barrier set, its these ones: Infrarot Lichtschranken-Paare TEMIC K153P online kaufen | Pollin.de

  1. can i use them for sensing visible light, not infrared light, too? does it make any difference concerning the sensibility?

  2. is this the right way to build the "circuit" up? i don't want to damage anything, so...:

    (sorry, the labeling arrow should point to the little black box, not to the poti, of course...)

  3. i found two different examples about how to use the phototransistor as a sensor, this one:

I built this circuit:

+5V----Resistor 18kohm----+------PhotoTransistor------GND
|
|
Arduino

(here, the resistor is before phototransistor and analog pin is also before transistor... why is this and whats the difference? is mine better than this?)

...and this one:
http://dm.risd.edu/~pbadger/AM/pmwiki/uploads/Main/Phototransistor2.png
(here, they used a "reversed biased" transistor... i don't get it. i am not wrong connecting it just like i did, am i?)

  1. how is the best way to build a sort-of-distance-sensor with a phototransistor? it should be influenced by holding a hand above it and coming closer or going more far away... maybe with infrared LEDs and reflection? or what do you think?

thanks,
jan

i never used the phototrasistor in this way ( in reverse), for me not sense. the best way in my opinion is tu use it in normal mode,
means use it like 5v--------4,7k to 10 k resistor-------------Collector --------------emitter, then collector to arduino ( the junction in the coelctor
see the diagrams

fastphotonpn.pdf (14.3 KB)

can i use them for sensing visible light, not infrared light, too? does it make any difference concerning the sensibility?

I think you mean sensitivity, Jane Austin wrote a book called Sense and Sensibility and she wasn't talking about photon detection.

Basically yes, sensors are matched to specific wavelengths, so to get the maximum sensitivity you have to use the right wavelength.

(here, the resistor is before phototransistor and analog pin is also before transistor... why is this and whats the difference? is mine better than this?)

Yes it is better than yours because it uses the voltage gain of the transistor, the other way round has no voltage gain and so is less sensitive.

how is the best way to build a sort-of-distance-sensor with a phototransistor?

The best way is not to bother, if you give more detailed of what you want then maybe a better answer could be given but distance measurements using photo transistors are not very good, reliable or repeatable.

I like the Sharp IR distance sensors. They come in different range values and are very simple to use.

http://www.robotshop.com/sharp-gp2y0a21yk0f-ir-range-sensor.html?utm_source=google&utm_medium=base&utm_campaign=jos

Lefty

They come in different range values and are very simple to use.

But they don't work very well.

Basically yes, sensors are matched to specific wavelengths, so to get the maximum sensitivity you have to use the right wavelength.

how can i find out if i can use this sensor for "normal" daylight or lamplight, too?
datasheet:
http://www.pollin.de/shop/downloads/D120592D.PDF

distance measurements using photo transistors are not very good, reliable or repeatable.

yeah, of course, thats why i wrote about a "sort-of-distance-sensor" - i want to experiment with sensors, i want to stay as cheap as possible and not build something that can measure exact distances. nevertheless, i want to have an analog sensor that i can influence with my hand and with not touching it. do you have other suggestions?

i never used the phototrasistor in this way ( in reverse), for me not sense. the best way in my opinion is tu use it in normal mode,
means use it like 5v--------4,7k to 10 k resistor-------------Collector --------------emitter, then collector to arduino ( the junction in the coelctor
see the diagrams

sorry, what do you mean with "junction"? i'm no native speaker, so could anyone explain this to me?

thanks a lot, jan

how can i find out if i can use this sensor for "normal" daylight or lamplight, too?

You look at the data sheet and find out the peak sensitivity wavelength. Then you compare that with the wavelength of the light you want to detect.
If you don't know the wavelengths of visible light then look here:-

zehneinsvierzehn:
sorry, what do you mean with "junction"? i'm no native speaker, so could anyone explain this to me?

thanks a lot, jan

Wie Geht's!

p-n-Übergang

I actually know Deutch only a little. So the above is what I got going to Wikipedia for "semiconductor junction", and then choosing the German version. Hope that helps.

ETA: You might try asking in the Deutsch forum too.

im talking the join collector and the resistance, did you check the diagrams ?

yeah, i got it now, thanks elandd2011, and thanks mike & justjed

anyway, i'll try at least to build a light barrier or to experiment with IR-LEDs and phototransistor for IR now
as i said, i have this: http://www.pollin.de/shop/downloads/D120592D.PDF

the datasheet says the emitter has a maximum forward voltage of 60 mA, the detector a maximum collector current of 50 mA.
it also says that basic characteristics for emitter are 1.25-1.6V forward voltage

i'm new to electronics, so: can i use those with an arduino without an extern voltage, without amplifying using a transistor?

what i don't get is: can i limit the current somehow so that emitter and detector just get 40 mA?
for example, if i put in a resistor (5v--------------emitter----resistor-----------Ground), i would limit the voltage, but not the current, right?
i always get a little confused about this, using U=R*I, i don't know how i should go on, because i want both current and voltage to be limited in this example, don't i?

do i at least get this right?: i have to limit voltage down to about 1.4V and current down to 40mA for the emitter. i have to limit the current down to 40mA for the detector.

thanks

do you want tu use the arduino for both?( Emitter and detector)
When you use a resistance do you limit both current and voltage
let see :V= IR, if R is a constant and V coming for the power yo have only
one value for I
Now in your case and for the data:

Emitter
Vcc-ForwardVolts-(35mamp(Rs))=0
where: Vcc= 5 volts ( from the arduino Power Vcc)
FowardVolts=1.25 (From emitter data sheet)
35 mamp ( no got to max. current form the arduino)
Rs the resistance that I need
so:
Rs=(5-1.25)/0.035= 107ohms
use 110 ohms
It not give you max power but i think it will work

Detector
You have work in the security region so you cant go more than 50 mamps for the detector (data sheet)
and all data that they give to us is for 5 volts and 5 mamps so:

Vcc - Vsat max - (IcRL)=0

5 -0.3 - (5(RL)=0
(5 - 0.3)/5=94 ohms
you have to use 100 ohms

Got it???

(here, the resistor is before phototransistor and analog pin is also before transistor... why is this and whats the difference? is mine better than this?)

Yes it is better than yours because it uses the voltage gain of the transistor, the other way round has no voltage gain and so is less sensitive.

I don't follow this - why would the order of the phototransistor and resistor in the circuit affect sensitivity? The phototransistor conducts current proportional to the amount of light received so either way should work the same, the only difference being that 5V-PT-res-GND produces a voltage proportional to light (brighter == higher ADC result) and 5V-res-PT-GND produces a voltage inversely proportional to light (brighter == lower ADC value). Have I overlooked something?

Have I overlooked something?

Yes.

Photons, create electron hole pairs in the base region of the transistor. In other words photo current is injected in the base. With one configuration you have a common collector circuit, or emitter follower, this has a voltage gain of 1. With the other you have a common emitter circuit, this has a voltage gain equal to the Hfe of the transistor.

But with a phototransistor, we don't have any knowledge of the voltage at the base - it's not pinned out of the device - so I have trouble applying CE vs CC. The specs simply provide current vs. illumination in which case either topology should have the same sensitivity since a given amount of light would result in the same collector-emitter current.

we don't have any knowledge of the voltage at the base - it's not pinned out of the device

No but that is where the photo current is generated.

so I have trouble applying CE vs CC.

Why? With one you have a resistor in the emitter to ground, with the other you have the resistor from the collector to +ve. What is there not to understand?

Try it and see.

Let me rephrase things - the difference in voltage gain between common emitter and common collector configurations is not applicable in this case. The base is not accessible so we can't really tell what the input voltage with respect to ground might be in either configuration. What really matters is the base current which is directly controlled by the illumination (and thus also the base to emitter voltage). The collector to emitter current should be the same for a given illumination whether there is a resistor from 5V to the collector or from the emitter to ground.

Try it and see.

I tried both configurations (5V-res-PT-gnd & 5V-PT-res-gnd) with a Vishay TEPT5600 phototransistor and can see no difference in sensitivity between the two. Where one would produce an ADC value of "n", the other would produce approximately the inverse (1023 - n) within the limits of my ability to control the illumination (AC dimmer switch controlling overhead lighting).

What value rssistor? With low values you will see little difference. In my experiments I have noticed a difference. Especially into the analogue input with 100K.

I used 100K ohms as I was interested in low light levels.

Another way to look at this: In a common collector NPN circuit, the voltage gain is essentially 1 because as the input voltage at the base (referenced to GND) increases, collector to emitter current through the transistor increases causing the voltage at the emitter to also increase (referenced to GND). This limits the increase in base-to-emitter voltage resulting in reduced overall voltage gain (ratio of input to output) through the circuit.

But for a phototransistor, the input is light (not referenced to GND) so the common collector analysis doesn't really apply. Light injects current into the base which the transistor's gain turns into a larger collector to emitter current. If you want to think in terms of voltage, light induces a base to emitter voltage - this is the input to the circuit. Whether you have a resistor from the emitter to GND or from 5V to the collector, the input is still Vbe, ie, the input floats with respect to GND.

Having written this, I realize I was ignoring the effect of the base current so I'll concede that there could be a very small difference in sensitivity between the two configurations but it should be in favor of "common collector"!