SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By trepetti
#192488
I am really new to electronic components, and I am working with a PIC to use a port pin to drive an LED with 12v and approx 115 ma. This needs to be a high side switch, so I am asking for a recommended transistor and some advice on whether I need a current limiting resistor on the base. It looks like a 2N3906 will work (will it switch a 200ma load?), but I am too new to this to be sure.

Any suggestions would be appreciated.

Thanks
By Dave Mueller
#192506
Bipolar transistors (the common PNP and NPN types) are controlled by current, not voltage. If you want to turn one on or off with a microcontroller or other logic chip, you must put a resistor in series with the base. The actual value depends on the characteristics of the transistor and the load current. Usually a few kiloohms.

Usually, with 5V logic, it is easier to use a FET like BS170, 2N7000 etc. These are voltage controlled and can be directly connected to the output of the uC.

Dave
By UhClem
#192507
It doesn't matter if you use a BJT or a MOSFET, you must use two transistors because of the level shift required by the difference between the MCU output voltage and the voltage being switched. A quick Google search on "high side switch circuit" would turn up plenty of examples.