Go Down

Topic: photo interrupter questions (Read 6472 times) previous topic - next topic

afremont

#15
Feb 18, 2013, 11:26 pm Last Edit: Feb 18, 2013, 11:38 pm by afremont Reason: 1
I can see why #3 doesn't work, because the pin is forced to 5V.  I do wonder why the pdf file of the test results doesn't show 5V present with the slot blocked or open.  I would have expected #2 to work ok, but with reversed output.

EDIT:  I just tested an NPN phototransistor with the collector tied to +5V, the emitter connected to an LED and then a resistor to ground.  It worked exactly the same as when wired with LED and resistor between 5V and the collector and the emitter tied to ground. 
Experience, it's what you get when you were expecting something else.

epicycloid

I'll re-test #2... I think I should have moved the multimeter when I re-arranged the circuit. I think you might be right. Testing now...

epicycloid

Ok, my fault. I messed up on the breadboard when changing the #2 circuit and missed one 5V connection.

So, #2 does work, and inverts the output as guessed. The voltage is higher with the slot open, at 0.52V and also higher when blocked, at 4.85V.

Now I'll swap in the other resistor values and see if that improves (lower V with slot open).

epicycloid

Ok, so the two cases work, and as speculated, are inverted logic.

Updated test results for #1 and #2 attached.

Any insights on selecting appropriate resistor values based on some datasheet attribute?

afremont

Maybe you got the voltages reversed there?  I also found that with the transistor on the "high side", I could only turn it on using the base pin connected to Vss (5V) to the point that I measured 3.85V at the emitter.  Using actual light, I could turn the transistor on far enough to get the emitter to 4.4V.  My Vss measures out at 5.1V.

I see you just posted again, so I'll get that question now.  Just pick a value that you like the characteristics of.  These characteristics being how much power can you tolerate to burn and how fast you need your rise/fall times to be.
Experience, it's what you get when you were expecting something else.

epicycloid

#20
Feb 19, 2013, 12:35 am Last Edit: Feb 19, 2013, 12:37 am by epicycloid Reason: 1
Yes, I didn't bother to reverse the multimeter for the readings, but both #1 and #2 are working as expected, with the logic inverted from one another. #1's logic, per the beginning of the thread acts like a N.O. switch. #2 acts like a N.C. switch.

There must be some reason that #1 is the "normal" way to hook this up (that the transistor prefers), since the resistor values I tried all draw less power with the slot open than the inverted #2 approaches do.

At this point I have it working, by trial-and-error, and I guess in the future, if I get another part/datasheet, I may have to do the same thing to find an appropriate resistor value, since that is the one part of this puzzle that still eludes me.

Thanks for the help, and sorry to de-rail with my erroneous results along the way, but I've learned a lot in the process, and I have a better feeling for how these photo-interrupters work now.

Off to build the real project now.

Go Up