I assumed on the basis of information given that the LED supply is 5 VDC:
50 mA (current through LED) x 47 ohms (current-limiting resistor) gives a voltage drop of 2.35 VDC.
Here is what Brian is trying to tell you:
<IMG SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1971&stc=1&d=118905553 3">
R1a and R1b are built into Q1; R2b and R2a are built into Q2.
As wired, the built-in 22K resistors create a voltage divider, shown in the circuit above. Brian is not quite correct in saying that "the PNP and NPN transistors are both turned ON by each other" (they are not), but he is right about the effect of the intrinsic resistors. When the input (at B) is in a high-impedance state (Z), the voltage at A is 3/4 of +VDC, at B, it is 1/2 of +VDC, and at C, it is 1/4 of +VDC.
In other words, if +VDC is 5 volts, and the pin connected to B is high-impedance (Z), the voltage at A will be 3.75 volts, at B 2.50 volts, and at C 1.25 volts. The voltages present at A and C will keep the transistors turned partly on, which sounds like the problem you described.
The effects of a logic high (nominal +5 VDC) or a logic low (nominal 0 VDC) at B I will leave as an exercise for those who are curious.





Bookmarks