1 Attachment(s)
npn reflective photo sensor input
I want to use a 25V reflective photo sensor as a digital input for a PIC 16F628.
Attached is a sketch of the circuit I am working with.
For information on the sensor see:
http://www.factorymation.com/s.nl/it...category=14137
This circuit works while the PIC input is high, but is unreliable when pulled low.
Any suggestions on how to use an NPN photo sensor as an input.
A2 to base needs resistor
Not sure what you mean by ' unreliable when pulled low' but the connection from A2 to the relay driver transistor needs a resistor. As you have it, A2 tries to go to 5 volts but the emitter base junction clamps at 0.7 volts. A2 may deliver up to 25 mA or the excess load may reset A2 to 0 volts. That may be causing internal problems with the PIC. Try 1-5 k ohms between A2 and the base.
HTH
Brian