Quote Originally Posted by TonyA View Post
Thank you.

Is it possible to just use a 2N2222 transistor?

I found this schematic, however my application is a little different. (It got me thinking though):

http://www.rentron.com/images/rely-drv.gif

If the relay was omitted from that circuit, and since I just need to switch an incoming wire to ground via the transistor. The "switching" would be controlled by the PIC.

Would I just connect B of the transistor to the pic pin, C to the incoming wire and E to ground?

Then toggle the PIC pin attached to B of transistor? Would this send my "incoming wire" to ground?

Thanks for the help.

T

That circuit is a basic open collector one. The trick is that since the relay has a 100 or so ohms of resistance it acts as a current limit. So you would need to replace the relay with maybe a 220 ohm resistor so that you don't blow the transistor. But like Darrel mentions, You could just use the PIC pin directly. The main reason to use the transistor would be if the switch you are replacing goes to something that has a much higher voltage than the PIC could handle, or you want to protect the PIC with the cheap transistor.