Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have very little experience with phototransistors. I'm trying to create a circuit that will effectively function as collision detection. I'm using OPB608A which utilizes an NPN transistor. My goal is to use said transistor to output logical signal to my PIC18F4520. The I/O pin I'm using for this has Schmitt Trigger Buffer - according to the datasheet any input above 0.8VDD (~4V) will be treated as logical high (and 0.2VDD - 1V - will bring it back down).

Having very little experience I am tempted to use the following circuit: circuit

and adjust value of R1 to adjust the sensitivity. My question is: is this a good idea? Won't this cause any problems (such as pretty much shorting the circuit if R1 is low value)? Any better way to handle it?

share|improve this question
Your circuit is fairly common. I don't see any glaring problems. It might just work for you. – Nick Alexeev Nov 23 '12 at 23:42
@NickAlexeev: Thanks! It's really having somebody with experience say it has a chance to work! :) – Bart Platak Nov 24 '12 at 0:09
consider 10Kohm for now .. The current gain on the reflective sensor is very low. What object is being used for this>? It is not very sensitive and very close proximity. Is that ok? 1.35 mm gap to reflective surgface hFE= 10% – Tony Stewart Nov 24 '12 at 0:13
Try 1K, 10K, 100K. 1M might work but it's a bit high to drive the PIC input. The best value will depend on the light level. A digital voltmeter and a sheet of black paper are handy! – Brian Drummond Nov 24 '12 at 0:21

Agreed, just be careful using the really high resistance values. 100k+ and beyond leaves your circuit more vulnerable to noise injection. It takes a bit of experimentation like the above responses have indicated.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.