Arduino Forum

Using Arduino => General Electronics => Topic started by: interestingfellow on Nov 13, 2015, 06:59 am

Title: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Nov 13, 2015, 06:59 am
I'm trying to build an optical tachometer with a nano and IR components salvaged from an old ps2 ball mouse.

I have it set up and working on a breadboard, but I don't understand why the electrical connections on the IR phototransistor are working.

I had found several web pages that said you can hook up only the collector and emitter to generate a pulse when IR is detected, but couldn't get that to work.  I came to the arrangement in the picture by accident.

I have the collector current limited with a 150 ohm resistor and tied to ground with another 150ohm resistor, and the signal pin pulled high* with a 47k to the nano (because that's what I had lying around).
I was using another LED on the ouput of the IR detector (no 47k) to try to figure out the proper pinout of the phototransistor and accidentally figured out that the LED flashed signifigantly brighter with gnd tied to vcc. Why?

Should I have things hooked up differently?  I am using the code on this page (http://www.me.umn.edu/courses/me2011/arduino/technotes/irbeam/irbeam.html) to test the setup for now; KISS.





*I'm new to all this and think that is the proper term for what is going on
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 13, 2015, 07:35 am
Quote
I have the collector current limited with a 150 ohm resistor and tied to ground with another 150ohm resistor
Do you? I don't see anything going to ground on the breadboard except the 47K resistor.

Quote
and the signal pin pulled high* with a 47k
Looks like it's pulled low to me.

I'm assuming that you're using the breadboard's red rail for +5V, and it's blue rail for 0V. Correct me if I'm wrong.
If I'm right, your description doesn't match the circuit on the breadboard.

If it's an IR photo-transistor, you connect the emitter to ground, connect the collector to the +5V rail through a pullup resistor, then take your output to the Arduino from the collector. It will go low when it receives IR input.
Title: Re: IR Phototransistor pinout/hookup question
Post by: TomGeorge on Nov 13, 2015, 10:57 am
Hi,
Is there a part number on the IR transistor?

Tom... :)
Title: Re: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Nov 13, 2015, 03:06 pm
Tom, no, that would be way too easy! ;D

Oldsteve,
Now that I look at it again, the 47k resistor *is limiting the output of the phototransistor, so that would be a pull down, yes?
Yes, blue gnd and red 5v+.
How is the 150ohm resistor from vcc a pullup resistor and not just limiting current to the phototransistor? is it limiting current to the phototransistor?
The way it's hooked up now, it goes high when it receives ir input (i tried with the ir led I have and also the tv remote).  Is it common for phototransistors to be normally open or normally closed?
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 13, 2015, 05:24 pm
How is the 150ohm resistor from vcc a pullup resistor and not just limiting current to the phototransistor?
Do you know anything at all about phototransistors?
For one thing, they don't have Vcc, GND and OUT pins as you've labelled them. Usually, they have two pins, emitter and collector. Sometimes, the base is also drawn out to a pin. You don't need to connect to that at all.
As I mentioned earlier, usually the collector connects to the +ve supply via a pullup resistor, and the output is also taken from the collector. The emitter connects directly to ground. This is a 'common-emitter' configuration, no different to a normal transistor circuit, except light operates it rather than current into the base.

They can also be connected in 'common-collector' configuration, with the collector connected directly to the +ve supply, a pulldown resistor from the emitter to ground, and the output taken from the emitter. This is what you have put together, but you have an additional 150 ohm resistor between collector and the +ve supply, reducing the transistor's gain. And another 150 ohm resistor that seems to do nothing?

Quote
is it limiting current to the phototransistor?
The way it's hooked up now, it goes high when it receives ir input (i tried with the ir led I have and also the tv remote).  Is it common for phototransistors to be normally open or normally closed?
Rather than waste further time with explanations, I've drawn up a diagram. (A bit of reading would have explained all of this.)

(http://i869.photobucket.com/albums/ab252/nowrasteve/Phototransistor%20Circuits_zpsxwr05iay.jpg)

The common-emitter circuit goes low in the presence of IR, the common-collector circuit goes high in the presence of IR.

All of this is based on the assumption that it's an NPN transistor. If it's PNP, the connections are reversed.
I also assume that it's a standard phototransistor as you claim, and doesn't have additional internal circuitry like an amplifier.
Title: Re: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Nov 14, 2015, 04:05 am
If a bit of reading were all it took for anyone to understand anything, then colleges, teachers, tutors, and forums would all be very unnecessary.

No, I know very little about electrical engineering when compared to most of the people on this forum. 

But, I do very much appreciate you taking time to answer my questions, and helping me better understand what I was missing.

Really: thank you.
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 14, 2015, 04:17 am
If a bit of reading were all it took for anyone to understand anything, then colleges, teachers, tutors, and forums would all be very unnecessary.
Often, that's true, but in this case all you had to do was google "phototransistor circuit" or similar. Still, not to worry, you know how they work now. (Didn't mean to sound rude, but my patience gets stretched a little sometimes. :)

Quote
No, I know very little about electrical engineering when compared to most of the people on this forum.
You're one step further up the ladder now. 

Quote
But, I do very much appreciate you taking time to answer my questions, and helping me better understand what I was missing.

Really: thank you.
No problem.
Title: Re: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Nov 17, 2015, 04:35 am
OldSteve....I'm sorry for being a noob and asking noob things, but I'm stuck.

After tinkering quite a bit with the salvaged components unsuccessfully, I decided to eliminate potential problems 1 at a time.  I bit the bullet and bought an IR emitter/detector set from radiocrack and I still can't get this breadboard and sketch to work.  I tried both common emitter and collector arrangements that you provided above, and am going insane trying to figure out why it won't work.
AND, I did read several sources on my own trying to figure it out, but I'm still missing something.

When I use the code below:
Code: [Select]
void setup() {
  pinMode(4,INPUT);
  Serial.begin(9600);
}
void loop() {
  Serial.println(digitalRead(4));
  delay(100);
}


In common collector configuration, I get only "1" (high) over the serial monitor unless I unplug the phototransistor, and then it changes to "0".

In common emitter configuration, I get only "0"(low) in the serial monitor.  .  The only way I can see a change in serial monitor is if I unplug the sense wire to pin 4 and short it to the vcc rail.

I have verified that the IR led is emitting using my phone camera.
I have verified polarity of the emitter and the detector.
I have tried only 1 150ohm resistor driving the emitter to make it brighter.
I have tried 47k, 1k, and 150ohm on the detector in both configurations.
And, of course, I have tried it with the lights in the room on and off.
I used a hotel keycard in the paper sleve to block the emitter.
I also tried removing the emitter completely.
And I still get the same results.

Wth am I doing wrong?
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 17, 2015, 06:02 am
OldSteve....I'm sorry for being a noob and asking noob things, but I'm stuck.

After tinkering quite a bit with the salvaged components unsuccessfully, I decided to eliminate potential problems 1 at a time.  I bit the bullet and bought an IR emitter/detector set from radiocrack and I still can't get this breadboard and sketch to work.  I tried both common emitter and collector arrangements that you provided above, and am going insane trying to figure out why it won't work.
AND, I did read several sources on my own trying to figure it out, but I'm still missing something.

When I use the code below:
Code: [Select]
void setup() {
  pinMode(4,INPUT);
  Serial.begin(9600);
}
void loop() {
  Serial.println(digitalRead(4));
  delay(100);
}


In common collector configuration, I get only "1" (high) over the serial monitor unless I unplug the phototransistor, and then it changes to "0".

In common emitter configuration, I get only "0"(low) in the serial monitor.  .  The only way I can see a change in serial monitor is if I unplug the sense wire to pin 4 and short it to the vcc rail.

I have verified that the IR led is emitting using my phone camera.
I have verified polarity of the emitter and the detector.
I have tried only 1 150ohm resistor driving the emitter to make it brighter.
I have tried 47k, 1k, and 150ohm on the detector in both configurations.
And, of course, I have tried it with the lights in the room on and off.
I used a hotel keycard in the paper sleve to block the emitter.
I also tried removing the emitter completely.
And I still get the same results.

Wth am I doing wrong?
For one thing, an IR LED has a Vf of about 1.2V to 1.5V. Allowing for 1.2V, that means there will be 3.8V across the resistance.
An IR LED should be driven with much more current than a standard LED. Most want about 100mA continuous.
3.8V/100mA=38 ohms. So for maximum brightness from a constantly on IR LED you could be using a 39 ohm resistor, instead of the pair of 150 ohm resistors. At the moment, you only have 11mA going through the LED.
(You should double-check the datasheet of the IR LED, for Vf and for continuous current rating, then select a resistor accordingly.)

I can't see your photo-transistor well, but you say "flat=cathode". A photo-transistor doesn't have a cathode, only a collector and an emitter, (if it's 2-pin). still, assuming you have the emitter to ground, with a resistor to +5V, and the output taken off the collector, it should go low when exposed to IR.

And although weak, I would have thought that since the IR LED and the IR photo-transistor are so close together, it would still work. Try a much smaller resistor on the IR LED, between 39 ohms and 100 ohms, (check the datasheet first for specs), and change the 47K resistor on the photo-transistor to 4K7, or even 2K2. 47K is a bit too high a value.

I don't know what else to suggest if that fails. This is so simple, that if connected properly nothing can really go wrong, unless the phototransistor has been shorted/overloaded and is dead. Did you buy several? If so, try another. If not, you should have. :) Putting 150 ohms on the collector as a load resistor wasn't a good idea. That's 33mA, and they're not typically rated anywhere near that high. Good chance it is dead. Edit: Correction, it's probably not dead - since in CE configuration, it stays low, it's staying switched 'on'. A dead transistor usually goes open and would stay high with a pullup resistor.
Don't just try random values on things - everything must be calculated, according to the datasheets.

Of course, this setup, even when working, is no good for any practical purpose, since it's not immune to ambient light/remote controls/fluorescent lights.
Ideally, you would drive the IR LED with a 38kHz or 40kHz carrier, modulate that carrier with codes, then use an IR receiver to 'demodulate' the carrier leaving just the codes (inverted). That's how an IR remote control does it.

By coincidence, I'm working with an IR LED and a receiver myself today, making an IR homing beacon and receiver for my robot car. (Using a 38kHz carrier and demodulating receiver.)
Title: Re: IR Phototransistor pinout/hookup question
Post by: liuzengqiang on Nov 17, 2015, 06:28 pm
I'm a little puzzled. I have some IR stuff. The emitter is not painted black and the phototransistor is usually painted black. An IR LED sees visible and UV as well as IR so if it's not painted black, it will respond to room light. With what you have, you seem to have swapped the IR LED and the phototransistor. You have with the black one two 150 ohm resistors meaning you treated it as an IR LED. I thought at was wrong.
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 17, 2015, 10:59 pm
I'm a little puzzled. I have some IR stuff. The emitter is not painted black and the phototransistor is usually painted black. An IR LED sees visible and UV as well as IR so if it's not painted black, it will respond to room light. With what you have, you seem to have swapped the IR LED and the phototransistor. You have with the black one two 150 ohm resistors meaning you treated it as an IR LED. I thought at was wrong.
My IR LEDs are dark-coloured, but not completely black, (I'm using one here right now). I don't think his is 'black' either, I think it's just the light. Also, he did say "I have verified that the IR led is emitting using my phone camera."

Quote
the phototransistor is usually painted black
Usually, but not always. I have some IR photo-transistors here that are in a water-clear case.
See here:- Infrared Phototransistor (http://www.jaycar.com.au/Active-Components/Optoelectronics/Optocouplers/Infrared-Phototransistor/p/ZD1950)
And I already said "since it's not immune to ambient light /remote controls/fluorescent lights."

Title: Re: IR Phototransistor pinout/hookup question
Post by: polymorph on Nov 17, 2015, 11:05 pm
Yes, there is still some IR in other sources of light.
Title: Re: IR Phototransistor pinout/hookup question
Post by: liuzengqiang on Nov 17, 2015, 11:07 pm
OK I didn't catch the "checked with camera part". Then paint the water clear phototransistor black already! I would use a black wet-erase marker and go over it several times. Let it dry and do another coating :) One of my POV displays was made using IR sensing. Now I remember the phototransistor was clear.
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 17, 2015, 11:22 pm
OK I didn't catch the "checked with camera part". Then paint the water clear phototransistor black already! I would use a black wet-erase marker and go over it several times. Let it dry and do another coating :) One of my POV displays was made using IR sensing. Now I remember the phototransistor was clear.
You're still right that this is puzzling. He did say that he's tried it with the lights off. And despite the fact that the IR LED series resistance is way too high at 300 ohms total, at that range it should still work.
I reckon the photo-transistor must be a dud, or possibly not really a photo-transistor. I got some water-clear IR LEDs from eBay last week, and when I tested them yesterday, they were normal red (visible) LEDs - refund pending. :D

And just as a final bit of proof regarding the dark-coloured IR emitter LEDs, I've attached a pic of the one I'm currently using. In my pic, you can see that it's not completely black, but very dark.
Title: Re: IR Phototransistor pinout/hookup question
Post by: polymorph on Nov 19, 2015, 02:16 am
It makes no difference the color of the case of the LED - only the receiver. You want it to appear black, because that is an IR pass/visible block filter.

liudr, are wet erase black markers transparent to IR?

I would just buy an IR phototransistor. If it doesn't have a black casing, it isn't only IR.

(http://www.nerdkits.com/videos/theremin_with_ir_distance_sensor/osram_led_phototransistor_labeled.jpg)
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 19, 2015, 02:26 am
It makes no difference the color of the case of the LED - only the receiver. You want it to appear black, because that is an IR pass/visible block filter.

liudr, are wet erase black markers transparent to IR?

I would just buy an IR phototransistor. If it doesn't have a black casing, it isn't only IR.
Many with clear cases are sold as IR photo-transistors, as in the link in post #10. Just not intended for use in the open.

And none of this explains why his circuit doesn't work in the dark.
Title: Re: IR Phototransistor pinout/hookup question
Post by: DaveEvans on Nov 19, 2015, 03:40 am
OP: You said you "verified polarity of the emitter and the detector."  How did you do that for the detector? 

FWIW, this guy (http://letsmakerobots.com/node/34708) found that "The Radioshack IR pairs are somewhat confusing, in that the IR LED and the detector kind of have "backwards" pins. On the IR LED the long pin is the positive side, whereas on the detector the short pin is the positive side (it was labeled as the "collector" on the diagram on the back of the package I got.)"


Also, it might help if you post the emitter and detector specs that are on the Radio Shack package (or just post a pic of the package).
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 19, 2015, 04:11 am
OP: You said you "verified polarity of the emitter and the detector."  How did you do that for the detector? 

FWIW, this guy (http://letsmakerobots.com/node/34708) found that "The Radioshack IR pairs are somewhat confusing, in that the IR LED and the detector kind of have "backwards" pins. On the IR LED the long pin is the positive side, whereas on the detector the short pin is the positive side (it was labeled as the "collector" on the diagram on the back of the package I got.)"

Also, it might help if you post the emitter and detector specs that are on the Radio Shack package (or just post a pic of the package).
Yep, on my similar IR photo-transistor the short leg is the collector, long leg is the emitter. (Opposite to an IR or normal LED, on which the long leg is always the anode and short leg the cathode.)

With mine, that was clearly shown on the specs, though. Those specs are shown under "Description" in this link:- IR Phototransistor (http://www.jaycar.com.au/Active-Components/Optoelectronics/Optocouplers/Infrared-Phototransistor/p/ZD1950)
Title: Re: IR Phototransistor pinout/hookup question
Post by: DaveEvans on Nov 19, 2015, 08:22 am
Radio Shack story:   :)

Three years ago or so I bought an IR emitter and detector, p/n 276-0142, from Radio Shack and the detector was a photo-transistor.   Then a year later I bought another pair, with exactly the same part number, and the detector was a photo-diode (or so the package said - I haven't tested it or used it)! 

These days, I stick to Vishay, Osram, etc.
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 19, 2015, 09:17 am
These days, I stick to Vishay, Osram, etc.
That's probably the best plan. The 38kHz demodulating receivers that I'm using are Vishay. (TSOP4838)
Title: Re: IR Phototransistor pinout/hookup question
Post by: liuzengqiang on Nov 19, 2015, 04:27 pm
Wet erase markers work. I have a POV display with clear IR transistor painted with a black wet eraser.
Title: Re: IR Phototransistor pinout/hookup question
Post by: polymorph on Nov 20, 2015, 06:10 pm
Cool! Good to know.

You have to be specific when you say "paint it black". I was in a conversation with a friend about black lights, and some guy sitting nearby impatiently said "why don't you just paint regular bulbs black? A can of black paint is only $5!" and said it like we were idiots.
Title: Re: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Nov 21, 2015, 08:10 am
Thank you for all the info. SOrry I haven't been back. I'm way busy with work right now, and this arduino stuff is in support of my rc habit, so it get's second seat when .  Actually, my heli is broke and i'm trying to build the tach so I can give it a proper diagnosis when switching out components.

Anyway, here's the product package for the set i'm using (I left it high res on purpose, sorry for the inconvenience)

I'll report back if I figure it out.

Thanks, again!
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 21, 2015, 08:25 am
Your pic didn't upload. Too big maybe?
Title: Re: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Nov 21, 2015, 08:53 pm
Yes, it was too big, and then I exceeded my post count or whatever...bleh. Here it is.
Title: Re: IR Phototransistor pinout/hookup question
Post by: raschemmel on Nov 21, 2015, 09:47 pm

Quote
Yes, it was too big, and then I exceeded my post count or whatever...bleh. Here it is. 
Open the photo with Paint, select "Resize" (upper left corner), type in 50 (%) where you see the "100", click the Floppy Disk symbol SAVE button, and then your photo should be small enough to upload.


Quote
If a bit of reading were all it took for anyone to understand anything, then colleges, teachers, tutors, and forums would all be very unnecessary.
Quote
Often, that's true, but in this case all you had to do was google "phototransistor circuit" or similar. Still, not to worry, you know how they work now. (Didn't mean to sound rude, but my patience gets stretched a little sometimes.  
Now if you could just google "How to draw a schematic..."

FYI, the most expedient method used here on the forum if you don't have ExpressSCH is to simply draw a schematic on a sheet of printer paper using black ink pen , take a photo and upload it.
It is much faster than uploading photos of you circuit. If you have the schematic and you think you miswired it the circuit photo would be useful , but uploading circuit photos because you don't know how to draw a schematic just takes more time.
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Nov 21, 2015, 10:21 pm
Radio Shack strikes again.

(http://i270.photobucket.com/albums/jj118/new_clear_days/circuits/18b29ebb-c78e-457b-b768-b41b75e94136_zps763ef855.jpg)
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 12:00 am
It's not a photo-transistor - it's just a photo-diode, with bad labelling on the pins.
nowhere on that package does it say "photo-transistor", (it does say "photodiode"), although for some obscure reason they've seen fit to label the pins "C", "E", instead of "A", "K".
Didn't you notice there was no photo-transistor symbol on the pack, only two diode symbols?
The "Vf=1.2V" also gives it away. :D
And the flat side is the cathode, as with all diodes. (Ignore the "C" "E" pin labels - they're wrong!)
So, before more time is wasted on this, and before you buy any more parts not suited to your purpose, what's the intended final purpose of the IR LED/IR detector? Remote-control, obstacle avoidance, etc ?
Chances are you'd be better off with a demodulating receiver anyway.

I just went back and re-read your initial post. You're making an optical tacho. So you do want a photo-transistor. You still need to buy one, a 'real' photo-transistor. :)

Here's that package label, cropped to show what's important:-
(http://i869.photobucket.com/albums/ab252/nowrasteve/pkg_zpsozxuo8vl.jpg)

Also see DaveEvans' reply #18.
(I accidentally partly cut it off when editing, but the part number is 276-0142, same as Dave's.)
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Nov 22, 2015, 12:29 am
It's not a photo-transistor - it's just a photo-diode, with bad labelling on the pins.

Well then, here's another version of that same pair, different package and set of device details, that should really frost your cookies --

(http://i270.photobucket.com/albums/jj118/new_clear_days/stuntpics/2e96c6b6-0582-4b09-9030-8d8b68b4047e_zpsegkqzpbj.jpg)

276-142 vs 276-0142
The "detector" has a phototransistor symbol and transistor "specs", but its leads are labeled "A" and "C".
[There's an irrelevant depiction of an optocoupler, or whatever, too (Holy TMI, Batman!) - but the package has two discrete components.]

Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 12:50 am
Well then, here's another version of that same pair, different package and set of device details, that should really frost your cookies --

(http://i270.photobucket.com/albums/jj118/new_clear_days/stuntpics/2e96c6b6-0582-4b09-9030-8d8b68b4047e_zpsegkqzpbj.jpg)

276-142 vs 276-0142
The "detector" has a phototransistor symbol and transistor "specs", but its leads are labeled "A" and "C".
[There's an irrelevant depiction of an optocoupler, or whatever, too (Holy TMI, Batman!) - but the package has two discrete components.]
That must be the old package that Dave Evans referred to in his post. And yeah, what a f@#$up of a label.
Incidentally, I did a Radio Shack search for the clear-lense photo-transistor the other day, and got an "Out-of-stock" result.

All of this is a good argument for buying from decent suppliers who know what they're doing. Obviously, Radio Shack is not one of those. :D

Edit: Silicon Infrared Phototransistor (http://www.digikey.com/catalog/en/partgroup/silicon-infrared-phototransistor/12436)

Edit2: Sparkfun - Optical Detector / Phototransistor - QRD1114 (https://www.sparkfun.com/products/246)

Title: Re: IR Phototransistor pinout/hookup question
Post by: raschemmel on Nov 22, 2015, 12:54 am
I've used the circuit described in this  (http://www.instructables.com/id/How-to-use-IR-Sensor-using-Op-amp-and-Arduino/step4/Schematic-and-theory-of-operation/) article before
Title: Re: IR Phototransistor pinout/hookup question
Post by: raschemmel on Nov 22, 2015, 12:56 am
Quote
All of this is a good argument for buying from decent suppliers who know what they're doing. Obviously, Radio Shack is not one of those. 
Maybe so , but they survived more than 75 years but couldn't survive the internet.
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 01:01 am
Maybe so , but they survived more than 75 years but couldn't survive the internet.
Yeah. They used to be better, I believe, but lost out when they tried to compete with the cheap Chinese stuff I guess.
They were over here in OZ too, but I haven't seen a Radio Shack for many years now.
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 01:03 am
I've used the circuit described in this  (http://www.instructables.com/id/How-to-use-IR-Sensor-using-Op-amp-and-Arduino/step4/Schematic-and-theory-of-operation/) article before
While he could do that and use the photo-diode, it's probably better to just buy a 'real' photo-transistor.
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Nov 22, 2015, 03:24 am
I am an old campaigner and I love a good campaign.

So, here, my "Detector" (as D.U.T.) findings --

(http://i270.photobucket.com/albums/jj118/new_clear_days/stuntpics/IMG_1831_zps4vxulckg.jpg)

I have the IR emitter pretty close to the detector, 0.1 inches or so.
I do have a light on, so that I can see what I'm doing, which influences the results a tad.
Uninterrupted, unobstructed, there is 0.8V at Vout and 1.4V when I interrupt, or obstruct, the optical path between.
If I place translucent material between (esd mylar bag, old pink anti-static bag), Vout varies with the material's transmissibility.
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 04:13 am
I am an old campaigner and I love a good campaign.

So, here, my "Detector" (as D.U.T.) findings --

I have the IR emitter pretty close to the detector, 0.1 inches or so.
I do have a light on, so that I can see what I'm doing, which influences the results a tad.
Uninterrupted, unobstructed, there is 0.8V at Vout and 1.4V when I interrupt, or obstruct, the optical path between.
If I place translucent material between (esd mylar bag, old pink anti-static bag), Vout varies with the material's transmissibility.
In the dark, I imagine the collector would go much closer to the 5V rail. (When the beam is interrupted.)
I'm surprised that the output doesn't go closer to 0V than 0.8V with them that close together though.

How hard are you driving the emitter? 100mA?
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Nov 22, 2015, 05:21 am
In the dark, I imagine the collector would go much closer to the 5V rail. (When the beam is interrupted.)
I'm surprised that the output doesn't go closer to 0V than 0.8V with them that close together though.

How hard are you driving the emitter? 100mA?
I'm only running about 20mA through the emitter. (The "spec card" states 40mA max for this.)
Changing the Vout pullup to 1kohm: obstructed Vout = 3.9V (also dark, under an old 35mm film holder) and unobstructed = 2.3V
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 05:35 am
I'm only running about 20mA through the emitter. (The "spec card" states 40mA max for this.)
Changing the Vout pullup to 1kohm: obstructed Vout = 3.9V (also dark, under an old 35mm film holder) and unobstructed = 2.3V
You'd get better results with a high-power IR LED. Mine are rated for 100mA continuous, 1A peak. (Everlight IR333-A)
I'm running a 25% duty-cycle, (38kHz), in my current project and driving the IR LED at 375mA, (10 ohm series resistor, 5V supply). Modulated at 1kHz. Great range.
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Nov 22, 2015, 02:06 pm
You'd get better results with a high-power IR LED.
Likely so, but perhaps somebody else.
My interest is only bringing clarity to the subject at hand.
Over the years they probably used several devices presenting these pairs.
My pack was pretty old. The "blister" had yellowed as well as the phototransistor encapsulant, but I opened it up for the sake of Science - to shed some badly needed light on this matter.

Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 02:14 pm
Likely so, but perhaps somebody else.
My interest is only bringing clarity to the subject at hand.
Over the years they probably used several devices presenting these pairs.
My pack was pretty old. The "blister" had yellowed as well as the phototransistor encapsulant, but I opened it up for the sake of Science - to shed some badly needed light on this matter.
I think that light was shed when it was realised that 'interestingfellow' really had a photo-diode, not a photo-transistor.
There wasn't actually a need for you to show the performance of your photo-transistor and low-power IR LED.
Title: Re: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Nov 22, 2015, 04:02 pm
Well, that makes me feel better; I was making a mistake, just not the one I thought.

Thanks, agian, y'all!

(and, no, I didn't notice the lack of transistor symbol, but I won't anymore* ;D )
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Nov 22, 2015, 04:04 pm
I think that light was shed when it was realised that 'interestingfellow' really had a photo-diode, not a photo-transistor.
There wasn't actually a need for you to show the performance of your photo-transistor and low-power IR LED.
You like to be a real wiseguy.  
"Realized" by whom?  You?  So what?

The OP has no interest in experimentation, nothing is conforming to his preconceptions. And you want to speculate endlessly, from your conceit of authority, based on nothing more than how you figure things ought to be - this part you like, that part you don't, so you make up the rest.
The RadioShack package that the OP's using has a phototransistor, albeit mismarked, but you can persist contrariwise all you like. The only authority here is the data and if the OP could be pulled away from playing with his toys, his admitted primary concern, and actually participate in his subject - then we might have more data.

Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 04:08 pm
The RadioShack package that the OP's using has a phototransistor, albeit mismarked, but you can persist contrariwise all you like.
Did you bother to read Dave Evans' post, #18?

And no need to get personal.
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Nov 22, 2015, 04:17 pm
Did you bother to read Dave Evans' post, #18?

Yes, as a matter of fact.
How critically did you read it?
Did you catch the part where he basically didn't know for certain?
"and the detector was a photo-diode (or so the package said - I haven't tested it or used it)! "
In both cases (the OP's and mine) there are mismarkings.  So, we fill our boots and do some intelligent experimenting.
Or just bin the lot.
Title: Re: IR Phototransistor pinout/hookup question
Post by: OldSteve on Nov 22, 2015, 04:18 pm
Well, that makes me feel better; I was making a mistake, just not the one I thought.

So what could I do with the set I have? Or rather, a typical intended purpose?

Thanks, agian, y'all!

(and, no, I didn't notice the lack of transistor symbol, but I won't anymore* ;D )
According to the label, and Dave Evans in post #18, (Edit: concession to 'Runaway Pancake's last post.) it's most likely a photo-diode and not a photo-transistor. I think that's pretty clear, despite what someone else thinks. That's no doubt why it wouldn't work for you, when connected as a phototransistor.

You could make use of it, but you'd get much better performance from a photo-transistor.
There are some photodiode circuits here, but they require additional components to be really useful:-
Photodiode Circuits (https://www.google.com.au/search?q=photodiode+circuit&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwiW8cqqqKTJAhWJX5QKHc9aC3MQsAQIHA&biw=1045&bih=469)

For your optical tacho, it would really be best if you could get a phototransistor. (Unless you do feel like adding a transistor or op-amp to the photodiode for experiment.)
Either way, let us know how you go. :)

Edit: You could set up a test circuit, I guess, just to verify exactly what it is. Just copy the photodiode/transistor circuit from the Google image search link I posted. This one or similar:-
http://farm9.staticflickr.com/8378/8455949720_0ccc37ff2b.jpg
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Nov 22, 2015, 04:46 pm
I think what I showed in #26 is the way to go (despite "phototransitor" (sic).
Have you tried that, exactly?
[I won't guaranty that "digital-worthy" performance can be had from these components alone.]
Title: Re: IR Phototransistor pinout/hookup question
Post by: be80be on Nov 22, 2015, 06:24 pm
This is kind of sad the whole problem here is not knowing what the op has forsure.
But be it a photodiode or a phototransistor they both will work for caching the blinks of a ir led.  Even a red led will work.
Quote
A phototransistor is "A junction transistor which responds to incident light by generating and amplifying an electric current. "
A photodiode is "A semiconductor diode which generates a potential difference or changes its electrical resistance when illuminated. "

Now here are some more expanded explanations.

 A phototransistor is a photosensible semiconductor device comprising three electrodes. Light or ultraviolet light activates this bipolar junction transistor.
Illumination of the base generates carriers which supply the base signal while the base electrode is left floating.The emitter junction constitutes a diode , and transistor action amplifies the incident light inducing the signal current.

A photodiode is a semiconductor diode which gives an important photocurrent under illumination.
One type of photodiode uses a p-n reverse biased junction operated below the breakdown voltage. Excess charge carriers or electron hole pairs are generated by photoconductivity with exposition to electromagnetic radiation.Carriers usually recombine quickly , but the ones produced near or in the depletion layer of the junction can cross the junction and give a photocurrent which is superimposed on the small reverse saturation current.
Photodiodes allow the manufacture of devices with a depletion width convenient for best sensitivity and frequency response.
Using a led is good for some things but heres a little wirte up from makezine http://makezine.com/projects/make-36-boards/how-to-use-leds-to-detect-light/
Title: Re: IR Phototransistor pinout/hookup question
Post by: be80be on Nov 22, 2015, 06:41 pm
Runaway Pancake post #26 is the best start at getting this to work the only problem is hooking the IR whatever the OP has right.
If it's a diode it conducts only when light hits it and backward you still get nothing
I would set it up like that and shine IR light on it and test output nothing then swap it's pins around one way it's going to work.
If it doesn't throw it in the trash  and get new one.
Oh and post 26 works for me with radio shacks bagged set.
Title: Re: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Nov 23, 2015, 12:24 am
I don't have time to try it right now but as soon as I can, I will.
I know I have some 2n7000s with me but I'm not sure about BC547's...

Thank you all again.
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Dec 01, 2015, 02:56 am
I found a guy on ebay who had these (276-0142) for sale.  I ordered two packages.
I expected them to be the same.  As fortune would have it - they aren't, exactly.
And who's surprised?

From the front, same label, looks like the same components.

(http://i270.photobucket.com/albums/jj118/new_clear_days/stuntpics/2pks_f_zpssdpzius1.jpg)

But, on the back - Differences!
(http://i270.photobucket.com/albums/jj118/new_clear_days/stuntpics/2pks_r_zpsircdlq6l.jpg)

Anybody want to continue the "conversation"?
Title: Re: IR Phototransistor pinout/hookup question
Post by: interestingfellow on Dec 01, 2015, 03:36 am
I gave up on that dern radiocrack crap. I managed to go home for the holiday, went ahead and pulled out my parts bin, and salvaged some proper printer emiter/phototransistor pairs.  I have 2 pair.  So far, I have verified that my 16x2 lcd works, and have since moved on to testing the phototransistor.

I'll report back, sirs.
Title: Re: IR Phototransistor pinout/hookup question
Post by: DaveEvans on Dec 01, 2015, 09:05 am
I found a guy on ebay who had these (276-0142) for sale.  I ordered two packages.

From the front, same label, looks like the same components.

But, on the back - Differences!

Anybody want to continue the "conversation"?
Yup - looks like my first and second packages.  My first one had a phototransistor and the detector in my 2nd one really is a photodiode (I checked recently).
Title: Re: IR Phototransistor pinout/hookup question
Post by: be80be on Dec 02, 2015, 01:55 am
You all do know there are two types of photodiodes Photovoltaics and Photoconductors. And for what most people ask to do the photodiode would be better than a phototransistor. They turn on faster nS where as phototransistors take mS to turn on.
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Dec 02, 2015, 02:09 am
Yes, the devices in my two packs tested as photodiodes. A voltage develops across them when they're exposed to light (more light, more volts), that's how to tell.
And the circuit in Reply #26 is a good one. I think that it is improved with the addition of a diode on the output, to block a negative voltage there when it's heavily illuminated (so to say.)  I was running 60mA or so through the IRED - with the devices coupled dome-to-dome.
At the pullup to cathode junction the voltage was 5V 'dark' and -0.5V with IR, through the diode that was 4.6V 'dark' and -0.1V with IR.
They have a susceptibility to visible light which may effect the test results. I used an old film plastic film holder as a shroud.

I like data.

[@be80be - I think you mean that there are two ways to use photodiodes.]
Title: Re: IR Phototransistor pinout/hookup question
Post by: be80be on Dec 02, 2015, 02:30 am
Nope there are two types for real they look the same but don't work the same so you really have three kinds to deal with from radio shack a real phototransistor and Photovoltaics and Photoconductors.

You can even use a red led as a Photovoltaics.
Quote
Photodiodes are semiconductors that produce current flow when they absorb light. In application, there are two types of photodiodes: 1) photovoltaics and 2) photoconductors.Photovoltaics work like solar cells (in fact they are the same). When light shines on the photodiode, a voltage is created across it, causing current to flow.
Photoconductors are reverse-biased photodiodes. When light shines on the photodiode, the resistance to the reverse-bias decreases. By measuring the current through the photodiode, you can detect the intensity of light.
Quote
Comparison

Frequency Response
Photodiodes are much faster than phototransistors (nanoseconds vs. microseconds)
Gain
Phototransistors have a higher gain. Photodiodes require an amplifier to use.
Temperature Response
Photodiodes vary less with temperature
Applications

Optocoupler
Optocouplers are used in electronics-sensitive applications. For example, you may use this in a mobile robot application to separate the microcontroller circuitry (low voltage/power) from the motor driver circuitry (high voltage/power).
(http://hades.mech.northwestern.edu/images/a/ae/Optocoupler.png)

Well I guess as I think about it you could say there's two kinds or two ways to use a photodiode
But there are photodiodes made to be used just one way and as by product it could work both ways I don't have both of them anymore But one made  current and one didn't.
But the red led makes about 480mA with the IR light at about a haft inch away.
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Dec 02, 2015, 02:45 am
be80be,
I don't know what source you're quoting, but there are two modes of operation for any photodiode:
photoconductive mode and photovoltaic mode
I have attached a PDF from OSI Optoelectronics that all interested should find very informative.

> > > Here's a link -- http://www.osioptoelectronics.com/application-notes/AN-Photodiode-Parameters-and-Characteristics.pdf (http://www.osioptoelectronics.com/application-notes/AN-Photodiode-Parameters-and-Characteristics.pdf)
Title: Re: IR Phototransistor pinout/hookup question
Post by: be80be on Dec 02, 2015, 03:14 am
References

Fairchild Semiconductor
But I'm talking about real life too back in I think 1986 I got some phototransistors and they had photodiodes two one bag showed how to use as Photovoltaic and worked great just as the bag said the other said it was Photoconductor and it did work to output any current more like a diode that switched with light you could read the resistance change with light. 
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Dec 02, 2015, 03:41 am
Photoconductor and it did work to output any current more like a diode that switched with light you could read the resistance change with light.  
Resistance, you say - then they (the contents of that bag) must have been photocells (a/k/a light dependent resistors, LDRs, photoresistors).
You didn't download the AppNote.

> > > photoresistors
Title: Re: IR Phototransistor pinout/hookup question
Post by: be80be on Dec 02, 2015, 04:06 am
You all with the bags that you don't no what your getting I stated a fact the resistance changes in a photodiode
that's use as Photoconductor  which is how the thing was labeled period.
And one is labeled to be  Photovoltaic and they showed how to use them as such period.
I sure I know whats what don't think you'll find any post by me anywhere how to use a phototransistor or a photodiode. And I no what LDR is don't see that looking like a diode in anyways shape or forum.

And I posted quote from    http://hades.mech.northwestern.edu/index.php/Photodiodes_and_Phototransistors
I don't really care if there is one or ten types is this not about someone getting a phototransistor an it being a photodiode and it didn't work as planed this is why there's 3 types in 3 bags and each works differently.
And I'm sure they mixed and matched the bags LOL then printed your parts may be different.
Title: Re: IR Phototransistor pinout/hookup question
Post by: be80be on Dec 02, 2015, 04:11 am
Does this look like a IR led or Photodiode I don't see it LOL (http://cdn.shopify.com/s/files/1/0672/9409/products/ldr_large_large_404ef181-2db8-42e1-ac3d-1e370603240c_1024x1024.jpg?v=1429039924)
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Dec 02, 2015, 04:20 am
There's no question in my mind at to "what is what", guy.
Title: Re: IR Phototransistor pinout/hookup question
Post by: be80be on Dec 02, 2015, 04:25 am
That's good makes two then here that read the bag and new what we was getting
Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Dec 02, 2015, 04:30 am
Focussing on the exact quote from your source: "In application, there are two types of photodiodes: 1) photovoltaics and 2) photoconductors. "
"In application" - meaning that there are two modes - photovoltaic and photoconductive, a photovoltaic application and a photoconductive application.
Which application to choose depends on the end desired.


Title: Re: IR Phototransistor pinout/hookup question
Post by: runaway_pancake on Dec 02, 2015, 05:13 pm
OK --
from reading at the source of that PDF, "OSI", there are specialty, specifically photovoltaic mode photodiodes.
Users are admonished to not reverse bias them (or not by as much as they would anticipate with others.)
http://osioptoelectronics.com/standard-products/silicon-photodiodes/general-purpose-photodiodes/photovoltaic-devices.aspx (http://osioptoelectronics.com/standard-products/silicon-photodiodes/general-purpose-photodiodes/photovoltaic-devices.aspx)
for calibrated photodiodes and so on as used in instruments.


Photoconductive types, too
http://osioptoelectronics.com/standard-products/silicon-photodiodes/general-purpose-photodiodes/photoconductive-devices.aspx (http://osioptoelectronics.com/standard-products/silicon-photodiodes/general-purpose-photodiodes/photoconductive-devices.aspx)
tweaked for speed (speculating that they don't do well in PV mode.)